From 0709a51162bcf4e871361a4814df33b82838548c Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Sat, 3 Aug 2024 00:09:09 +0900 Subject: [PATCH 01/23] feat: create with vue-i18n --- index.ts | 28 ++++++++++++++++--- locales/en-US.json | 3 ++ locales/fr-FR.json | 3 ++ locales/tr-TR.json | 3 ++ locales/zh-Hans.json | 3 ++ locales/zh-Hant.json | 3 ++ template/config/vue-i18n/package.json | 6 ++++ template/config/vue-i18n/src/i18n/en.json | 0 template/config/vue-i18n/src/i18n/index.js | 15 ++++++++++ template/entry/i18n/src/main.js | 7 +++++ template/entry/pinia-and-i18n/src/main.js | 9 ++++++ template/entry/router-and-i18n/src/main.js | 9 ++++++ .../entry/router-pinia-and-i18n/src/main.js | 11 ++++++++ utils/getLanguage.ts | 1 + 14 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 template/config/vue-i18n/package.json create mode 100644 template/config/vue-i18n/src/i18n/en.json create mode 100644 template/config/vue-i18n/src/i18n/index.js create mode 100644 template/entry/i18n/src/main.js create mode 100644 template/entry/pinia-and-i18n/src/main.js create mode 100644 template/entry/router-and-i18n/src/main.js create mode 100644 template/entry/router-pinia-and-i18n/src/main.js diff --git a/index.ts b/index.ts index f552cfd8..cb68455d 100755 --- a/index.ts +++ b/index.ts @@ -97,7 +97,9 @@ async function init() { 'vue-router': { type: 'boolean' }, router: { type: 'boolean' }, 'vue-devtools': { type: 'boolean' }, - devtools: { type: 'boolean' } + devtools: { type: 'boolean' }, + 'vue-i18n': { type: 'boolean' }, + i18n: { type: 'boolean' } } as const const { values: argv, positionals } = parseArgs({ @@ -121,7 +123,9 @@ async function init() { argv.playwright ?? argv.eslint ?? argv['eslint-with-prettier'] ?? - (argv.devtools || argv['vue-devtools']) + (argv.devtools || argv['vue-devtools']) ?? + argv['vue-i18n'] ?? + argv.i18n ) === 'boolean' let targetDir = positionals[0] @@ -144,6 +148,7 @@ async function init() { needsEslint?: boolean needsPrettier?: boolean needsDevTools?: boolean + needsVueI18n?: boolean } = {} try { @@ -300,6 +305,14 @@ async function init() { initial: false, active: language.defaultToggleOptions.active, inactive: language.defaultToggleOptions.inactive + }, + { + name: 'needsVueI18n', + type: () => (isFeatureFlagsUsed ? null : 'toggle'), + message: language.needsVueI18n.message, + initial: false, + active: language.defaultToggleOptions.active, + inactive: language.defaultToggleOptions.inactive } ], { @@ -326,7 +339,8 @@ async function init() { needsVitest = argv.vitest || argv.tests, needsEslint = argv.eslint || argv['eslint-with-prettier'], needsPrettier = argv['eslint-with-prettier'], - needsDevTools = argv.devtools || argv['vue-devtools'] + needsDevTools = argv.devtools || argv['vue-devtools'], + needsVueI18n = argv['vue-i18n'] || argv.i18n } = result const { needsE2eTesting } = result @@ -474,6 +488,10 @@ async function init() { if (needsDevTools) { render('config/devtools') } + + if (needsVueI18n) { + render('config/vue-i18n') + } // Render code template. // prettier-ignore const codeTemplate = @@ -488,6 +506,8 @@ async function init() { render('entry/pinia') } else if (needsRouter) { render('entry/router') + } else if (needsVueI18n) { + render('entry/i18n') } else { render('entry/default') } @@ -520,7 +540,7 @@ async function init() { // We try to share as many files between TypeScript and JavaScript as possible. // If that's not possible, we put `.ts` version alongside the `.js` one in the templates. // So after all the templates are rendered, we need to clean up the redundant files. - // (Currently it's only `cypress/plugin/index.ts`, but we might add more in the future.) + // (Currently it's only `cypress/plugin/index.js`, but we might add more in the future.) // (Or, we might completely get rid of the plugins folder as Cypress 10 supports `cypress.config.ts`) if (needsTypeScript) { diff --git a/locales/en-US.json b/locales/en-US.json index 8dc45e43..ed0a783f 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -53,6 +53,9 @@ "needsDevTools": { "message": "Add Vue DevTools 7 extension for debugging? (experimental)" }, + "needsVueI18n": { + "message": "Add Vue I18n for internationalization?" + }, "errors": { "operationCancelled": "Operation cancelled" }, diff --git a/locales/fr-FR.json b/locales/fr-FR.json index 6815e766..1f8a36e3 100644 --- a/locales/fr-FR.json +++ b/locales/fr-FR.json @@ -53,6 +53,9 @@ "needsDevTools": { "message": "Ajouter l'extension Vue DevTools 7 pour le débogage\u00a0? (expérimental)" }, + "needsVueI18n": { + "message": "Ajouter Vue I18n pour l'internationalisation\u00a0?" + }, "errors": { "operationCancelled": "Operation annulée" }, diff --git a/locales/tr-TR.json b/locales/tr-TR.json index 26ea693f..8b212bf1 100644 --- a/locales/tr-TR.json +++ b/locales/tr-TR.json @@ -53,6 +53,9 @@ "needsDevTools": { "message": "Hata ayıklama için Vue DevTools 7 eklentisi eklensin mi? (deneysel)" }, + "needsVueI18n": { + "message": "Uluslararasılaştırma için Vue I18n eklensin mi?" + }, "errors": { "operationCancelled": "İşlem iptal edildi" }, diff --git a/locales/zh-Hans.json b/locales/zh-Hans.json index 1e9a0fc0..c91b9bb6 100644 --- a/locales/zh-Hans.json +++ b/locales/zh-Hans.json @@ -53,6 +53,9 @@ "needsDevTools": { "message": "是否引入 Vue DevTools 7 扩展用于调试? (试验阶段)" }, + "needsVueI18n": { + "message": "是否引入 Vue I18n 用于国际化?" + }, "errors": { "operationCancelled": "操作取消" }, diff --git a/locales/zh-Hant.json b/locales/zh-Hant.json index cab9ca21..75417816 100644 --- a/locales/zh-Hant.json +++ b/locales/zh-Hant.json @@ -57,6 +57,9 @@ "needsDevTools": { "message": "是否引入 Vue DevTools 7 擴充元件以協助偵錯?(試驗性功能)" }, + "needsVueI18n": { + "message": "是否引入 Vue I18n 用於國際化?" + }, "errors": { "operationCancelled": "操作取消" }, diff --git a/template/config/vue-i18n/package.json b/template/config/vue-i18n/package.json new file mode 100644 index 00000000..c3ad3d65 --- /dev/null +++ b/template/config/vue-i18n/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "vue": "^3.4.34", + "vue-i18n": "^9.2.2" + } +} diff --git a/template/config/vue-i18n/src/i18n/en.json b/template/config/vue-i18n/src/i18n/en.json new file mode 100644 index 00000000..e69de29b diff --git a/template/config/vue-i18n/src/i18n/index.js b/template/config/vue-i18n/src/i18n/index.js new file mode 100644 index 00000000..d58ac5ef --- /dev/null +++ b/template/config/vue-i18n/src/i18n/index.js @@ -0,0 +1,15 @@ +import { createI18n } from 'vue-i18n' + +const messages = { + en: { + // English Transtlations + } +} + +export default createI18n({ + legacy: false, + globalInjection: true, + locale: 'en', + fallbackLocale: 'en', + messages +}) diff --git a/template/entry/i18n/src/main.js b/template/entry/i18n/src/main.js new file mode 100644 index 00000000..1d8316ce --- /dev/null +++ b/template/entry/i18n/src/main.js @@ -0,0 +1,7 @@ +import { createApp } from 'vue' +import App from './App.vue' +import i18n from './main.js' + +const app = createApp(App) +app.use(i18n) +app.mount('#app') diff --git a/template/entry/pinia-and-i18n/src/main.js b/template/entry/pinia-and-i18n/src/main.js new file mode 100644 index 00000000..1d26532a --- /dev/null +++ b/template/entry/pinia-and-i18n/src/main.js @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import App from './App.vue' +import i18n from './i18n' + +const app = createApp(App) +app.use(createPinia()) +app.use(i18n) +app.mount('#app') diff --git a/template/entry/router-and-i18n/src/main.js b/template/entry/router-and-i18n/src/main.js new file mode 100644 index 00000000..a62c7d73 --- /dev/null +++ b/template/entry/router-and-i18n/src/main.js @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import App from './App.vue' +import router from './router' +import i18n from './i18n' + +const app = createApp(App) +app.use(router) +app.use(i18n) +app.mount('#app') diff --git a/template/entry/router-pinia-and-i18n/src/main.js b/template/entry/router-pinia-and-i18n/src/main.js new file mode 100644 index 00000000..d10f08e3 --- /dev/null +++ b/template/entry/router-pinia-and-i18n/src/main.js @@ -0,0 +1,11 @@ +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import App from './App.vue' +import router from './router' +import i18n from './i18n' + +const app = createApp(App) +app.use(createPinia()) +app.use(router) +app.use(i18n) +app.mount('#app') diff --git a/utils/getLanguage.ts b/utils/getLanguage.ts index b3bc8233..5aab2c23 100644 --- a/utils/getLanguage.ts +++ b/utils/getLanguage.ts @@ -31,6 +31,7 @@ interface Language { needsEslint: LanguageItem needsPrettier: LanguageItem needsDevTools: LanguageItem + needsVueI18n: LanguageItem errors: { operationCancelled: string } From 807f730013884f8af73fcf7d76e2c921419b6939 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Sat, 3 Aug 2024 00:12:40 +0900 Subject: [PATCH 02/23] chore(test): add tests --- __test__/sortDependencies.spec.ts | 6 ++++-- package.json | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/__test__/sortDependencies.spec.ts b/__test__/sortDependencies.spec.ts index 29becf4f..9c65287a 100644 --- a/__test__/sortDependencies.spec.ts +++ b/__test__/sortDependencies.spec.ts @@ -20,7 +20,8 @@ describe('sortDependencies', () => { '@vitejs/plugin-vue': '^4.4.0', 'eslint-plugin-cypress': '^2.15.1', 'eslint-plugin-vue': '^9.17.0', - vitest: '^0.34.6' + vitest: '^0.34.6', + 'vue-i18n': '^9.13.1' } } expect(sortDependencies(packageJson)).toStrictEqual({ @@ -40,7 +41,8 @@ describe('sortDependencies', () => { jsdom: '^22.1.0', 'start-server-and-test': '^2.0.1', vite: '^4.4.11', - vitest: '^0.34.6' + vitest: '^0.34.6', + 'vue-i18n': '^9.13.1' } }) }) diff --git a/package.json b/package.json index 7aa43e7a..d48596df 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ "prettier": "^3.3.3", "prompts": "^2.4.2", "vitest": "^2.0.4", - "zx": "^8.1.4" + "zx": "^8.1.4", + "vue-i18n": "^9.13.1" }, "lint-staged": { "*.{js,ts,vue,json}": [ From 4da6366abbeab55786ae2d338c5a4a164f1ebe00 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Sat, 3 Aug 2024 00:15:59 +0900 Subject: [PATCH 03/23] Update pnpm-lock.yaml --- pnpm-lock.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce2a0015..3d1a754f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -200,6 +200,15 @@ importers: specifier: ^2.0.4 version: 2.0.4(@types/node@20.14.13)(jsdom@24.1.1) + template/config/vue-i18n: + dependencies: + vue: + specifier: ^3.4.34 + version: 3.4.34(typescript@5.5.3) + vue-i18n: + specifier: ^9.2.2 + version: 9.13.1(vue@3.4.34(typescript@5.5.3)) + template/tsconfig/base: devDependencies: '@tsconfig/node20': @@ -788,6 +797,18 @@ packages: '@hapi/topo@5.1.0': resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@intlify/core-base@9.13.1': + resolution: {integrity: sha512-+bcQRkJO9pcX8d0gel9ZNfrzU22sZFSA0WVhfXrf5jdJOS24a+Bp8pozuS9sBI9Hk/tGz83pgKfmqcn/Ci7/8w==} + engines: {node: '>= 16'} + + '@intlify/message-compiler@9.13.1': + resolution: {integrity: sha512-SKsVa4ajYGBVm7sHMXd5qX70O2XXjm55zdZB3VeMFCvQyvLew/dLvq3MqnaIsTMF1VkkOb9Ttr6tHcMlyPDL9w==} + engines: {node: '>= 16'} + + '@intlify/shared@9.13.1': + resolution: {integrity: sha512-u3b6BKGhE6j/JeRU6C/RL2FgyJfy6LakbtfeVF8fJXURpZZTzfh3e05J0bu0XPw447Q6/WUp3C4ajv4TMS4YsQ==} + engines: {node: '>= 16'} + '@jridgewell/gen-mapping@0.3.3': resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} @@ -3627,6 +3648,12 @@ packages: '@vue/composition-api': optional: true + vue-i18n@9.13.1: + resolution: {integrity: sha512-mh0GIxx0wPtPlcB1q4k277y0iKgo25xmDPWioVVYanjPufDBpvu5ySTjP5wOrSvlYQ2m1xI+CFhGdauv/61uQg==} + engines: {node: '>= 16'} + peerDependencies: + vue: ^3.0.0 + vue-router@4.4.0: resolution: {integrity: sha512-HB+t2p611aIZraV2aPSRNXf0Z/oLZFrlygJm+sZbdJaW6lcFqEDQwnzUBXn+DApw+/QzDU/I9TeWx9izEjTmsA==} peerDependencies: @@ -4342,6 +4369,18 @@ snapshots: dependencies: '@hapi/hoek': 9.3.0 + '@intlify/core-base@9.13.1': + dependencies: + '@intlify/message-compiler': 9.13.1 + '@intlify/shared': 9.13.1 + + '@intlify/message-compiler@9.13.1': + dependencies: + '@intlify/shared': 9.13.1 + source-map-js: 1.2.0 + + '@intlify/shared@9.13.1': {} + '@jridgewell/gen-mapping@0.3.3': dependencies: '@jridgewell/set-array': 1.1.2 @@ -7401,6 +7440,13 @@ snapshots: dependencies: vue: 3.4.34(typescript@5.5.3) + vue-i18n@9.13.1(vue@3.4.34(typescript@5.5.3)): + dependencies: + '@intlify/core-base': 9.13.1 + '@intlify/shared': 9.13.1 + '@vue/devtools-api': 6.6.3 + vue: 3.4.34(typescript@5.5.3) + vue-router@4.4.0(vue@3.4.34(typescript@5.5.3)): dependencies: '@vue/devtools-api': 6.5.1 From 007c98b80ee4f351e85a5b24df42682c05ca61ec Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Sat, 3 Aug 2024 00:18:13 +0900 Subject: [PATCH 04/23] fix(ci): add generated files --- .idea/.gitignore | 8 +++ .idea/codeStyles/Project.xml | 61 ++++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 ++ .idea/create-vue.iml | 12 ++++ .idea/inspectionProfiles/Project_Default.xml | 6 ++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 7 +++ pnpm-lock.yaml | 3 + scripts/build.mjs | 2 +- 9 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/create-vue.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000..725b6741 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 00000000..79ee123c --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/create-vue.iml b/.idea/create-vue.iml new file mode 100644 index 00000000..24643cc3 --- /dev/null +++ b/.idea/create-vue.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..03d9549e --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..a5de8534 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..b81b4fde --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d1a754f..e6720fee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,9 @@ importers: vitest: specifier: ^2.0.4 version: 2.0.4(@types/node@20.14.13)(jsdom@24.1.1) + vue-i18n: + specifier: ^9.13.1 + version: 9.13.1(vue@3.4.34(typescript@5.5.3)) zx: specifier: ^8.1.4 version: 8.1.4 diff --git a/scripts/build.mjs b/scripts/build.mjs index f1d780be..74cf01cd 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -26,7 +26,7 @@ SOFTWARE. await esbuild.build({ bundle: true, - entryPoints: ['index.ts'], + entryPoints: ['index.js'], external: ['locales/*'], outfile: 'outfile.cjs', format: 'cjs', From a8764b50f212f5ec34e354f104b989c76b394c3a Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Sat, 3 Aug 2024 00:20:37 +0900 Subject: [PATCH 05/23] fix(ci): set entrypoints ts --- scripts/build.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.mjs b/scripts/build.mjs index 74cf01cd..f1d780be 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -26,7 +26,7 @@ SOFTWARE. await esbuild.build({ bundle: true, - entryPoints: ['index.js'], + entryPoints: ['index.ts'], external: ['locales/*'], outfile: 'outfile.cjs', format: 'cjs', From cd6b00f38beee868684a98d160f7f79ee8214d4d Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Mon, 5 Aug 2024 20:07:50 +0900 Subject: [PATCH 06/23] Revert "fix(ci): add generated files" This reverts commit 007c98b80ee4f351e85a5b24df42682c05ca61ec. --- .idea/.gitignore | 8 --- .idea/codeStyles/Project.xml | 61 -------------------- .idea/codeStyles/codeStyleConfig.xml | 5 -- .idea/create-vue.iml | 12 ---- .idea/inspectionProfiles/Project_Default.xml | 6 -- .idea/modules.xml | 8 --- .idea/vcs.xml | 7 --- pnpm-lock.yaml | 3 - 8 files changed, 110 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/create-vue.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 725b6741..00000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123c..00000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/create-vue.iml b/.idea/create-vue.iml deleted file mode 100644 index 24643cc3..00000000 --- a/.idea/create-vue.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 03d9549e..00000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index a5de8534..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index b81b4fde..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6720fee..3d1a754f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,9 +56,6 @@ importers: vitest: specifier: ^2.0.4 version: 2.0.4(@types/node@20.14.13)(jsdom@24.1.1) - vue-i18n: - specifier: ^9.13.1 - version: 9.13.1(vue@3.4.34(typescript@5.5.3)) zx: specifier: ^8.1.4 version: 8.1.4 From 3c8210b67eb8957e6c2aff958809319ab2fc9149 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Mon, 5 Aug 2024 20:43:05 +0900 Subject: [PATCH 07/23] fix: change index.js like vue-i18n document --- template/config/vue-i18n/src/i18n/en.json | 5 +++++ template/config/vue-i18n/src/i18n/index.js | 16 +++++----------- template/tsconfig/vue-i18n/i18n.d.ts | 11 +++++++++++ template/tsconfig/vue-i18n/tsconfig.i18n.json | 9 +++++++++ 4 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 template/tsconfig/vue-i18n/i18n.d.ts create mode 100644 template/tsconfig/vue-i18n/tsconfig.i18n.json diff --git a/template/config/vue-i18n/src/i18n/en.json b/template/config/vue-i18n/src/i18n/en.json index e69de29b..5d72ea76 100644 --- a/template/config/vue-i18n/src/i18n/en.json +++ b/template/config/vue-i18n/src/i18n/en.json @@ -0,0 +1,5 @@ +{ + "messages": { + "hello": "Hello, {name}!" + } +} diff --git a/template/config/vue-i18n/src/i18n/index.js b/template/config/vue-i18n/src/i18n/index.js index d58ac5ef..a095f005 100644 --- a/template/config/vue-i18n/src/i18n/index.js +++ b/template/config/vue-i18n/src/i18n/index.js @@ -1,15 +1,9 @@ import { createI18n } from 'vue-i18n' +import enUS from './en.json' -const messages = { - en: { - // English Transtlations +const i18n = createI18n({ + locale: 'en-US', + messages: { + 'en-US': enUS } -} - -export default createI18n({ - legacy: false, - globalInjection: true, - locale: 'en', - fallbackLocale: 'en', - messages }) diff --git a/template/tsconfig/vue-i18n/i18n.d.ts b/template/tsconfig/vue-i18n/i18n.d.ts new file mode 100644 index 00000000..d1287f54 --- /dev/null +++ b/template/tsconfig/vue-i18n/i18n.d.ts @@ -0,0 +1,11 @@ +/** + * you need to import the some interfaces + */ +import { DefineLocaleMessage } from 'vue-i18n' + +declare module 'vue-i18n' { + // define the locale messages schema + export interface DefineLocaleMessage { + hello: string + } +} diff --git a/template/tsconfig/vue-i18n/tsconfig.i18n.json b/template/tsconfig/vue-i18n/tsconfig.i18n.json new file mode 100644 index 00000000..63e3499e --- /dev/null +++ b/template/tsconfig/vue-i18n/tsconfig.i18n.json @@ -0,0 +1,9 @@ +{ + "extends": "../base/tsconfig.app.json", + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vue-i18n.tsbuildinfo", + "types": ["i18n"] + }, + "include": ["src/template/config/vue-i18n/**/*", "src/template/config/vue-i18n/**/*.json"] +} From f4b7e2fea42d3f45182b73f31a6dfcd76a683395 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Mon, 5 Aug 2024 20:48:11 +0900 Subject: [PATCH 08/23] chore: pnpm-lock.yaml --- pnpm-lock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d1a754f..e6720fee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,9 @@ importers: vitest: specifier: ^2.0.4 version: 2.0.4(@types/node@20.14.13)(jsdom@24.1.1) + vue-i18n: + specifier: ^9.13.1 + version: 9.13.1(vue@3.4.34(typescript@5.5.3)) zx: specifier: ^8.1.4 version: 8.1.4 From aebef03fe836f97b41d885bf6407f492a0232528 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Mon, 5 Aug 2024 20:55:27 +0900 Subject: [PATCH 09/23] Update pnpm-lock.yaml --- pnpm-lock.yaml | 266 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 253 insertions(+), 13 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5190bbdf..abb42f8b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,11 +54,11 @@ importers: specifier: ^2.4.2 version: 2.4.2 vitest: - specifier: ^2.0.5 - version: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1) + specifier: ^2.0.4 + version: 2.0.4(@types/node@20.14.14)(jsdom@24.1.1) vue-i18n: specifier: ^9.13.1 - version: 9.13.1(vue@3.4.34(typescript@5.5.3)) + version: 9.13.1(vue@3.4.35(typescript@5.5.3)) zx: specifier: ^8.1.4 version: 8.1.4 @@ -1072,21 +1072,39 @@ packages: vite: ^5.0.0 vue: ^3.2.25 + '@vitest/expect@2.0.4': + resolution: {integrity: sha512-39jr5EguIoanChvBqe34I8m1hJFI4+jxvdOpD7gslZrVQBKhh8H9eD7J/LJX4zakrw23W+dITQTDqdt43xVcJw==} + '@vitest/expect@2.0.5': resolution: {integrity: sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==} + '@vitest/pretty-format@2.0.4': + resolution: {integrity: sha512-RYZl31STbNGqf4l2eQM1nvKPXE0NhC6Eq0suTTePc4mtMQ1Fn8qZmjV4emZdEdG2NOWGKSCrHZjmTqDCDoeFBw==} + '@vitest/pretty-format@2.0.5': resolution: {integrity: sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==} + '@vitest/runner@2.0.4': + resolution: {integrity: sha512-Gk+9Su/2H2zNfNdeJR124gZckd5st4YoSuhF1Rebi37qTXKnqYyFCd9KP4vl2cQHbtuVKjfEKrNJxHHCW8thbQ==} + '@vitest/runner@2.0.5': resolution: {integrity: sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==} + '@vitest/snapshot@2.0.4': + resolution: {integrity: sha512-or6Mzoz/pD7xTvuJMFYEtso1vJo1S5u6zBTinfl+7smGUhqybn6VjzCDMhmTyVOFWwkCMuNjmNNxnyXPgKDoPw==} + '@vitest/snapshot@2.0.5': resolution: {integrity: sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==} + '@vitest/spy@2.0.4': + resolution: {integrity: sha512-uTXU56TNoYrTohb+6CseP8IqNwlNdtPwEO0AWl+5j7NelS6x0xZZtP0bDWaLvOfUbaYwhhWp1guzXUxkC7mW7Q==} + '@vitest/spy@2.0.5': resolution: {integrity: sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==} + '@vitest/utils@2.0.4': + resolution: {integrity: sha512-Zc75QuuoJhOBnlo99ZVUkJIuq4Oj0zAkrQ2VzCqNCx6wAwViHEh5Fnp4fiJTE9rA+sAoXRf00Z9xGgfEzV6fzQ==} + '@vitest/utils@2.0.5': resolution: {integrity: sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==} @@ -1115,24 +1133,36 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@vue/compiler-core@3.4.33': + resolution: {integrity: sha512-MoIREbkdPQlnGfSKDMgzTqzqx5nmEjIc0ydLVYlTACGBsfvOJ4tHSbZXKVF536n6fB+0eZaGEOqsGThPpdvF5A==} + '@vue/compiler-core@3.4.34': resolution: {integrity: sha512-Z0izUf32+wAnQewjHu+pQf1yw00EGOmevl1kE+ljjjMe7oEfpQ+BI3/JNK7yMB4IrUsqLDmPecUrpj3mCP+yJQ==} '@vue/compiler-core@3.4.35': resolution: {integrity: sha512-gKp0zGoLnMYtw4uS/SJRRO7rsVggLjvot3mcctlMXunYNsX+aRJDqqw/lV5/gHK91nvaAAlWFgdVl020AW1Prg==} + '@vue/compiler-dom@3.4.33': + resolution: {integrity: sha512-GzB8fxEHKw0gGet5BKlpfXEqoBnzSVWwMnT+dc25wE7pFEfrU/QsvjZMP9rD4iVXHBBoemTct8mN0GJEI6ZX5A==} + '@vue/compiler-dom@3.4.34': resolution: {integrity: sha512-3PUOTS1h5cskdOJMExCu2TInXuM0j60DRPpSCJDqOCupCfUZCJoyQmKtRmA8EgDNZ5kcEE7vketamRZfrEuVDw==} '@vue/compiler-dom@3.4.35': resolution: {integrity: sha512-pWIZRL76/oE/VMhdv/ovZfmuooEni6JPG1BFe7oLk5DZRo/ImydXijoZl/4kh2406boRQ7lxTYzbZEEXEhj9NQ==} + '@vue/compiler-sfc@3.4.33': + resolution: {integrity: sha512-7rk7Vbkn21xMwIUpHQR4hCVejwE6nvhBOiDgoBcR03qvGqRKA7dCBSsHZhwhYUsmjlbJ7OtD5UFIyhP6BY+c8A==} + '@vue/compiler-sfc@3.4.34': resolution: {integrity: sha512-x6lm0UrM03jjDXTPZgD9Ad8bIVD1ifWNit2EaWQIZB5CULr46+FbLQ5RpK7AXtDHGjx9rmvC7QRCTjsiGkAwRw==} '@vue/compiler-sfc@3.4.35': resolution: {integrity: sha512-xacnRS/h/FCsjsMfxBkzjoNxyxEyKyZfBch/P4vkLRvYJwe5ChXmZZrj8Dsed/752H2Q3JE8kYu9Uyha9J6PgA==} + '@vue/compiler-ssr@3.4.33': + resolution: {integrity: sha512-0WveC9Ai+eT/1b6LCV5IfsufBZ0HP7pSSTdDjcuW302tTEgoBw8rHVHKPbGUtzGReUFCRXbv6zQDDgucnV2WzQ==} + '@vue/compiler-ssr@3.4.34': resolution: {integrity: sha512-8TDBcLaTrFm5rnF+Qm4BlliaopJgqJ28Nsrc80qazynm5aJO+Emu7y0RWw34L8dNnTRdcVBpWzJxhGYzsoVu4g==} @@ -1169,20 +1199,37 @@ packages: typescript: optional: true + '@vue/reactivity@3.4.34': + resolution: {integrity: sha512-ua+Lo+wBRlBEX9TtgPOShE2JwIO7p6BTZ7t1KZVPoaBRfqbC7N3c8Mpzicx173fXxx5VXeU6ykiHo7WgLzJQDA==} + '@vue/reactivity@3.4.35': resolution: {integrity: sha512-Ggtz7ZZHakriKioveJtPlStYardwQH6VCs9V13/4qjHSQb/teE30LVJNrbBVs4+aoYGtTQKJbTe4CWGxVZrvEw==} + '@vue/runtime-core@3.4.34': + resolution: {integrity: sha512-PXhkiRPwcPGJ1BnyBZFI96GfInCVskd0HPNIAZn7i3YOmLbtbTZpB7/kDTwC1W7IqdGPkTVC63IS7J2nZs4Ebg==} + '@vue/runtime-core@3.4.35': resolution: {integrity: sha512-D+BAjFoWwT5wtITpSxwqfWZiBClhBbR+bm0VQlWYFOadUUXFo+5wbe9ErXhLvwguPiLZdEF13QAWi2vP3ZD5tA==} + '@vue/runtime-dom@3.4.34': + resolution: {integrity: sha512-dXqIe+RqFAK2Euak4UsvbIupalrhc67OuQKpD7HJ3W2fv8jlqvI7szfBCsAEcE8o/wyNpkloxB6J8viuF/E3gw==} + '@vue/runtime-dom@3.4.35': resolution: {integrity: sha512-yGOlbos+MVhlS5NWBF2HDNgblG8e2MY3+GigHEyR/dREAluvI5tuUUgie3/9XeqhPE4LF0i2wjlduh5thnfOqw==} + '@vue/server-renderer@3.4.34': + resolution: {integrity: sha512-GeyEUfMVRZMD/mZcNONEqg7MiU10QQ1DB3O/Qr6+8uXpbwdlmVgQ5Qs1/ZUAFX1X2UUtqMoGrDRbxdWfOJFT7Q==} + peerDependencies: + vue: 3.4.34 + '@vue/server-renderer@3.4.35': resolution: {integrity: sha512-iZ0e/u9mRE4T8tNhlo0tbA+gzVkgv8r5BX6s1kRbOZqfpq14qoIvCZ5gIgraOmYkMYrSEZgkkojFPr+Nyq/Mnw==} peerDependencies: vue: 3.4.35 + '@vue/shared@3.4.33': + resolution: {integrity: sha512-aoRY0jQk3A/cuvdkodTrM4NMfxco8n55eG4H7ML/CRy7OryHfiqvug4xrCBBMbbN+dvXAetDDwZW9DXWWjBntA==} + '@vue/shared@3.4.34': resolution: {integrity: sha512-x5LmiRLpRsd9KTjAB8MPKf0CDPMcuItjP0gbNqFCIgL1I8iYp4zglhj9w9FPCdIbHG2M91RVeIbArFfFTz9I3A==} @@ -3527,6 +3574,11 @@ packages: peerDependencies: vite: ^2.6.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-0 + vite-node@2.0.4: + resolution: {integrity: sha512-ZpJVkxcakYtig5iakNeL7N3trufe3M6vGuzYAr4GsbCTwobDeyPJpE4cjDhhPluv8OvQCFzu2LWp6GkoKRITXA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + vite-node@2.0.5: resolution: {integrity: sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==} engines: {node: ^18.0.0 || >=20.0.0} @@ -3612,6 +3664,31 @@ packages: terser: optional: true + vitest@2.0.4: + resolution: {integrity: sha512-luNLDpfsnxw5QSW4bISPe6tkxVvv5wn2BBs/PuDRkhXZ319doZyLOBr1sjfB5yCEpTiU7xCAdViM8TNVGPwoog==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 2.0.4 + '@vitest/ui': 2.0.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vitest@2.0.5: resolution: {integrity: sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -3656,12 +3733,13 @@ packages: peerDependenciesMeta: '@vue/composition-api': optional: true - + vue-i18n@9.13.1: resolution: {integrity: sha512-mh0GIxx0wPtPlcB1q4k277y0iKgo25xmDPWioVVYanjPufDBpvu5ySTjP5wOrSvlYQ2m1xI+CFhGdauv/61uQg==} engines: {node: '>= 16'} peerDependencies: vue: ^3.0.0 + vue-router@4.4.2: resolution: {integrity: sha512-1qNybkn2L7QsLzaXs8nvlQmRKp8XF8DCxZys/Jr1JpQcHsKUxTKzTxCVA1G7NfBfwRIBgCJPoujOG5lHCCNUxw==} peerDependencies: @@ -3673,6 +3751,14 @@ packages: peerDependencies: typescript: '>=5.0.0' + vue@3.4.34: + resolution: {integrity: sha512-VZze05HWlA3ItreQ/ka7Sx7PoD0/3St8FEiSlSTVgb6l4hL+RjtP2/8g5WQBzZgyf8WG2f+g1bXzC7zggLhAJA==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + vue@3.4.35: resolution: {integrity: sha512-+fl/GLmI4GPileHftVlCdB7fUL4aziPcqTudpTGXCT8s+iZWuOCeNEB5haX6Uz2IpRrbEXOgIFbe+XciCuGbNQ==} peerDependencies: @@ -3891,7 +3977,7 @@ snapshots: '@babel/traverse': 7.23.3 '@babel/types': 7.23.3 convert-source-map: 2.0.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.5 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -4160,7 +4246,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.24.7 '@babel/types': 7.24.6 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -4175,7 +4261,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.24.6 '@babel/parser': 7.24.7 '@babel/types': 7.24.6 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -4665,6 +4751,13 @@ snapshots: vite: 5.3.5(@types/node@20.14.14) vue: 3.4.35(typescript@5.5.3) + '@vitest/expect@2.0.4': + dependencies: + '@vitest/spy': 2.0.4 + '@vitest/utils': 2.0.4 + chai: 5.1.1 + tinyrainbow: 1.2.0 + '@vitest/expect@2.0.5': dependencies: '@vitest/spy': 2.0.5 @@ -4672,25 +4765,51 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 + '@vitest/pretty-format@2.0.4': + dependencies: + tinyrainbow: 1.2.0 + '@vitest/pretty-format@2.0.5': dependencies: tinyrainbow: 1.2.0 + '@vitest/runner@2.0.4': + dependencies: + '@vitest/utils': 2.0.4 + pathe: 1.1.2 + '@vitest/runner@2.0.5': dependencies: '@vitest/utils': 2.0.5 pathe: 1.1.2 + '@vitest/snapshot@2.0.4': + dependencies: + '@vitest/pretty-format': 2.0.4 + magic-string: 0.30.10 + pathe: 1.1.2 + '@vitest/snapshot@2.0.5': dependencies: '@vitest/pretty-format': 2.0.5 magic-string: 0.30.10 pathe: 1.1.2 + '@vitest/spy@2.0.4': + dependencies: + tinyspy: 3.0.0 + '@vitest/spy@2.0.5': dependencies: tinyspy: 3.0.0 + '@vitest/utils@2.0.4': + dependencies: + '@vitest/pretty-format': 2.0.4 + estree-walker: 3.0.3 + loupe: 3.1.1 + tinyrainbow: 1.2.0 + '@vitest/utils@2.0.5': dependencies: '@vitest/pretty-format': 2.0.5 @@ -4737,7 +4856,15 @@ snapshots: '@babel/helper-module-imports': 7.22.15 '@babel/helper-plugin-utils': 7.24.0 '@babel/parser': 7.24.7 - '@vue/compiler-sfc': 3.4.34 + '@vue/compiler-sfc': 3.4.33 + + '@vue/compiler-core@3.4.33': + dependencies: + '@babel/parser': 7.24.7 + '@vue/shared': 3.4.33 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.2.0 '@vue/compiler-core@3.4.34': dependencies: @@ -4755,6 +4882,11 @@ snapshots: estree-walker: 2.0.2 source-map-js: 1.2.0 + '@vue/compiler-dom@3.4.33': + dependencies: + '@vue/compiler-core': 3.4.33 + '@vue/shared': 3.4.33 + '@vue/compiler-dom@3.4.34': dependencies: '@vue/compiler-core': 3.4.34 @@ -4765,6 +4897,18 @@ snapshots: '@vue/compiler-core': 3.4.35 '@vue/shared': 3.4.35 + '@vue/compiler-sfc@3.4.33': + dependencies: + '@babel/parser': 7.24.7 + '@vue/compiler-core': 3.4.33 + '@vue/compiler-dom': 3.4.33 + '@vue/compiler-ssr': 3.4.33 + '@vue/shared': 3.4.33 + estree-walker: 2.0.2 + magic-string: 0.30.10 + postcss: 8.4.39 + source-map-js: 1.2.0 + '@vue/compiler-sfc@3.4.34': dependencies: '@babel/parser': 7.24.7 @@ -4789,6 +4933,11 @@ snapshots: postcss: 8.4.40 source-map-js: 1.2.0 + '@vue/compiler-ssr@3.4.33': + dependencies: + '@vue/compiler-dom': 3.4.33 + '@vue/shared': 3.4.33 + '@vue/compiler-ssr@3.4.34': dependencies: '@vue/compiler-dom': 3.4.34 @@ -4841,9 +4990,9 @@ snapshots: '@vue/language-core@2.0.29(typescript@5.5.3)': dependencies: '@volar/language-core': 2.4.0-alpha.18 - '@vue/compiler-dom': 3.4.34 + '@vue/compiler-dom': 3.4.33 '@vue/compiler-vue2': 2.7.16 - '@vue/shared': 3.4.34 + '@vue/shared': 3.4.33 computeds: 0.0.1 minimatch: 9.0.3 muggle-string: 0.4.1 @@ -4851,15 +5000,31 @@ snapshots: optionalDependencies: typescript: 5.5.3 + '@vue/reactivity@3.4.34': + dependencies: + '@vue/shared': 3.4.34 + '@vue/reactivity@3.4.35': dependencies: '@vue/shared': 3.4.35 + '@vue/runtime-core@3.4.34': + dependencies: + '@vue/reactivity': 3.4.34 + '@vue/shared': 3.4.34 + '@vue/runtime-core@3.4.35': dependencies: '@vue/reactivity': 3.4.35 '@vue/shared': 3.4.35 + '@vue/runtime-dom@3.4.34': + dependencies: + '@vue/reactivity': 3.4.34 + '@vue/runtime-core': 3.4.34 + '@vue/shared': 3.4.34 + csstype: 3.1.3 + '@vue/runtime-dom@3.4.35': dependencies: '@vue/reactivity': 3.4.35 @@ -4867,12 +5032,20 @@ snapshots: '@vue/shared': 3.4.35 csstype: 3.1.3 + '@vue/server-renderer@3.4.34(vue@3.4.34(typescript@5.5.3))': + dependencies: + '@vue/compiler-ssr': 3.4.34 + '@vue/shared': 3.4.34 + vue: 3.4.34(typescript@5.5.3) + '@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.5.3))': dependencies: '@vue/compiler-ssr': 3.4.35 '@vue/shared': 3.4.35 vue: 3.4.35(typescript@5.5.3) + '@vue/shared@3.4.33': {} + '@vue/shared@3.4.34': {} '@vue/shared@3.4.35': {} @@ -4909,7 +5082,7 @@ snapshots: agent-base@7.1.0: dependencies: - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -6026,7 +6199,7 @@ snapshots: https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.0 - debug: 4.3.6(supports-color@8.1.1) + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -7315,6 +7488,23 @@ snapshots: dependencies: vite: 5.3.5(@types/node@20.14.14) + vite-node@2.0.4(@types/node@20.14.14): + dependencies: + cac: 6.7.14 + debug: 4.3.5 + pathe: 1.1.2 + tinyrainbow: 1.2.0 + vite: 5.3.5(@types/node@20.14.14) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + vite-node@2.0.5(@types/node@20.14.14): dependencies: cac: 6.7.14 @@ -7388,7 +7578,7 @@ snapshots: '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.6) '@babel/plugin-transform-typescript': 7.24.6(@babel/core@7.24.6) '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.6) - '@vue/compiler-dom': 3.4.34 + '@vue/compiler-dom': 3.4.33 kolorist: 1.8.0 magic-string: 0.30.10 vite: 5.3.5(@types/node@20.14.14) @@ -7413,6 +7603,39 @@ snapshots: '@types/node': 20.14.14 fsevents: 2.3.3 + vitest@2.0.4(@types/node@20.14.14)(jsdom@24.1.1): + dependencies: + '@ampproject/remapping': 2.3.0 + '@vitest/expect': 2.0.4 + '@vitest/pretty-format': 2.0.4 + '@vitest/runner': 2.0.4 + '@vitest/snapshot': 2.0.4 + '@vitest/spy': 2.0.4 + '@vitest/utils': 2.0.4 + chai: 5.1.1 + debug: 4.3.5 + execa: 8.0.1 + magic-string: 0.30.10 + pathe: 1.1.2 + std-env: 3.7.0 + tinybench: 2.8.0 + tinypool: 1.0.0 + tinyrainbow: 1.2.0 + vite: 5.3.5(@types/node@20.14.14) + vite-node: 2.0.4(@types/node@20.14.14) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.14.14 + jsdom: 24.1.1 + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1): dependencies: '@ampproject/remapping': 2.3.0 @@ -7463,6 +7686,13 @@ snapshots: '@vue/devtools-api': 6.6.3 vue: 3.4.34(typescript@5.5.3) + vue-i18n@9.13.1(vue@3.4.35(typescript@5.5.3)): + dependencies: + '@intlify/core-base': 9.13.1 + '@intlify/shared': 9.13.1 + '@vue/devtools-api': 6.6.3 + vue: 3.4.35(typescript@5.5.3) + vue-router@4.4.2(vue@3.4.35(typescript@5.5.3)): dependencies: '@vue/devtools-api': 6.6.3 @@ -7475,6 +7705,16 @@ snapshots: semver: 7.5.4 typescript: 5.5.3 + vue@3.4.34(typescript@5.5.3): + dependencies: + '@vue/compiler-dom': 3.4.34 + '@vue/compiler-sfc': 3.4.34 + '@vue/runtime-dom': 3.4.34 + '@vue/server-renderer': 3.4.34(vue@3.4.34(typescript@5.5.3)) + '@vue/shared': 3.4.34 + optionalDependencies: + typescript: 5.5.3 + vue@3.4.35(typescript@5.5.3): dependencies: '@vue/compiler-dom': 3.4.35 From b2c996a09dd5d07fc6a22c1259e279a60562d2df Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Mon, 12 Aug 2024 12:43:47 +0900 Subject: [PATCH 10/23] feat: add flags to snapshot --- scripts/snapshot.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/snapshot.mjs b/scripts/snapshot.mjs index ea4c4ad1..47082fcf 100644 --- a/scripts/snapshot.mjs +++ b/scripts/snapshot.mjs @@ -15,7 +15,8 @@ const featureFlags = [ 'vitest', 'cypress', 'playwright', - 'nightwatch' + 'nightwatch', + 'vue-i18n' ] const featureFlagsDenylist = [ ['cypress', 'playwright'], @@ -55,12 +56,14 @@ function fullCombination(arr) { let flagCombinations = fullCombination(featureFlags) flagCombinations.push(['default'], ['devtools', 'router', 'pinia'], ['eslint'], ['eslint-with-prettier']) +// vue-i18n flag combinations +flagCombinations.push(['vue-i18n'], ['vue-i18n', 'typescript'], ['vue-i18n', 'router', 'pinia']) // `--with-tests` are equivalent of `--vitest --cypress` // Previously it means `--cypress` without `--vitest`. // Here we generate the snapshots only for the sake of easier comparison with older templates. // They may be removed in later releases. -const withTestsFlags = fullCombination(['typescript', 'jsx', 'router', 'pinia']).map((args) => [ +const withTestsFlags = fullCombination(['typescript', 'jsx', 'router', 'pinia', 'vue-i18n']).map((args) => [ ...args, 'with-tests' ]) From a44a4e8468d53889ca192cab6b3d4ce8411747bd Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Mon, 12 Aug 2024 15:15:55 +0900 Subject: [PATCH 11/23] fix: remove template/tsconfig/vue-i18n --- scripts/snapshot.mjs | 3 +-- template/tsconfig/vue-i18n/i18n.d.ts | 11 ----------- template/tsconfig/vue-i18n/tsconfig.i18n.json | 9 --------- 3 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 template/tsconfig/vue-i18n/i18n.d.ts delete mode 100644 template/tsconfig/vue-i18n/tsconfig.i18n.json diff --git a/scripts/snapshot.mjs b/scripts/snapshot.mjs index 47082fcf..2de9884c 100644 --- a/scripts/snapshot.mjs +++ b/scripts/snapshot.mjs @@ -15,8 +15,7 @@ const featureFlags = [ 'vitest', 'cypress', 'playwright', - 'nightwatch', - 'vue-i18n' + 'nightwatch' ] const featureFlagsDenylist = [ ['cypress', 'playwright'], diff --git a/template/tsconfig/vue-i18n/i18n.d.ts b/template/tsconfig/vue-i18n/i18n.d.ts deleted file mode 100644 index d1287f54..00000000 --- a/template/tsconfig/vue-i18n/i18n.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * you need to import the some interfaces - */ -import { DefineLocaleMessage } from 'vue-i18n' - -declare module 'vue-i18n' { - // define the locale messages schema - export interface DefineLocaleMessage { - hello: string - } -} diff --git a/template/tsconfig/vue-i18n/tsconfig.i18n.json b/template/tsconfig/vue-i18n/tsconfig.i18n.json deleted file mode 100644 index 63e3499e..00000000 --- a/template/tsconfig/vue-i18n/tsconfig.i18n.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../base/tsconfig.app.json", - "compilerOptions": { - "composite": true, - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vue-i18n.tsbuildinfo", - "types": ["i18n"] - }, - "include": ["src/template/config/vue-i18n/**/*", "src/template/config/vue-i18n/**/*.json"] -} From 8f7ccfffb72040b65b981fbf8b9c53774d6dcd17 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Mon, 12 Aug 2024 15:23:33 +0900 Subject: [PATCH 12/23] chore: fix package.json --- package.json | 6 +- pnpm-lock.yaml | 266 +++++++++++++------------------------------------ 2 files changed, 72 insertions(+), 200 deletions(-) diff --git a/package.json b/package.json index b6185fca..8bdf1b9b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "3.10.4", "description": "An easy way to start a Vue project", "type": "module", - "packageManager": "pnpm@9.6.0", + "packageManager": "pnpm@9.7.0", "bin": { "create-vue": "outfile.cjs" }, @@ -39,7 +39,7 @@ "devDependencies": { "@tsconfig/node20": "^20.1.4", "@types/eslint": "^9.6.0", - "@types/node": "^20.14.14", + "@types/node": "^20.14.15", "@types/prompts": "^2.4.9", "@vue/create-eslint-config": "^0.3.3", "@vue/tsconfig": "^0.5.1", @@ -51,7 +51,7 @@ "lint-staged": "^15.2.8", "prettier": "^3.3.3", "prompts": "^2.4.2", - "vitest": "^2.0.4", + "vitest": "^2.0.5", "zx": "^8.1.4", "vue-i18n": "^9.13.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99698cb6..17f75005 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^9.6.0 version: 9.6.0 '@types/node': - specifier: ^20.14.14 - version: 20.14.14 + specifier: ^20.14.15 + version: 20.14.15 '@types/prompts': specifier: ^2.4.9 version: 2.4.9 @@ -51,8 +51,8 @@ importers: specifier: ^2.4.2 version: 2.4.2 vitest: - specifier: ^2.0.4 - version: 2.0.4(@types/node@20.14.14)(jsdom@24.1.1) + specifier: ^2.0.5 + version: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1) vue-i18n: specifier: ^9.13.1 version: 9.13.1(vue@3.4.35(typescript@5.5.3)) @@ -68,10 +68,10 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: ^5.1.2 - version: 5.1.2(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3)) + version: 5.1.2(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3)) vite: specifier: ^5.3.5 - version: 5.3.5(@types/node@20.14.14) + version: 5.3.5(@types/node@20.14.15) template/config/cypress: devDependencies: @@ -96,7 +96,7 @@ importers: devDependencies: vite-plugin-vue-devtools: specifier: ^7.3.7 - version: 7.3.7(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3)) + version: 7.3.7(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3)) template/config/jsx: dependencies: @@ -106,19 +106,19 @@ importers: devDependencies: '@vitejs/plugin-vue-jsx': specifier: ^4.0.0 - version: 4.0.0(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3)) + version: 4.0.0(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3)) vite: specifier: ^5.3.5 - version: 5.3.5(@types/node@20.14.14) + version: 5.3.5(@types/node@20.14.15) template/config/nightwatch: devDependencies: '@nightwatch/vue': specifier: ^3.1.1 - version: 3.1.1(@types/node@20.14.14)(@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.5.3)))(vue@3.4.35(typescript@5.5.3)) + version: 3.1.1(@types/node@20.14.15)(@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.5.3)))(vue@3.4.35(typescript@5.5.3)) '@vitejs/plugin-vue': specifier: ^5.1.2 - version: 5.1.2(vite@4.5.2(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3)) + version: 5.1.2(vite@4.5.2(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3)) chromedriver: specifier: ^127.0.1 version: 127.0.1 @@ -130,7 +130,7 @@ importers: version: 3.7.0(chromedriver@127.0.1)(geckodriver@4.4.2) ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.14.14)(typescript@5.5.3) + version: 10.9.2(@types/node@20.14.15)(typescript@5.5.3) vite-plugin-nightwatch: specifier: ^0.4.6 version: 0.4.6(@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.5.3)))(vue@3.4.35(typescript@5.5.3)) @@ -198,7 +198,7 @@ importers: version: 24.1.1 vitest: specifier: ^2.0.5 - version: 2.0.5(@types/node@20.14.14)(jsdom@24.1.1) + version: 2.0.5(@types/node@20.14.15)(jsdom@24.1.1) template/config/vue-i18n: dependencies: @@ -1027,6 +1027,9 @@ packages: '@types/node@20.14.14': resolution: {integrity: sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==} + '@types/node@20.14.15': + resolution: {integrity: sha512-Fz1xDMCF/B00/tYSVMlmK7hVeLh7jE5f3B7X1/hmV0MJBwE27KlS7EvD/Yp+z1lm8mVhwV5w+n8jOZG8AfTlKw==} + '@types/prompts@2.4.9': resolution: {integrity: sha512-qTxFi6Buiu8+50/+3DGIWLHM6QuWsEKugJnnP6iv2Mc4ncxE4A/OJkjuVOA+5X0X1S/nq5VJRa8Lu+nwcvbrKA==} @@ -1069,39 +1072,21 @@ packages: vite: ^5.0.0 vue: ^3.2.25 - '@vitest/expect@2.0.4': - resolution: {integrity: sha512-39jr5EguIoanChvBqe34I8m1hJFI4+jxvdOpD7gslZrVQBKhh8H9eD7J/LJX4zakrw23W+dITQTDqdt43xVcJw==} - '@vitest/expect@2.0.5': resolution: {integrity: sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==} - '@vitest/pretty-format@2.0.4': - resolution: {integrity: sha512-RYZl31STbNGqf4l2eQM1nvKPXE0NhC6Eq0suTTePc4mtMQ1Fn8qZmjV4emZdEdG2NOWGKSCrHZjmTqDCDoeFBw==} - '@vitest/pretty-format@2.0.5': resolution: {integrity: sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==} - '@vitest/runner@2.0.4': - resolution: {integrity: sha512-Gk+9Su/2H2zNfNdeJR124gZckd5st4YoSuhF1Rebi37qTXKnqYyFCd9KP4vl2cQHbtuVKjfEKrNJxHHCW8thbQ==} - '@vitest/runner@2.0.5': resolution: {integrity: sha512-TfRfZa6Bkk9ky4tW0z20WKXFEwwvWhRY+84CnSEtq4+3ZvDlJyY32oNTJtM7AW9ihW90tX/1Q78cb6FjoAs+ig==} - '@vitest/snapshot@2.0.4': - resolution: {integrity: sha512-or6Mzoz/pD7xTvuJMFYEtso1vJo1S5u6zBTinfl+7smGUhqybn6VjzCDMhmTyVOFWwkCMuNjmNNxnyXPgKDoPw==} - '@vitest/snapshot@2.0.5': resolution: {integrity: sha512-SgCPUeDFLaM0mIUHfaArq8fD2WbaXG/zVXjRupthYfYGzc8ztbFbu6dUNOblBG7XLMR1kEhS/DNnfCZ2IhdDew==} - '@vitest/spy@2.0.4': - resolution: {integrity: sha512-uTXU56TNoYrTohb+6CseP8IqNwlNdtPwEO0AWl+5j7NelS6x0xZZtP0bDWaLvOfUbaYwhhWp1guzXUxkC7mW7Q==} - '@vitest/spy@2.0.5': resolution: {integrity: sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==} - '@vitest/utils@2.0.4': - resolution: {integrity: sha512-Zc75QuuoJhOBnlo99ZVUkJIuq4Oj0zAkrQ2VzCqNCx6wAwViHEh5Fnp4fiJTE9rA+sAoXRf00Z9xGgfEzV6fzQ==} - '@vitest/utils@2.0.5': resolution: {integrity: sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==} @@ -3571,11 +3556,6 @@ packages: peerDependencies: vite: ^2.6.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-0 - vite-node@2.0.4: - resolution: {integrity: sha512-ZpJVkxcakYtig5iakNeL7N3trufe3M6vGuzYAr4GsbCTwobDeyPJpE4cjDhhPluv8OvQCFzu2LWp6GkoKRITXA==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - vite-node@2.0.5: resolution: {integrity: sha512-LdsW4pxj0Ot69FAoXZ1yTnA9bjGohr2yNBU7QKRxpz8ITSkhuDl6h3zS/tvgz4qrNjeRnvrWeXQ8ZF7Um4W00Q==} engines: {node: ^18.0.0 || >=20.0.0} @@ -3661,31 +3641,6 @@ packages: terser: optional: true - vitest@2.0.4: - resolution: {integrity: sha512-luNLDpfsnxw5QSW4bISPe6tkxVvv5wn2BBs/PuDRkhXZ319doZyLOBr1sjfB5yCEpTiU7xCAdViM8TNVGPwoog==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.0.4 - '@vitest/ui': 2.0.4 - happy-dom: '*' - jsdom: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@types/node': - optional: true - '@vitest/browser': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - vitest@2.0.5: resolution: {integrity: sha512-8GUxONfauuIdeSl5f9GTgVEpg5BTOlplET4WEDaeY2QBiN8wSm68vxN/tb5z405OwppfoCavnwXafiaYBC/xOA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -4531,12 +4486,12 @@ snapshots: dependencies: archiver: 5.3.2 - '@nightwatch/vue@3.1.1(@types/node@20.14.14)(@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.5.3)))(vue@3.4.35(typescript@5.5.3))': + '@nightwatch/vue@3.1.1(@types/node@20.14.15)(@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.5.3)))(vue@3.4.35(typescript@5.5.3))': dependencies: '@nightwatch/esbuild-utils': 0.2.1 - '@vitejs/plugin-vue': 4.6.2(vite@4.5.2(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3)) + '@vitejs/plugin-vue': 4.6.2(vite@4.5.2(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3)) get-port: 5.1.1 - vite: 4.5.2(@types/node@20.14.14) + vite: 4.5.2(@types/node@20.14.15) vite-plugin-nightwatch: 0.4.6(@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.5.3)))(vue@3.4.35(typescript@5.5.3)) optionalDependencies: '@esbuild/android-arm': 0.17.19 @@ -4673,12 +4628,12 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.3 - '@types/node': 20.14.14 + '@types/node': 20.14.15 optional: true '@types/jsdom@21.1.7': dependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 '@types/tough-cookie': 4.0.4 parse5: 7.1.2 @@ -4686,7 +4641,7 @@ snapshots: '@types/jsonfile@6.1.3': dependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 optional: true '@types/nightwatch@2.3.30': @@ -4699,9 +4654,13 @@ snapshots: dependencies: undici-types: 5.26.5 + '@types/node@20.14.15': + dependencies: + undici-types: 5.26.5 + '@types/prompts@2.4.9': dependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 kleur: 3.0.3 '@types/selenium-webdriver@4.1.19': @@ -4716,45 +4675,38 @@ snapshots: '@types/ws@8.5.8': dependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 '@types/yauzl@2.10.3': dependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 optional: true - '@vitejs/plugin-vue-jsx@4.0.0(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3))': + '@vitejs/plugin-vue-jsx@4.0.0(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3))': dependencies: '@babel/core': 7.24.6 '@babel/plugin-transform-typescript': 7.24.6(@babel/core@7.24.6) '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.6) - vite: 5.3.5(@types/node@20.14.14) + vite: 5.3.5(@types/node@20.14.15) vue: 3.4.35(typescript@5.5.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@4.6.2(vite@4.5.2(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3))': + '@vitejs/plugin-vue@4.6.2(vite@4.5.2(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3))': dependencies: - vite: 4.5.2(@types/node@20.14.14) + vite: 4.5.2(@types/node@20.14.15) vue: 3.4.35(typescript@5.5.3) - '@vitejs/plugin-vue@5.1.2(vite@4.5.2(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3))': + '@vitejs/plugin-vue@5.1.2(vite@4.5.2(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3))': dependencies: - vite: 4.5.2(@types/node@20.14.14) + vite: 4.5.2(@types/node@20.14.15) vue: 3.4.35(typescript@5.5.3) - '@vitejs/plugin-vue@5.1.2(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3))': + '@vitejs/plugin-vue@5.1.2(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3))': dependencies: - vite: 5.3.5(@types/node@20.14.14) + vite: 5.3.5(@types/node@20.14.15) vue: 3.4.35(typescript@5.5.3) - '@vitest/expect@2.0.4': - dependencies: - '@vitest/spy': 2.0.4 - '@vitest/utils': 2.0.4 - chai: 5.1.1 - tinyrainbow: 1.2.0 - '@vitest/expect@2.0.5': dependencies: '@vitest/spy': 2.0.5 @@ -4762,51 +4714,25 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 - '@vitest/pretty-format@2.0.4': - dependencies: - tinyrainbow: 1.2.0 - '@vitest/pretty-format@2.0.5': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.0.4': - dependencies: - '@vitest/utils': 2.0.4 - pathe: 1.1.2 - '@vitest/runner@2.0.5': dependencies: '@vitest/utils': 2.0.5 pathe: 1.1.2 - '@vitest/snapshot@2.0.4': - dependencies: - '@vitest/pretty-format': 2.0.4 - magic-string: 0.30.10 - pathe: 1.1.2 - '@vitest/snapshot@2.0.5': dependencies: '@vitest/pretty-format': 2.0.5 magic-string: 0.30.10 pathe: 1.1.2 - '@vitest/spy@2.0.4': - dependencies: - tinyspy: 3.0.0 - '@vitest/spy@2.0.5': dependencies: tinyspy: 3.0.0 - '@vitest/utils@2.0.4': - dependencies: - '@vitest/pretty-format': 2.0.4 - estree-walker: 3.0.3 - loupe: 3.1.1 - tinyrainbow: 1.2.0 - '@vitest/utils@2.0.5': dependencies: '@vitest/pretty-format': 2.0.5 @@ -4958,14 +4884,14 @@ snapshots: '@vue/devtools-api@6.6.3': {} - '@vue/devtools-core@7.3.7(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3))': + '@vue/devtools-core@7.3.7(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3))': dependencies: '@vue/devtools-kit': 7.3.7 '@vue/devtools-shared': 7.3.7 mitt: 3.0.1 nanoid: 3.3.7 pathe: 1.1.2 - vite-hot-client: 0.2.3(vite@5.3.5(@types/node@20.14.14)) + vite-hot-client: 0.2.3(vite@5.3.5(@types/node@20.14.15)) vue: 3.4.35(typescript@5.5.3) transitivePeerDependencies: - vite @@ -5079,7 +5005,7 @@ snapshots: agent-base@7.1.0: dependencies: - debug: 4.3.6 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -5587,10 +5513,6 @@ snapshots: dependencies: ms: 2.1.2 - debug@4.3.6: - dependencies: - ms: 2.1.2 - debug@4.3.6(supports-color@8.1.1): dependencies: ms: 2.1.2 @@ -6180,7 +6102,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -6200,7 +6122,7 @@ snapshots: https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.0 - debug: 4.3.6 + debug: 4.3.5 transitivePeerDependencies: - supports-color @@ -6505,7 +6427,7 @@ snapshots: dependencies: chalk: 5.3.0 commander: 12.1.0 - debug: 4.3.6 + debug: 4.3.6(supports-color@8.1.1) execa: 8.0.1 lilconfig: 3.1.2 listr2: 8.2.4 @@ -7412,14 +7334,14 @@ snapshots: dependencies: punycode: 2.3.1 - ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.3): + ts-node@10.9.2(@types/node@20.14.15)(typescript@5.5.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.14.14 + '@types/node': 20.14.15 acorn: 8.11.2 acorn-walk: 8.3.0 arg: 4.1.3 @@ -7485,34 +7407,17 @@ snapshots: core-util-is: 1.0.2 extsprintf: 1.3.0 - vite-hot-client@0.2.3(vite@5.3.5(@types/node@20.14.14)): + vite-hot-client@0.2.3(vite@5.3.5(@types/node@20.14.15)): dependencies: - vite: 5.3.5(@types/node@20.14.14) + vite: 5.3.5(@types/node@20.14.15) - vite-node@2.0.4(@types/node@20.14.14): + vite-node@2.0.5(@types/node@20.14.15): dependencies: cac: 6.7.14 - debug: 4.3.5 - pathe: 1.1.2 - tinyrainbow: 1.2.0 - vite: 5.3.5(@types/node@20.14.14) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - - vite-node@2.0.5(@types/node@20.14.14): - dependencies: - cac: 6.7.14 - debug: 4.3.6 + debug: 4.3.6(supports-color@8.1.1) pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.3.5(@types/node@20.14.14) + vite: 5.3.5(@types/node@20.14.15) transitivePeerDependencies: - '@types/node' - less @@ -7523,7 +7428,7 @@ snapshots: - supports-color - terser - vite-plugin-inspect@0.8.4(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.14)): + vite-plugin-inspect@0.8.4(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.15)): dependencies: '@antfu/utils': 0.7.7 '@rollup/pluginutils': 5.1.0(rollup@4.13.2) @@ -7534,7 +7439,7 @@ snapshots: perfect-debounce: 1.0.0 picocolors: 1.0.1 sirv: 2.0.4 - vite: 5.3.5(@types/node@20.14.14) + vite: 5.3.5(@types/node@20.14.15) transitivePeerDependencies: - rollup - supports-color @@ -7555,23 +7460,23 @@ snapshots: - utf-8-validate - vue - vite-plugin-vue-devtools@7.3.7(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3)): + vite-plugin-vue-devtools@7.3.7(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3)): dependencies: - '@vue/devtools-core': 7.3.7(vite@5.3.5(@types/node@20.14.14))(vue@3.4.35(typescript@5.5.3)) + '@vue/devtools-core': 7.3.7(vite@5.3.5(@types/node@20.14.15))(vue@3.4.35(typescript@5.5.3)) '@vue/devtools-kit': 7.3.7 '@vue/devtools-shared': 7.3.7 execa: 8.0.1 sirv: 2.0.4 - vite: 5.3.5(@types/node@20.14.14) - vite-plugin-inspect: 0.8.4(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.14)) - vite-plugin-vue-inspector: 5.1.3(vite@5.3.5(@types/node@20.14.14)) + vite: 5.3.5(@types/node@20.14.15) + vite-plugin-inspect: 0.8.4(rollup@4.13.2)(vite@5.3.5(@types/node@20.14.15)) + vite-plugin-vue-inspector: 5.1.3(vite@5.3.5(@types/node@20.14.15)) transitivePeerDependencies: - '@nuxt/kit' - rollup - supports-color - vue - vite-plugin-vue-inspector@5.1.3(vite@5.3.5(@types/node@20.14.14)): + vite-plugin-vue-inspector@5.1.3(vite@5.3.5(@types/node@20.14.15)): dependencies: '@babel/core': 7.24.6 '@babel/plugin-proposal-decorators': 7.24.0(@babel/core@7.24.6) @@ -7582,62 +7487,29 @@ snapshots: '@vue/compiler-dom': 3.4.33 kolorist: 1.8.0 magic-string: 0.30.10 - vite: 5.3.5(@types/node@20.14.14) + vite: 5.3.5(@types/node@20.14.15) transitivePeerDependencies: - supports-color - vite@4.5.2(@types/node@20.14.14): + vite@4.5.2(@types/node@20.14.15): dependencies: esbuild: 0.18.20 postcss: 8.4.39 rollup: 3.29.4 optionalDependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 fsevents: 2.3.3 - vite@5.3.5(@types/node@20.14.14): + vite@5.3.5(@types/node@20.14.15): dependencies: esbuild: 0.21.5 postcss: 8.4.39 rollup: 4.13.2 optionalDependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 fsevents: 2.3.3 - vitest@2.0.4(@types/node@20.14.14)(jsdom@24.1.1): - dependencies: - '@ampproject/remapping': 2.3.0 - '@vitest/expect': 2.0.4 - '@vitest/pretty-format': 2.0.4 - '@vitest/runner': 2.0.4 - '@vitest/snapshot': 2.0.4 - '@vitest/spy': 2.0.4 - '@vitest/utils': 2.0.4 - chai: 5.1.1 - debug: 4.3.5 - execa: 8.0.1 - magic-string: 0.30.10 - pathe: 1.1.2 - std-env: 3.7.0 - tinybench: 2.8.0 - tinypool: 1.0.0 - tinyrainbow: 1.2.0 - vite: 5.3.5(@types/node@20.14.14) - vite-node: 2.0.4(@types/node@20.14.14) - why-is-node-running: 2.3.0 - optionalDependencies: - '@types/node': 20.14.14 - jsdom: 24.1.1 - transitivePeerDependencies: - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - - vitest@2.0.5(@types/node@20.14.14)(jsdom@24.1.1): + vitest@2.0.5(@types/node@20.14.15)(jsdom@24.1.1): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 @@ -7647,7 +7519,7 @@ snapshots: '@vitest/spy': 2.0.5 '@vitest/utils': 2.0.5 chai: 5.1.1 - debug: 4.3.6 + debug: 4.3.6(supports-color@8.1.1) execa: 8.0.1 magic-string: 0.30.10 pathe: 1.1.2 @@ -7655,11 +7527,11 @@ snapshots: tinybench: 2.8.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.3.5(@types/node@20.14.14) - vite-node: 2.0.5(@types/node@20.14.14) + vite: 5.3.5(@types/node@20.14.15) + vite-node: 2.0.5(@types/node@20.14.15) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.14.14 + '@types/node': 20.14.15 jsdom: 24.1.1 transitivePeerDependencies: - less @@ -7876,4 +7748,4 @@ snapshots: zx@8.1.4: optionalDependencies: '@types/fs-extra': 11.0.4 - '@types/node': 20.14.14 + '@types/node': 20.14.15 From b3fa7e0b9240361a2ceb1757027a23b7dd9066b1 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 22:11:34 +0900 Subject: [PATCH 13/23] feat: add ts files --- template/code/typescript-i18n/src/App.vue | 47 ++++++++++ .../src/components/HelloWorld.vue | 45 ++++++++++ .../src/components/TheWelcome.vue | 88 +++++++++++++++++++ .../src/components/WelcomeItem.vue | 87 ++++++++++++++++++ .../src/components/icons/IconCommunity.vue | 7 ++ .../components/icons/IconDocumentation.vue | 7 ++ .../src/components/icons/IconEcosystem.vue | 7 ++ .../src/components/icons/IconSupport.vue | 7 ++ .../src/components/icons/IconTooling.vue | 19 ++++ .../code/typescript-i18n/src/i18n/index.ts | 11 +++ .../src/i18n/locales/en-US.json | 5 ++ 11 files changed, 330 insertions(+) create mode 100644 template/code/typescript-i18n/src/App.vue create mode 100644 template/code/typescript-i18n/src/components/HelloWorld.vue create mode 100644 template/code/typescript-i18n/src/components/TheWelcome.vue create mode 100644 template/code/typescript-i18n/src/components/WelcomeItem.vue create mode 100644 template/code/typescript-i18n/src/components/icons/IconCommunity.vue create mode 100644 template/code/typescript-i18n/src/components/icons/IconDocumentation.vue create mode 100644 template/code/typescript-i18n/src/components/icons/IconEcosystem.vue create mode 100644 template/code/typescript-i18n/src/components/icons/IconSupport.vue create mode 100644 template/code/typescript-i18n/src/components/icons/IconTooling.vue create mode 100644 template/code/typescript-i18n/src/i18n/index.ts create mode 100644 template/code/typescript-i18n/src/i18n/locales/en-US.json diff --git a/template/code/typescript-i18n/src/App.vue b/template/code/typescript-i18n/src/App.vue new file mode 100644 index 00000000..d05208d6 --- /dev/null +++ b/template/code/typescript-i18n/src/App.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/template/code/typescript-i18n/src/components/HelloWorld.vue b/template/code/typescript-i18n/src/components/HelloWorld.vue new file mode 100644 index 00000000..82912b32 --- /dev/null +++ b/template/code/typescript-i18n/src/components/HelloWorld.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/template/code/typescript-i18n/src/components/TheWelcome.vue b/template/code/typescript-i18n/src/components/TheWelcome.vue new file mode 100644 index 00000000..49d8f735 --- /dev/null +++ b/template/code/typescript-i18n/src/components/TheWelcome.vue @@ -0,0 +1,88 @@ + + + diff --git a/template/code/typescript-i18n/src/components/WelcomeItem.vue b/template/code/typescript-i18n/src/components/WelcomeItem.vue new file mode 100644 index 00000000..6d7086ae --- /dev/null +++ b/template/code/typescript-i18n/src/components/WelcomeItem.vue @@ -0,0 +1,87 @@ + + + diff --git a/template/code/typescript-i18n/src/components/icons/IconCommunity.vue b/template/code/typescript-i18n/src/components/icons/IconCommunity.vue new file mode 100644 index 00000000..2dc8b055 --- /dev/null +++ b/template/code/typescript-i18n/src/components/icons/IconCommunity.vue @@ -0,0 +1,7 @@ + diff --git a/template/code/typescript-i18n/src/components/icons/IconDocumentation.vue b/template/code/typescript-i18n/src/components/icons/IconDocumentation.vue new file mode 100644 index 00000000..6d4791cf --- /dev/null +++ b/template/code/typescript-i18n/src/components/icons/IconDocumentation.vue @@ -0,0 +1,7 @@ + diff --git a/template/code/typescript-i18n/src/components/icons/IconEcosystem.vue b/template/code/typescript-i18n/src/components/icons/IconEcosystem.vue new file mode 100644 index 00000000..c3a4f078 --- /dev/null +++ b/template/code/typescript-i18n/src/components/icons/IconEcosystem.vue @@ -0,0 +1,7 @@ + diff --git a/template/code/typescript-i18n/src/components/icons/IconSupport.vue b/template/code/typescript-i18n/src/components/icons/IconSupport.vue new file mode 100644 index 00000000..7452834d --- /dev/null +++ b/template/code/typescript-i18n/src/components/icons/IconSupport.vue @@ -0,0 +1,7 @@ + diff --git a/template/code/typescript-i18n/src/components/icons/IconTooling.vue b/template/code/typescript-i18n/src/components/icons/IconTooling.vue new file mode 100644 index 00000000..660598d7 --- /dev/null +++ b/template/code/typescript-i18n/src/components/icons/IconTooling.vue @@ -0,0 +1,19 @@ + + diff --git a/template/code/typescript-i18n/src/i18n/index.ts b/template/code/typescript-i18n/src/i18n/index.ts new file mode 100644 index 00000000..465cbe61 --- /dev/null +++ b/template/code/typescript-i18n/src/i18n/index.ts @@ -0,0 +1,11 @@ +import { createI18n } from 'vue-i18n' +import enUS from './locales/en-US.json' + +type MessageSchema = typeof enUS + +const i18n = createI18n<[MessageSchema], 'en-US'>({ + locale: 'en-US', + messages: { + 'en-US': enUS + } +}) diff --git a/template/code/typescript-i18n/src/i18n/locales/en-US.json b/template/code/typescript-i18n/src/i18n/locales/en-US.json new file mode 100644 index 00000000..6619b046 --- /dev/null +++ b/template/code/typescript-i18n/src/i18n/locales/en-US.json @@ -0,0 +1,5 @@ +{ + "greetings": { + "message": "You've successfully created a project with" + } +} From d098768a18160df675ce6ba4703ca1f3fdf48365 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 22:15:29 +0900 Subject: [PATCH 14/23] fix: cd.yml --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d798ca10..a85f6473 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,7 @@ jobs: flag-for-router: ['', '--router'] flag-for-pinia: ['', '--pinia'] flag-for-vitest: ['', '--vitest'] + flag-for-i18n: [''] # It's quite costly to install Cypress & Playwright even with cache. # Maybe we can split them into another job so that all the projects @@ -67,6 +68,7 @@ jobs: flag-for-vitest: '--vitest' flag-for-e2e: '--cypress' flag-for-devtools: '--devtools' + flag-for-i18n: '--vue-i18n' - node-version: 18 os: macos-latest @@ -77,6 +79,7 @@ jobs: flag-for-vitest: '--vitest' flag-for-e2e: '--cypress' flag-for-devtools: '--devtools' + flag-for-i18n: '--vue-i18n' - node-version: 20 os: ubuntu-latest @@ -87,6 +90,7 @@ jobs: flag-for-vitest: '--vitest' flag-for-e2e: '--cypress' flag-for-devtools: '--devtools' + flag-for-i18n: '--vue-i18n' - node-version: 22 os: ubuntu-latest @@ -97,10 +101,11 @@ jobs: flag-for-vitest: '--vitest' flag-for-e2e: '--cypress' flag-for-devtools: '--devtools' + flag-for-i18n: '--vue-i18n' runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.os == 'windows-latest' }} env: - FEATURE_FLAGS: ${{ matrix.flag-for-ts }} ${{ matrix.flag-for-jsx }} ${{ matrix.flag-for-router }} ${{ matrix.flag-for-pinia }} ${{ matrix.flag-for-vitest }} ${{ matrix.flag-for-e2e }} ${{matrix.flag-for-devtools}} + FEATURE_FLAGS: ${{ matrix.flag-for-ts }} ${{ matrix.flag-for-jsx }} ${{ matrix.flag-for-router }} ${{ matrix.flag-for-pinia }} ${{ matrix.flag-for-vitest }} ${{ matrix.flag-for-e2e }} ${{matrix.flag-for-devtools}} ${{ matrix.flag-for-i18n }} # Sometimes the Linux runner can't verify Cypress in 30s CYPRESS_VERIFY_TIMEOUT: 60000 steps: From cf5d71e242592f271d20dae4a255a392c06bb4cb Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 22:24:41 +0900 Subject: [PATCH 15/23] chore: export i18n --- template/code/typescript-i18n/src/i18n/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/template/code/typescript-i18n/src/i18n/index.ts b/template/code/typescript-i18n/src/i18n/index.ts index 465cbe61..8082b976 100644 --- a/template/code/typescript-i18n/src/i18n/index.ts +++ b/template/code/typescript-i18n/src/i18n/index.ts @@ -9,3 +9,5 @@ const i18n = createI18n<[MessageSchema], 'en-US'>({ 'en-US': enUS } }) + +export default i18n From 3a83d529670526df3b0a45189972b047d48ba698 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 22:32:28 +0900 Subject: [PATCH 16/23] feat: add views --- .../code/typescript-i18n/src/views/AboutView.vue | 15 +++++++++++++++ .../code/typescript-i18n/src/views/HomeView.vue | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 template/code/typescript-i18n/src/views/AboutView.vue create mode 100644 template/code/typescript-i18n/src/views/HomeView.vue diff --git a/template/code/typescript-i18n/src/views/AboutView.vue b/template/code/typescript-i18n/src/views/AboutView.vue new file mode 100644 index 00000000..756ad2a1 --- /dev/null +++ b/template/code/typescript-i18n/src/views/AboutView.vue @@ -0,0 +1,15 @@ + + + diff --git a/template/code/typescript-i18n/src/views/HomeView.vue b/template/code/typescript-i18n/src/views/HomeView.vue new file mode 100644 index 00000000..6bb706f0 --- /dev/null +++ b/template/code/typescript-i18n/src/views/HomeView.vue @@ -0,0 +1,9 @@ + + + From 17fb167588353137f07e053f4d5f825cefb27af9 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 22:46:05 +0900 Subject: [PATCH 17/23] chore: typo --- .../code/typescript-i18n/src/views/AboutView.vue | 15 --------------- .../code/typescript-i18n/src/views/HomeView.vue | 9 --------- template/entry/i18n/src/main.js | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 template/code/typescript-i18n/src/views/AboutView.vue delete mode 100644 template/code/typescript-i18n/src/views/HomeView.vue diff --git a/template/code/typescript-i18n/src/views/AboutView.vue b/template/code/typescript-i18n/src/views/AboutView.vue deleted file mode 100644 index 756ad2a1..00000000 --- a/template/code/typescript-i18n/src/views/AboutView.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/template/code/typescript-i18n/src/views/HomeView.vue b/template/code/typescript-i18n/src/views/HomeView.vue deleted file mode 100644 index 6bb706f0..00000000 --- a/template/code/typescript-i18n/src/views/HomeView.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/template/entry/i18n/src/main.js b/template/entry/i18n/src/main.js index 1d8316ce..13d6ca51 100644 --- a/template/entry/i18n/src/main.js +++ b/template/entry/i18n/src/main.js @@ -1,6 +1,6 @@ import { createApp } from 'vue' import App from './App.vue' -import i18n from './main.js' +import i18n from './i18n' const app = createApp(App) app.use(i18n) From c7922a67eaab5813043d4576b199e2fc29cbc349 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 23:07:18 +0900 Subject: [PATCH 18/23] chore: delete i18n on matrix --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3eaf3248..1b9de14d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,6 @@ jobs: flag-for-router: ['', '--router'] flag-for-pinia: ['', '--pinia'] flag-for-vitest: ['', '--vitest'] - flag-for-i18n: [''] # It's quite costly to install Cypress & Playwright even with cache. # Maybe we can split them into another job so that all the projects From 026cd9e9332dafd4536daa9b2f58374c92f80258 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 23:17:02 +0900 Subject: [PATCH 19/23] chore: avoid lint error --- template/code/typescript-i18n/src/i18n/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/code/typescript-i18n/src/i18n/index.ts b/template/code/typescript-i18n/src/i18n/index.ts index 8082b976..e6e5688a 100644 --- a/template/code/typescript-i18n/src/i18n/index.ts +++ b/template/code/typescript-i18n/src/i18n/index.ts @@ -3,11 +3,11 @@ import enUS from './locales/en-US.json' type MessageSchema = typeof enUS -const i18n = createI18n<[MessageSchema], 'en-US'>({ +export const i18n = createI18n<[MessageSchema], 'en-US'>({ locale: 'en-US', messages: { 'en-US': enUS } }) -export default i18n +export type I18nInstance = typeof i18n From 884b9dd68412947e4bfb3c910e65d1bd9da8e0f7 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 23:20:06 +0900 Subject: [PATCH 20/23] chore: disable eslint --- template/code/typescript-i18n/src/i18n/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/template/code/typescript-i18n/src/i18n/index.ts b/template/code/typescript-i18n/src/i18n/index.ts index e6e5688a..274ae9f1 100644 --- a/template/code/typescript-i18n/src/i18n/index.ts +++ b/template/code/typescript-i18n/src/i18n/index.ts @@ -3,6 +3,7 @@ import enUS from './locales/en-US.json' type MessageSchema = typeof enUS +// eslint-disable-next-line @typescript-eslint/no-unused-vars export const i18n = createI18n<[MessageSchema], 'en-US'>({ locale: 'en-US', messages: { From ad66d81eefa4b557a2460c46c230fef99360b8fc Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 23:36:41 +0900 Subject: [PATCH 21/23] chore: test --- .github/workflows/ci.yml | 1 + template/code/typescript-i18n/src/i18n/index.ts | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b9de14d..58c53b1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,7 @@ jobs: flag-for-router: ['', '--router'] flag-for-pinia: ['', '--pinia'] flag-for-vitest: ['', '--vitest'] + flag-for-i18n: ['', '--vue-i18n'] # It's quite costly to install Cypress & Playwright even with cache. # Maybe we can split them into another job so that all the projects diff --git a/template/code/typescript-i18n/src/i18n/index.ts b/template/code/typescript-i18n/src/i18n/index.ts index 274ae9f1..8082b976 100644 --- a/template/code/typescript-i18n/src/i18n/index.ts +++ b/template/code/typescript-i18n/src/i18n/index.ts @@ -3,12 +3,11 @@ import enUS from './locales/en-US.json' type MessageSchema = typeof enUS -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export const i18n = createI18n<[MessageSchema], 'en-US'>({ +const i18n = createI18n<[MessageSchema], 'en-US'>({ locale: 'en-US', messages: { 'en-US': enUS } }) -export type I18nInstance = typeof i18n +export default i18n From a125bc772d0e9889129238f5d42c5241eb3eb582 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Fri, 16 Aug 2024 23:47:55 +0900 Subject: [PATCH 22/23] chore: export i18n --- template/config/vue-i18n/src/i18n/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/template/config/vue-i18n/src/i18n/index.js b/template/config/vue-i18n/src/i18n/index.js index a095f005..a326b17e 100644 --- a/template/config/vue-i18n/src/i18n/index.js +++ b/template/config/vue-i18n/src/i18n/index.js @@ -7,3 +7,4 @@ const i18n = createI18n({ 'en-US': enUS } }) +export default i18n From d2bf4f42ee9670ee1b9209bc9590a1dd24014444 Mon Sep 17 00:00:00 2001 From: Hanse Kim Date: Sat, 17 Aug 2024 17:09:11 +0900 Subject: [PATCH 23/23] fix: delete duplicated files --- template/code/typescript-i18n/src/App.vue | 47 ---------- .../src/components/TheWelcome.vue | 88 ------------------- .../src/components/WelcomeItem.vue | 87 ------------------ .../src/components/icons/IconCommunity.vue | 7 -- .../components/icons/IconDocumentation.vue | 7 -- .../src/components/icons/IconEcosystem.vue | 7 -- .../src/components/icons/IconSupport.vue | 7 -- .../src/components/icons/IconTooling.vue | 19 ---- 8 files changed, 269 deletions(-) delete mode 100644 template/code/typescript-i18n/src/App.vue delete mode 100644 template/code/typescript-i18n/src/components/TheWelcome.vue delete mode 100644 template/code/typescript-i18n/src/components/WelcomeItem.vue delete mode 100644 template/code/typescript-i18n/src/components/icons/IconCommunity.vue delete mode 100644 template/code/typescript-i18n/src/components/icons/IconDocumentation.vue delete mode 100644 template/code/typescript-i18n/src/components/icons/IconEcosystem.vue delete mode 100644 template/code/typescript-i18n/src/components/icons/IconSupport.vue delete mode 100644 template/code/typescript-i18n/src/components/icons/IconTooling.vue diff --git a/template/code/typescript-i18n/src/App.vue b/template/code/typescript-i18n/src/App.vue deleted file mode 100644 index d05208d6..00000000 --- a/template/code/typescript-i18n/src/App.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - - - diff --git a/template/code/typescript-i18n/src/components/TheWelcome.vue b/template/code/typescript-i18n/src/components/TheWelcome.vue deleted file mode 100644 index 49d8f735..00000000 --- a/template/code/typescript-i18n/src/components/TheWelcome.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/template/code/typescript-i18n/src/components/WelcomeItem.vue b/template/code/typescript-i18n/src/components/WelcomeItem.vue deleted file mode 100644 index 6d7086ae..00000000 --- a/template/code/typescript-i18n/src/components/WelcomeItem.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - diff --git a/template/code/typescript-i18n/src/components/icons/IconCommunity.vue b/template/code/typescript-i18n/src/components/icons/IconCommunity.vue deleted file mode 100644 index 2dc8b055..00000000 --- a/template/code/typescript-i18n/src/components/icons/IconCommunity.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/template/code/typescript-i18n/src/components/icons/IconDocumentation.vue b/template/code/typescript-i18n/src/components/icons/IconDocumentation.vue deleted file mode 100644 index 6d4791cf..00000000 --- a/template/code/typescript-i18n/src/components/icons/IconDocumentation.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/template/code/typescript-i18n/src/components/icons/IconEcosystem.vue b/template/code/typescript-i18n/src/components/icons/IconEcosystem.vue deleted file mode 100644 index c3a4f078..00000000 --- a/template/code/typescript-i18n/src/components/icons/IconEcosystem.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/template/code/typescript-i18n/src/components/icons/IconSupport.vue b/template/code/typescript-i18n/src/components/icons/IconSupport.vue deleted file mode 100644 index 7452834d..00000000 --- a/template/code/typescript-i18n/src/components/icons/IconSupport.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/template/code/typescript-i18n/src/components/icons/IconTooling.vue b/template/code/typescript-i18n/src/components/icons/IconTooling.vue deleted file mode 100644 index 660598d7..00000000 --- a/template/code/typescript-i18n/src/components/icons/IconTooling.vue +++ /dev/null @@ -1,19 +0,0 @@ - -