-
Notifications
You must be signed in to change notification settings - Fork 76
/
stencil.config.ts
166 lines (164 loc) · 6.75 KB
/
stencil.config.ts
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import { Config } from "@stencil/core";
import { postcss } from "@stencil-community/postcss";
import { sass } from "@stencil/sass";
import autoprefixer from "autoprefixer";
import { reactOutputTarget } from "@stencil/react-output-target";
import { angularOutputTarget } from "@stencil/angular-output-target";
import tailwindcss, { Config as TailwindConfig } from "tailwindcss";
import stylelint from "stylelint";
import tailwindConfig from "./tailwind.config";
import { generatePreactTypes } from "./support/preact";
import { version } from "./package.json";
export const create: () => Config = () => ({
namespace: "calcite",
bundles: [
{ components: ["calcite-accordion", "calcite-accordion-item"] },
{ components: ["calcite-action"] },
{ components: ["calcite-action-bar"] },
{ components: ["calcite-action-menu"] },
{ components: ["calcite-action-pad"] },
{ components: ["calcite-alert"] },
{ components: ["calcite-avatar"] },
{ components: ["calcite-block", "calcite-block-section"] },
{ components: ["calcite-button"] },
{ components: ["calcite-card"] },
{ components: ["calcite-card-group"] },
{ components: ["calcite-carousel", "calcite-carousel-item"] },
{ components: ["calcite-checkbox"] },
{ components: ["calcite-chip"] },
{ components: ["calcite-chip-group"] },
{ components: ["calcite-color-picker", "calcite-color-picker-hex-input", "calcite-color-picker-swatch"] },
{ components: ["calcite-combobox", "calcite-combobox-item-group", "calcite-combobox-item"] },
{
components: [
"calcite-date-picker",
"calcite-date-picker-day",
"calcite-date-picker-month",
"calcite-date-picker-month-header",
],
},
{ components: ["calcite-dropdown", "calcite-dropdown-group", "calcite-dropdown-item"] },
{ components: ["calcite-fab"] },
{ components: ["calcite-flow"] },
{ components: ["calcite-icon"] },
{ components: ["calcite-inline-editable"] },
{ components: ["calcite-input"] },
{ components: ["calcite-input-date-picker"] },
{ components: ["calcite-input-message"] },
{ components: ["calcite-input-number"] },
{ components: ["calcite-input-time-picker", "calcite-time-picker"] },
{ components: ["calcite-input-time-zone"] },
{ components: ["calcite-label"] },
{ components: ["calcite-link"] },
{ components: ["calcite-list", "calcite-list-item", "calcite-list-item-group"] },
{ components: ["calcite-loader"] },
{ components: ["calcite-meter"] },
{ components: ["calcite-modal"] },
{ components: ["calcite-navigation", "calcite-navigation-user", "calcite-navigation-logo"] },
{ components: ["calcite-menu", "calcite-menu-item"] },
{ components: ["calcite-notice"] },
{ components: ["calcite-pagination"] },
{ components: ["calcite-panel"] },
{ components: ["calcite-pick-list", "calcite-pick-list-group", "calcite-pick-list-item"] },
{ components: ["calcite-popover"] },
{ components: ["calcite-progress"] },
{ components: ["calcite-radio-button"] },
{ components: ["calcite-radio-button-group"] },
{ components: ["calcite-rating"] },
{ components: ["calcite-scrim"] },
{ components: ["calcite-segmented-control", "calcite-segmented-control-item"] },
{ components: ["calcite-select", "calcite-option", "calcite-option-group"] },
{ components: ["calcite-sheet"] },
{ components: ["calcite-shell", "calcite-shell-center-row", "calcite-shell-panel"] },
{ components: ["calcite-slider", "calcite-graph"] },
{ components: ["calcite-sortable-list"] },
{ components: ["calcite-split-button"] },
{ components: ["calcite-stack"] },
{ components: ["calcite-stepper", "calcite-stepper-item"] },
{ components: ["calcite-switch"] },
{ components: ["calcite-tab", "calcite-tab-title", "calcite-tab-nav", "calcite-tabs"] },
{ components: ["calcite-text-area"] },
{ components: ["calcite-tile"] },
{ components: ["calcite-tile-group"] },
{ components: ["calcite-tile-select-group", "calcite-tile-select"] },
{ components: ["calcite-tip", "calcite-tip-group", "calcite-tip-manager"] },
{ components: ["calcite-tooltip"] },
{ components: ["calcite-tree", "calcite-tree-item"] },
{ components: ["calcite-value-list", "calcite-value-list-item"] },
],
outputTargets: [
angularOutputTarget({
componentCorePackage: "@esri/calcite-components",
directivesProxyFile:
"../calcite-components-angular/projects/component-library/src/lib/stencil-generated/components.ts",
directivesArrayFile:
"../calcite-components-angular/projects/component-library/src/lib/stencil-generated/index.ts",
}),
reactOutputTarget({
componentCorePackage: "@esri/calcite-components",
proxiesFile: "../calcite-components-react/src/components.ts",
excludeComponents: ["context-consumer"],
customElementsDir: "dist/components",
}),
{ type: "dist-hydrate-script" },
{ type: "dist-custom-elements", customElementsExportBehavior: "auto-define-custom-elements" },
{ type: "dist" },
{ type: "docs-readme" },
{ type: "docs-json", file: "./dist/extras/docs-json.json" },
{
type: "docs-vscode",
file: "./dist/extras/vscode-data.json",
},
{ type: "custom", name: "preact", generator: generatePreactTypes },
{
type: "www",
baseUrl: "https://stenciljs.com/",
prerenderConfig: "./prerender.config.ts",
copy: [
{ src: "demos", dest: "demos" },
{ src: "robots.txt", dest: "robots.txt" },
],
serviceWorker: {
unregister: true,
},
},
],
globalStyle: "src/assets/styles/global.scss",
globalScript: "src/utils/globalScript.ts",
plugins: [
sass({
injectGlobalPaths: ["src/assets/styles/includes.scss"],
}),
postcss({
plugins: [
tailwindcss(tailwindConfig as any as TailwindConfig),
autoprefixer(),
stylelint({
configFile: ".stylelintrc-postcss.json",
fix: true,
}),
],
}),
],
testing: {
watchPathIgnorePatterns: ["<rootDir>/../../node_modules", "<rootDir>/dist", "<rootDir>/www", "<rootDir>/hydrate"],
moduleNameMapper: {
"^lodash-es$": "lodash",
},
setupFilesAfterEnv: ["<rootDir>/src/tests/setupTests.ts"],
transform: {
"calcite-design-tokens/dist/es6/.*\\.js$":
"<rootDir>../../node_modules/@stencil/core/testing/jest-preprocessor.js",
},
},
hydratedFlag: {
selector: "attribute",
name: "calcite-hydrated",
},
preamble: `All material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.\nv${version}`,
extras: {
enableImportInjection: true,
scriptDataOpts: true,
},
});
export const config = create();