Skip to content

Commit 1d836ff

Browse files
committed
chore: restructure packages and migrate to pnpm
1 parent 95cac45 commit 1d836ff

File tree

286 files changed

+19153
-21242
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

+19153
-21242
lines changed

.knip.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
"ignoreDependencies": [
77
"@md3-ui/core",
88
"@md3-ui/test-utils",
9-
"@preconstruct/hook",
109
"@svgr/plugin-jsx",
11-
"prettier-plugin-organize-imports",
12-
"webpack",
13-
"yarn-deduplicate"
10+
"prettier-plugin-organize-imports"
1411
],
1512
"rules": {
1613
"unresolved": "off"

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
strict-peer-dependencies=false
2+
enable-pre-post-scripts=true

.storybook/main.ts

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,51 @@
1-
import { StorybookConfig } from "@storybook/react-webpack5"
2-
import webpack from "webpack"
1+
import { StorybookConfig } from "@storybook/react-vite"
2+
import { mergeConfig } from "vite"
3+
4+
const extensions = [
5+
".web.js",
6+
".js",
7+
".web.jsx",
8+
".jsx",
9+
".web.ts",
10+
".ts",
11+
".web.tsx",
12+
".tsx",
13+
".json",
14+
]
315

416
const config: StorybookConfig = {
5-
stories: ["../packages/*/stories/*.stories.tsx"],
17+
stories: ["../packages/*/src/**/*.stories.tsx"],
618
addons: [
719
"@storybook/addon-a11y",
8-
"@storybook/addon-essentials",
20+
{
21+
name: "@storybook/addon-essentials",
22+
options: {
23+
docs: false,
24+
},
25+
},
926
"storybook-addon-performance",
1027
"storybook-dark-mode",
1128
],
1229
framework: {
13-
name: "@storybook/react-webpack5",
30+
name: "@storybook/react-vite",
1431
options: {
1532
strictMode: true,
16-
builder: {
17-
fsCache: true,
18-
lazyCompilation: true,
19-
},
2033
},
2134
},
22-
webpackFinal: (config) => ({
23-
...config,
24-
plugins: [
25-
...(config.plugins ?? []),
26-
new webpack.DefinePlugin({
27-
__DEV__: JSON.stringify(true),
28-
}),
29-
],
30-
resolve: {
31-
...config.resolve,
32-
alias: {
33-
...config.resolve?.alias,
34-
"react-native": "react-native-web",
35+
viteFinal: (config) =>
36+
mergeConfig(config, {
37+
optimizeDeps: {
38+
esbuildOptions: {
39+
resolveExtensions: extensions,
40+
},
3541
},
36-
extensions: [".web.js", ".web.jsx", ".web.ts", ".web.tsx"].concat(
37-
config.resolve?.extensions ?? [],
38-
),
39-
},
40-
}),
42+
resolve: {
43+
alias: {
44+
"react-native": "react-native-web",
45+
},
46+
extensions,
47+
},
48+
}),
4149
}
4250

4351
export default config

app/metro.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ module.exports = {
1919
],
2020
// 3. Force Metro to resolve (sub)dependencies only from `nodeModulesPaths`
2121
disableHierarchicalLookup: true,
22+
unstable_enableSymlinks: true,
2223
},
2324
}

app/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
"main": "src/index.ts",
66
"dependencies": {
77
"@expo/vector-icons": "^13.0.0",
8-
"@md3-ui/core": "^0.2.1",
8+
"@md3-ui/core": "workspace:*",
99
"expo": "^49.0.13",
1010
"expo-status-bar": "~1.6.0",
1111
"react": "18.2.0",
1212
"react-dom": "18.2.0",
13-
"react-native": "0.72.5",
13+
"react-native": "0.72.6",
1414
"react-native-iphone-x-helper": "^1.3.1",
1515
"react-native-safe-area-context": "4.6.3",
16-
"react-router-native": "^6.16.0",
17-
"uuid": "^3.4.0"
16+
"react-router-native": "^6.16.0"
1817
},
1918
"devDependencies": {
2019
"babel-preset-expo": "^9.5.2",

babel.config.js

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

docs/next.config.mjs

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import nextMDX from "@next/mdx"
2-
import withPreconstruct from "@preconstruct/next"
32
import remarkEmoji from "remark-emoji"
43
import remarkGfm from "remark-gfm"
54
import remarkSlug from "remark-slug"
@@ -13,28 +12,26 @@ const withMDX = nextMDX({
1312
},
1413
})
1514

16-
export default withPreconstruct(
17-
withMDX({
18-
transpilePackages: [
19-
"react-native",
20-
"react-native-safe-area-context",
21-
"react-native-svg",
22-
"react-native-web",
23-
],
24-
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
25-
reactStrictMode: true,
26-
webpack: (config) => ({
27-
...config,
28-
resolve: {
29-
...config.resolve,
30-
alias: {
31-
...config.resolve.alias,
32-
"react-native": "react-native-web",
33-
},
34-
extensions: [".web.js", ".web.jsx", ".web.ts", ".web.tsx"].concat(
35-
config.resolve.extensions,
36-
),
15+
export default withMDX({
16+
transpilePackages: [
17+
"react-native",
18+
"react-native-safe-area-context",
19+
"react-native-svg",
20+
"react-native-web",
21+
],
22+
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
23+
reactStrictMode: true,
24+
webpack: (config) => ({
25+
...config,
26+
resolve: {
27+
...config.resolve,
28+
alias: {
29+
...config.resolve.alias,
30+
"react-native": "react-native-web",
3731
},
38-
}),
32+
extensions: [".web.js", ".web.jsx", ".web.ts", ".web.tsx"].concat(
33+
config.resolve.extensions,
34+
),
35+
},
3936
}),
40-
)
37+
})

docs/package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,27 @@
99
"start": "next start"
1010
},
1111
"dependencies": {
12-
"@md3-ui/core": "^0.2.1",
13-
"@md3-ui/icons": "^0.2.1",
14-
"@md3-ui/props-docs": "^0.2.1",
15-
"@md3-ui/utils": "^0.2.1",
12+
"@md3-ui/core": "workspace:*",
13+
"@md3-ui/icons": "workspace:*",
14+
"@md3-ui/props-docs": "workspace:*",
15+
"@md3-ui/utils": "workspace:*",
1616
"@mdx-js/loader": "^2.3.0",
1717
"@mdx-js/react": "^2.3.0",
1818
"@next/mdx": "^13.5.4",
19-
"@preconstruct/next": "^4.0.0",
2019
"copy-to-clipboard": "^3.3.3",
2120
"next": "^13.5.4",
2221
"next-seo": "^6.1.0",
2322
"prism-react-renderer": "^2.1.0",
2423
"react": "18.2.0",
2524
"react-dom": "18.2.0",
2625
"react-live": "^4.1.5",
27-
"react-native": "0.72.5",
26+
"react-native": "0.72.6",
2827
"react-native-safe-area-context": "4.6.3",
29-
"react-native-svg": "13.9.0",
28+
"react-native-svg": "13.10.0",
3029
"react-native-web": "^0.19.9",
3130
"remark-emoji": "^4.0.0",
32-
"remark-gfm": "^4.0.0",
33-
"remark-slug": "^7.0.1",
34-
"webpack": "^5.88.2"
31+
"remark-gfm": "^3.0.1",
32+
"remark-slug": "^7.0.1"
3533
},
3634
"devDependencies": {
3735
"eslint": "^8.51.0",

docs/pages/docs/components/button.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const meta = {
44
title: "Button",
55
description:
66
"Buttons help people initiate actions, from sending an email, to sharing a document, to liking a post.",
7-
package: "@md3-ui/button",
7+
package: "@md3-ui/components",
88
}
99

1010
There are five types of common buttons: elevated, filled, filled tonal,

docs/pages/docs/components/checkbox.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const meta = {
44
title: "Checkbox",
55
description:
66
"Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.",
7-
package: "@md3-ui/checkbox",
7+
package: "@md3-ui/components",
88
}
99

1010
There's one type of checkbox in Material. Use this selection control when the

0 commit comments

Comments
 (0)