diff --git a/package-lock.json b/package-lock.json index ef6d655a..598e9b20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,11 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { + "@aurodesignsystem/auro-button": "^8.0.0", + "@aurodesignsystem/auro-formvalidation": "^1.0.3", "@aurodesignsystem/auro-icon": "^5.0.0", "@floating-ui/dom": "^1.6.11", + "cleave.js": "^1.6.0", "lit": "^3.2.0" }, "devDependencies": { @@ -150,6 +153,35 @@ "node": ">=8" } }, + "node_modules/@aurodesignsystem/auro-button": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@aurodesignsystem/auro-button/-/auro-button-8.0.0.tgz", + "integrity": "sha512-BAxMbOcN3Q8iQroQHeRhnxJ11m+ftVwe+dx6MkiWleNvvepI595W2zTAjrMtAJs5ZrF/5j8C452rHVgf3ltfdw==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@aurodesignsystem/auro-loader": "^3.0.0", + "chalk": "^5.3.0", + "lit": "^3.2.0" + }, + "engines": { + "node": "^18 || ^20" + }, + "peerDependencies": { + "@aurodesignsystem/design-tokens": "^4.9.2", + "@aurodesignsystem/webcorestylesheets": "^5.1.2" + } + }, + "node_modules/@aurodesignsystem/auro-formvalidation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@aurodesignsystem/auro-formvalidation/-/auro-formvalidation-1.0.3.tgz", + "integrity": "sha512-diJ5VE64WjVlnSIdSm8Wcj0ouhNPgveXePYrhknWcXwLvepPwt3XZyY+hGFaXTEd1ni9I2VYzypvnTPawkMsOA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": "^18 || ^20" + } + }, "node_modules/@aurodesignsystem/auro-icon": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@aurodesignsystem/auro-icon/-/auro-icon-5.0.0.tgz", @@ -186,6 +218,24 @@ "node": "^18 || ^20" } }, + "node_modules/@aurodesignsystem/auro-loader": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aurodesignsystem/auro-loader/-/auro-loader-3.0.0.tgz", + "integrity": "sha512-DVwJT9LoPYNFOw9umT/IcQV/ekRKww2yg4W6dLU9nB5CnqGKz4zsWd5zQEhFRLOLgr6T3P0e8YsfLQ2uzNKmyQ==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "chalk": "^5.3.0", + "lit": "^3.2.0" + }, + "engines": { + "node": "^18.x || ^20.x " + }, + "peerDependencies": { + "@aurodesignsystem/design-tokens": "^4.9.2", + "@aurodesignsystem/webcorestylesheets": "^5.1.2" + } + }, "node_modules/@aurodesignsystem/design-tokens": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/@aurodesignsystem/design-tokens/-/design-tokens-4.9.2.tgz", @@ -3793,6 +3843,12 @@ "node": ">=6" } }, + "node_modules/cleave.js": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/cleave.js/-/cleave.js-1.6.0.tgz", + "integrity": "sha512-ivqesy3j5hQVG3gywPfwKPbi/7ZSftY/UNp5uphnqjr25yI2CP8FS2ODQPzuLXXnNLi29e2+PgPkkiKUXLs/Nw==", + "license": "Apache-2.0" + }, "node_modules/cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", diff --git a/package.json b/package.json index 540d9c44..265dd32e 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,11 @@ "node": "^18.x || ^20.x " }, "dependencies": { + "@aurodesignsystem/auro-button": "^8.0.0", + "@aurodesignsystem/auro-formvalidation": "^1.0.3", "@aurodesignsystem/auro-icon": "^5.0.0", "@floating-ui/dom": "^1.6.11", + "cleave.js": "^1.6.0", "lit": "^3.2.0" }, "peerDependencies": { diff --git a/rollup.config.mjs b/rollup.config.mjs index 97addb6b..8593ada7 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -5,33 +5,45 @@ import path from 'path'; const production = !process.env.ROLLUP_WATCH; -// Function to get additional entry points -const getAdditionalEntryPoints = () => { +// Get entry points for each component +const getComponentEntryPoints = () => { const files = glob.sync('src/*/index.js'); - return files.reduce((acc, file) => { + return files.map(file => { const name = path.basename(path.dirname(file)); - acc[`${name}__bundled`] = file; - return acc; - }, {}); + return { + name, + input: file, + output: `dist/${name}` + }; + }); }; -const modernConfig = { - input: { - ['auro-form__bundled']: './index.js', - ...getAdditionalEntryPoints() - }, +const createConfig = (name, input, output) => ({ + input: { [`${name}__bundled`]: input }, output: { format: 'esm', - dir: 'dist/' + dir: output, + chunkFileNames: '[name]-[hash].js' }, plugins: [ - nodeResolve(), + nodeResolve({ + browser: true, + dedupe: ['lit', 'lit-element', 'lit-html'], + preferBuiltins: false, + moduleDirectories: ['node_modules'] + }), !production && serve({ open: true, openPage: '/docs/' }) ] -}; +}); + +const mainConfig = createConfig('auro-form', './index.js', 'dist'); + +const componentConfigs = getComponentEntryPoints().map(({ name, input, output }) => + createConfig(name, input, output) +); -export default [modernConfig]; \ No newline at end of file +export default [mainConfig, ...componentConfigs]; \ No newline at end of file