Skip to content

Commit 73dc99b

Browse files
committed
fix(ci): fix CLI argument parsing and use local rake build for tool generators
Fix frontend generator tests to properly test plugin build workflows: **CLI Argument Parsing (openc3.sh)** - Replace echo pipe argument parsing with shift/"$@" to preserve quotes - Fixes: `./openc3.sh cli generate tool_vue 'Test Vue Tool'` now works - Applied to both `cli` and `cliroot` commands (lines 268-273, 313-314) **CI Workflow (tool.yml)** - Add pnpm installation step (lines 30-33) - Run `rake build VERSION=1.0.0` directly on CI runner instead of in Docker container where pnpm is unavailable - Use `pnpm install --ignore-scripts` for fresh plugins: - Skip --frozen-lockfile (no lockfile in generated plugins) - Keep --ignore-scripts to skip broken lifecycle hooks (e.g., Svelte's prepare script that requires missing @material/theme dependencies) - Non-tool plugins continue using `../openc3.sh cli rake build` **Why This Works** Tool/widget plugins have package.json, so Rakefile runs `pnpm run build` (lines 19-23). Previously this failed inside Docker container because: 1. pnpm only installed in CI runner, not in openc3-cosmos-cmd-tlm-api 2. Svelte's prepare hook tried to compile themes without dependencies
1 parent c68f3a6 commit 73dc99b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/tool.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jobs:
6666
# Verify package.json has required scripts
6767
grep -q '"build"' package.json
6868
grep -q '"serve"' package.json
69-
# Build plugin (use pnpm install without --frozen-lockfile for fresh plugins)
70-
pnpm install
69+
# Build plugin (skip --frozen-lockfile for fresh plugins, keep --ignore-scripts)
70+
pnpm install --ignore-scripts
7171
rake build VERSION=1.0.0
7272
# Verify build output (Vue builds to tools/testvuetool/ directory)
7373
test -f tools/testvuetool/main.js
@@ -96,8 +96,8 @@ jobs:
9696
grep -q 'INLINE_URL main.js' plugin.txt
9797
# Verify package.json has required scripts
9898
grep -q '"build"' package.json
99-
# Build plugin (use pnpm install without --frozen-lockfile for fresh plugins)
100-
pnpm install
99+
# Build plugin (skip --frozen-lockfile for fresh plugins, keep --ignore-scripts)
100+
pnpm install --ignore-scripts
101101
rake build VERSION=1.0.0
102102
# Verify build output (Angular builds to tools/testangulartool/)
103103
test -f tools/testangulartool/main.js
@@ -126,8 +126,8 @@ jobs:
126126
grep -q 'INLINE_URL main.js' plugin.txt
127127
# Verify package.json has required scripts
128128
grep -q '"build"' package.json
129-
# Build plugin (use pnpm install without --frozen-lockfile for fresh plugins)
130-
pnpm install
129+
# Build plugin (skip --frozen-lockfile for fresh plugins, keep --ignore-scripts)
130+
pnpm install --ignore-scripts
131131
rake build VERSION=1.0.0
132132
# Verify build output (React builds to tools/testreacttool/)
133133
test -f tools/testreacttool/main.js
@@ -156,8 +156,8 @@ jobs:
156156
grep -q 'INLINE_URL main.js' plugin.txt
157157
# Verify package.json has required scripts
158158
grep -q '"build"' package.json
159-
# Build plugin (use pnpm install without --frozen-lockfile for fresh plugins)
160-
pnpm install
159+
# Build plugin (skip --frozen-lockfile for fresh plugins, keep --ignore-scripts)
160+
pnpm install --ignore-scripts
161161
rake build VERSION=1.0.0
162162
# Verify build output (Svelte builds to tools/testsveltetool/)
163163
test -f tools/testsveltetool/main.js
@@ -185,8 +185,8 @@ jobs:
185185
grep -q "WIDGET Testwidget" plugin.txt
186186
# Verify package.json has required scripts
187187
grep -q '"build"' package.json
188-
# Build plugin (use pnpm install without --frozen-lockfile for fresh plugins)
189-
pnpm install
188+
# Build plugin (skip --frozen-lockfile for fresh plugins, keep --ignore-scripts)
189+
pnpm install --ignore-scripts
190190
rake build VERSION=1.0.0
191191
# Verify build output (widgets build to tools/widgets/TestWidget/)
192192
test -f tools/widgets/TestWidget/TestWidget.umd.min.js
@@ -228,8 +228,8 @@ jobs:
228228
test -f vite.config.js
229229
# Verify it's a Vue project by checking for Vue dependencies
230230
grep -q "vue" package.json
231-
# Build plugin (use pnpm install without --frozen-lockfile for fresh plugins)
232-
pnpm install
231+
# Build plugin (skip --frozen-lockfile for fresh plugins, keep --ignore-scripts)
232+
pnpm install --ignore-scripts
233233
rake build VERSION=1.0.0
234234
# Verify build output (should be in tools/generictool/)
235235
test -f tools/generictool/main.js

0 commit comments

Comments
 (0)