Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[feat] Added support for Bun#630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mchao123 wants to merge4 commits intovuejs:main
base:main
Choose a base branch
Loading
frommchao123:main
Open
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
自动判断运行时,更新依赖
  • Loading branch information
@mchao123
mchao123 committedFeb 6, 2025
commit505bbc14cf96f7617cf46bbbff13d715c74a793a
24 changes: 22 additions & 2 deletionsindex.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,6 +63,22 @@ function emptyDir(dir) {
)
}

// get now user runtime
function detectRuntime() {
// @ts-ignore
if (typeof Bun !== 'undefined') {
return 'bun'
}
if (typeof process !== 'undefined' && process.versions && process.versions.node) {
return 'node'
}
// @ts-ignore
if (typeof Deno !== 'undefined') {
return 'deno'
}
return 'unknown'
}

const helpMessage = `\
Usage: create-vue [FEATURE_FLAGS...] [OPTIONS...] [DIRECTORY]

Expand DownExpand Up@@ -105,6 +121,9 @@ Available feature flags:
--eslint-with-prettier
Add Prettier for code formatting in addition to ESLint.

--runtime
Show runtime environment selection prompt.

Unstable feature flags:
--tests, --with-tests
Add both unit testing and end-to-end testing support.
Expand All@@ -123,6 +142,7 @@ async function init() {
tests: { type: 'boolean' },
'vue-router': { type: 'boolean' },
router: { type: 'boolean' },
runtime: { type: 'boolean' },
} as const

const { values: argv, positionals } = parseArgs({
Expand DownExpand Up@@ -209,7 +229,7 @@ async function init() {
[
{
name: 'runtime',
type: () => (isFeatureFlagsUsed ?null :'select'),
type: () => (argv.runtime ? 'select' : null),
message: language.needsRuntime.message,
initial: 0,
choices: [
Expand DownExpand Up@@ -391,7 +411,7 @@ async function init() {
needsPinia = argv.pinia,
needsVitest = argv.vitest || argv.tests,
needsPrettier = argv['eslint-with-prettier'],
runtime ='node',
runtime =detectRuntime(),
} = result

const needsEslint = Boolean(argv.eslint || argv['eslint-with-prettier'] || result.needsEslint)
Expand Down
1 change: 1 addition & 0 deletionstemplate/others-runtime/bun/config/typescript/env.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,8 +6,8 @@
},
"devDependencies": {
"@types/bun": "^1.1.13",
"npm-run-all2": "^7.0.1",
"typescript": "~5.6.3",
"vue-tsc": "^2.1.10"
"npm-run-all2": "^7.0.2",
"typescript": "~5.7.3",
"vue-tsc": "^2.2.0"
}
}

[8]ページ先頭

©2009-2025 Movatter.jp