Skip to content

Commit 26f3df2

Browse files
dferber90montezume
authored andcommitted
Add bundling (rollup) (#34)
* feat: first-attempt at adding rollup * feat(build-process): fix css bundling * feat(build-process): fix svg bundling ^_^ * chore(build-process): dep cleanup" * chore(build-process): fixup rollup config * feat(build-process): add messages export * chore: moved proxy exports * chore(build-process): add cjs module and script fixups Add cjs module export, rearrange npm scripts, fix for namespace exports, add cleanup rollup plugin, and copy files and folders to dist. * chore(build-process): remove thread loader from webpack config * chore: copy files from rollup * chore: inline plugins in rollup config * chore: cp -r -> -R * chore: rename demo to storybook in scripts * chore(build-process): remove remnants of thread-loader from webpack.config * chore(build-process): remove unused webpack loaders * chore(build-process): fixup deps, remove unused rollup deps * chore: disable eslint for proxy-exports dir * chore(build-systems): add cross-env for node-env setting * chore: add netlify.toml config * docs(readme): improve imports docs * chore: run prettier, adjust glob matches * chore(build-process): add rollup replace plugin for production node env setting * chore(build-process): add srync copy for orig materials * chore(build-process): remove unused proxy exports * chore(build-process): copy images as well * chore(process-build): add table-cell proxy export * chore: add script for copying files to dist folder
1 parent 8f98678 commit 26f3df2

File tree

119 files changed

+1475
-364
lines changed

Some content is hidden

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

119 files changed

+1475
-364
lines changed

β€Ž.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist/
2+
proxy_exports/**/*.js
23
node_modules/*
34
**/node_modules/*

β€Ž.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ logs
44
npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
7-
7+
**/.DS_Store
8+
dist
89
# Runtime data
910
pids
1011
*.pid
@@ -79,6 +80,3 @@ typings/
7980
.idea
8081
.vscode
8182
!.vscode/settings.json
82-
83-
# Netlify
84-
netlify.toml

β€Ž.storybook/webpack.config.js

-40
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,6 @@ module.exports = (storybookBaseConfig, configType) => {
2929
test: /\.js$/,
3030
include: sourceFolders,
3131
use: [
32-
// This loader parallelizes code compilation, it is optional but
33-
// improves compile time on larger projects
34-
Object.assign(
35-
{},
36-
{
37-
loader: require.resolve('thread-loader'),
38-
},
39-
// Keep workers alive only for development mode
40-
configType === 'PRODUCTION'
41-
? {}
42-
: {
43-
options: {
44-
poolTimeout: Infinity, // keep workers alive for more effective watch mode
45-
},
46-
}
47-
),
4832
{
4933
loader: require.resolve('babel-loader'),
5034
options: {
@@ -99,30 +83,6 @@ module.exports = (storybookBaseConfig, configType) => {
9983
},
10084
],
10185
},
102-
// For normal svg files (not icons) we should load the file normally
103-
// and simply use it as a `<img src/>`.
104-
{
105-
test: function testForNormalSvgFiles(fileName) {
106-
return (
107-
// Use this only for plain SVG.
108-
// For SVG as React components, see loader above.
109-
fileName.endsWith('.svg') && !fileName.endsWith('.react.svg')
110-
);
111-
},
112-
use: [
113-
{
114-
loader: require.resolve('svg-url-loader'),
115-
options: { noquotes: true },
116-
},
117-
],
118-
},
119-
// "url" loader works like "file" loader except that it embeds assets
120-
// smaller than specified limit in bytes as data URLs to avoid requests.
121-
// A missing `test` is equivalent to a match.
122-
{
123-
test: /\.png$/,
124-
use: [require.resolve('url-loader')],
125-
},
12686
// "postcss" loader applies autoprefixer to our CSS
12787
// "css" loader resolves paths in CSS and adds assets as dependencies.
12888
// "style" loader turns CSS into JS modules that inject <style> tags.

β€Ž.stylelintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"rule-empty-line-before": null,
2929
"value-list-comma-newline-after": null,
3030
"indentation": null,
31-
"selector-descendant-combinator-no-non-space": null
31+
"selector-descendant-combinator-no-non-space": null,
32+
"selector-combinator-space-before": null
3233
}
3334
}

β€ŽCODE_OF_CONDUCT.md

+10-10

β€ŽREADME.md

+10-5

β€Žbuttons/accessible-button/index.js

-2
This file was deleted.

β€Žbuttons/flat-button/index.js

-2
This file was deleted.

β€Žbuttons/ghost-button/index.js

-2
This file was deleted.

β€Žbuttons/icon-button/index.js

-2
This file was deleted.

β€Žbuttons/link-button/index.js

-2
This file was deleted.

β€Žbuttons/primary-button/index.js

-2
This file was deleted.

β€Žbuttons/secondary-button/index.js

-2
This file was deleted.

β€Žbuttons/secondary-icon-button/index.js

-2
This file was deleted.

β€Žcollapsible-motion/index.js

-2
This file was deleted.

β€Ždropdowns/primary-action-dropdown/index.js

-5
This file was deleted.

β€Žfield-label/index.js

-2
This file was deleted.

β€Žfields/text-field/index.js

-2
This file was deleted.

β€Žhocs/with-mouse-down-state/index.js

-2
This file was deleted.

β€Žhocs/with-mouse-over-state/index.js

-2
This file was deleted.

β€Ži18n/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
export * as en from './en.json';
2-
export * as de from './de.json';
3-
export * as es from './es.json';
1+
import * as en from './en.json';
2+
import * as de from './de.json';
3+
import * as es from './es.json';
4+
5+
export { en, de, es };

β€Žinputs/async-creatable-select-input/index.js

-4
This file was deleted.

β€Žinputs/async-select-input/index.js

-2
This file was deleted.

β€Žinputs/creatable-select-input/index.js

-2
This file was deleted.

β€Žinputs/date-input/index.js

-2
This file was deleted.

β€Žinputs/date-time-input/index.js

-2
This file was deleted.

β€Žinputs/localized-multiline-text-input/index.js

-4
This file was deleted.

β€Žinputs/localized-text-input/index.js

-2
This file was deleted.

β€Žinputs/money-input/index.js

-2
This file was deleted.

β€Žinputs/multiline-text-input/index.js

-2
This file was deleted.

β€Žinputs/number-input/index.js

-2
This file was deleted.

β€Žinputs/password-input/index.js

-2
This file was deleted.

β€Žinputs/select-input/index.js

-2
This file was deleted.

β€Žinputs/text-input/index.js

-2
This file was deleted.

β€Žinputs/time-input/index.js

-2
This file was deleted.

β€Žjest.eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ module.exports = {
88
'<rootDir>/src/**/*.js',
99
'<rootDir>/**/*.js', // for backwards compatible folders
1010
],
11-
testPathIgnorePatterns: ['<rootDir>/node_modules'],
11+
testPathIgnorePatterns: ['<rootDir>/node_modules', '<rootDir>/proxy-exports'],
1212
watchPlugins: ['jest-plugin-filename'],
1313
};

β€Žlint-staged.config.js

+29-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1+
const formatMarkdown = ['npm run format:md', 'git add'];
2+
const formatJs = [
3+
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
4+
// flag, jest does not seem correctly parse the arguments.
5+
//
6+
// No tests found related to files changed since last commit.
7+
// Run Jest without `-o` or with `--all` to run all tests.
8+
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
9+
//
10+
// For that reason, we move the `--onlyChanged` flag next to it.
11+
'npm run lint:js -- --reporters=jest-silent-reporter --onlyChanged',
12+
];
13+
const formatCss = [
14+
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
15+
// flag, jest does not seem correctly parse the arguments.
16+
//
17+
// No tests found related to files changed since last commit.
18+
// Run Jest without `-o` or with `--all` to run all tests.
19+
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
20+
//
21+
// For that reason, we move the `--onlyChanged` flag next to it.
22+
'npm run lint:css -- --reporters=jest-silent-reporter --onlyChanged',
23+
];
24+
125
module.exports = {
2-
'{.github,src,examples}/**/*.md': ['npm run format:md', 'git add'],
3-
'{src,scripts,examples,.storybook}/**/*.js': [
4-
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
5-
// flag, jest does not seem correctly parse the arguments.
6-
//
7-
// No tests found related to files changed since last commit.
8-
// Run Jest without `-o` or with `--all` to run all tests.
9-
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
10-
//
11-
// For that reason, we move the `--onlyChanged` flag next to it.
12-
'npm run lint:js -- --reporters=jest-silent-reporter --onlyChanged',
13-
],
14-
'src/**/*.css': [
15-
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
16-
// flag, jest does not seem correctly parse the arguments.
17-
//
18-
// No tests found related to files changed since last commit.
19-
// Run Jest without `-o` or with `--all` to run all tests.
20-
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
21-
//
22-
// For that reason, we move the `--onlyChanged` flag next to it.
23-
'npm run lint:css -- --reporters=jest-silent-reporter --onlyChanged',
24-
],
26+
'*.md': formatMarkdown,
27+
'{.github,.storybook,examples,src}/**/*.md': formatMarkdown,
28+
'*.js': formatJs,
29+
'{.storybook,examples,scripts,src}/**/*.js': formatJs,
30+
'{.storybook,examples,src}/**/*.css': formatCss,
2531
};

β€Žloading-spinner/index.js

-2
This file was deleted.

β€Žmaterials/borders.mod.css

-3
This file was deleted.

β€Žmaterials/colors/base-colors.mod.css

-3
This file was deleted.

β€Žmaterials/colors/colors-for-story.mod.css

-3
This file was deleted.

β€Žmaterials/grid.mod.css

-3
This file was deleted.

β€Žmaterials/media-queries.mod.css

-3
This file was deleted.

β€Žmaterials/reset.mod.css

-3
This file was deleted.

β€Žmaterials/shadows/base-shadows.mod.css

-3
This file was deleted.

β€Žmaterials/sizes.mod.css

-3
This file was deleted.

β€Žmaterials/spacings.mod.css

-3
This file was deleted.

β€Žmaterials/tokens/backgrounds.mod.css

-3
This file was deleted.

β€Žmaterials/tokens/borders.mod.css

-3
This file was deleted.

β€Žmaterials/tokens/fonts.mod.css

-3
This file was deleted.

β€Žmaterials/tokens/shadows.mod.css

-3
This file was deleted.

β€Žmaterials/tokens/sizes.mod.css

-3
This file was deleted.

β€Žmaterials/tokens/tokens.mod.css

-3
This file was deleted.

β€Žmaterials/transitions.mod.css

-3
This file was deleted.

β€Žmessages/error-message/index.js

-2
This file was deleted.

β€Žnetlify.toml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build]
2+
command = "yarn storybook:build"
3+
publish = ".public"
4+

0 commit comments

Comments
Β (0)