Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
105 changes: 24 additions & 81 deletions packages/create-vite/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ For more information, please see

# Licenses of bundled dependencies
The published create-vite artifact additionally contains code with the following licenses:
Apache-2.0, ISC, MIT
Apache-2.0, MIT

# Bundled dependencies:
## @clack/core, @clack/prompts
Expand Down Expand Up @@ -375,35 +375,6 @@ Repository: https://github.com/vercel/vercel

---------------------------------------

## cross-spawn
License: MIT
By: André Cruz
Repository: https://github.com/moxystudio/node-cross-spawn

> The MIT License (MIT)
>
> Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.

---------------------------------------

## fast-string-truncated-width, fast-string-width
License: MIT
Repositories: https://github.com/fabiospampinato/fast-string-truncated-width, https://github.com/fabiospampinato/fast-string-width
Expand Down Expand Up @@ -463,29 +434,6 @@ Repository: https://github.com/43081j/fast-wrap-ansi

---------------------------------------

## isexe, which
License: ISC
By: Isaac Z. Schlueter
Repositories: https://github.com/isaacs/isexe, https://github.com/isaacs/node-which

> The ISC License
>
> Copyright (c) Isaac Z. Schlueter and Contributors
>
> Permission to use, copy, modify, and/or distribute this software for any
> purpose with or without fee is hereby granted, provided that the above
> copyright notice and this permission notice appear in all copies.
>
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---------------------------------------

## mri
License: MIT
By: Luke Edwards
Expand Down Expand Up @@ -515,48 +463,43 @@ Repository: https://github.com/lukeed/mri

---------------------------------------

## path-key, shebang-regex
License: MIT
By: Sindre Sorhus
Repositories: https://github.com/sindresorhus/path-key, https://github.com/sindresorhus/shebang-regex

> MIT License
>
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---------------------------------------

## shebang-command
## sisteransi
License: MIT
By: Kevin Mårtensson
Repository: https://github.com/kevva/shebang-command
By: Terkel Gjervig
Repository: https://github.com/terkelg/sisteransi

> MIT License
>
> Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
> Copyright (c) 2018 Terkel Gjervig Nielsen
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

---------------------------------------

## sisteransi
## tinyexec
License: MIT
By: Terkel Gjervig
Repository: https://github.com/terkelg/sisteransi
By: James Garbutt
Repository: https://github.com/tinylibs/tinyexec

> MIT License
>
> Copyright (c) 2018 Terkel Gjervig Nielsen
> Copyright (c) 2024 Tinylibs
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"devDependencies": {
"@clack/prompts": "^1.8.1",
"@vercel/detect-agent": "^1.2.5",
"cross-spawn": "^7.0.6",
"mri": "^1.2.0",
"tinyexec": "^1.3.1",
"tsdown": "^0.23.0",
"unrun": "^0.3.1"
}
Expand Down
22 changes: 12 additions & 10 deletions packages/create-vite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { fileURLToPath } from 'node:url'
import util from 'node:util'
import * as prompts from '@clack/prompts'
import { determineAgent } from '@vercel/detect-agent'
import spawn from 'cross-spawn'
import mri from 'mri'
import { xSync } from 'tinyexec'

const {
blue,
Expand Down Expand Up @@ -399,16 +399,18 @@ const renameFiles: Record<string, string | undefined> = {
const defaultTargetDir = 'vite-project'

function run([command, ...args]: string[], options?: SpawnOptions) {
const { status, error } = spawn.sync(command, args, options)
if (status != null && status > 0) {
process.exit(status)
}

if (error) {
let exitCode: number | undefined
try {
;({ exitCode } = xSync(command, args, { nodeOptions: options }))
} catch (error) {
console.error(`\n${command} ${args.join(' ')} error!`)
console.error(error)
process.exit(1)
}

if (exitCode != null && exitCode > 0) {
process.exit(exitCode)
}
}

function install(root: string, agent: string) {
Expand Down Expand Up @@ -621,10 +623,10 @@ async function init() {
const replacedArgs = args.map((arg) =>
arg.replace('TARGET_DIR', () => targetDir),
)
const { status } = spawn.sync(command, replacedArgs, {
stdio: 'inherit',
const { exitCode } = xSync(command, replacedArgs, {
nodeOptions: { stdio: 'inherit' },
})
process.exit(status ?? 0)
process.exit(exitCode ?? 0)
}

// 5. Ask whether to use ESLint instead of Oxlint (React templates only)
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"outDir": "dist",
"target": "es2023",
"module": "preserve",
"types": [],
"types": ["node"],
"noEmit": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
Expand Down
5 changes: 5 additions & 0 deletions packages/create-vite/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export default defineConfig(() => ({
'\n\n',
),
],
inputOptions: {
resolve: {
mainFields: ['module', 'main'],
},
},
}))

const cc0LicenseText = `
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading