Skip to content

Commit ba211da

Browse files
committed
feat(ui-components): prepublish
1 parent ab0ba1d commit ba211da

File tree

15 files changed

+387
-176
lines changed

15 files changed

+387
-176
lines changed

.github/workflows/publish-packages.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,14 @@ jobs:
119119
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
120120
run: |
121121
# Create a unique version using the commit SHA as a prerelease identifier
122-
# This ensures we can publish multiple times from the same codebase with unique versions
123122
npm version --no-git-tag-version 1.0.1-$COMMIT_SHA
124-
# Publish the package to the npm registry with public access flag
125-
pnpm publish --access public --no-git-checks
123+
124+
# Check if a custom publish script exists in package.json
125+
if jq -e '.scripts.publish' package.json > /dev/null; then
126+
pnpm run publish
127+
else
128+
pnpm publish --access public --no-git-checks
129+
fi
126130
127131
- name: Notify on Manual Release
128132
if: ${{ github.event_name == 'workflow_dispatch' }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ apps/site/public/blog-data.json
1717
junit.xml
1818
lcov.info
1919

20+
# Distributed Files
21+
dist
22+
2023
# Storybook
2124
storybook-static
2225
build-storybook.log

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ CODEOWNERS
3939
# Public Folders
4040
apps/site/public
4141

42+
# Distributed Files
43+
dist
44+
4245
# Prettier's Handlebar parser is limited and chokes on some syntax features
4346
# https://github.com/prettier/prettier/issues/11834
4447
scripts/release-post/template.hbs

apps/site/styles/effects.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@reference "@node-core/ui-components/styles/index.css";
2+
13
@utility turtle {
24
@apply animate-surf
35
absolute

apps/site/styles/locales.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@reference "@node-core/ui-components/styles/index.css";
2+
13
/**
24
* To enhance readability for Korean users, line spacing is increased,
35
* line breaks in the middle of words are prevented, and long words are

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default [
1818
'**/.open-next',
1919
'test-results',
2020
'playwright-report',
21+
'dist',
2122
],
2223
},
2324
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
storybook-static
2+
dist

packages/ui-components/package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
]
1212
},
1313
"scripts": {
14+
"compile:ts": "tsc",
15+
"compile:css": "postcss --dir dist --base src \"src/**/*.css\"",
16+
"compile": "node --run compile:ts && node --run compile:css",
17+
"publish": "node --run compile && node scripts/publish.mjs",
1418
"lint": "turbo run lint:js lint:css",
1519
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
1620
"lint:fix": "node --run lint -- -- --fix",
@@ -33,13 +37,13 @@
3337
"@radix-ui/react-tabs": "~1.1.12",
3438
"@radix-ui/react-toast": "~1.2.14",
3539
"@radix-ui/react-tooltip": "~1.2.7",
36-
"@tailwindcss/postcss": "~4.1.11",
3740
"@vcarl/remark-headings": "~0.1.0",
38-
"classnames": "catalog:",
39-
"postcss-calc": "^10.1.1",
40-
"tailwindcss": "catalog:"
41+
"classnames": "catalog:"
4142
},
4243
"devDependencies": {
44+
"@tailwindcss/postcss": "~4.1.11",
45+
"postcss-calc": "^10.1.1",
46+
"tailwindcss": "catalog:",
4347
"@storybook/addon-styling-webpack": "^2.0.0",
4448
"@storybook/addon-themes": "^9.0.15",
4549
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
@@ -53,6 +57,7 @@
5357
"eslint-plugin-react": "~7.37.4",
5458
"eslint-plugin-storybook": "~9.0.3",
5559
"global-jsdom": "^26.0.0",
60+
"postcss-cli": "^11.0.1",
5661
"postcss-loader": "~8.1.1",
5762
"react": "catalog:",
5863
"storybook": "^9.0.15",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { spawnSync } from 'node:child_process';
2+
import { writeFile } from 'node:fs/promises';
3+
4+
import pkg from '../package.json' with { type: 'json' };
5+
6+
/* eslint-disable @typescript-eslint/no-unused-vars */
7+
const { devDependencies, exports, ...cleanedPkg } = pkg;
8+
cleanedPkg.imports = {
9+
...pkg.imports,
10+
'#ui/*': ['./dist/*'],
11+
};
12+
13+
await writeFile(
14+
'dist/package.json',
15+
JSON.stringify(cleanedPkg, null, 2),
16+
'utf8'
17+
);
18+
spawnSync('pnpm', ['publish'], { cwd: 'dist', stdio: 'inherit' });
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
* {
2-
@apply subpixel-antialiased;
3-
}
1+
@reference "tailwindcss";
2+
@reference "./theme.css";
43

5-
html,
6-
body {
7-
@apply h-full;
8-
}
4+
@layer utilities {
5+
* {
6+
@apply subpixel-antialiased;
7+
}
8+
9+
html,
10+
body {
11+
@apply h-full;
12+
}
913

10-
body {
11-
@apply font-open-sans
12-
bg-white
13-
text-neutral-950
14-
motion-safe:scroll-smooth
15-
dark:bg-neutral-950
16-
dark:text-white;
14+
body {
15+
@apply font-open-sans
16+
bg-white
17+
text-neutral-950
18+
motion-safe:scroll-smooth
19+
dark:bg-neutral-950
20+
dark:text-white;
21+
}
1722
}

0 commit comments

Comments
 (0)