Skip to content

Commit

Permalink
Remove npx usage, fix lint and update GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Salmen committed Jul 21, 2023
1 parent 4e7ab42 commit 03c3850
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 35 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ module.exports = {
'@typescript-eslint/no-misused-new': 'error', // no constructors for interfaces or new for classes
'@typescript-eslint/no-namespace': 'off', // disallow the use of custom TypeScript modules and namespaces
'@typescript-eslint/no-non-null-assertion': 'off', // allow ! operator
'@typescript-eslint/no-parameter-properties': 'error', // no property definitions in class constructors
'@typescript-eslint/no-unused-vars': ['error', { // disallow Unused Variables
'argsIgnorePattern': '^_'
}],
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
- name: Build
shell: bash
run: |
npm ci
npm run build
- name: Lint
shell: bash
run: |
npm run lint
npm run build
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"lint": "npm run lint --workspaces",
"lint:fix": "npm run lint:fix --workspaces",
"doc": "npm run doc --workspace packages/objloader2",
"compile": "npx tsc --build tsconfig.build.json",
"watch": "npx tsc --build tsconfig.build.json --watch",
"compile": "tsc --build tsconfig.build.json",
"watch": "tsc --build tsconfig.build.json --watch",
"build": "npm run build --workspaces",
"build:obj2": "npm run build --workspace packages/objloader2",
"dev": "npx vite",
"dev:debug": "npx vite --debug --force",
"dev": "vite",
"dev:debug": "vite --debug --force",
"verify": "npm run verify --workspace packages/examples",
"prerelease": "npm run build && npm run doc && npx shx cp -f README.md packages/objloader2/README.md",
"prerelease": "npm run build && npm run doc && shx cp -f README.md packages/objloader2/README.md",
"test": "vitest",
"update:versions:dev": "node config/UpdateVersions.mjs dev",
"update:versions:real": "node config/UpdateVersions.mjs real",
Expand Down
28 changes: 14 additions & 14 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
"type": "module",
"private": "true",
"scripts": {
"clean": "npx shx rm -rf ./dist ./libs && npx tsc --build --clean",
"compile": "npx tsc",
"lint": "npx eslint src --ext .ts",
"lint:fix": "npx eslint src --ext .ts --fix",
"copy:prepare": "npx shx mkdir -p ./libs/worker",
"copy:three": "npx shx cp -f ../../node_modules/three/build/three.module.js ./libs/three.module.js",
"copy:three:trackball": "npx shx cp -f ../../node_modules/three/examples/jsm/controls/TrackballControls.js ./libs/TrackballControls.js",
"copy:three:mtlloader": "npx shx cp -f ../../node_modules/three/examples/jsm/loaders/MTLLoader.js ./libs/MTLLoader.js",
"copy:three:vertexnormalshelper": "npx shx cp -f ../../node_modules/three/examples/jsm/helpers/VertexNormalsHelper.js ./libs/VertexNormalsHelper.js",
"copy:lil-gui": "npx shx cp -f ../../node_modules/lil-gui/dist/lil-gui.esm.js ./libs/lil-gui.esm.js",
"copy:wtd-core": "npx shx mkdir -p ./libs/wtd-core && npx shx cp -f ../../node_modules/wtd-core/dist/* ./libs/wtd-core",
"copy:objloader2": "npx shx cp -f ../objloader2/lib/objloader2.js ./libs/objloader2.js",
"copy:objloader2:worker": "npx shx cp -f ../objloader2/lib/worker/OBJLoader2WorkerModule.js ./libs/worker/OBJLoader2WorkerModule.js && npx shx cp -f ../objloader2/lib/worker/OBJLoader2WorkerClassic.js ./libs/worker/OBJLoader2WorkerClassic.js",
"clean": "shx rm -rf ./dist ./libs && tsc --build --clean",
"compile": "tsc",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"copy:prepare": "shx mkdir -p ./libs/worker",
"copy:three": "shx cp -f ../../node_modules/three/build/three.module.js ./libs/three.module.js",
"copy:three:trackball": "shx cp -f ../../node_modules/three/examples/jsm/controls/TrackballControls.js ./libs/TrackballControls.js",
"copy:three:mtlloader": "shx cp -f ../../node_modules/three/examples/jsm/loaders/MTLLoader.js ./libs/MTLLoader.js",
"copy:three:vertexnormalshelper": "shx cp -f ../../node_modules/three/examples/jsm/helpers/VertexNormalsHelper.js ./libs/VertexNormalsHelper.js",
"copy:lil-gui": "shx cp -f ../../node_modules/lil-gui/dist/lil-gui.esm.js ./libs/lil-gui.esm.js",
"copy:wtd-core": "shx mkdir -p ./libs/wtd-core && shx cp -f ../../node_modules/wtd-core/dist/* ./libs/wtd-core",
"copy:objloader2": "shx cp -f ../objloader2/lib/objloader2.js ./libs/objloader2.js",
"copy:objloader2:worker": "shx cp -f ../objloader2/lib/worker/OBJLoader2WorkerModule.js ./libs/worker/OBJLoader2WorkerModule.js && shx cp -f ../objloader2/lib/worker/OBJLoader2WorkerClassic.js ./libs/worker/OBJLoader2WorkerClassic.js",
"build": "npm run clean && npm run compile && npm run copy:prepare && npm run copy:three && npm run copy:three:trackball && npm run copy:three:mtlloader && npm run copy:three:vertexnormalshelper && npm run copy:lil-gui && npm run copy:wtd-core && npm run copy:objloader2 && npm run copy:objloader2:worker",
"serve": "npx tsc && npx vite preview",
"serve": "tsc && vite preview",
"verify": "http-server --port 20001 ./"
},
"volta": {
Expand Down
20 changes: 10 additions & 10 deletions packages/objloader2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@
"README.md"
],
"scripts": {
"clean": "npx shx rm -rf ./dist ./lib ./src/worker/OBJLoader2WorkerClassic.js ./src/worker/OBJLoader2WorkerModule.js ./docs && npx tsc --build --clean",
"doc": "npx shx rm -fr docs && npx typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts",
"lint": "npx eslint src --ext .ts",
"lint:fix": "npx eslint src --ext .ts --fix",
"build:worker:copy": "npx shx mkdir -p ./lib/worker && npx shx cp ./src/worker/OBJLoader2WorkerModule.js ./lib/worker/ && npx shx cp ./src/worker/OBJLoader2WorkerClassic.js ./lib/worker/",
"build:worker": "npx vite -c vite.config.worker.ts build",
"build:lib": "npx vite build",
"compile": "npx tsc",
"watch": "npx tsc -w",
"clean": "shx rm -rf ./dist ./lib ./src/worker/OBJLoader2WorkerClassic.js ./src/worker/OBJLoader2WorkerModule.js ./docs && tsc --build --clean",
"doc": "shx rm -fr docs && typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"build:worker:copy": "shx mkdir -p ./lib/worker && shx cp ./src/worker/OBJLoader2WorkerModule.js ./lib/worker/ && shx cp ./src/worker/OBJLoader2WorkerClassic.js ./lib/worker/",
"build:worker": "vite -c vite.config.worker.ts build",
"build:lib": "vite build",
"compile": "tsc",
"watch": "tsc -w",
"build": "npm run clean && npm run compile && npm run build:lib && npm run build:worker",
"serve": "npx tsc && npx vite preview"
"serve": "tsc && vite preview"
},
"volta": {
"node": "18.17.0",
Expand Down

0 comments on commit 03c3850

Please sign in to comment.