Skip to content

Commit

Permalink
build(api-console-gui): attempt to get it working
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Sep 11, 2023
1 parent baa07c3 commit b22482b
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 279 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV=development
60 changes: 60 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Setup
description: ''

inputs:
node-version:
description: Node.js version
required: true
default: 18.7.1

pnpm-version:
description: pnpm version
required: true
default: 8.7.4

runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: ${{ inputs.pnpm-version }}

- uses: actions/setup-node@v3
name: Install Node.js
with:
node-version: ${{ inputs.node-version }}
registry-url: https://registry.npmjs.org
cache: pnpm

- name: Install dependencies
run: pnpm install
shell: bash
env:
CI: 'true'

- name: Set GITHUB_BRANCH and NX_BRANCH environment variable in pull request
if: github.event_name == 'pull_request'
shell: bash
run: |
echo "GITHUB_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "NX_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
- name: Set GITHUB_BRANCH and NX_BRANCH environment variable
if: github.event_name != 'pull_request'
shell: bash
run: |
echo "GITHUB_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
echo "NX_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3

- name: Cache Nx
uses: actions/cache@v2
with:
path: node_modules/.cache/nx
key: cache-nx-${{ env.NX_BASE }}-${{ env.NX_HEAD }}
restore-keys: |
cache-nx-${{ env.NX_BASE }}-
cache-nx-
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
"install-compiler": "sh scripts/install-compiler.sh",
"docs": "rm -rf docs && node --max-old-space-size=12096 node_modules/.bin/typedoc packages/*/index.ts",
"publish-website": "heroku container:push web && heroku container:release web",
"postinstall": "npm run install-compiler"
"postinstall": "CI || npm run install-compiler"
},
"devDependencies": {
"@angular-devkit/core": "^15.0.0",
"@angular-devkit/schematics": "^15.0.0",
"@angular-eslint/eslint-plugin": "^16.1.2",
"@angular-eslint/eslint-plugin-template": "~15.0.0",
"@angular-devkit/build-angular": "15.0.0",
"@angular-eslint/template-parser": "~15.0.0",
"@angular/language-service": "^15.0.0",
"@jest/globals": "^29.2.1",
Expand Down Expand Up @@ -82,7 +83,7 @@
"ts-node": "^10.9.1",
"ts-node-dev": "^2.0.0",
"typedoc": "^0.23.17",
"typescript": "^4.8.4"
"typescript": "4.8.4"
},
"dependencies": {
"@angular-devkit/build-angular": "^15.0.0",
Expand Down Expand Up @@ -163,7 +164,16 @@
"widest-line": "^3.1.0",
"wrap-ansi": "^6.2.0",
"ws": "^8.6.0",
"zone.js": "~0.12.0"
"zone.js": "~0.12.0",
"webpack": "5.88.2",
"ts-loader": "9.4.4"
},
"resolutions": {
"typescript": "4.8.4",
"@angular-devkit/core": "15.0.0",
"@angular-devkit/build-angular": "15.0.0",
"@angular/compiler-cli": "15.0.0",
"@angular/cli": "15.0.0"
},
"engines": {
"node": ">= 16.0.0"
Expand Down
58 changes: 0 additions & 58 deletions packages/api-console-gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,10 @@
"name": "@deepkit/api-console-gui",
"version": "1.0.1-alpha.97",
"description": "API Console GUI",
"scripts": {
"ng": "ng",
"start": "NODE_OPTIONS=--preserve-symlinks ng serve",
"build": "rm -rf .angular && NODE_OPTIONS=--preserve-symlinks ng build --configuration production",
"build:dev": "NODE_OPTIONS=--preserve-symlinks ng build",
"watch": "NODE_OPTIONS=--preserve-symlinks ng build --watch",
"test": "NODE_OPTIONS=--preserve-symlinks ng test",
"lint": "NODE_OPTIONS=--preserve-symlinks ng lint",
"e2e": "NODE_OPTIONS=--preserve-symlinks ng e2e"
},
"repository": "https://github.com/deepkit/deepkit-framework",
"author": "Marc J. Schmidt <[email protected]>",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"devDependencies": {
"@angular-devkit/build-angular": "^15.0.0",
"@angular/animations": "^15.0.0",
"@angular/cdk": "^15.0.0",
"@angular/cli": "~15.0.0",
"@angular/common": "^15.0.0",
"@angular/compiler": "^15.0.0",
"@angular/compiler-cli": "^15.0.0",
"@angular/core": "^15.0.0",
"@angular/forms": "^15.0.0",
"@angular/platform-browser": "^15.0.0",
"@angular/platform-browser-dynamic": "^15.0.0",
"@angular/router": "^15.0.0",
"@deepkit/api-console-api": "^1.0.1-alpha.97",
"@deepkit/bson": "^1.0.1-alpha.97",
"@deepkit/core": "^1.0.1-alpha.97",
"@deepkit/core-rxjs": "^1.0.1-alpha.97",
"@deepkit/crypto": "^1.0.1-alpha.89",
"@deepkit/desktop-ui": "^1.0.1-alpha.97",
"@deepkit/event": "^1.0.1-alpha.97",
"@deepkit/injector": "^1.0.1-alpha.97",
"@deepkit/logger": "^1.0.1-alpha.97",
"@deepkit/rpc": "^1.0.1-alpha.97",
"@deepkit/stopwatch": "^1.0.1-alpha.97",
"@deepkit/type": "^1.0.1-alpha.97",
"@deepkit/type-compiler": "^1.0.1-alpha.97",
"@deepkit/ui-library": "^1.0.1-alpha.56",
"@types/jasmine": "~4.3.0",
"@types/marked": "^4.0.3",
"hammerjs": "^2.0.8",
"jasmine-core": "~4.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"marked": "^4.0.17",
"ngx-markdown": "^15.0.0",
"object-inspect": "^1.11.0",
"prismjs": "^1.24.1",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"typescript": "~4.8.2",
"zone.js": "~0.12.0"
}
}
36 changes: 20 additions & 16 deletions packages/api-console-gui/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,31 @@
"projectType": "application",
"prefix": "app",
"sourceRoot": "packages/api-console-gui/src",
"tags": [],
"tags": ["gui"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"executor": "@nx/angular:webpack-browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/api-console-gui",
"index": "packages/api-console-gui/src/index.html",
"main": "packages/api-console-gui/src/main.ts",
"buildLibsFromSource": false,
"outputPath": "dist/{projectRoot}",
"index": "{projectRoot}/src/index.html",
"main": "{projectRoot}/src/main.ts",
"customWebpackConfig": {
"path": "{projectRoot}/webpack.config.ts"
},
"polyfills": ["zone.js"],
"preserveSymlinks": true,
"tsConfig": "packages/api-console-gui/tsconfig.app.json",
"tsConfig": "{projectRoot}/tsconfig.app.json",
"assets": [
"packages/api-console-gui/src/favicon.ico",
"packages/api-console-gui/src/assets"
"{projectRoot}/src/favicon.ico",
"{projectRoot}/src/assets"
],
"styles": [
"dist/packages/desktop-ui/src/scss/all.scss",
"dist/packages/desktop-ui/src/scss/icon.scss",
"dist/packages/ui-library/src/styles/style-code.scss",
"packages/api-console-gui/src/styles.scss"
"packages/desktop-ui/src/lib/scss/all.scss",
"packages/desktop-ui/src/lib/scss/icon.scss",
"packages/ui-library/src/lib/styles/style-code.scss",
"{projectRoot}/src/styles.scss"
],
"scripts": []
},
Expand Down Expand Up @@ -56,7 +60,7 @@
"defaultConfiguration": "production"
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"executor": "@nx/angular:webpack-dev-server",
"configurations": {
"production": {
"browserTarget": "api-console-gui:build:production"
Expand All @@ -78,16 +82,16 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"packages/api-console-gui/**/*.ts",
"packages/api-console-gui/**/*.html"
"{projectRoot}/**/*.ts",
"{projectRoot}/**/*.html"
]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/api-console-gui/jest.config.ts",
"jestConfig": "{projectRoot}/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
Expand Down
8 changes: 1 addition & 7 deletions packages/api-console-gui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{
"compilerOptions": {
"target": "es2022",
"useDefineForClassFields": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"useDefineForClassFields": false
},
"files": [],
"include": [],
Expand Down
5 changes: 5 additions & 0 deletions packages/api-console-gui/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { composePlugins, withNx } from '@nx/webpack';
import { withDeepkit } from '@deepkit/nx-webpack-plugin';

// FIXME: TypeError: transformer is not a function
export default composePlugins(withNx(), withDeepkit());
Loading

0 comments on commit b22482b

Please sign in to comment.