create-template-project 1.2.1 → 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.
@@ -153,7 +153,7 @@
153
153
  "description": "Declarative routing for React web applications."
154
154
  },
155
155
  "release-it": {
156
- "version": "19.2.4",
156
+ "version": "20.0.0",
157
157
  "description": "Interactive release-tool for Git repositories."
158
158
  },
159
159
  "cors": {
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 = (_opts) => ({
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: "npm run build --workspaces",
509
- dev: "npm run dev --workspaces",
510
- test: "npm run test --workspaces",
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-truthy': 'off', // FIXME: Conflict Detected: prefer-strict-boolean-matchers enforces toBe(true), but prefer-to-be-truthy enforces toBeTruthy().
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 +1,5 @@
1
- export default {extends: ['@commitlint/config-conventional']};
1
+ const config = {
2
+ extends: ['@commitlint/config-conventional'],
3
+ };
4
+
5
+ export default config;
@@ -1,35 +1,36 @@
1
1
  {
2
- "name": "{{projectName}}",
3
- "version": "0.1.0",
4
- "private": true,
5
- "type": "module",
6
- "scripts": {
7
- "lint": "tsc && oxlint --disable-nested-config src client server tests *.config.ts && npm run format:check",
8
- "format": "oxfmt --write .",
9
- "format:check": "oxfmt --check .",
10
- "test": "vitest run --coverage",
11
- "release": "release-it",
12
- "ci": "npm run lint && npm run build && npm run test",
13
- "create-changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
14
- "prepare": "husky"
15
- },
16
- "dependencies": {
17
- "debug": ""
18
- },
19
- "devDependencies": {
20
- "@commitlint/cli": "",
21
- "@commitlint/config-conventional": "",
22
- "@types/debug": "",
23
- "@types/node": "",
24
- "@vitest/coverage-v8": "",
25
- "conventional-changelog": "",
26
- "husky": "",
27
- "oxlint": "",
28
- "oxlint-tsgolint": "",
29
- "oxfmt": "",
30
- "release-it": "",
31
- "eslint-plugin-regexp": "",
32
- "typescript": "",
33
- "vitest": ""
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": "npm run build --workspaces",
31
- "dev": "npm run dev --workspaces",
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
- "name": "create-template-project",
3
- "version": "1.2.1",
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
- "exports": {
46
- ".": "./dist/index.js",
47
- "./package.json": "./package.json"
48
- },
49
- "imports": {
50
- "#shared/*.js": "./src/shared/*.ts",
51
- "#templates/*.js": "./src/templates/*.ts",
52
- "#templating/*.js": "./src/utils/templating/*.ts"
53
- },
54
- "scripts": {
55
- "run-interactive": "node ./dist/index.js interactive",
56
- "build": "vite build && node scripts/copy-templates.ts",
57
- "dependencies-check": "node scripts/dependencies.ts",
58
- "dependencies-update": "node scripts/dependencies.ts --update",
59
- "lint": "tsc && oxlint --disable-nested-config src scripts *.config.ts && pnpm run format:check",
60
- "format": "oxfmt --write src scripts *.config.ts",
61
- "format:check": "oxfmt --check src scripts *.config.ts",
62
- "test": "vitest run --coverage --exclude '**/*.integration.*.test.ts'",
63
- "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",
64
- "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",
65
- "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",
66
- "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",
67
- "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",
68
- "ci": "pnpm run lint && pnpm run build && pnpm run test",
69
- "create-changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
70
- "prepare": "husky",
71
- "release": "release-it"
72
- },
73
- "dependencies": {
74
- "@clack/prompts": "1.2.0",
75
- "commander": "14.0.3",
76
- "debug": "4.4.3",
77
- "execa": "9.6.1",
78
- "zod": "4.3.6"
79
- },
80
- "devDependencies": {
81
- "@commitlint/cli": "20.5.0",
82
- "@commitlint/config-conventional": "20.5.0",
83
- "@types/cli-progress": "3.11.6",
84
- "@types/debug": "4.1.13",
85
- "@types/node": "25.6.0",
86
- "@vitest/coverage-v8": "4.1.4",
87
- "conventional-changelog": "7.2.0",
88
- "conventional-changelog-angular": "8.3.1",
89
- "eslint-plugin-regexp": "3.1.0",
90
- "husky": "9.1.7",
91
- "oxfmt": "0.45.0",
92
- "oxlint": "1.60.0",
93
- "oxlint-tsgolint": "0.20.0",
94
- "pnpm": "10.33.0",
95
- "release-it": "19.2.4",
96
- "rimraf": "6.1.3",
97
- "typescript": "6.0.2",
98
- "vite": "8.0.8",
99
- "vitest": "4.1.4"
100
- },
101
- "engines": {
102
- "node": ">=22"
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
  }