create-packkit 1.3.0 → 1.4.1
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/README.md +7 -0
- package/package.json +3 -1
- package/src/cli/args.js +9 -1
- package/src/cli/index.js +6 -2
- package/src/core/features/bundler.js +3 -0
- package/src/core/features/frameworks.js +5 -5
package/README.md
CHANGED
|
@@ -80,6 +80,13 @@ Packkit is a pure `config → { files }` **core** that runs in both Node and the
|
|
|
80
80
|
|
|
81
81
|
Both drive from one options schema ([`src/core/options.js`](src/core/options.js)), so the CLI and the web page always stay in sync.
|
|
82
82
|
|
|
83
|
+
## Staying fresh
|
|
84
|
+
|
|
85
|
+
Two GitHub Actions keep the templates honest:
|
|
86
|
+
|
|
87
|
+
- **Dependency freshness** — a weekly check flags any version Packkit writes into generated projects that's fallen a major behind (versions Dependabot can't see), and opens an issue.
|
|
88
|
+
- **Integration** — on any change to generation logic or a template dependency, it generates every preset, installs it, and runs its real checks (build/test/lint, and actually starts services) — so an update can't silently break the projects you'd get.
|
|
89
|
+
|
|
83
90
|
## License
|
|
84
91
|
|
|
85
92
|
[MIT](LICENSE) © DanMat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-packkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
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,8 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"start": "node bin/cli.js",
|
|
26
26
|
"test": "node --test",
|
|
27
|
+
"check:deps": "node scripts/check-template-deps.mjs",
|
|
28
|
+
"integration": "node scripts/integration.mjs",
|
|
27
29
|
"build:web": "esbuild src/core/index.js --bundle --format=esm --outfile=docs/packkit-core.js"
|
|
28
30
|
},
|
|
29
31
|
"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
|
-
|
|
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);
|
|
@@ -46,6 +46,9 @@ export default {
|
|
|
46
46
|
pkg.scripts.build = tool;
|
|
47
47
|
pkg.scripts.dev = `${tool} --watch`;
|
|
48
48
|
pkg.devDependencies = { [tool]: tool === 'tsup' ? '^8.0.0' : '^0.6.0' };
|
|
49
|
+
// tsup/tsdown resolve `typescript` even for plain-JS builds; TS projects
|
|
50
|
+
// already get it from the typescript feature.
|
|
51
|
+
if (!cfg.isTs) pkg.devDependencies.typescript = '^5.5.0';
|
|
49
52
|
} else if (cfg.bundler === 'unbuild') {
|
|
50
53
|
files['build.config.ts'] = unbuildConfig(cfg);
|
|
51
54
|
pkg.scripts.build = 'unbuild';
|
|
@@ -40,7 +40,7 @@ function react(cfg, files, pkg, forApp) {
|
|
|
40
40
|
`}`,
|
|
41
41
|
``,
|
|
42
42
|
].join('\n');
|
|
43
|
-
pkg.dependencies = { react: '^
|
|
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 = '^
|
|
60
|
-
pkg.devDependencies['react-dom'] = '^
|
|
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'] = '^
|
|
64
|
-
pkg.devDependencies['@types/react-dom'] = '^
|
|
63
|
+
pkg.devDependencies['@types/react'] = '^19.0.0';
|
|
64
|
+
pkg.devDependencies['@types/react-dom'] = '^19.0.0';
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|