From 86603573f04033e1ee4774f2ed2f24c4ac7e9e34 Mon Sep 17 00:00:00 2001 From: Jin <22962980+JYC333@users.noreply.github.com> Date: Sat, 10 Aug 2024 12:00:57 +0200 Subject: [PATCH] fix ci build --- .github/workflows/main.yml | 1 + loader-register.js | 10 ++++++++++ package.json | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 loader-register.js diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47edb19e3..2942e0a24 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,7 @@ jobs: node-version: 20 cache: "npm" - run: npm ci + - run: npm install --save-dev appdmg - name: Run MacOS installer build (x86_64) run: | npm run update-build-info diff --git a/loader-register.js b/loader-register.js new file mode 100644 index 000000000..346caacb5 --- /dev/null +++ b/loader-register.js @@ -0,0 +1,10 @@ +// Used to register the loader with Node.js +// This is used to avoid the warning message when using the loader +// Can be removed if this PR is merged: +// https://github.com/TypeStrong/ts-node/pull/2073 +// Then probably can change webpack comand to +// "webpack": "cross-env NODE_OPTIONS=--import=ts-node/esm webpack -c webpack.config.ts", + +import { register } from 'node:module'; +import { pathToFileURL } from 'node:url'; +register('ts-node/esm', pathToFileURL('./')); \ No newline at end of file diff --git a/package.json b/package.json index a1d32688e..ea24661bd 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "build-backend-docs": "rimraf ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js", "build-frontend-docs": "rimraf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js", "build-docs": "npm run build-backend-docs && npm run build-frontend-docs", - "webpack": "cross-env node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));' node_modules/webpack/bin/webpack.js -c webpack.config.ts", + "webpack": "cross-env node --import ./loader-register.js node_modules/webpack/bin/webpack.js -c webpack.config.ts", "test-jasmine": "cross-env TRILIUM_DATA_DIR=./data-test tsx ./node_modules/.bin/jasmine", "test-es6": "tsx -r esm spec-es6/attribute_parser.spec.ts", "test": "npm run test-jasmine && npm run test-es6",