feat(xo-stack): add @core alias to import Core from Web and Lite (#7375)

This commit is contained in:
Thierry Goettelmann 2024-02-14 14:43:23 +01:00 committed by GitHub
parent f23fd69e7e
commit 35c660dbf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 34 additions and 7 deletions

View File

@ -65,10 +65,11 @@ module.exports = {
typescript: true, typescript: true,
'eslint-import-resolver-custom-alias': { 'eslint-import-resolver-custom-alias': {
alias: { alias: {
'@core': '../web-core/lib',
'@': './src', '@': './src',
}, },
extensions: ['.ts'], extensions: ['.ts'],
packages: ['@xen-orchestra/lite'], packages: ['@xen-orchestra/lite', '@xen-orchestra/web'],
}, },
}, },
}, },

View File

@ -1,13 +1,15 @@
{ {
"extends": "@vue/tsconfig/tsconfig.dom.json", "extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"], "include": ["env.d.ts", "src/**/*", "src/**/*.vue", "../web-core/lib/**/*", "../web-core/lib/**/*.vue"],
"exclude": ["src/**/__tests__/*"], "exclude": ["src/**/__tests__/*"],
"compilerOptions": { "compilerOptions": {
"composite": true, "composite": true,
"noEmit": true, "noEmit": true,
"baseUrl": ".", "baseUrl": ".",
"rootDir": "..",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"],
"@core/*": ["../web-core/lib/*"]
} }
} }
} }

View File

@ -23,6 +23,7 @@ export default defineConfig({
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)),
'@core': fileURLToPath(new URL('../web-core/lib', import.meta.url)),
}, },
}, },

View File

@ -10,7 +10,8 @@
} }
}, },
"devDependencies": { "devDependencies": {
"vue": "^3.4.13" "vue": "^3.4.13",
"@vue/tsconfig": "^0.5.1"
}, },
"homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/web-core", "homepage": "https://github.com/vatesfr/xen-orchestra/tree/master/@xen-orchestra/web-core",
"bugs": "https://github.com/vatesfr/xen-orchestra/issues", "bugs": "https://github.com/vatesfr/xen-orchestra/issues",
@ -25,6 +26,6 @@
}, },
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"engines": { "engines": {
"node": ">=8.10" "node": ">=18"
} }
} }

View File

@ -0,0 +1,12 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "lib/**/*", "lib/**/*.vue"],
"exclude": ["lib/**/__tests__/*"],
"compilerOptions": {
"noEmit": true,
"baseUrl": ".",
"paths": {
"@core/*": ["./lib/*"]
}
}
}

View File

@ -1,13 +1,22 @@
{ {
"extends": "@vue/tsconfig/tsconfig.dom.json", "extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "typed-router.d.ts", "src/**/*", "src/**/*.vue"], "include": [
"env.d.ts",
"typed-router.d.ts",
"src/**/*",
"src/**/*.vue",
"../web-core/lib/**/*",
"../web-core/lib/**/*.vue"
],
"exclude": ["src/**/__tests__/*"], "exclude": ["src/**/__tests__/*"],
"compilerOptions": { "compilerOptions": {
"composite": true, "composite": true,
"noEmit": true, "noEmit": true,
"baseUrl": ".", "baseUrl": ".",
"rootDir": "..",
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": ["./src/*"],
"@core/*": ["../web-core/lib/*"]
} }
} }
} }

View File

@ -11,6 +11,7 @@ export default defineConfig({
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)), '@': fileURLToPath(new URL('./src', import.meta.url)),
'@core': fileURLToPath(new URL('../web-core/lib', import.meta.url)),
}, },
}, },
}) })