Skip to content

Commit

Permalink
Merge pull request #1423 from system-ui/preconstruct-2
Browse files Browse the repository at this point in the history
WIP: Build packages with Preconstruct 2
  • Loading branch information
hasparus authored Apr 5, 2021
2 parents ba0219f + 6304630 commit 3d0dfed
Show file tree
Hide file tree
Showing 133 changed files with 697 additions and 1,090 deletions.
1 change: 0 additions & 1 deletion deprecated/chrome/babel.config.js

This file was deleted.

12 changes: 5 additions & 7 deletions deprecated/chrome/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"name": "@theme-ui/chrome",
"version": "0.5.0-alpha.0",
"main": "index.js",
"main": "dist/chrome.cjs.js",
"author": "Brent Jackson",
"license": "MIT",
"scripts": {
Expand All @@ -18,7 +18,6 @@
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@emotion/react": "^11.1.1",
"@theme-ui/editor": "^0.5.0-alpha.0",
"babel-loader": "^8.0.6",
"copy-to-clipboard": "^3.2.0",
Expand All @@ -29,10 +28,9 @@
"stringify-object": "^3.3.0",
"theme-ui": "^0.5.0-alpha.0",
"webpack": "^4.33.0",
"webpack-cli": "^3.3.4"
"webpack-cli": "^3.3.4",
"@emotion/react": "^11.1.1"
},
"devDependencies": {
"@theme-ui/css": "^0.5.0-alpha.0"
},
"gitHead": "bfd026cae085f377ca537de897dc43233d50f5d5"
"gitHead": "bfd026cae085f377ca537de897dc43233d50f5d5",
"module": "dist/chrome.esm.js"
}
8 changes: 0 additions & 8 deletions deprecated/chrome/tsconfig.json

This file was deleted.

17 changes: 0 additions & 17 deletions deprecated/chrome/webpack.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/gatsby-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"husky": ">=4.0.7",
"jest": "^24.8.0",
"lint-staged": "10",
"react-test-renderer": "^16.8.6"
"react-test-renderer": "^17.0.1"
}
}
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const config = {
statements: 90,
},
},
modulePathIgnorePatterns: ['packages/.*/dist'],
// projects: ['<rootDir>/packages/*'],
snapshotSerializers: ['@emotion/jest/serializer'],
setupFiles: ['jest-canvas-mock'],
transform: {
Expand Down
30 changes: 19 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"private": true,
"scripts": {
"prepare": "lerna run prepare",
"start": "yarn workspace docs start",
"build": "yarn workspace docs build",
"serve": "yarn workspace docs serve --port 8000",
"build": "preconstruct build",
"clean": "lerna run clean && rimraf packages/*/{dist,rts2_cache*}",
"format": "prettier --write \"**/*.js{,on}\" \"**/*.md\" \"**/*.mdx\"",
"format": "prettier --write \"**/*.{ts,js,json}\" \"**/*.md\" \"**/*.mdx\"",
"test": "jest",
"typecheck": "lerna run typecheck",
"typecheck": "tsc --noEmit",
"typecheck:tests": "tsc --noEmit -P ./tsconfig.test.json",
"logo": "yarn workspace docs logo",
"postinstall": "preconstruct dev",
"version:bump": "lerna version",
"version:bump-next": "lerna version prerelease --preid alpha --exact",
"dev:chrome": "yarn workspace @theme-ui/chrome dev",
"dev:editor": "yarn workspace @theme-ui/editor dev",
"release": "yarn clean && yarn prepare && auto shipit -v",
"release": "yarn clean && yarn build && auto shipit -v",
"release-manual": "yarn prerelease-manual && lerna publish from-package --dist-tag next --pre-dist-tag next",
"prerelease-manual": "yarn clean && yarn prepare && yarn typecheck && yarn test --coverage",
"prerelease-manual": "yarn clean && yarn build && yarn typecheck && yarn test --coverage",
"bump-version": "lerna version",
"bump-version-next": "lerna version prerelease --preid alpha --exact --force-publish",
"all-contributors:check": "./scripts/all-contributors-check.js",
Expand Down Expand Up @@ -52,16 +52,24 @@
"jest-mock-console": "^1.0.1",
"lerna": "^3.14.1",
"lint-staged": "10",
"microbundle": "^0.13.0",
"prettier": "^2.2.0",
"react-test-renderer": "^17.0.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.4.4",
"typescript": "^4"
"typescript": "^4",
"@types/node": "^14.14.20",
"@preconstruct/cli": "^2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
},
"preconstruct": {
"packages": [
"packages/*",
"!packages/docs"
]
},
"name": "@theme-ui/monorepo"
}
12 changes: 4 additions & 8 deletions packages/color-modes/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{
"name": "@theme-ui/color-modes",
"version": "0.6.1",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "dist/theme-ui-color-modes.cjs.js",
"module": "dist/theme-ui-color-modes.esm.js",
"types": "dist/theme-ui-color-modes.cjs.d.ts",
"source": "src/index.tsx",
"sideEffects": false,
"scripts": {
"prepare": "microbundle --no-compress",
"watch": "microbundle watch --no-compress",
"typecheck": "tsc --noEmit"
},
"scripts": {},
"repository": "system-ui/theme-ui",
"author": "Brent Jackson",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/color-modes/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ test('does not initialize mode based on localStorage if useLocalStorage is set t
})

test('retains initial context', () => {
let context: ThemeUIContextValue
let context: ThemeUIContextValue | undefined = undefined;
const Consumer = () => {
context = useThemeUI()
return null
Expand Down
7 changes: 0 additions & 7 deletions packages/color-modes/tsconfig.json

This file was deleted.

11 changes: 4 additions & 7 deletions packages/color/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
"name": "@theme-ui/color",
"version": "0.6.1",
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"scripts": {
"prepare": "microbundle --no-compress",
"watch": "microbundle watch --no-compress"
},
"main": "dist/theme-ui-color.cjs.js",
"module": "dist/theme-ui-color.esm.js",
"types": "dist/theme-ui-color.cjs.d.ts",
"scripts": {},
"dependencies": {
"@theme-ui/css": "0.6.0",
"polished": "^4.0.5"
Expand Down
4 changes: 0 additions & 4 deletions packages/color/tsconfig.json

This file was deleted.

23 changes: 9 additions & 14 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
{
"name": "@theme-ui/components",
"version": "0.6.1",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"main": "dist/theme-ui-components.cjs.js",
"module": "dist/theme-ui-components.esm.js",
"types": "index.d.ts",
"sideEffects": false,
"scripts": {
"prepare": "microbundle --no-compress --jsx React.createElement",
"watch": "microbundle watch --no-compress --jsx React.createElement",
"typecheck": "tsc --noEmit"
},
"scripts": {},
"dependencies": {
"@emotion/react": "^11.1.1",
"@emotion/styled": "^11.0.0",
"@styled-system/color": "^5.1.2",
"@styled-system/should-forward-prop": "^5.1.2",
"@styled-system/space": "^5.1.2",
"@theme-ui/css": "0.6.0",
"@types/styled-system": "^5.1.10"
"@theme-ui/css": "^0.6.0",
"@types/styled-system": "^5.1.10",
"@emotion/react": "^11.1.1"
},
"peerDependencies": {
"react": "^16.14.0 || ^17.0.0"
},
"devDependencies": {
"react": "^17.0.1"
},
"publishConfig": {
"access": "public"
},
"author": "Brent Jackson <jxnblk@gmail.com>",
"license": "MIT",
"gitHead": "621199460fa3bdb0100748441e62517b7529b8c8"
"devDependencies": {
"react": "^17.0.1"
}
}
10 changes: 0 additions & 10 deletions packages/components/tsconfig.json

This file was deleted.

6 changes: 3 additions & 3 deletions packages/core/jsx-dev-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@theme-ui/core-jsx-dev-runtime",
"source": "../src/jsx-dev-runtime.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/jsx-dev-runtime.d.ts",
"main": "dist/theme-ui-core-jsx-dev-runtime.cjs.js",
"module": "dist/theme-ui-core-jsx-dev-runtime.esm.js",
"types": "dist/theme-ui-core-jsx-dev-runtime.cjs.d.ts",
"dependencies": {
"@emotion/react": "*",
"@theme-ui/parse-props": "*",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/jsx-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@theme-ui/core-jsx-runtime",
"source": "../src/jsx-runtime.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/jsx-runtime.d.ts",
"main": "dist/theme-ui-core-jsx-runtime.cjs.js",
"module": "dist/theme-ui-core-jsx-runtime.esm.js",
"types": "dist/theme-ui-core-jsx-runtime.cjs.d.ts",
"dependencies": {
"@emotion/react": "*",
"@theme-ui/parse-props": "*",
Expand Down
25 changes: 12 additions & 13 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,11 @@
"name": "@theme-ui/core",
"version": "0.6.1",
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "dist/theme-ui-core.cjs.js",
"module": "dist/theme-ui-core.esm.js",
"types": "dist/theme-ui-core.cjs.d.ts",
"sideEffects": false,
"scripts": {
"prepare": "yarn prepare:index && yarn prepare:jsx-runtime && yarn prepare:jsx-dev-runtime",
"prepare:index": "microbundle --no-compress --tsconfig tsconfig.json",
"prepare:jsx-runtime": "microbundle --no-compress --tsconfig tsconfig.json --cwd jsx-runtime",
"prepare:jsx-dev-runtime": "microbundle --no-compress --tsconfig tsconfig.json --cwd jsx-dev-runtime",
"watch": "microbundle watch --no-compress --tsconfig tsconfig.json",
"typecheck": "tsc --noEmit"
},
"scripts": {},
"repository": "system-ui/theme-ui",
"author": "Brent Jackson",
"license": "MIT",
Expand All @@ -22,7 +15,7 @@
},
"dependencies": {
"@emotion/react": "^11.1.1",
"@theme-ui/css": "0.6.0",
"@theme-ui/css": "^0.6.0",
"@theme-ui/parse-props": "^0.6.1",
"deepmerge": "^4.2.2"
},
Expand All @@ -33,5 +26,11 @@
"@types/react": "^17.0.0",
"react": "^17.0.1"
},
"gitHead": "621199460fa3bdb0100748441e62517b7529b8c8"
"preconstruct": {
"entrypoints": [
"index.ts",
"jsx-dev-runtime.ts",
"jsx-runtime.ts"
]
}
}
8 changes: 0 additions & 8 deletions packages/core/tsconfig.json

This file was deleted.

15 changes: 5 additions & 10 deletions packages/css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,18 @@
"name": "@theme-ui/css",
"version": "0.6.0",
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"main": "dist/theme-ui-css.cjs.js",
"module": "dist/theme-ui-css.esm.js",
"sideEffects": false,
"scripts": {
"prepare": "microbundle --no-compress --tsconfig tsconfig.json",
"watch": "microbundle watch --no-compress --tsconfig tsconfig.json",
"typecheck": "tsc --noEmit"
},
"scripts": {},
"author": "Brent Jackson",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@emotion/react": "^11.1.1",
"csstype": "^3.0.5"
"csstype": "^3.0.5",
"@emotion/react": "^11.1.1"
},
"gitHead": "621199460fa3bdb0100748441e62517b7529b8c8"
}
4 changes: 2 additions & 2 deletions packages/css/test/errors-and-inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Theme', () => {
declare module 'theme-ui' {
interface Theme {
syntaxHighlighting: MySyntaxHighlightingTheme
syntaxHighlighting?: MySyntaxHighlightingTheme
}
}
Expand All @@ -82,7 +82,7 @@ describe('Theme', () => {
},
}
const syntaxHighlighting = theme.syntaxHighlighting
const syntaxHighlighting = theme.syntaxHighlighting!
`).toInfer('syntaxHighlighting', 'MySyntaxHighlightingTheme')
})

Expand Down
2 changes: 1 addition & 1 deletion packages/css/test/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe(__internalGetUseRootStyles, () => {
(value) => {
const theme: Theme = {
useBodyStyles: value,
useRootStyles: null,
useRootStyles: null as any as undefined,
}

expect(__internalGetUseRootStyles(theme)).toStrictEqual({
Expand Down
4 changes: 0 additions & 4 deletions packages/css/tsconfig.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/custom-properties/babel.config.js

This file was deleted.

Loading

0 comments on commit 3d0dfed

Please sign in to comment.