Skip to content

Commit 52bed19

Browse files
frostebiteclaude
andcommitted
refactor: move CLI to orchestrator, fix validate-orchestrator workflow
- Delete src/cli.ts, src/cli/ (commands, tests, input-mapper) — moved to game-ci/orchestrator repo (PR #813 reference) - Delete .github/workflows/release-cli.yml — moved to orchestrator - Remove bin, pkg, yargs, @types/yargs, pkg from package.json - Fix validate-orchestrator.yml: - Build TypeScript before running require() smoke tests - Remove || echo fallback that swallowed errors - Add smoke test that installs orchestrator via npm pack and verifies loadOrchestrator() returns defined exports Legacy src/model/cli/ (Cli class, CliFunctionsRepository) preserved — used by Input.getInput() and build-parameters.ts on main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 01c718a commit 52bed19

File tree

16 files changed

+49
-2670
lines changed

16 files changed

+49
-2670
lines changed

.github/workflows/release-cli.yml

Lines changed: 0 additions & 170 deletions
This file was deleted.

.github/workflows/validate-orchestrator.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,20 @@ jobs:
5151
- name: Install unity-builder dependencies
5252
run: yarn install --frozen-lockfile
5353

54-
- name: Verify unity-builder compiles without orchestrator
54+
- name: Build unity-builder
5555
run: |
56-
echo "Verifying unity-builder compiles without @game-ci/orchestrator installed..."
57-
npx tsc --noEmit
56+
echo "Building unity-builder TypeScript..."
57+
npx tsc
5858
echo "✓ unity-builder compiles successfully"
5959
6060
- name: Run unity-builder tests
6161
run: |
6262
echo "Running unity-builder tests..."
6363
npx jest --no-cache --passWithNoTests 2>&1 | tail -10
6464
65-
- name: Verify plugin loader gracefully handles missing orchestrator
65+
- name: Verify plugin loader returns undefined without orchestrator
6666
run: |
67-
echo "Checking that orchestrator-plugin.ts handles missing package..."
68-
# The plugin loader should return undefined when @game-ci/orchestrator is not installed
67+
echo "Checking plugin loader handles missing @game-ci/orchestrator..."
6968
node -e "
7069
const { loadOrchestrator, loadEnterpriseServices } = require('./lib/model/orchestrator-plugin');
7170
(async () => {
@@ -83,7 +82,7 @@ jobs:
8382
}
8483
console.log('✓ loadEnterpriseServices() returns undefined when package not installed');
8584
})();
86-
" 2>&1 || echo "::warning::Plugin loader test requires compiled JS (run yarn build first)"
85+
"
8786
8887
- name: Verify orchestrator type declarations exist
8988
run: |
@@ -94,16 +93,46 @@ jobs:
9493
exit 1
9594
fi
9695
97-
- name: Run orchestrator standalone tests
96+
- name: Build and install orchestrator standalone
9897
working-directory: orchestrator-standalone
9998
run: |
10099
yarn install --frozen-lockfile
100+
echo "Building orchestrator standalone..."
101+
npx tsc
102+
echo "✓ orchestrator standalone compiles successfully"
103+
echo "Packing orchestrator as tarball..."
104+
npm pack
105+
106+
- name: Run orchestrator standalone tests
107+
working-directory: orchestrator-standalone
108+
run: |
101109
echo "Running orchestrator standalone tests..."
102110
npx jest --no-cache 2>&1 | tail -10
103111
104-
- name: Verify orchestrator standalone compiles
105-
working-directory: orchestrator-standalone
112+
- name: Verify plugin loader returns exports with orchestrator installed
106113
run: |
107-
echo "Verifying orchestrator standalone compiles..."
108-
npx tsc --noEmit
109-
echo "✓ orchestrator standalone compiles successfully"
114+
echo "Installing orchestrator into unity-builder workspace..."
115+
npm install ./orchestrator-standalone/game-ci-orchestrator-*.tgz --no-save
116+
echo "Checking plugin loader returns defined exports..."
117+
node -e "
118+
const { loadOrchestrator, loadEnterpriseServices } = require('./lib/model/orchestrator-plugin');
119+
(async () => {
120+
const orch = await loadOrchestrator();
121+
if (orch === undefined) {
122+
console.error('ERROR: loadOrchestrator should return defined exports when package is installed');
123+
process.exit(1);
124+
}
125+
if (typeof orch.run !== 'function') {
126+
console.error('ERROR: loadOrchestrator().run should be a function');
127+
process.exit(1);
128+
}
129+
console.log('✓ loadOrchestrator() returns defined exports with orchestrator installed');
130+
131+
const services = await loadEnterpriseServices();
132+
if (services === undefined) {
133+
console.error('ERROR: loadEnterpriseServices should return defined exports when package is installed');
134+
process.exit(1);
135+
}
136+
console.log('✓ loadEnterpriseServices() returns defined exports with orchestrator installed');
137+
})();
138+
"

package.json

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,6 @@
33
"version": "3.0.0",
44
"description": "Build Unity projects for different platforms.",
55
"main": "dist/index.js",
6-
"bin": {
7-
"game-ci": "./lib/cli.js"
8-
},
9-
"pkg": {
10-
"scripts": "lib/**/*.js",
11-
"assets": [
12-
"lib/**/*.json",
13-
"package.json"
14-
],
15-
"targets": [
16-
"node20-linux-x64",
17-
"node20-linux-arm64",
18-
"node20-macos-x64",
19-
"node20-macos-arm64",
20-
"node20-win-x64"
21-
],
22-
"outputPath": "dist-binaries"
23-
},
246
"repository": "git@github.com:game-ci/unity-builder.git",
257
"author": "Webber <webber@takken.io>",
268
"license": "MIT",
@@ -29,8 +11,6 @@
2911
"build": "yarn && tsc && ncc build lib --source-map --license licenses.txt",
3012
"lint": "prettier --check \"src/**/*.{js,ts}\" && eslint src/**/*.ts",
3113
"format": "prettier --write \"src/**/*.{js,ts}\"",
32-
"cli": "yarn ts-node src/index.ts -m cli",
33-
"game-ci": "ts-node src/cli.ts",
3414
"test": "jest",
3515
"test:ci": "jest --config=jest.ci.config.js --runInBand"
3616
},
@@ -50,14 +30,12 @@
5030
"semver": "^7.5.2",
5131
"ts-md5": "^1.3.1",
5232
"unity-changeset": "^3.1.0",
53-
"yaml": "^2.2.2",
54-
"yargs": "^17.7.2"
33+
"yaml": "^2.2.2"
5534
},
5635
"devDependencies": {
5736
"@types/jest": "^27.4.1",
5837
"@types/node": "^17.0.23",
5938
"@types/semver": "^7.3.9",
60-
"@types/yargs": "^17.0.35",
6139
"@typescript-eslint/parser": "4.8.1",
6240
"@vercel/ncc": "^0.36.1",
6341
"cross-env": "^7.0.3",
@@ -73,7 +51,6 @@
7351
"js-yaml": "^4.1.0",
7452
"lefthook": "^1.6.1",
7553
"node-fetch": "2",
76-
"pkg": "^5.8.1",
7754
"prettier": "^2.5.1",
7855
"ts-jest": "^27.1.3",
7956
"ts-node": "10.8.1",

src/cli.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)