create-deka-app 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/package-manager.js +4 -10
- package/src/scaffold.js +17 -12
package/package.json
CHANGED
package/src/package-manager.js
CHANGED
|
@@ -8,17 +8,11 @@
|
|
|
8
8
|
// arm64". `npm_execpath` is a fallback for the rarer case where that header
|
|
9
9
|
// is absent but the package manager's own launcher script is still visible
|
|
10
10
|
// on the path it invoked us with.
|
|
11
|
-
// `runScript` renders the command we tell the user to run for a
|
|
12
|
-
// package.json script (currently always "dev"). It must work with zero
|
|
13
|
-
// global installs, using only what the install step above already put on
|
|
14
|
-
// disk -- so it is each package manager's own idiom for running a local
|
|
15
|
-
// script, never a bare `deka ...` invocation (deka itself only lives in
|
|
16
|
-
// this project's node_modules/.bin).
|
|
17
11
|
const MANAGERS = {
|
|
18
|
-
npm: { name: 'npm', install: ['npm', ['install']]
|
|
19
|
-
pnpm: { name: 'pnpm', install: ['pnpm', ['install']]
|
|
20
|
-
yarn: { name: 'yarn', install: ['yarn', ['install']]
|
|
21
|
-
bun: { name: 'bun', install: ['bun', ['install']]
|
|
12
|
+
npm: { name: 'npm', install: ['npm', ['install']] },
|
|
13
|
+
pnpm: { name: 'pnpm', install: ['pnpm', ['install']] },
|
|
14
|
+
yarn: { name: 'yarn', install: ['yarn', ['install']] },
|
|
15
|
+
bun: { name: 'bun', install: ['bun', ['install']] },
|
|
22
16
|
}
|
|
23
17
|
|
|
24
18
|
export function detectPackageManager(env = process.env) {
|
package/src/scaffold.js
CHANGED
|
@@ -43,20 +43,25 @@ function stripDekaNextSteps(output) {
|
|
|
43
43
|
return cutIndex === -1 ? String(output) : lines.slice(0, cutIndex).join('\n')
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// deka init's own next-steps text always tells the user to run
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
|
|
46
|
+
// deka init's own next-steps text always tells the user to run `deka dev`,
|
|
47
|
+
// and that command is correct as-is -- `deka` from this package is scoped
|
|
48
|
+
// to the project, so the copy installed into node_modules/.bin (and picked
|
|
49
|
+
// up via the project's package.json script) works with nothing beyond what
|
|
50
|
+
// the install step above already put on disk. We suppress deka's block
|
|
51
|
+
// (stripDekaNextSteps) only because it doesn't know it's being invoked
|
|
52
|
+
// from the parent directory here, so it can't tell the user they still
|
|
53
|
+
// need to `cd <dirName>` first -- not because its command is wrong. Our
|
|
54
|
+
// own block adds that missing `cd` and repeats `deka dev` verbatim,
|
|
55
|
+
// regardless of which package manager ran the install. (This reverts an
|
|
56
|
+
// earlier version of this function that substituted a package-manager
|
|
57
|
+
// idiom -- `npm run dev` / `pnpm dev` / etc. -- for `deka dev`, on the
|
|
58
|
+
// mistaken premise that a bare `deka dev` can't be run without a global
|
|
59
|
+
// install.)
|
|
60
|
+
function printNextSteps(log, dirName) {
|
|
56
61
|
log('')
|
|
57
62
|
log(' Next steps:')
|
|
58
63
|
log(` cd ${dirName}`)
|
|
59
|
-
log(
|
|
64
|
+
log(' deka dev')
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
export const RUNTIME_PACKAGE = '@dekaruntime/deka'
|
|
@@ -229,7 +234,7 @@ export function createApp({
|
|
|
229
234
|
|
|
230
235
|
if (init.stdout) log(stripDekaNextSteps(init.stdout))
|
|
231
236
|
if (init.stderr) log(stripDekaNextSteps(init.stderr))
|
|
232
|
-
printNextSteps(log, dirName
|
|
237
|
+
printNextSteps(log, dirName)
|
|
233
238
|
|
|
234
239
|
return 0
|
|
235
240
|
}
|