Skip to content

Commit c825ac2

Browse files
committed
chore: migrate to vitest
1 parent c08f6e0 commit c825ac2

File tree

14 files changed

+684
-1694
lines changed

14 files changed

+684
-1694
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged && npx pretty-quick --staged
4+
npx pretty-quick --staged

jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"clean": "shx rm -rf lib 'templates/*/{yarn.lock,package-lock.json,node_modules}'",
99
"dev": "npm run tsup -- --watch",
1010
"prepublishOnly": "npm run clean && npm run build",
11+
"readme": "doctoc -p README.md",
1112
"release": "release-it",
12-
"test": "npm run tsup && jest",
13+
"test": "npm run tsup && vitest --run",
1314
"toc": "doctoc README.md",
1415
"tsup": "tsup src/index.ts src/cli.ts -d lib"
1516
},
@@ -40,27 +41,18 @@
4041
"devDependencies": {
4142
"@release-it/conventional-changelog": "^5.0.0",
4243
"@types/cross-spawn": "^6.0.2",
43-
"@types/jest": "^28.1.0",
4444
"@types/node": "^17.0.39",
4545
"@types/uuid": "^8.3.4",
4646
"@uetchy/doctoc": "^1.5.0",
4747
"husky": "^8.0.1",
48-
"jest": "^28.1.0",
49-
"lint-staged": "^13.0.0",
5048
"prettier": "^2.6.2",
5149
"pretty-quick": "^3.1.3",
5250
"release-it": "^15.0.0",
5351
"shx": "^0.3.4",
54-
"ts-jest": "^28.0.4",
5552
"ts-node": "^10.8.1",
5653
"tsup": "^6.0.1",
57-
"typescript": "^4.7.3"
58-
},
59-
"lint-staged": {
60-
"*.md": [
61-
"doctoc -p",
62-
"git add"
63-
]
54+
"typescript": "^4.7.3",
55+
"vitest": "^0.16.0"
6456
},
6557
"homepage": "https://github.com/uetchy/create-create-app",
6658
"repository": {
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
package-lock.json
2+
yarn.lock
3+
4+
# Created by https://www.gitignore.io/api/node
5+
# Edit at https://www.gitignore.io/?templates=node
6+
7+
### Node ###
8+
# Logs
9+
logs
10+
*.log
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
lerna-debug.log*
15+
16+
# Diagnostic reports (https://nodejs.org/api/report.html)
17+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
18+
19+
# Runtime data
20+
pids
21+
*.pid
22+
*.seed
23+
*.pid.lock
24+
25+
# Directory for instrumented libs generated by jscoverage/JSCover
26+
lib-cov
27+
28+
# Coverage directory used by tools like istanbul
29+
coverage
30+
*.lcov
31+
32+
# nyc test coverage
33+
.nyc_output
34+
35+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
36+
.grunt
37+
38+
# Bower dependency directory (https://bower.io/)
39+
bower_components
40+
41+
# node-waf configuration
42+
.lock-wscript
43+
44+
# Compiled binary addons (https://nodejs.org/api/addons.html)
45+
build/Release
46+
47+
# Dependency directories
48+
node_modules/
49+
jspm_packages/
50+
51+
# TypeScript v1 declaration files
52+
typings/
53+
54+
# TypeScript cache
55+
*.tsbuildinfo
56+
57+
# Optional npm cache directory
58+
.npm
59+
60+
# Optional eslint cache
61+
.eslintcache
62+
63+
# Optional REPL history
64+
.node_repl_history
65+
66+
# Output of 'npm pack'
67+
*.tgz
68+
69+
# Yarn Integrity file
70+
.yarn-integrity
71+
72+
# dotenv environment variables file
73+
.env
74+
.env.test
75+
76+
# parcel-bundler cache (https://parceljs.org/)
77+
.cache
78+
79+
# next.js build output
80+
.next
81+
82+
# nuxt.js build output
83+
.nuxt
84+
85+
# react / gatsby
86+
public/
87+
88+
# vuepress build output
89+
.vuepress/dist
90+
91+
# Serverless directories
92+
.serverless/
93+
94+
# FuseBox cache
95+
.fusebox/
96+
97+
# DynamoDB Local files
98+
.dynamodb/
99+
100+
# End of https://www.gitignore.io/api/node

tests/fixtures/create-test/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2022 Yasuaki Uechi <y@uechi.io>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19+
OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Create Test
2+
3+
description
4+
5+
> created by [create-create-app](https://github.com/uetchy/create-create-app).
6+
7+
## Usage
8+
9+
```bash
10+
npx create-test <name>
11+
```
12+
13+
## Template string reference
14+
15+
> Don't forget to remove this before publishing your package!
16+
17+
- {{name}} => create-test
18+
- {{upper name}} => CREATE-TEST
19+
- {{lower name}} => create-test
20+
- {{capital name}} => CreateTest
21+
- {{capital name space=true}} => Create Test
22+
- {{camel name}} => createTest
23+
- {{snake name}} => create_test
24+
- {{kebab name}} => create-test
25+
- {{space name}} => create test
26+
- {{uuid}} => 40406304-c66a-4ddc-ba5e-6abce618c366
27+
- {{upper (uuid)}} => 9D8C3716-0991-4367-979B-95502F721DD3
28+
- {{description}} => description
29+
- {{author}} => Yasuaki Uechi
30+
- {{email}} => y@uechi.io
31+
- {{contact}} => Yasuaki Uechi <y@uechi.io>
32+
- {{license}} => MIT
33+
- {{year}} => 2022
34+
- {{custom}} => (undefined until it is defined in `extra` field in `create` function arguments)
35+
36+
See https://github.com/uetchy/create-create-app#template for the further details.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "create-test",
3+
"description": "description",
4+
"version": "0.0.0",
5+
"author": "Yasuaki Uechi <y@uechi.io>",
6+
"bin": "src/cli.js",
7+
"files": [
8+
"src",
9+
"templates"
10+
],
11+
"dependencies": {
12+
"create-create-app": "link:../../.."
13+
},
14+
"license": "MIT"
15+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
const { resolve } = require('path');
4+
const { create } = require('create-create-app');
5+
6+
const templateRoot = resolve(__dirname, '..', 'templates');
7+
8+
const caveat = `
9+
This is a caveat!
10+
You can change this in \`src/cli.js\`.
11+
`;
12+
13+
// See https://github.com/uetchy/create-create-app/blob/master/README.md for other options.
14+
15+
create('create-test', {
16+
templateRoot,
17+
extra: {
18+
architecture: {
19+
type: 'list',
20+
describe: 'choose your fave os',
21+
choices: ['macOS', 'Windows', 'Linux'],
22+
prompt: 'if-no-arg',
23+
},
24+
},
25+
after: ({ answers }) => console.log(`Ok you chose ${answers.architecture}.`),
26+
caveat,
27+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# {{capital name space=true}}
2+
3+
{{description}}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
package-lock.json
2+
yarn.lock
3+
4+
# Created by https://www.gitignore.io/api/node
5+
6+
# Edit at https://www.gitignore.io/?templates=node
7+
8+
### Node
9+
10+
# Logs
11+
12+
logs
13+
_.log
14+
npm-debug.log_
15+
yarn-debug.log*
16+
yarn-error.log*
17+
lerna-debug.log\*
18+
19+
# Diagnostic reports (https://nodejs.org/api/report.html)
20+
21+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
22+
23+
# Runtime data
24+
25+
pids
26+
_.pid
27+
_.seed
28+
\*.pid.lock
29+
30+
# Directory for instrumented libs generated by jscoverage/JSCover
31+
32+
lib-cov
33+
34+
# Coverage directory used by tools like istanbul
35+
36+
coverage
37+
\*.lcov
38+
39+
# nyc test coverage
40+
41+
.nyc_output
42+
43+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
44+
45+
.grunt
46+
47+
# Bower dependency directory (https://bower.io/)
48+
49+
bower_components
50+
51+
# node-waf configuration
52+
53+
.lock-wscript
54+
55+
# Compiled binary addons (https://nodejs.org/api/addons.html)
56+
57+
build/Release
58+
59+
# Dependency directories
60+
61+
node_modules/
62+
jspm_packages/
63+
64+
# TypeScript v1 declaration files
65+
66+
typings/
67+
68+
# TypeScript cache
69+
70+
\*.tsbuildinfo
71+
72+
# Optional npm cache directory
73+
74+
.npm
75+
76+
# Optional eslint cache
77+
78+
.eslintcache
79+
80+
# Optional REPL history
81+
82+
.node_repl_history
83+
84+
# Output of 'npm pack'
85+
86+
\*.tgz
87+
88+
# Yarn Integrity file
89+
90+
.yarn-integrity
91+
92+
# dotenv environment variables file
93+
94+
.env
95+
.env.test
96+
97+
# parcel-bundler cache (https://parceljs.org/)
98+
99+
.cache
100+
101+
# next.js build output
102+
103+
.next
104+
105+
# nuxt.js build output
106+
107+
.nuxt
108+
109+
# react / gatsby
110+
111+
public/
112+
113+
# vuepress build output
114+
115+
.vuepress/dist
116+
117+
# Serverless directories
118+
119+
.serverless/
120+
121+
# FuseBox cache
122+
123+
.fusebox/
124+
125+
# DynamoDB Local files
126+
127+
.dynamodb/
128+
129+
# End of https://www.gitignore.io/api/node

0 commit comments

Comments
 (0)