@muonic/muon 0.0.2-beta.41 → 0.0.2-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/rollup.config.mjs +3 -2
- package/scripts/utils/index.mjs +18 -0
- package/tests/scripts/utils/utils-test.mjs +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.2-beta.42](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.39...v0.0.2-beta.42) (2023-09-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* bubble the detail toggle event ([9a82a2b](https://github.com/centrica-engineering/muon/commit/9a82a2b35ecd29d9c00d9ae4d68b919ba1188c84))
|
|
11
|
+
* inputter detail max width ([f32f699](https://github.com/centrica-engineering/muon/commit/f32f69945a7210765a70ac8d7f0a5bd868992386))
|
|
12
|
+
* inputter detail width tokens ([c61bc6f](https://github.com/centrica-engineering/muon/commit/c61bc6f782b551229a45024ec984f1b4d07307c7))
|
|
13
|
+
* inputter helper toggle event ([987dd38](https://github.com/centrica-engineering/muon/commit/987dd38fe39192906ae5e813a230342aca599dad))
|
|
14
|
+
* virtual component-export ([5b7190e](https://github.com/centrica-engineering/muon/commit/5b7190ec3e96e5ba5ea228a30ecedb1e9d64ca4d))
|
|
15
|
+
|
|
5
16
|
### [0.0.2-beta.41](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.40...v0.0.2-beta.41) (2023-08-23)
|
|
6
17
|
|
|
7
18
|
### [0.0.2-beta.40](https://github.com/centrica-engineering/muon/compare/v0.0.2-beta.10...v0.0.2-beta.40) (2023-08-17)
|
package/package.json
CHANGED
package/rollup.config.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import virtual from '@rollup/plugin-virtual';
|
|
|
3
3
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
4
4
|
import { createBasicConfig } from '@open-wc/building-rollup';
|
|
5
5
|
import path from 'path';
|
|
6
|
-
import { componentDefiner, getDestination } from '@muonic/muon/scripts/utils/index.mjs';
|
|
6
|
+
import { componentDefiner, componentImportExport, getDestination } from '@muonic/muon/scripts/utils/index.mjs';
|
|
7
7
|
import { rollupPlugins } from '@muonic/muon/scripts/rollup-plugins.mjs';
|
|
8
8
|
import minifyHTMLPlugin from 'rollup-plugin-minify-html-literals';
|
|
9
9
|
|
|
@@ -17,7 +17,8 @@ export default merge(config, {
|
|
|
17
17
|
plugins: [
|
|
18
18
|
minifyHTMLPlugin.default(),
|
|
19
19
|
virtual({
|
|
20
|
-
'component-definitions.js': componentDefiner()
|
|
20
|
+
'component-definitions.js': componentDefiner(),
|
|
21
|
+
'component-export.js': componentImportExport()
|
|
21
22
|
}),
|
|
22
23
|
...rollupPlugins,
|
|
23
24
|
nodeResolve()
|
package/scripts/utils/index.mjs
CHANGED
|
@@ -313,6 +313,23 @@ const componentDefiner = async () => {
|
|
|
313
313
|
return componentDefinition;
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
+
const componentImportExport = async () => {
|
|
317
|
+
const compList = await analyze();
|
|
318
|
+
let componentDefinition = `import '@webcomponents/scoped-custom-element-registry';`;
|
|
319
|
+
|
|
320
|
+
componentDefinition += compList.map(({ file, exportName }) => {
|
|
321
|
+
return `import { ${exportName} } from '${file}';
|
|
322
|
+
`;
|
|
323
|
+
}).join('');
|
|
324
|
+
|
|
325
|
+
componentDefinition += `
|
|
326
|
+
export {
|
|
327
|
+
${compList.map(({ exportName }) => exportName).join(',')}
|
|
328
|
+
};`;
|
|
329
|
+
|
|
330
|
+
return componentDefinition;
|
|
331
|
+
};
|
|
332
|
+
|
|
316
333
|
const runner = async (file, overrideDestination) => {
|
|
317
334
|
const destination = overrideDestination || getDestination();
|
|
318
335
|
|
|
@@ -328,6 +345,7 @@ export {
|
|
|
328
345
|
filterPathToCustomElements,
|
|
329
346
|
createTokens,
|
|
330
347
|
componentDefiner,
|
|
348
|
+
componentImportExport,
|
|
331
349
|
runner,
|
|
332
350
|
sourceFilesAnalyzer,
|
|
333
351
|
getAliasPaths
|
|
@@ -74,6 +74,17 @@ componentsDefinitionMacro.title = (providedTitle, expected) => `${providedTitle}
|
|
|
74
74
|
|
|
75
75
|
testRunner('componentDefiner', componentsDefinitionMacro, { card: 'Card', cta: 'Cta', detail: 'Detail', form: 'Form', icon: 'Icon', inputter: 'Inputter', image: 'Image' });
|
|
76
76
|
|
|
77
|
+
const componentImportExportMacro = async (t, expected) => {
|
|
78
|
+
const componentImportExport = await utilsLibrary.componentImportExport();
|
|
79
|
+
t.true(componentImportExport !== undefined);
|
|
80
|
+
Object.keys(expected).forEach((component) => {
|
|
81
|
+
t.true(componentImportExport.indexOf(`import { ${expected[component]} } from '${process.cwd()}/components/${component}/src/${component}-component.js';`) > -1);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
componentImportExportMacro.title = (providedTitle, expected) => `${providedTitle} => ${Object.keys(expected)}`;
|
|
85
|
+
|
|
86
|
+
testRunner('componentImportExport', componentImportExportMacro, { card: 'Card', cta: 'Cta', detail: 'Detail', form: 'Form', icon: 'Icon', inputter: 'Inputter', image: 'Image' });
|
|
87
|
+
|
|
77
88
|
testRunner('getAliasPath glob', async (t) => {
|
|
78
89
|
const alias = utilsLibrary.getAliasPaths('glob');
|
|
79
90
|
|