create-packkit 1.3.0 → 1.4.0

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-packkit",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Highly configurable scaffolder for modern npm packages and CLIs — pick your stack (TS/JS, bundler, tests, linter, CI, releases) from a CLI or a web configurator.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -24,6 +24,7 @@
24
24
  "scripts": {
25
25
  "start": "node bin/cli.js",
26
26
  "test": "node --test",
27
+ "check:deps": "node scripts/check-template-deps.mjs",
27
28
  "build:web": "esbuild src/core/index.js --bundle --format=esm --outfile=docs/packkit-core.js"
28
29
  },
29
30
  "repository": {
package/src/cli/args.js CHANGED
@@ -38,6 +38,7 @@ export function parseCliArgs(argv) {
38
38
  from: { type: 'string' },
39
39
  name: { type: 'string' },
40
40
  yes: { type: 'boolean', short: 'y' },
41
+ recommended: { type: 'boolean' },
41
42
  here: { type: 'boolean' },
42
43
  'no-install': { type: 'boolean' },
43
44
  'no-git': { type: 'boolean' },
@@ -45,6 +46,7 @@ export function parseCliArgs(argv) {
45
46
  target: { type: 'string', multiple: true },
46
47
  workflows: { type: 'string', multiple: true },
47
48
  minify: { type: 'boolean' },
49
+ monorepo: { type: 'boolean' },
48
50
  storybook: { type: 'boolean' },
49
51
  'pkg-checks': { type: 'boolean' },
50
52
  knip: { type: 'boolean' },
@@ -70,6 +72,7 @@ export function parseCliArgs(argv) {
70
72
  if (values.target) overrides.target = values.target;
71
73
  if (values.workflows) overrides.workflows = values.workflows;
72
74
  if (values.minify) overrides.minify = true;
75
+ if (values.monorepo) overrides.monorepo = true;
73
76
  if (values.storybook) overrides.storybook = true;
74
77
  if (values['pkg-checks']) overrides.pkgChecks = true;
75
78
  if (values.knip) overrides.knip = true;
@@ -79,12 +82,17 @@ export function parseCliArgs(argv) {
79
82
  }
80
83
  if (name) overrides.name = name;
81
84
 
85
+ // Config flags provided (anything beyond the name) → the user knows what they
86
+ // want, so we can skip the wizard.
87
+ const hasConfigFlags = Object.keys(overrides).some((k) => k !== 'name');
88
+
82
89
  return {
83
90
  preset,
84
91
  from: values.from,
85
92
  name,
86
93
  here: !!values.here,
87
- yes: !!values.yes,
94
+ yes: !!values.yes || !!values.recommended,
95
+ hasConfigFlags,
88
96
  install: !values['no-install'],
89
97
  git: !values['no-git'],
90
98
  help: !!values.help,
package/src/cli/index.js CHANGED
@@ -30,7 +30,9 @@ Options:
30
30
  --from <file> Load defaults from a JSON profile (or packkit.config.json)
31
31
  --name <name> Package name
32
32
  --here Scaffold into the current directory
33
- -y, --yes Accept defaults / preset, no prompts
33
+ -y, --yes Accept defaults / preset, no prompts (one-shot)
34
+ --recommended Alias for --yes — recommended defaults in one command
35
+ --monorepo Generate a pnpm/Turborepo workspace
34
36
  --no-install Skip dependency install
35
37
  --no-git Skip git init
36
38
  --pm <manager> npm | pnpm | yarn | bun
@@ -64,7 +66,9 @@ export async function run(argv = process.argv.slice(2)) {
64
66
  return void console.log(JSON.stringify({ version: pkgVersion(), options: OPTIONS, presets: PRESET_INFO, aliases: PRESET_ALIASES }, null, 2));
65
67
  }
66
68
 
67
- const interactive = !args.preset && !args.yes && !args.from && process.stdout.isTTY;
69
+ // Only prompt when the user gave nothing to go on — a preset, --yes, a
70
+ // profile, or any config flag makes it a one-shot.
71
+ const interactive = !args.preset && !args.yes && !args.from && !args.hasConfigFlags && process.stdout.isTTY;
68
72
 
69
73
  // Precedence: preset < profile file < CLI flags.
70
74
  const profile = loadProfile(args);
@@ -40,7 +40,7 @@ function react(cfg, files, pkg, forApp) {
40
40
  `}`,
41
41
  ``,
42
42
  ].join('\n');
43
- pkg.dependencies = { react: '^18.3.0', 'react-dom': '^18.3.0' };
43
+ pkg.dependencies = { react: '^19.0.0', 'react-dom': '^19.0.0' };
44
44
  } else {
45
45
  files[`src/index.${x}`] = cfg.isTs
46
46
  ? [
@@ -56,12 +56,12 @@ function react(cfg, files, pkg, forApp) {
56
56
  ].join('\n')
57
57
  : [`export function Button({ label, onClick }) {`, `\treturn <button onClick={onClick}>{label}</button>;`, `}`, ``].join('\n');
58
58
  pkg.peerDependencies = { react: '>=18', 'react-dom': '>=18' };
59
- pkg.devDependencies.react = '^18.3.0';
60
- pkg.devDependencies['react-dom'] = '^18.3.0';
59
+ pkg.devDependencies.react = '^19.0.0';
60
+ pkg.devDependencies['react-dom'] = '^19.0.0';
61
61
  }
62
62
  if (cfg.isTs) {
63
- pkg.devDependencies['@types/react'] = '^18.3.0';
64
- pkg.devDependencies['@types/react-dom'] = '^18.3.0';
63
+ pkg.devDependencies['@types/react'] = '^19.0.0';
64
+ pkg.devDependencies['@types/react-dom'] = '^19.0.0';
65
65
  }
66
66
  }
67
67