create-template-project 1.2.2 → 1.2.4
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 +16 -16
- package/dist/index.js +1 -1
- package/dist/templates/base/files/_oxc.config.ts +9 -4
- package/dist/templates/cli/files/src/index.test.ts +11 -9
- package/dist/templates/web-app/files/src/App.test.tsx +6 -4
- package/dist/templates/web-fullstack/files/server/src/index.ts +3 -3
- package/dist/templates/web-vanilla/files/src/index.test.ts +9 -7
- package/package.json +103 -104
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"vite": {
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.10",
|
|
5
5
|
"description": "Native-ESM powered web dev build tool"
|
|
6
6
|
},
|
|
7
7
|
"@vitejs/plugin-react": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"description": "The default Vite plugin for React projects."
|
|
10
10
|
},
|
|
11
11
|
"@vitest/browser": {
|
|
12
|
-
"version": "4.1.
|
|
12
|
+
"version": "4.1.5",
|
|
13
13
|
"description": "Run Vitest in the browser."
|
|
14
14
|
},
|
|
15
15
|
"@vitest/browser-playwright": {
|
|
16
|
-
"version": "4.1.
|
|
16
|
+
"version": "4.1.5",
|
|
17
17
|
"description": "Playwright provider for Vitest browser mode."
|
|
18
18
|
},
|
|
19
19
|
"playwright": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"description": "A tiny JavaScript debugging utility modelled after Node.js core debugging technique."
|
|
26
26
|
},
|
|
27
27
|
"@commitlint/cli": {
|
|
28
|
-
"version": "20.5.
|
|
28
|
+
"version": "20.5.3",
|
|
29
29
|
"description": "Lint commit messages to ensure they follow conventional commits."
|
|
30
30
|
},
|
|
31
31
|
"@commitlint/config-conventional": {
|
|
32
|
-
"version": "20.5.
|
|
32
|
+
"version": "20.5.3",
|
|
33
33
|
"description": "Shareable commitlint config enforcing conventional commits."
|
|
34
34
|
},
|
|
35
35
|
"@types/debug": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"description": "TypeScript definitions for Node.js."
|
|
42
42
|
},
|
|
43
43
|
"@vitest/coverage-v8": {
|
|
44
|
-
"version": "4.1.
|
|
44
|
+
"version": "4.1.5",
|
|
45
45
|
"description": "V8 coverage provider for Vitest."
|
|
46
46
|
},
|
|
47
47
|
"conventional-changelog": {
|
|
@@ -53,23 +53,23 @@
|
|
|
53
53
|
"description": "Modern native git hooks made easy."
|
|
54
54
|
},
|
|
55
55
|
"oxlint": {
|
|
56
|
-
"version": "1.
|
|
56
|
+
"version": "1.62.0",
|
|
57
57
|
"description": "A JavaScript linter written in Rust."
|
|
58
58
|
},
|
|
59
59
|
"oxlint-tsgolint": {
|
|
60
|
-
"version": "0.
|
|
60
|
+
"version": "0.22.1",
|
|
61
61
|
"description": "TypeScript-specific rules for oxlint."
|
|
62
62
|
},
|
|
63
63
|
"oxfmt": {
|
|
64
|
-
"version": "0.
|
|
64
|
+
"version": "0.47.0",
|
|
65
65
|
"description": "High performance JavaScript / TypeScript formatter."
|
|
66
66
|
},
|
|
67
67
|
"typescript": {
|
|
68
|
-
"version": "6.0.
|
|
68
|
+
"version": "6.0.3",
|
|
69
69
|
"description": "A superset of JavaScript that compiles to clean JavaScript output."
|
|
70
70
|
},
|
|
71
71
|
"vitest": {
|
|
72
|
-
"version": "4.1.
|
|
72
|
+
"version": "4.1.5",
|
|
73
73
|
"description": "A Vite-native unit test framework."
|
|
74
74
|
},
|
|
75
75
|
"commander": {
|
|
@@ -129,15 +129,15 @@
|
|
|
129
129
|
"description": "End-to-end testing framework."
|
|
130
130
|
},
|
|
131
131
|
"@trpc/server": {
|
|
132
|
-
"version": "11.
|
|
132
|
+
"version": "11.17.0",
|
|
133
133
|
"description": "tRPC server library."
|
|
134
134
|
},
|
|
135
135
|
"@trpc/client": {
|
|
136
|
-
"version": "11.
|
|
136
|
+
"version": "11.17.0",
|
|
137
137
|
"description": "tRPC client library."
|
|
138
138
|
},
|
|
139
139
|
"@trpc/react-query": {
|
|
140
|
-
"version": "11.
|
|
140
|
+
"version": "11.17.0",
|
|
141
141
|
"description": "tRPC integration for React Query."
|
|
142
142
|
},
|
|
143
143
|
"@tanstack/react-query": {
|
|
@@ -149,11 +149,11 @@
|
|
|
149
149
|
"description": "TypeScript-first schema validation with static type inference."
|
|
150
150
|
},
|
|
151
151
|
"react-router-dom": {
|
|
152
|
-
"version": "7.14.
|
|
152
|
+
"version": "7.14.2",
|
|
153
153
|
"description": "Declarative routing for React web applications."
|
|
154
154
|
},
|
|
155
155
|
"release-it": {
|
|
156
|
-
"version": "20.0.
|
|
156
|
+
"version": "20.0.1",
|
|
157
157
|
"description": "Interactive release-tool for Git repositories."
|
|
158
158
|
},
|
|
159
159
|
"cors": {
|
package/dist/index.js
CHANGED
|
@@ -773,7 +773,7 @@ Restrictions & Behavior:
|
|
|
773
773
|
process.exit(0);
|
|
774
774
|
}
|
|
775
775
|
const directory = await p.text({
|
|
776
|
-
message: "Target directory:",
|
|
776
|
+
message: "Target parent directory (project name will be appended):",
|
|
777
777
|
initialValue: "."
|
|
778
778
|
});
|
|
779
779
|
if (p.isCancel(directory)) {
|
|
@@ -84,7 +84,6 @@ export const linter = defineConfig({
|
|
|
84
84
|
'import/no-nodejs-modules': 'off',
|
|
85
85
|
'import/prefer-default-export': 'off',
|
|
86
86
|
'import/no-default-export': 'off',
|
|
87
|
-
// FIXME: remove all jest rules
|
|
88
87
|
'jest/consistent-test-it': 'off',
|
|
89
88
|
'jest/expect-expect': 'off',
|
|
90
89
|
'jest/max-expects': 'off',
|
|
@@ -113,12 +112,13 @@ export const linter = defineConfig({
|
|
|
113
112
|
'jest/no-test-return-statement': 'off',
|
|
114
113
|
'jest/no-unneeded-async-expect-function': 'off',
|
|
115
114
|
'jest/no-untyped-mock-factory': 'off',
|
|
116
|
-
//'jest/padding-around-after-all-blocks': 'off',
|
|
117
115
|
'jest/padding-around-test-blocks': 'off',
|
|
118
116
|
'jest/prefer-called-with': 'off',
|
|
119
117
|
'jest/prefer-comparison-matcher': 'off',
|
|
120
118
|
'jest/prefer-each': 'off',
|
|
119
|
+
'jest/prefer-ending-with-an-expect': 'off',
|
|
121
120
|
'jest/prefer-equality-matcher': 'off',
|
|
121
|
+
'jest/prefer-expect-assertions': 'off',
|
|
122
122
|
'jest/prefer-expect-resolves': 'off',
|
|
123
123
|
'jest/prefer-hooks-in-order': 'off',
|
|
124
124
|
'jest/prefer-hooks-on-top': 'off',
|
|
@@ -126,7 +126,6 @@ export const linter = defineConfig({
|
|
|
126
126
|
'jest/prefer-lowercase-title': 'off',
|
|
127
127
|
'jest/prefer-mock-promise-shorthand': 'off',
|
|
128
128
|
'jest/prefer-mock-return-shorthand': 'off',
|
|
129
|
-
//'jest/prefer-snapshot-hint': 'off',
|
|
130
129
|
'jest/prefer-spy-on': 'off',
|
|
131
130
|
'jest/prefer-strict-equal': 'off',
|
|
132
131
|
'jest/prefer-to-be': 'off',
|
|
@@ -155,10 +154,15 @@ export const linter = defineConfig({
|
|
|
155
154
|
'unicorn/no-process-exit': 'off', // TODO: consider enabling
|
|
156
155
|
'unicorn/no-typeof-undefined': 'off', // TODO: consider enabling
|
|
157
156
|
'unicorn/prefer-module': 'off', // TODO: consider enabling
|
|
158
|
-
'react/jsx-filename-extension': '
|
|
157
|
+
'react/jsx-filename-extension': ['error', {extensions: ['.tsx']}],
|
|
158
|
+
'react/jsx-max-depth': ['error', {max: 5}],
|
|
159
159
|
'react/react-in-jsx-scope': 'off',
|
|
160
|
+
'vitest/max-expects': 'off',
|
|
161
|
+
'vitest/no-conditional-in-test': 'off',
|
|
162
|
+
'vitest/no-hooks': 'off',
|
|
160
163
|
'vitest/no-importing-vitest-globals': 'off',
|
|
161
164
|
'vitest/prefer-describe-function-title': 'off',
|
|
165
|
+
'vitest/prefer-expect-assertions': 'off',
|
|
162
166
|
'vitest/prefer-to-be-falsy': 'off', // NOTE: Pick strictness: keep prefer-strict-boolean-matchers, disable truthy/falsy rules.
|
|
163
167
|
'vitest/prefer-to-be-truthy': 'off', // NOTE: Pick strictness: keep prefer-strict-boolean-matchers, disable truthy/falsy rules.
|
|
164
168
|
'vitest/require-test-timeout': 'off',
|
|
@@ -172,6 +176,7 @@ export const linter = defineConfig({
|
|
|
172
176
|
'typescript/no-explicit-any': 'off',
|
|
173
177
|
'typescript/no-unsafe-assignment': 'off',
|
|
174
178
|
'typescript/no-unsafe-member-access': 'off',
|
|
179
|
+
'no-useless-undefined': 'off',
|
|
175
180
|
},
|
|
176
181
|
},
|
|
177
182
|
{
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {expect,
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
2
|
import {greet, calculateProgress} from './lib.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
describe('lib', () => {
|
|
5
|
+
it('greet returns correct message', () => {
|
|
6
|
+
expect(greet('Vitest')).toBe('Hello, Vitest! Welcome to your new CLI.');
|
|
7
|
+
});
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
it('calculateProgress works correctly', () => {
|
|
10
|
+
expect(calculateProgress(50, 100)).toBe(50);
|
|
11
|
+
expect(calculateProgress(1, 3)).toBe(33);
|
|
12
|
+
expect(calculateProgress(0, 100)).toBe(0);
|
|
13
|
+
expect(calculateProgress(50, 0)).toBe(0);
|
|
14
|
+
});
|
|
13
15
|
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {expect,
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
2
|
import {render} from 'vitest-browser-react';
|
|
3
3
|
import {page} from 'vitest/browser';
|
|
4
4
|
import {App} from './App.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
describe('App', () => {
|
|
7
|
+
it('renders hello message in the browser', async () => {
|
|
8
|
+
await render(<App />);
|
|
9
|
+
await expect.element(page.getByText(/Hello from React!/i)).toBeVisible();
|
|
10
|
+
});
|
|
9
11
|
});
|
|
@@ -5,7 +5,7 @@ import {appRouter} from './routers/_app.js';
|
|
|
5
5
|
import {createContext} from './context.js';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const rootDir = import.meta.dirname;
|
|
9
9
|
const app = express();
|
|
10
10
|
const port = Number(process.env['PORT'] ?? 3001);
|
|
11
11
|
|
|
@@ -20,10 +20,10 @@ app.use(
|
|
|
20
20
|
}),
|
|
21
21
|
);
|
|
22
22
|
|
|
23
|
-
app.use(express.static(path.join(
|
|
23
|
+
app.use(express.static(path.join(rootDir, '../../client/dist')));
|
|
24
24
|
|
|
25
25
|
app.get('*', (_req, res) => {
|
|
26
|
-
res.sendFile(path.join(
|
|
26
|
+
res.sendFile(path.join(rootDir, '../../client/dist/index.html'));
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
app.listen(port, () => {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {expect,
|
|
1
|
+
import {describe, expect, it} from 'vitest';
|
|
2
2
|
import {page} from 'vitest/browser';
|
|
3
3
|
import {formatMessage, createHeading} from './lib.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
describe('lib', () => {
|
|
6
|
+
it('formatMessage returns correct string', () => {
|
|
7
|
+
expect(formatMessage('World')).toBe('Hello, World!');
|
|
8
|
+
});
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
it('createHeading renders in the browser', async () => {
|
|
11
|
+
document.body.append(createHeading('Browser Test'));
|
|
12
|
+
await expect.element(page.getByRole('heading', {name: 'Browser Test'})).toBeVisible();
|
|
13
|
+
});
|
|
12
14
|
});
|
package/package.json
CHANGED
|
@@ -1,105 +1,104 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|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
|
|
2
|
+
"name": "create-template-project",
|
|
3
|
+
"version": "1.2.4",
|
|
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
|
+
"dependencies": {
|
|
55
|
+
"@clack/prompts": "1.3.0",
|
|
56
|
+
"commander": "14.0.3",
|
|
57
|
+
"debug": "4.4.3",
|
|
58
|
+
"execa": "9.6.1",
|
|
59
|
+
"zod": "4.4.1"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@commitlint/cli": "20.5.3",
|
|
63
|
+
"@commitlint/config-conventional": "20.5.3",
|
|
64
|
+
"@types/cli-progress": "3.11.6",
|
|
65
|
+
"@types/debug": "4.1.13",
|
|
66
|
+
"@types/node": "25.6.0",
|
|
67
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
68
|
+
"conventional-changelog": "7.2.0",
|
|
69
|
+
"conventional-changelog-angular": "8.3.1",
|
|
70
|
+
"eslint-plugin-regexp": "3.1.0",
|
|
71
|
+
"husky": "9.1.7",
|
|
72
|
+
"oxfmt": "0.47.0",
|
|
73
|
+
"oxlint": "1.62.0",
|
|
74
|
+
"oxlint-tsgolint": "0.22.1",
|
|
75
|
+
"pnpm": "10.33.2",
|
|
76
|
+
"release-it": "20.0.1",
|
|
77
|
+
"rimraf": "6.1.3",
|
|
78
|
+
"typescript": "6.0.3",
|
|
79
|
+
"vite": "8.0.10",
|
|
80
|
+
"vitest": "4.1.5"
|
|
81
|
+
},
|
|
82
|
+
"engines": {
|
|
83
|
+
"node": ">=22"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"typecheck": "tsc --noEmit",
|
|
87
|
+
"lint": "oxlint --disable-nested-config",
|
|
88
|
+
"format": "oxfmt --write",
|
|
89
|
+
"format:check": "oxfmt --check",
|
|
90
|
+
"ci": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm run build && pnpm run test",
|
|
91
|
+
"build": "vite build && node scripts/copy-templates.ts",
|
|
92
|
+
"dependencies-check": "node scripts/dependencies.ts",
|
|
93
|
+
"dependencies-update": "node scripts/dependencies.ts --update",
|
|
94
|
+
"test": "vitest run --coverage --exclude '**/*.integration.*.test.ts'",
|
|
95
|
+
"run-interactive": "node ./dist/index.js interactive",
|
|
96
|
+
"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",
|
|
97
|
+
"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",
|
|
98
|
+
"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",
|
|
99
|
+
"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",
|
|
100
|
+
"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",
|
|
101
|
+
"create-changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
102
|
+
"release": "release-it"
|
|
103
|
+
}
|
|
104
|
+
}
|