Skip to content
Draft
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
4 changes: 2 additions & 2 deletions packages/x-archetype-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"prepublishOnly": "pnpm run build"
},
"peerDependencies": {
"vue": "^3.4.31",
"vue": "^3.5.18",
"vue-i18n": "^9.14.4"
},
"dependencies": {
Expand All @@ -61,7 +61,7 @@
"rollup-plugin-typescript2": "0.36.0",
"ts-jest": "29.4.0",
"typescript": "5.8.3",
"vue": "3.4.31"
"vue": "3.5.18"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/x-components/build/build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { OutputOptions } from 'rollup'
import { rollup } from 'rollup'
import { rollupConfig } from './rollup.config'
import rollupConfig from './rollup.config'

/**
* Entry point for building the project.
Expand Down

This file was deleted.

32 changes: 24 additions & 8 deletions packages/x-components/build/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Plugin, RollupOptions } from 'rollup'
import fs from 'node:fs'
import path from 'node:path'
import vue3 from '@vitejs/plugin-vue'
import copy from 'rollup-plugin-copy'
Expand All @@ -7,12 +8,11 @@ import styles from 'rollup-plugin-styles'
import typescript from 'rollup-plugin-typescript2'
import { dependencies as pkgDeps, peerDependencies as pkgPeerDeps } from '../package.json'
import { apiDocumentation } from './docgen/documentation.rollup-plugin'
import { generateEntryFiles } from './rollup-plugins/x-components.rollup-plugin'

const rootDir = path.resolve(__dirname, '../')
const buildPath = path.join(rootDir, 'dist')
const r = (p: string) => path.join(rootDir, p)

const jsOutputDir = path.join(buildPath, 'js')
const typesOutputDir = path.join(buildPath, 'types')

const dependencies = new Set(Object.keys(pkgDeps).concat(Object.keys(pkgPeerDeps)))
Expand All @@ -23,10 +23,24 @@ const vueDocs = {
!/vue&type=docs/.test(id) ? undefined : `export default ''`,
}

export const rollupConfig: RollupOptions = {
input: path.join(rootDir, 'src/index.ts'),
const getXModules = () => {
const xModulesPath = path.join(rootDir, 'src', 'x-modules')
return Object.fromEntries(
fs
.readdirSync(xModulesPath)
.filter(file => fs.statSync(path.join(xModulesPath, file)).isDirectory())
.map(module => [`${module}/index`, r(`src/x-modules/${module}/index.ts`)]),
)
}

const rollupConfig: RollupOptions = {
input: {
'core/index': r('src/core.entry.ts'),
...getXModules(),
'x-modules.types/index': r('src/x-modules/x-modules.types.ts'),
},
output: {
dir: jsOutputDir,
dir: buildPath,
format: 'esm',
sourcemap: true,
preserveModules: true,
Expand Down Expand Up @@ -61,6 +75,7 @@ export const rollupConfig: RollupOptions = {
],
}),
typescript({
check: false,
useTsconfigDeclarationDir: true,
tsconfig: path.resolve(rootDir, 'tsconfig.json'),
tsconfigOverride: {
Expand All @@ -84,20 +99,21 @@ export const rollupConfig: RollupOptions = {
mode: [
'inject',
varname => {
const pathInjector = path.resolve('./tools/inject-css.js')
const pathInjector = r('src/utils/inject-css.js')
return `import injectCss from '${pathInjector}';injectCss(${varname});`
},
],
}),
vueDocs,
generateEntryFiles({ buildPath, jsOutputDir, typesOutputDir }),
apiDocumentation({ buildPath }),
copy({
targets: [
{ src: ['build/tools'], dest: buildPath },
{ src: ['CHANGELOG.md', 'package.json', 'README.md', 'docs'], dest: buildPath },
{ src: ['CHANGELOG.md', 'package.json', 'README.md', 'docs', 'patches'], dest: buildPath },
],
hook: 'writeBundle',
}),
],
}

export default rollupConfig
10 changes: 6 additions & 4 deletions packages/x-components/build/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
"compilerOptions": {
"target": "es2020",
"jsx": "preserve",
"lib": ["esnext", "dom", "scripthost"],
"experimentalDecorators": true,
"lib": ["esnext", "dom", "dom.iterable"],
"baseUrl": ".",
"rootDir": "src",
"module": "commonjs",
"moduleResolution": "node",
"paths": {},
"resolveJsonModule": true,
"types": ["node"],
"allowJs": true,
"strict": true,
"noImplicitAny": true,
"noImplicitThis": true,
"declaration": true,
"declarationMap": true,
"importHelpers": true,
"sourceMap": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["**/*.ts", "**/*.js"],
"include": ["**/*.ts", "**/*.js", "**/*.vue"],
"exclude": ["node_modules"]
}
Loading
Loading