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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-deka-app",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Scaffold a new deka app",
5
5
  "bin": {
6
6
  "create-deka-app": "./index.js"
@@ -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']], runScript: (script) => `npm run ${script}` },
19
- pnpm: { name: 'pnpm', install: ['pnpm', ['install']], runScript: (script) => `pnpm ${script}` },
20
- yarn: { name: 'yarn', install: ['yarn', ['install']], runScript: (script) => `yarn ${script}` },
21
- bun: { name: 'bun', install: ['bun', ['install']], runScript: (script) => `bun run ${script}` },
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 a bare
47
- // `deka ...` command, because that's correct advice for someone who ran
48
- // `deka init` by hand with deka already on their PATH. It is wrong advice
49
- // here: create-deka-app only ever installs deka into this project's own
50
- // node_modules/.bin, so a bare `deka` command fails for a user who has no
51
- // global install. We suppress deka's block (stripDekaNextSteps) and print
52
- // our own -- the `cd` line plus the detected package manager's own idiom
53
- // for running the "dev" script already sitting in package.json, which
54
- // works with nothing beyond what the install step just put on disk.
55
- function printNextSteps(log, dirName, pm) {
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(` ${pm.runScript('dev')}`)
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, pm)
237
+ printNextSteps(log, dirName)
233
238
 
234
239
  return 0
235
240
  }