-
Notifications
You must be signed in to change notification settings - Fork 2
/
custom-elements-manifest.config.js
86 lines (81 loc) · 3.16 KB
/
custom-elements-manifest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { getTsProgram, expandTypesPlugin } from 'cem-plugin-expanded-types';
import { customElementReactWrapperPlugin } from 'custom-element-react-wrappers';
import { customElementVsCodePlugin } from 'custom-element-vs-code-integration';
import { customElementJetBrainsPlugin } from 'custom-element-jet-brains-integration';
import { customElementSolidJsPlugin } from 'custom-element-solidjs-integration';
import { customElementJsxPlugin } from 'custom-element-jsx-integration';
import { customElementVuejsPlugin } from 'custom-element-vuejs-integration';
import { customElementSveltePlugin } from 'custom-element-svelte-integration';
import { cemInheritancePlugin } from 'custom-elements-manifest-inheritance';
import { customElementLazyLoaderPlugin } from 'custom-element-lazy-loader';
import { customJSDocTagsPlugin } from 'cem-plugin-custom-jsdoc-tags';
import { customEsLintRuleGeneratorPlugin } from 'custom-element-eslint-rule-generator';
import { cemDeprecatorPlugin } from "custom-elements-manifest-deprecator";
export default {
/** Globs to analyze */
globs: ['src/components/**/*.ts'],
/** Globs to exclude */
exclude: ['src/**/*.test.ts', 'src/**/*.stories.ts', 'src/**/*.styles.ts'],
/** Enable special handling for litelement */
litelement: true,
/** Provide custom plugins */
plugins: [
expandTypesPlugin(),
cemInheritancePlugin(),
cemDeprecatorPlugin(),
customElementVsCodePlugin(),
customElementJetBrainsPlugin(),
customElementReactWrapperPlugin({
outdir: 'react',
modulePath: (_, tagName) =>
`../dist/components/${tagName.replace('my-', '')}/index.js`,
}),
customElementSolidJsPlugin({
outdir: 'types',
fileName: 'custom-element-solidjs.d.ts',
modulePath: (_, tagName) =>
`../dist/components/${tagName.replace('my-', '')}/${tagName.replace('my-', '')}.js`,
}),
customElementJsxPlugin({
outdir: 'types',
modulePath: (_, tagName) =>
`../dist/components/${tagName.replace('my-', '')}/${tagName.replace('my-', '')}.js`,
}),
customElementVuejsPlugin({
outdir: 'types',
fileName: 'custom-element-vuejs.d.ts',
modulePath: (_, tagName) =>
`../dist/components/${tagName.replace('my-', '')}/${tagName.replace('my-', '')}.js`,
}),
customElementSveltePlugin({
outdir: 'types',
fileName: 'custom-element-svelte.d.ts',
modulePath: (_, tagName) =>
`../dist/components/${tagName.replace('my-', '')}/${tagName.replace('my-', '')}.js`,
}),
customElementLazyLoaderPlugin({
outdir: 'cdn',
importPathTemplate: (_, tagName) =>
`../dist/components/${tagName.replace('my-', '')}/${tagName.replace('my-', '')}.js`,
}),
customJSDocTagsPlugin({
tags: {
status: {},
since: {},
dependency: {
mappedName: 'dependencies',
isArray: true,
},
},
}),
customEsLintRuleGeneratorPlugin({
outdir: 'eslint',
}),
],
overrideModuleCreation: ({ ts, globs }) => {
const program = getTsProgram(ts, globs, 'tsconfig.json');
return program
.getSourceFiles()
.filter(sf => globs.find(glob => sf.fileName.includes(glob)));
},
};