-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: use rollup to build JS and styles - To better support server-side rendering - By producing a single .css file - Instead of delegating css module processing to consuming apps * refactor(rollup): remove spritemap and commonjs from config * build: remove styles build from main build command * refactor: import css variables into index * build(rollup): mark dependencies as external (#1558) * build(rollup): mark dependencies as external * build(rollup): use node resolve plugin * docs(build): explain rollup external option * build!: generate cjs and type declarations (#1572) * build: generate cjs and esm, separate types build * build: add sourcemaps and add declaration back to tsconfig * build: cjs and js in the same output * build: add conditional exports * build: remove build types script * refactor: revert tw config to ts * build: bump target to es2018 and grep for tslib * chore(release): 12.0.0-alpha.0 * refactor: dry css exports * build!: remove some tokens from build (#1581) * refactor: remove references to unexported files * build!: no longer include some tokens in build * refactor: remove unused commonjs plugin (#1582) * chore(release): 12.0.0-alpha.1 * refactor: use named import for clsx * chore: remove rollup plugin commonjs * Revert "refactor: use named import for clsx" This reverts commit d58182b. * docs: explicate tslib grep * fix: no need for ts expect error --------- Co-authored-by: Andrew Huth <[email protected]>
- Loading branch information
Showing
14 changed files
with
849 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
{ | ||
"name": "@chanzuckerberg/eds", | ||
"version": "11.1.1", | ||
"version": "12.0.0-alpha.1", | ||
"description": "The React-powered design system library for Chan Zuckerberg Initiative education web applications", | ||
"author": "CZI <[email protected]>", | ||
"homepage": "https://github.com/chanzuckerberg/edu-design-system", | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./lib/index.js", | ||
"require": "./lib/index.cjs" | ||
}, | ||
"./index.css": "./lib/index.css", | ||
"./fonts.css": "./lib/tokens/fonts.css", | ||
"./tailwind.config": "./tailwind.config.ts" | ||
}, | ||
"types": "lib/index.d.ts", | ||
"sideEffects": [ | ||
"lib/tokens/css/variables.css", | ||
"lib/index.css", | ||
"lib/tokens/fonts.css" | ||
], | ||
"publishConfig": { | ||
|
@@ -25,15 +34,14 @@ | |
"tailwind.config.*" | ||
], | ||
"scripts": { | ||
"build": "yarn build:clean && yarn build:tokens && yarn build:js && yarn build:styles && yarn copy-fonts-to-lib", | ||
"build": "yarn build:clean && yarn build:tokens && yarn build:js && yarn copy-fonts-to-lib", | ||
"build:clean": "rm -rf lib/", | ||
"build:tokens": "rm -rf src/tokens-dist/ && node ./style-dictionary.config.js && yarn copy-tokens-to-lib && yarn prettier-tokens-dist", | ||
"build:js": "tsc --project tsconfig.build.json", | ||
"build:tokens": "rm -rf src/tokens-dist/ && node ./style-dictionary.config.js && yarn prettier-tokens-dist", | ||
"build:js": "rollup --config", | ||
"build:storybook": "build-storybook -o storybook-static -s src/design-tokens/tier-1-definitions/fonts", | ||
"build:styles": "postcss \"src/components/**/*.css\" --dir lib/ --base src/ --verbose", | ||
"chromatic": "chromatic", | ||
"copy-fonts-to-lib": "copyfiles -u 3 src/design-tokens/tier-1-definitions/fonts.css src/design-tokens/tier-1-definitions/fonts/**/* lib/tokens", | ||
"copy-tokens-to-lib": "copyfiles -u 2 src/tokens-dist/**/* lib/tokens", | ||
"create-component": "plop", | ||
"deploy:docs": "storybook-to-ghpages --ci", | ||
"lint": "yarn run lint:styles && yarn run lint:scripts", | ||
|
@@ -90,8 +98,6 @@ | |
"react-popper": "^2.3.0", | ||
"react-portal": "^4.2.2" | ||
}, | ||
"entry": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"devDependencies": { | ||
"@chanzuckerberg/axe-storybook-testing": "^6.3.1", | ||
"@chanzuckerberg/eslint-config-edu-js": "^1.1.0", | ||
|
@@ -103,6 +109,8 @@ | |
"@commitlint/cli": "^17.6.1", | ||
"@commitlint/config-conventional": "^17.6.1", | ||
"@geometricpanda/storybook-addon-badges": "^1.1.1", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-typescript": "^11.0.0", | ||
"@size-limit/file": "^8.2.4", | ||
"@storybook/addon-a11y": "^6.5.16", | ||
"@storybook/addon-docs": "^6.5.16", | ||
|
@@ -154,6 +162,8 @@ | |
"prettier": "^2.8.4", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"rollup": "^3.20.0", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"size-limit": "^8.2.4", | ||
"snake-case": "^3.0.4", | ||
"standard-version": "^9.5.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export default { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
dir: 'lib', | ||
format: 'es', | ||
preserveModules: true, | ||
preserveModulesRoot: 'src', | ||
sourcemap: true, | ||
}, | ||
{ | ||
dir: 'lib', | ||
format: 'cjs', | ||
preserveModules: true, | ||
preserveModulesRoot: 'src', | ||
sourcemap: true, | ||
entryFileNames: '[name].cjs', | ||
}, | ||
], | ||
/** | ||
* With the nodeResolve plugin, this marks all EDS node_modules as external, aka provided by the consumer. | ||
* Since EDS is not imported directly into a web <script>, package managers (such as npm or yarn) | ||
* will install the deps listed in EDS package.json and hence won't need to be included in the bundle. | ||
*/ | ||
external: [/node_modules/], | ||
plugins: [ | ||
nodeResolve(), | ||
postcss({ | ||
extract: true, | ||
modules: true, | ||
}), | ||
typescript({ | ||
tsconfig: 'tsconfig.build.json', | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.