Skip to content

Commit

Permalink
Fix module resolution (#614)
Browse files Browse the repository at this point in the history
* Replace outdated resolution flag by custom loader

* Bump version to 0.22.3

* Remove deprecated resolution flag from test commands

* Remove caret in version identifier

* Specify custom loader in Docker build
  • Loading branch information
TimJentzsch committed Apr 1, 2024
1 parent 74f323e commit 32dc816
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 53 deletions.
50 changes: 20 additions & 30 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
{
"editor.tabSize": 2,
"files.eol": "\n",
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext"
],
"spellright.language": [
"en"
],
"diffEditor.ignoreTrimWhitespace": false,
"files.exclude": {
"coverage": true,
"dist": true,
"node_modules": true,
"package-lock.json": true
"editor.tabSize": 2,
"files.eol": "\n",
"spellright.documentTypes": ["markdown", "latex", "plaintext"],
"spellright.language": ["en"],
"diffEditor.ignoreTrimWhitespace": false,
"files.exclude": {
"coverage": false,
"dist": false,
"node_modules": false,
"package-lock.json": false
},
"json.schemas": [
{
"fileMatch": ["/config/games/*.json"],
"url": "./config/schemas/game_config.schema.json"
},
"json.schemas": [
{
"fileMatch": [
"/config/games/*.json"
],
"url": "./config/schemas/game_config.schema.json"
},
{
"fileMatch": [
"/config/api_config*.json"
],
"url": "./config/schemas/api_config.schema.json"
}
]
{
"fileMatch": ["/config/api_config*.json"],
"url": "./config/schemas/api_config.schema.json"
}
]
}
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ COPY --from=build-dependencies /app/dist ./dist
COPY --from=production-dependencies /app/node_modules ./node_modules
COPY ./config/games ./config/games
ENV NODE_ENV=production
ENV NODE_OPTIONS='--experimental-specifier-resolution=node'
ENV LOG_LEVEL=info
CMD ["node", "/app/dist/src/_main.js"]
CMD ["node", "--loader", "commonjs-extension-resolution-loader", "/app/dist/src/_main.js"]
37 changes: 21 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gamefeeder",
"version": "0.22.2",
"version": "0.22.3",
"description": "A notification bot for several games, available on Discord and Telegram.",
"main": "src/_main.ts",
"type": "module",
Expand All @@ -20,15 +20,16 @@
},
"scripts": {
"build": "tsc --build",
"dev": "NODE_OPTIONS='--experimental-specifier-resolution=node' nodemon --watch \"src/**\" --ext \"ts,json\" --exec \"node --loader ts-node/esm src/_main.ts\"",
"start": "NODE_OPTIONS='--experimental-specifier-resolution=node' node dist/src/_main.js",
"dev": "nodemon --watch \"src/**\" --ext \"ts,json\" --exec \"node --loader ts-node/esm src/_main.ts\"",
"start": "node --loader commonjs-extension-resolution-loader dist/src/_main.js",
"lint": "eslint \"src/**/*.ts\" \"tests/**/*.spec.ts\"",
"format": "eslint \"src/**/*.ts\" --fix",
"test": "NODE_OPTIONS='--experimental-vm-modules --experimental-specifier-resolution=node' jest --config jest.config.ts",
"coverage": "NODE_OPTIONS='--experimental-vm-modules --experimental-specifier-resolution=node' jest --config jest.config.ts --coverage",
"test": "NODE_OPTIONS='--experimental-vm-modules' jest --config jest.config.ts",
"coverage": "NODE_OPTIONS='--experimental-vm-modules' jest --config jest.config.ts --coverage",
"watch": "tsc --watch"
},
"dependencies": {
"commonjs-extension-resolution-loader": "0.1.0",
"discord.js": "14.14.1",
"escape-string-regexp": "5.0.0",
"lodash": "4.17.21",
Expand Down

0 comments on commit 32dc816

Please sign in to comment.