Skip to content

Commit

Permalink
Merge pull request #1503 from akashic-games/fix-bin-ext
Browse files Browse the repository at this point in the history
fix: fix commands broken on early versions of Node.js v18, v20 and v21
  • Loading branch information
xnv authored Feb 14, 2025
2 parents 9bf4646 + 2428caf commit 662a0b0
Show file tree
Hide file tree
Showing 39 changed files with 34 additions and 23 deletions.
12 changes: 12 additions & 0 deletions .changeset/clean-seas-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@akashic/akashic-cli-lib-manage": patch
"@akashic/akashic-cli-sandbox": patch
"@akashic/akashic-cli-export": patch
"@akashic/akashic-cli-extra": patch
"@akashic/akashic-cli-serve": patch
"@akashic/akashic-cli-init": patch
"@akashic/akashic-cli-scan": patch
"@akashic/akashic-cli": patch
---

fix commands broken on early versions of Node.js v18, v20 and v21
File renamed without changes.
10 changes: 5 additions & 5 deletions packages/akashic-cli-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"prepublish": "npm run clean && npm run build",
"clean": "shx rm -rf lib && shx rm -rf spec/build",
"start": "npm run build && node bin/run",
"start": "npm run build && node bin/run.js",
"build": "npm run build:app && npm run copy:pdi && npm run build:template",
"build:app": "tsc -p ./ && tsc -p ./tsconfig.cjs.json",
"copy:pdi": "npm run copy:pdi:v1 && npm run copy:pdi:v2 && npm run copy:pdi:v3",
Expand All @@ -25,10 +25,10 @@
"author": "DWANGO Co., Ltd.",
"license": "MIT",
"bin": {
"akashic-cli-export": "./bin/run",
"akashic-cli-export-html": "./bin/akashic-cli-export-html",
"akashic-cli-export-zip": "./bin/akashic-cli-export-zip",
"akashic-cli-zip": "./bin/akashic-cli-export-zip"
"akashic-cli-export": "./bin/run.js",
"akashic-cli-export-html": "./bin/akashic-cli-export-html.js",
"akashic-cli-export-zip": "./bin/akashic-cli-export-zip.js",
"akashic-cli-zip": "./bin/akashic-cli-export-zip.js"
},
"files": [
"lib"
Expand Down
7 changes: 3 additions & 4 deletions packages/akashic-cli-extra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
"./package.json": "./package.json"
},
"bin": {
"akashic-cli-config": "./bin/akashic-cli-config",
"akashic-cli-modify": "./bin/akashic-cli-modify",
"akashic-cli-stat": "./bin/akashic-cli-stat"
"akashic-cli-config": "./bin/akashic-cli-config.js",
"akashic-cli-modify": "./bin/akashic-cli-modify.js",
"akashic-cli-stat": "./bin/akashic-cli-stat.js"
},
"scripts": {
"prepublish": "npm run clean && npm run build",
"clean": "rimraf ./lib && rimraf ./spec/build",
"start": "npm run build && node bin/run",
"build": "tsc -p ./",
"test": "npm run test:vitest && npm run test:lint",
"test:vitest": "vitest run",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/akashic-cli-init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"prepublish": "npm run clean && npm run build",
"clean": "rimraf ./lib",
"start": "npm run build && node bin/run",
"start": "npm run build && node bin/run.js",
"build": "tsc -p ./",
"lint": "eslint -c .eslintrc.cjs --fix",
"test": "npm run test:vitest && npm run lint",
Expand All @@ -15,7 +15,7 @@
"author": "DWANGO Co., Ltd.",
"license": "MIT",
"bin": {
"akashic-cli-init": "./bin/run"
"akashic-cli-init": "./bin/run.js"
},
"files": [
"lib"
Expand Down
6 changes: 3 additions & 3 deletions packages/akashic-cli-lib-manage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"author": "DWANGO Co., Ltd.",
"license": "MIT",
"bin": {
"akashic-cli-install": "./bin/akashic-cli-install",
"akashic-cli-uninstall": "./bin/akashic-cli-uninstall",
"akashic-cli-update": "./bin/akashic-cli-update"
"akashic-cli-install": "./bin/akashic-cli-install.js",
"akashic-cli-uninstall": "./bin/akashic-cli-uninstall.js",
"akashic-cli-update": "./bin/akashic-cli-update.js"
},
"files": [
"lib"
Expand Down
4 changes: 2 additions & 2 deletions packages/akashic-cli-sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "index.js",
"scripts": {
"prepublish": "npm run build",
"start": "npm run build && node bin/run",
"start": "npm run build && node bin/akashic-cli-sandbox.js",
"build": "npm run copy:common && npm run copy:engine-files && npm run build:client && npm run build:server",
"copy:common": "cpx \"./engine-src/common/js/**/*.js\" ./js && cpx \"./engine-src/common/external/**/*.js\" ./js",
"copy:engine-files": "npm run copy:v1 && npm run copy:v2 && npm run copy:v3",
Expand All @@ -24,7 +24,7 @@
"author": "DWANGO Co., Ltd.",
"license": "MIT",
"bin": {
"akashic-cli-sandbox": "./bin/akashic-cli-sandbox"
"akashic-cli-sandbox": "./bin/akashic-cli-sandbox.js"
},
"files": [
"lib",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/akashic-cli-scan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "DWANGO Co., Ltd.",
"license": "MIT",
"bin": {
"akashic-cli-scan": "./bin/run"
"akashic-cli-scan": "./bin/run.js"
},
"files": [
"bin",
Expand Down
2 changes: 1 addition & 1 deletion packages/akashic-cli-serve/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ COPY --from=build --chown=node:node /app/config ./config

USER node
EXPOSE 3300
ENTRYPOINT ["/tini", "--", "node", "bin/run"]
ENTRYPOINT ["/tini", "--", "node", "bin/run.js"]
CMD ["/game"]
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/akashic-cli-serve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"author": "DWANGO Co., Ltd.",
"license": "MIT",
"bin": {
"akashic-cli-serve": "./bin/run"
"akashic-cli-serve": "./bin/run.js"
},
"dependencies": {
"@akashic/akashic-cli-commons": "1.0.0-next.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/akashic-cli-serve/src/client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineConfig({
emptyOutDir: false,
},

// vite serve 用の設定。利用時は別で適当なコンテンツを実行する serve を起動しておく必要がある (e.g. `node bin/run -B --port 3300 <content>`) 。
// vite serve 用の設定。利用時は別で適当なコンテンツを実行する serve を起動しておく必要がある (e.g. `node bin/run.js -B --port 3300 <content>`) 。
// TODO HMR が効かない問題を解消する
server: {
proxy: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/akashic-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Command-line utility for akashic game development",
"type": "module",
"bin": {
"akashic": "./bin/akashic"
"akashic": "./bin/akashic.js"
},
"scripts": {
"prepublish": "npm run clean && npm run build",
Expand Down
4 changes: 2 additions & 2 deletions test/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Usage:
// node test/e2e.js (latestタグでpublishされたものをインストールしてテスト)
// node test/e2e.js --local (このリポジトリの packages/akashic-cli/bin/akashic をテスト)
// node test/e2e.js --local (このリポジトリの packages/akashic-cli/bin/akashic.js をテスト)

import { tmpdir } from "os";
import { dirname, join, resolve } from "path";
Expand Down Expand Up @@ -107,7 +107,7 @@ try {
await exec("npm install @akashic/akashic-cli@latest");
akashicCliPath = `${targetDir}/node_modules/.bin/akashic`;
} else {
akashicCliPath = resolve(__dirname, "..", "packages", "akashic-cli", "bin", "akashic");
akashicCliPath = resolve(__dirname, "..", "packages", "akashic-cli", "bin", "akashic.js");

// workaround: Windows 環境は shebang を解釈しないのでそのままでは実行できない。
// (npm i @akashic/akashic-cli した時は実行可能な .cmd ファイルが作られるが、ここでは存在しない)
Expand Down

0 comments on commit 662a0b0

Please sign in to comment.