Skip to content

Commit 78edc25

Browse files
authored
chore(ui): reduce prod deps (#8955)
* chore(ui): reduce prod deps * fixup! * fixup!
1 parent e3dbfbb commit 78edc25

12 files changed

Lines changed: 69 additions & 67 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ jobs:
4444
with:
4545
pnpm: true
4646
use-version-file: true
47-
# We only want to install required production packages
48-
install-flags: --prod
4947

5048
- name: Use GNU tar instead BSD tar
5149
# This ensures that we use GNU `tar` which is more efficient for extracting caches's

apps/site/.stylelintrc.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
plugins: [
2727
'stylelint-order',
2828
'stylelint-selector-bem-pattern',
29-
'@node-core/ui-components/stylelint/one-utility-class-per-line.mjs',
29+
'@node-core/ui-components/src/stylelint/one-utility-class-per-line.mjs',
3030
],
3131
rules: {
3232
// Enforces Element Class Names to be camelCase

apps/site/styles/index.css

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
* @see https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
77
*/
88

9-
@import '@node-core/ui-components/styles/index.css';
9+
@import 'tailwindcss';
10+
@import '@node-core/ui-components/src/styles/index.css';
1011
@import '@node-core/rehype-shiki/index.css';
11-
@import './locales.css';
12+
13+
/**
14+
* To enhance readability for Korean users, line spacing is increased,
15+
* line breaks in the middle of words are prevented, and long words are
16+
* managed to avoid disrupting the layout.
17+
*/
18+
html[lang='ko'] {
19+
@apply leading-7
20+
break-words
21+
break-keep;
22+
}

apps/site/styles/locales.css

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

apps/site/turbo.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"extends": ["//"],
44
"tasks": {
55
"dev": {
6-
"dependsOn": ["build:blog-data"],
6+
"dependsOn": ["build:blog-data", "build:twoslash-fsmap", "^build"],
77
"cache": false,
88
"persistent": true,
99
"env": [
@@ -115,7 +115,7 @@
115115
"cache": false
116116
},
117117
"test:unit": {
118-
"dependsOn": ["build:blog-data"],
118+
"dependsOn": ["build:blog-data", "build:twoslash-fsmap", "^build"],
119119
"inputs": [
120120
"{app,components,hooks,i18n,layouts,middlewares,pages,providers,types,util}/**/*.{ts,tsx,mjs}",
121121
"{app,components,layouts,pages,styles}/**/*.css",
@@ -142,7 +142,7 @@
142142
"outputs": ["generated/twoslash-fsmap.json"]
143143
},
144144
"cloudflare:build:worker": {
145-
"dependsOn": ["build:blog-data", "build:twoslash-fsmap"],
145+
"dependsOn": ["build:blog-data", "build:twoslash-fsmap", "^build"],
146146
"inputs": [
147147
"{app,components,hooks,i18n,layouts,middlewares,pages,providers,types,util}/**/*.{ts,tsx}",
148148
"{app,components,layouts,pages,styles}/**/*.css",

apps/site/vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"$schema": "https://openapi.vercel.sh/vercel.json",
3-
"installCommand": "pnpm install --prod --frozen-lockfile",
3+
"installCommand": "pnpm install --frozen-lockfile",
44
"ignoreCommand": "[[ \"$VERCEL_GIT_COMMIT_REF\" =~ \"^dependabot/.*\" || \"$VERCEL_GIT_COMMIT_REF\" =~ \"^gh-readonly-queue/.*\" ]]"
55
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"name": "Node.js Website Team and Contributors"
1414
},
1515
"scripts": {
16-
"compile": "turbo compile",
1716
"build": "turbo build",
1817
"cloudflare:deploy": "turbo cloudflare:deploy",
1918
"cloudflare:preview": "turbo cloudflare:preview",

packages/rehype-shiki/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"directory": "packages/rehype-shiki"
2121
},
2222
"scripts": {
23-
"compile:ts": "tsc",
24-
"compile": "node --run compile:ts",
25-
"release": "node --run compile",
23+
"build:ts": "tsc",
24+
"build": "node --run build:ts",
25+
"release": "node --run build",
2626
"lint": "node --run lint:js",
2727
"lint:fix": "node --run lint:js:fix",
2828
"lint:js": "eslint \"**/*.mjs\"",

packages/ui-components/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ compiled outputs and keep them updated while you work.
1717
```bash
1818
# From nodejs.org/packages/ui-components
1919
pnpm install
20-
node --run compile:watch
20+
node --run build:watch
2121

2222
# In another terminal, still in nodejs.org/packages/ui-components
2323
npm link
@@ -26,5 +26,5 @@ npm link
2626
npm link @node-core/ui-components
2727
```
2828

29-
The `compile:watch` script keeps `dist/` up to date so consumers resolve compiled
29+
The `build:watch` script keeps `dist/` up to date so consumers resolve compiled
3030
CSS and JavaScript instead of the raw Tailwind source.

packages/ui-components/package.json

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,48 @@
11
{
22
"name": "@node-core/ui-components",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"type": "module",
55
"exports": {
66
"./*": {
7-
"rolldown": [
8-
"./dist/*",
9-
"./dist/*.js",
10-
"./dist/*/index.js"
11-
],
12-
"default": [
7+
"types": [
138
"./src/*",
149
"./src/*.tsx",
1510
"./src/*/index.tsx",
1611
"./src/*.ts",
1712
"./src/*/index.ts"
13+
],
14+
"default": [
15+
"./dist/*",
16+
"./dist/*.js",
17+
"./dist/*/index.js"
1818
]
19-
}
19+
},
20+
"./src/*": [
21+
"./src/*",
22+
"./src/*.tsx",
23+
"./src/*/index.tsx",
24+
"./src/*.ts",
25+
"./src/*/index.ts"
26+
]
2027
},
2128
"repository": {
2229
"type": "git",
2330
"url": "https://github.com/nodejs/nodejs.org",
2431
"directory": "packages/ui-components"
2532
},
2633
"scripts": {
27-
"compile:ts": "tsc",
28-
"compile:css": "postcss --dir dist --base src \"src/**/*.module.css\" src/styles/index.css",
29-
"compile": "node --run compile:ts && node --run compile:css",
30-
"compile:watch": "concurrently -k \"node --run compile:ts -- --watch\" \"node --run compile:css -- --watch\"",
31-
"release": "node --run compile",
34+
"build": "node --run build:ts && node --run build:css",
35+
"build:css": "postcss --dir dist --base src \"src/**/*.module.css\" src/styles/index.css",
36+
"build:ts": "tsc",
37+
"build:watch": "concurrently -k \"node --run build:ts -- --watch\" \"node --run build:css -- --watch\"",
3238
"lint": "node --run lint:js && node --run lint:css",
3339
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
3440
"lint:css:fix": "node --run lint:css -- --fix",
3541
"lint:fix": "node --run lint:js:fix && node --run lint:css:fix",
3642
"lint:js": "eslint \"**/*.{js,mjs,ts,tsx}\"",
3743
"lint:js:fix": "node --run lint:js -- --fix",
3844
"lint:types": "tsc --noEmit",
45+
"release": "node --run build",
3946
"storybook": "cross-env NODE_NO_WARNINGS=1 storybook dev -p 6006 --quiet",
4047
"storybook:build": "cross-env NODE_NO_WARNINGS=1 storybook build --quiet --webpack-stats-json",
4148
"test": "node --run test:unit",
@@ -54,15 +61,9 @@
5461
"@radix-ui/react-separator": "^1.1.8",
5562
"@radix-ui/react-tabs": "^1.1.13",
5663
"@radix-ui/react-tooltip": "^1.2.8",
57-
"@tailwindcss/postcss": "~4.3.0",
58-
"@types/react": "catalog:",
5964
"@vcarl/remark-headings": "~0.1.0",
6065
"classnames": "catalog:",
61-
"postcss-calc": "10.1.1",
62-
"postcss-cli": "11.0.1",
63-
"react": "catalog:",
64-
"tailwindcss": "catalog:",
65-
"typescript": "catalog:"
66+
"react": "catalog:"
6667
},
6768
"devDependencies": {
6869
"@eslint-react/eslint-plugin": "~5.8.6",
@@ -71,23 +72,29 @@
7172
"@storybook/addon-themes": "~10.4.1",
7273
"@storybook/addon-webpack5-compiler-swc": "~4.0.3",
7374
"@storybook/react-webpack5": "~10.4.1",
75+
"@tailwindcss/postcss": "~4.3.0",
7476
"@testing-library/user-event": "~14.6.1",
7577
"@types/node": "catalog:",
78+
"@types/react": "catalog:",
7679
"concurrently": "9.2.1",
7780
"cross-env": "catalog:",
7881
"css-loader": "7.1.4",
7982
"eslint-plugin-react": "7.37.5",
8083
"eslint-plugin-react-hooks": "7.1.1",
8184
"eslint-plugin-storybook": "10.3.3",
8285
"global-jsdom": "29.0.0",
86+
"postcss-calc": "~10.1.1",
87+
"postcss-cli": "^11.0.1",
8388
"postcss-loader": "8.2.1",
8489
"storybook": "~10.4.1",
8590
"style-loader": "4.0.0",
8691
"stylelint": "17.9.1",
8792
"stylelint-config-standard": "40.0.0",
8893
"stylelint-order": "8.1.1",
8994
"stylelint-selector-bem-pattern": "4.0.1",
90-
"tsx": "4.22.3"
95+
"tailwindcss": "catalog:",
96+
"tsx": "4.22.3",
97+
"typescript": "catalog:"
9198
},
9299
"imports": {
93100
"#ui/*": {

0 commit comments

Comments
 (0)