Skip to content

Commit 8b3f5b5

Browse files
committed
build(component-builder): legacy builder clean-up unused plugins
1 parent 45cba30 commit 8b3f5b5

File tree

286 files changed

+3297
-10180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+3297
-10180
lines changed

.github/workflows/publish-site.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ jobs:
9393
- name: Deploy
9494
uses: nwtgck/actions-netlify@v2
9595
with:
96-
# publish-dir: site/dist
97-
publish-dir: dist
96+
publish-dir: site/dist
9897
production-branch: main
9998
production-deploy: false
10099
netlify-config-path: ./netlify.toml

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/node_modules
44
/tasks
55
/temp
6-
/gulpfile.js
76
npm-debug.log
87
/.github
98
/dist/docs/

.storybook/main.js

Lines changed: 46 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -42,65 +42,54 @@ module.exports = {
4242
},
4343
env: {
4444
MIGRATED_PACKAGES: componentPkgs.filter((dir) => {
45-
const pkg = require(resolve(componentsPath, dir, "package.json"));
46-
if (
47-
pkg.devDependencies &&
48-
pkg.devDependencies["@spectrum-css/component-builder-simple"]
49-
) {
50-
return true;
51-
}
52-
return false;
45+
const {
46+
peerDependencies = {}
47+
} = require(
48+
resolve(componentsPath, dir, "package.json")
49+
) ?? {};
50+
return Boolean(peerDependencies["@spectrum-css/tokens"]);
5351
}),
5452
},
55-
webpackFinal: function (config) {
56-
// Removing the global alias as it conflicts with the global npm pkg
57-
const { global, ...alias } = config.resolve.alias;
58-
config.resolve.alias = alias;
59-
let storybookRules =
60-
config && config.module && config.module.rules
61-
? config.module.rules.filter(
62-
(rule) => !(rule.test && rule.test.toString().includes("css"))
63-
)
64-
: [];
53+
webpackFinal: async (config = {}) => {
54+
if (!config.module) config.module = {};
55+
if (!config.module.rules) config.module.rules = [];
56+
57+
config.module.rules = config.module.rules.map((f) => {
58+
if (f && f.test && f.test.toString() === '/\\.css$/') {
59+
f.test = /(node_modules|dist(\/|\\))(.*)\.css$/;
60+
}
61+
return f;
62+
});
63+
6564
return {
6665
...config,
67-
stats: {
68-
/* Suppress autoprefixer warnings from storybook build */
69-
warningsFilter: [/autoprefixer: /],
70-
},
71-
/* Add support for root node_modules imports */
66+
ignoreWarnings: [
67+
...config.ignoreWarnings ?? [],
68+
/autoprefixer: /
69+
],
7270
resolve: {
73-
...(config.resolve ? config.resolve : {}),
71+
...config.resolve ?? {},
7472
modules: [
75-
...(config.resolve ? config.resolve.modules : []),
73+
...config.resolve.modules ?? [],
74+
/* Add support for root node_modules imports */
7675
resolve(__dirname, "../node_modules"),
7776
],
7877
alias: {
79-
...(config.resolve ? config.resolve.alias : {}),
78+
...config.resolve.alias ?? {},
8079
...componentPkgs.reduce((pkgs, dir) => {
8180
const pkg = require(resolve(componentsPath, dir, "package.json"));
8281
pkgs[pkg.name] = resolve(componentsPath, dir);
8382
return pkgs;
8483
}, {}),
85-
},
84+
}
8685
},
8786
module: {
88-
...(config.module ?? []),
87+
...config.module ?? {},
8988
rules: [
90-
...storybookRules,
89+
...config.module.rules ?? [],
9190
{
92-
test: /^\w+\.{ico,jpg,jpeg,png,gif,webp}$/i,
93-
use: [
94-
{
95-
loader: "file-loader",
96-
options: {
97-
outputPath: (url) => `assets/images/${url.replace(/_\//g, "")}`,
98-
},
99-
},
100-
],
101-
},
102-
{
103-
test: /\.css$/i,
91+
test: /\.css$/,
92+
exclude: [/node_modules/, /dist/],
10493
sideEffects: true,
10594
use: [
10695
{
@@ -113,61 +102,44 @@ module.exports = {
113102
},
114103
},
115104
{
116-
loader: "file-loader",
105+
loader: 'file-loader',
117106
options: {
118-
name: "[path][name].[ext][query]",
107+
name: '[path][name].[ext][query]',
119108
outputPath: (url) => {
120-
const cleanURL = url.replace(/_\//g, "");
121-
if (/node_modules\/@spectrum-css/.test(url)) {
122-
return `assets/css/${cleanURL.replace(/node_modules\/@spectrum-css\//g, "")}`;
109+
const cleanUrl = url.replace(/_\//g, '');
110+
if (/node_modules\/@spectrum-css/.test(cleanUrl)) {
111+
return `assets/css/${cleanUrl.replace(/node_modules\/@spectrum-css\//g, "")}`;
123112
}
124-
125-
return `assets/css/${cleanURL}`;
113+
return `assets/css/${cleanUrl}`;
126114
},
127115
esModule: false,
128116
},
129117
},
130118
{
131-
loader: "postcss-loader",
119+
// Gets options from `postcss.config.js` in your project root
120+
loader: 'postcss-loader',
132121
options: {
133-
implementation: require("postcss"),
134-
postcssOptions: {
135-
config: resolve(__dirname, "postcss.config.js"),
136-
},
137-
},
138-
},
122+
implementation: require('postcss'),
123+
sourceMap: true,
124+
}
125+
}
139126
],
140127
},
141-
{
142-
test: /\.js$/,
143-
enforce: "pre",
144-
use: ["source-map-loader"],
145-
} /* Raw SVG loader */,
146-
{
147-
test: /\.svg$/i,
148-
loader: "raw-loader",
149-
},
150-
],
151-
},
128+
]
129+
}
152130
};
153131
},
154132
framework: {
155133
name: "@storybook/web-components-webpack5",
156-
options: {},
157134
},
158135
features: {
159136
/* Code splitting flag; load stories on-demand */
160137
storyStoreV7: true,
161138
/* Builds stories.json to help with on-demand loading */
162139
buildStoriesJson: true,
140+
lazyCompilation: true,
141+
fsCache: true,
163142
},
164-
// refs: {
165-
// 'swc': {
166-
// title: 'Spectrum Web Components',
167-
// url: 'https://opensource.adobe.com/spectrum-web-components/storybook/',
168-
// expanded: false,
169-
// },
170-
// },
171143
docs: {
172144
autodocs: true, // see below for alternatives
173145
defaultName: "Docs", // set to change the name of generated docs entries

.storybook/package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"dependencies": {
1313
"@adobe/spectrum-css-workflow-icons": "^1.5.4",
1414
"@spectrum-css/expressvars": "^3.0.9",
15-
"@spectrum-css/site": "^4.0.4",
1615
"@spectrum-css/tokens": "^13.0.8",
1716
"@spectrum-css/ui-icons": "^1.1.1",
1817
"@spectrum-css/vars": "^9.0.8"
@@ -21,7 +20,6 @@
2120
"@babel/core": "^7.22.1",
2221
"@chromaui/addon-visual-tests": "^0.0.124",
2322
"@etchteam/storybook-addon-status": "^4.2.4",
24-
"@spectrum-css/component-builder": "^4.0.21",
2523
"@storybook/addon-a11y": "^7.6.8",
2624
"@storybook/addon-actions": "~7.5",
2725
"@storybook/addon-console": "^1.2.3",
@@ -44,12 +42,8 @@
4442
"file-loader": "6.2.0",
4543
"lit": "^3.1.1",
4644
"lodash-es": "^4.17.21",
47-
"postcss": "^7.0.36",
48-
"postcss-class-prefix": "^0.3.0",
49-
"postcss-loader": "^4.0.0",
50-
"postcss-prefix-selector": "^1.16.0",
51-
"postcss-selector-replace": "^1.0.2",
52-
"postcss-warn-cleaner": "^0.1.9",
45+
"postcss": "^8.4.33",
46+
"postcss-loader": "^7.3.4",
5347
"prettier": "^2.8.8",
5448
"raw-loader": "^4.0.2",
5549
"react": "^18.0.0",

.storybook/postcss.config.js

Lines changed: 0 additions & 99 deletions
This file was deleted.

.storybook/project.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
"{projectRoot}/*.{js,html}"
88
]
99
},
10-
"implicitDependencies": [
11-
"@spectrum-css/*",
12-
"!@spectrum-css/generator",
13-
"!@spectrum-css/bundle-builder",
14-
"!@spectrum-css/component-builder",
15-
"!@spectrum-css/component-builder-simple"
16-
],
1710
"targets": {
1811
"clean": {
1912
"cache": true,
@@ -64,7 +57,6 @@
6457
"{projectRoot}/decorators",
6558
"{projectRoot}/*.js",
6659
"{projectRoot}/*.html",
67-
"{workspaceRoot}/components/*/dist",
6860
{ "externalDependencies": ["storybook"] },
6961
{ "env": "WATCH_MODE" }
7062
],

components/accordion/gulpfile.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/actionbar/gulpfile.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/actionbutton/gulpfile.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/actionbutton/metadata/mods.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
| `--mod-actionbutton-icon-size` |
4848
| `--mod-actionbutton-label-color` |
4949
| `--mod-actionbutton-min-width` |
50-
| `--mod-actionbutton-static-content-color` |
5150
| `--mod-actionbutton-text-to-visual` |
5251
| `--mod-animation-duration-100` |
5352
| `--mod-button-animation-duration` |

0 commit comments

Comments
 (0)