@@ -76,7 +76,7 @@ command:
7676 "sync": "node --version",
7777 "typegen": "node --version"
7878}
79- "npm@10.9.2"
79+ null
8080{
8181 "lodash": "4.17.21"
8282}
@@ -146,7 +146,7 @@ command:
146146 "sync": "node --version",
147147 "typegen": "node --version"
148148}
149- "npm@10.9.2"
149+ null
150150{
151151 "lodash": "4.17.21"
152152}
@@ -169,6 +169,53 @@ Error: template has package-lock.json but no pnpm-lock.yaml required by "pnpm in
169169 cd compatible-app
170170 npm ci && npm run dev
171171
172+ "npm@9.9.4"
173+
174+ === Npm records the installed version in a plain template
175+ >>> CLI_TEST_NPM_VERSION=11.4.1 [CLI] apps init --name installed-app --template npm-only-template --package-manager npm
176+ ✔ Installing dependencies
177+ ✔ Creating project
178+
179+ ✔ Project created successfully!
180+
181+ Location: [TEST_TMP_DIR]/installed-app
182+ Files: 2
183+
184+ Next steps:
185+
186+ cd installed-app
187+ npm run dev
188+
189+ npm@11.4.1
190+
191+ === Npm records the installed version in a Go template
192+ >>> CLI_TEST_NPM_VERSION=10.8.3 [CLI] apps init --name rendered-app --template install-template --package-manager npm
193+ ✔ Installing dependencies
194+ ✔ Creating project
195+
196+ ✔ Project created successfully!
197+
198+ Location: [TEST_TMP_DIR]/rendered-app
199+ Files: 2
200+
201+ Next steps:
202+
203+ cd rendered-app
204+ npm run dev
205+
206+ npm@10.8.3
207+
208+ === Npm version detection failure stops before creating the project
209+ >>> [CLI] apps init --name failed-app --template npm-only-template --package-manager npm
210+ Error: detect npm version; ensure npm is installed and working, or use --skip-install: exit status 1
211+
212+ === Npm invalid version stops before creating the project
213+ >>> CLI_TEST_NPM_VERSION=invalid [CLI] apps init --name invalid-app --template npm-only-template --package-manager npm
214+ Error: npm --version returned invalid version "invalid"; ensure npm is working, or use --skip-install
215+
216+ === Npm empty version stops before creating the project
217+ >>> CLI_TEST_NPM_VERSION= [CLI] apps init --name empty-app --template npm-only-template --package-manager npm
218+ Error: npm --version returned invalid version ""; ensure npm is working, or use --skip-install
172219
173220=== Version downgrade uses npm throughout
174221>>> [CLI] apps init --name older-app --version 0.81.0 --skip-install
@@ -193,7 +240,7 @@ command:
193240 - "run"
194241 - "start"
195242"npm run build:server && npm run build:client"
196- "npm@10.9.2"
243+ null
197244
198245=== Missing version falls back to the embedded template and its package manager
199246>>> DATABRICKS_CACHE_DIR=cache DATABRICKS_CACHE_ENABLED=true DATABRICKS_FORCE_EMBEDDED_COMPAT=false [CLI] apps init --name fallback-app --skip-install
@@ -219,4 +266,24 @@ command:
219266 - "run"
220267 - "start"
221268"npm run build:server && npm run build:client"
222- "npm@10.9.2"
269+ null
270+
271+ === Version downgrade resolves the installed npm pin
272+ >>> CLI_TEST_NPM_VERSION=11.4.1 [CLI] apps init --name installed-older-app --version 0.81.0
273+ ✔ Cloning template (version 0.81.0)
274+ Warn: Package manager "pnpm" is not supported for AppKit version version 0.81.0, using npm instead
275+ ✔ Creating project
276+ ✔ Installing dependencies
277+
278+ ✔ Project created successfully!
279+
280+ Location: [TEST_TMP_DIR]/installed-older-app
281+ Files: 4
282+
283+ Next steps:
284+
285+ cd installed-older-app
286+ npm run dev
287+
288+ "npm@11.4.1"
289+ npm@11.4.1
0 commit comments