Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v1
- uses: pnpm/[email protected]
with:
version: 6
version: 8
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ dist

# TernJS port file
.tern-port

# Finder (MacOS) folder config
.DS_Store
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec lint-staged
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ pnpm-lock.yaml
**/*.spec.js
**/*.spec.ts
**/dist
# https://github.com/prettier/prettier/issues/5246
**/*.html

playground
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Repository: git+https://github.com/marvinhagemeister/kolorist.git

License: MIT
By: James Halliday
Repository: git://github.com/substack/minimist.git
Repository: git://github.com/minimistjs/minimist.git

> This software is released under the MIT license:
>
Expand Down
39 changes: 39 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,54 @@ async function init() {

// Render tsconfigs
render('tsconfig/base')

// The content of the root `tsconfig.json` is a bit complicated,
// So here we are programmatically generating it.
const rootTsConfig = {
// It doesn't target any specific files because they are all configured in the referenced ones.
files: [],
// All templates contain at least a `.node` and a `.app` tsconfig.
references: [
{
path: './tsconfig.node.json'
},
{
path: './tsconfig.app.json'
}
]
}

if (needsCypress) {
render('tsconfig/cypress')
// Cypress uses `ts-node` internally, which doesn't support solution-style tsconfig.
// So we have to set a dummy `compilerOptions` in the root tsconfig to make it work.
// I use `NodeNext` here instead of `ES2015` because that's what the actual environment is.
// (Cypress uses the ts-node/esm loader when `type: module` is specified in package.json.)
// @ts-ignore
rootTsConfig.compilerOptions = {
module: 'NodeNext'
}
}
if (needsCypressCT) {
render('tsconfig/cypress-ct')
// Cypress Component Testing needs a standalone tsconfig.
rootTsConfig.references.push({
path: './tsconfig.cypress-ct.json'
})
}
if (needsVitest) {
render('tsconfig/vitest')
// Vitest needs a standalone tsconfig.
rootTsConfig.references.push({
path: './tsconfig.vitest.json'
})
}

fs.writeFileSync(
path.resolve(root, 'tsconfig.json'),
JSON.stringify(rootTsConfig, null, 2) + '\n',
'utf-8'
)
}

// Render ESLint config
Expand Down
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "create-vue",
"version": "2.2.0",
"description": "An easy way to start a Vue project",
"packageManager": "[email protected]",
"type": "module",
"bin": {
"create-vue": "outfile.cjs"
Expand All @@ -11,10 +12,10 @@
"template"
],
"engines": {
"node": "^14.13.1 || >=16.0.0"
"node": ">=v16.20.0"
},
"scripts": {
"prepare": "husky install",
"prepare": "husky",
"format": "prettier --write .",
"build": "zx ./scripts/build.mjs",
"snapshot": "zx ./scripts/snapshot.mjs",
Expand All @@ -34,19 +35,21 @@
},
"homepage": "https://github.com/vuejs/create-vue#readme",
"devDependencies": {
"@types/eslint": "^8.4.5",
"@types/prompts": "^2.0.14",
"@vue/tsconfig": "^0.1.3",
"esbuild": "^0.14.49",
"@tsconfig/node18": "^18.2.4",
"@types/eslint": "^8.56.9",
"@types/node": "18.19.3",
"@types/prompts": "^2.4.9",
"@vue/tsconfig": "^0.5.1",
"esbuild": "^0.19.10",
"esbuild-plugin-license": "^1.2.2",
"husky": "^8.0.1",
"kolorist": "^1.5.1",
"lint-staged": "^13.0.3",
"minimist": "^1.2.6",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"husky": "^9.0.11",
"kolorist": "^1.8.0",
"lint-staged": "^15.2.2",
"minimist": "^1.2.8",
"npm-run-all2": "^6.1.2",
"prettier": "^3.2.5",
"prompts": "^2.4.2",
"zx": "^4.3.0"
"zx": "^7.2.3"
},
"lint-staged": {
"*.{js,ts,vue,json}": [
Expand Down
2 changes: 1 addition & 1 deletion playground
Loading