create-template-project 1.2.0 → 1.2.2
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/dist/config/dependencies.json +1 -1
- package/dist/index.js +5 -8
- package/dist/templates/base/files/_oxc.config.ts +12 -1
- package/dist/templates/base/files/commitlint.config.js +5 -1
- package/dist/templates/base/files/package.json +33 -32
- package/dist/templates/web-fullstack/files/package.json +2 -2
- package/package.json +103 -102
package/dist/index.js
CHANGED
|
@@ -442,7 +442,7 @@ var getWebAppTemplate = (_opts) => ({
|
|
|
442
442
|
});
|
|
443
443
|
//#endregion
|
|
444
444
|
//#region src/templates/web-fullstack/index.ts
|
|
445
|
-
var getWebFullstackTemplate = (
|
|
445
|
+
var getWebFullstackTemplate = (opts) => ({
|
|
446
446
|
name: "web-fullstack",
|
|
447
447
|
description: "A comprehensive full-stack monorepo featuring an Express backend with tRPC and a modern React client with MUI.",
|
|
448
448
|
components: [
|
|
@@ -505,9 +505,9 @@ var getWebFullstackTemplate = (_opts) => ({
|
|
|
505
505
|
"vitest-browser-react": "vitest-browser-react"
|
|
506
506
|
},
|
|
507
507
|
scripts: {
|
|
508
|
-
build:
|
|
509
|
-
dev:
|
|
510
|
-
test:
|
|
508
|
+
build: `${opts.packageManager} run build --workspaces`,
|
|
509
|
+
dev: `${opts.packageManager} run dev --workspaces`,
|
|
510
|
+
test: `${opts.packageManager} run test --workspaces`,
|
|
511
511
|
"integration-test": "playwright test"
|
|
512
512
|
},
|
|
513
513
|
files: [],
|
|
@@ -1210,7 +1210,7 @@ var generateProject = async (opts) => {
|
|
|
1210
1210
|
if (template.templateDir === void 0) return;
|
|
1211
1211
|
const templatePkgPath = path.join(template.templateDir, "package.json");
|
|
1212
1212
|
if (!await pathExists(templatePkgPath)) return;
|
|
1213
|
-
return parseTemplatePackageJson(await fs.readFile(templatePkgPath, "utf8"));
|
|
1213
|
+
return parseTemplatePackageJson(processContent("package.json", await fs.readFile(templatePkgPath, "utf8"), opts, addedDeps));
|
|
1214
1214
|
}));
|
|
1215
1215
|
for (const [index, t] of templates.entries()) {
|
|
1216
1216
|
debug$1("Collecting dependencies and scripts from template: %s", t.name);
|
|
@@ -1380,9 +1380,6 @@ var generateProject = async (opts) => {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
}
|
|
1382
1382
|
const pm = opts.packageManager;
|
|
1383
|
-
if (pm !== "npm") {
|
|
1384
|
-
for (const [key, value] of Object.entries(finalPkg.scripts)) if (typeof value === "string") finalPkg.scripts[key] = value.replaceAll("npm run ", `${pm} run `);
|
|
1385
|
-
}
|
|
1386
1383
|
if (pm === "pnpm" && finalPkg.workspaces) {
|
|
1387
1384
|
debug$1("Creating pnpm-workspace.yaml");
|
|
1388
1385
|
const workspaceYaml = `packages:\n${finalPkg.workspaces.map((w) => ` - '${w}'`).join("\n")}\n`;
|
|
@@ -159,10 +159,21 @@ export const linter = defineConfig({
|
|
|
159
159
|
'react/react-in-jsx-scope': 'off',
|
|
160
160
|
'vitest/no-importing-vitest-globals': 'off',
|
|
161
161
|
'vitest/prefer-describe-function-title': 'off',
|
|
162
|
-
'vitest/prefer-to-be-
|
|
162
|
+
'vitest/prefer-to-be-falsy': 'off', // NOTE: Pick strictness: keep prefer-strict-boolean-matchers, disable truthy/falsy rules.
|
|
163
|
+
'vitest/prefer-to-be-truthy': 'off', // NOTE: Pick strictness: keep prefer-strict-boolean-matchers, disable truthy/falsy rules.
|
|
163
164
|
'vitest/require-test-timeout': 'off',
|
|
164
165
|
},
|
|
165
166
|
overrides: [
|
|
167
|
+
{
|
|
168
|
+
// Relax strict type rules for unit tests to allow easier mocking and test scaffolding
|
|
169
|
+
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx'],
|
|
170
|
+
rules: {
|
|
171
|
+
'typescript/no-unsafe-type-assertion': 'off',
|
|
172
|
+
'typescript/no-explicit-any': 'off',
|
|
173
|
+
'typescript/no-unsafe-assignment': 'off',
|
|
174
|
+
'typescript/no-unsafe-member-access': 'off',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
166
177
|
{
|
|
167
178
|
files: ['tests/e2e/**/*.e2e-test.ts', '**/*.e2e-test.ts'],
|
|
168
179
|
rules: {
|
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"typecheck": "tsc --noEmit",
|
|
8
|
+
"lint": "oxlint",
|
|
9
|
+
"format": "oxfmt --write",
|
|
10
|
+
"format:check": "oxfmt --check",
|
|
11
|
+
"ci": "{{packageManager}} run typecheck && {{packageManager}} run lint && {{packageManager}} run format:check && {{packageManager}} run build && {{packageManager}} run test",
|
|
12
|
+
"test": "vitest run --coverage",
|
|
13
|
+
"release": "release-it",
|
|
14
|
+
"create-changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
15
|
+
"prepare": "husky"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"debug": ""
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@commitlint/cli": "",
|
|
22
|
+
"@commitlint/config-conventional": "",
|
|
23
|
+
"@types/debug": "",
|
|
24
|
+
"@types/node": "",
|
|
25
|
+
"@vitest/coverage-v8": "",
|
|
26
|
+
"conventional-changelog": "",
|
|
27
|
+
"husky": "",
|
|
28
|
+
"oxlint": "",
|
|
29
|
+
"oxlint-tsgolint": "",
|
|
30
|
+
"oxfmt": "",
|
|
31
|
+
"release-it": "",
|
|
32
|
+
"eslint-plugin-regexp": "",
|
|
33
|
+
"typescript": "",
|
|
34
|
+
"vitest": ""
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@playwright/test": ""
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "
|
|
31
|
-
"dev": "
|
|
30
|
+
"build": "{{packageManager}} run build --workspaces",
|
|
31
|
+
"dev": "{{packageManager}} run dev --workspaces",
|
|
32
32
|
"integration-test": "playwright test"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/package.json
CHANGED
|
@@ -1,104 +1,105 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
2
|
+
"name": "create-template-project",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "An ultra-modular, type-safe Node.js CLI tool used to scaffold new project templates (CLI, Webpage, Webapp, Fullstack) with best-practice configurations pre-installed.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"boilerplate",
|
|
8
|
+
"cli",
|
|
9
|
+
"dependencies",
|
|
10
|
+
"express",
|
|
11
|
+
"generator",
|
|
12
|
+
"maintenance",
|
|
13
|
+
"monorepo",
|
|
14
|
+
"npm",
|
|
15
|
+
"react",
|
|
16
|
+
"scaffold",
|
|
17
|
+
"scaffolding",
|
|
18
|
+
"security",
|
|
19
|
+
"template",
|
|
20
|
+
"trpc",
|
|
21
|
+
"typescript",
|
|
22
|
+
"vite",
|
|
23
|
+
"vulnerability"
|
|
24
|
+
],
|
|
25
|
+
"homepage": "https://github.com/doberkofler/create-template-project#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/doberkofler/create-template-project/issues"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"author": "Dieter Oberkofler",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/doberkofler/create-template-project.git"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"create-template-project": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"type": "module",
|
|
42
|
+
"main": "./dist/index.js",
|
|
43
|
+
"module": "./dist/index.js",
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"imports": {
|
|
46
|
+
"#shared/*.js": "./src/shared/*.ts",
|
|
47
|
+
"#templates/*.js": "./src/templates/*.ts",
|
|
48
|
+
"#templating/*.js": "./src/utils/templating/*.ts"
|
|
49
|
+
},
|
|
50
|
+
"exports": {
|
|
51
|
+
".": "./dist/index.js",
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"typecheck": "tsc --noEmit",
|
|
56
|
+
"lint": "oxlint --disable-nested-config",
|
|
57
|
+
"format": "oxfmt --write",
|
|
58
|
+
"format:check": "oxfmt --check",
|
|
59
|
+
"ci": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm run build && pnpm run test",
|
|
60
|
+
"build": "vite build && node scripts/copy-templates.ts",
|
|
61
|
+
"dependencies-check": "node scripts/dependencies.ts",
|
|
62
|
+
"dependencies-update": "node scripts/dependencies.ts --update",
|
|
63
|
+
"test": "vitest run --coverage --exclude '**/*.integration.*.test.ts'",
|
|
64
|
+
"run-interactive": "node ./dist/index.js interactive",
|
|
65
|
+
"integration-test:cli": "rimraf --max-retries=3 ./temp/cli && node ./dist/index.js create --package-manager=pnpm --build --debug --no-progress --template=cli --name=cli --author=\"Jon Doe\" --github-username=\"jon-doe\" --path=./temp/cli",
|
|
66
|
+
"integration-test:web-vanilla": "rimraf --max-retries=3 ./temp/web-vanilla && node ./dist/index.js create --package-manager=pnpm --build --debug --no-progress --template=web-vanilla --name=web-vanilla --author=\"Jon Doe\" --github-username=\"jon-doe\" --path=./temp/web-vanilla",
|
|
67
|
+
"integration-test:web-app": "rimraf --max-retries=3 ./temp/web-app && node ./dist/index.js create --package-manager=pnpm --build --debug --no-progress --template=web-app --name=web-app --author=\"Jon Doe\" --github-username=\"jon-doe\" --path=./temp/web-app",
|
|
68
|
+
"integration-test:web-fullstack": "rimraf --max-retries=3 ./temp/web-fullstack && node ./dist/index.js create --package-manager=pnpm --build --debug --no-progress --template=web-fullstack --name=web-fullstack --author=\"Jon Doe\" --github-username=\"jon-doe\" --path=./temp/web-fullstack",
|
|
69
|
+
"integration-test": "pnpm run integration-test:cli && pnpm run integration-test:web-vanilla && pnpm run integration-test:web-app && pnpm run integration-test:web-fullstack",
|
|
70
|
+
"create-changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
71
|
+
"prepare": "husky",
|
|
72
|
+
"release": "release-it"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"@clack/prompts": "1.2.0",
|
|
76
|
+
"commander": "14.0.3",
|
|
77
|
+
"debug": "4.4.3",
|
|
78
|
+
"execa": "9.6.1",
|
|
79
|
+
"zod": "4.3.6"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@commitlint/cli": "20.5.0",
|
|
83
|
+
"@commitlint/config-conventional": "20.5.0",
|
|
84
|
+
"@types/cli-progress": "3.11.6",
|
|
85
|
+
"@types/debug": "4.1.13",
|
|
86
|
+
"@types/node": "25.6.0",
|
|
87
|
+
"@vitest/coverage-v8": "4.1.4",
|
|
88
|
+
"conventional-changelog": "7.2.0",
|
|
89
|
+
"conventional-changelog-angular": "8.3.1",
|
|
90
|
+
"eslint-plugin-regexp": "3.1.0",
|
|
91
|
+
"husky": "9.1.7",
|
|
92
|
+
"oxfmt": "0.45.0",
|
|
93
|
+
"oxlint": "1.60.0",
|
|
94
|
+
"oxlint-tsgolint": "0.21.0",
|
|
95
|
+
"pnpm": "10.33.0",
|
|
96
|
+
"release-it": "20.0.0",
|
|
97
|
+
"rimraf": "6.1.3",
|
|
98
|
+
"typescript": "6.0.2",
|
|
99
|
+
"vite": "8.0.8",
|
|
100
|
+
"vitest": "4.1.4"
|
|
101
|
+
},
|
|
102
|
+
"engines": {
|
|
103
|
+
"node": ">=22"
|
|
104
|
+
}
|
|
104
105
|
}
|