Skip to content

Commit d5a2467

Browse files
committed
chore: drop ui-components publishing changes
1 parent 66bb0d7 commit d5a2467

File tree

5 files changed

+50
-41
lines changed

5 files changed

+50
-41
lines changed

.github/workflows/publish-packages.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,10 @@ jobs:
116116
# Check if a custom publish script exists in package.json
117117
if jq -e '.scripts.release' package.json > /dev/null; then
118118
pnpm run release
119+
else
120+
pnpm publish --access public --no-git-checks
119121
fi
120122
121-
# Then publish the package to npm
122-
pnpm publish --access public --no-git-checks
123-
124123
- name: Notify on Manual Release
125124
if: ${{ github.event_name == 'workflow_dispatch' }}
126125
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # 2.3.3

apps/site/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"esModuleInterop": true,
1111
"module": "esnext",
1212
"moduleResolution": "Bundler",
13-
"customConditions": ["default"],
1413
"resolveJsonModule": true,
1514
"isolatedModules": true,
1615
"jsx": "react-jsx",

packages/ui-components/package.json

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@
33
"version": "1.5.10",
44
"type": "module",
55
"exports": {
6-
"./*": {
7-
"rolldown": [
8-
"./dist/*",
9-
"./dist/*.js",
10-
"./dist/*/index.js"
11-
],
12-
"default": [
13-
"./src/*",
14-
"./src/*.tsx",
15-
"./src/*/index.tsx",
16-
"./src/*.ts",
17-
"./src/*/index.ts"
18-
]
19-
}
6+
"./*": [
7+
"./src/*",
8+
"./src/*.tsx",
9+
"./src/*/index.tsx",
10+
"./src/*.ts",
11+
"./src/*/index.ts"
12+
]
2013
},
2114
"repository": {
2215
"type": "git",
@@ -27,8 +20,7 @@
2720
"compile:ts": "tsc",
2821
"compile:css": "postcss --dir dist --base src \"src/**/*.module.css\" src/styles/index.css",
2922
"compile": "node --run compile:ts && node --run compile:css",
30-
"compile:watch": "node --run compile:ts -- --watch & node --run compile:css -- --watch",
31-
"release": "node --run compile",
23+
"release": "node --run compile && node scripts/publish.mjs",
3224
"lint": "node --run lint:js && node --run lint:css",
3325
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
3426
"lint:css:fix": "node --run lint:css -- --fix",
@@ -88,25 +80,14 @@
8880
"typescript": "catalog:"
8981
},
9082
"imports": {
91-
"#ui/*": {
92-
"rolldown": [
93-
"./dist/*",
94-
"./dist/*.js",
95-
"./dist/*/index.js"
96-
],
97-
"default": [
98-
"./src/*",
99-
"./src/*.tsx",
100-
"./src/*/index.tsx",
101-
"./src/*.ts",
102-
"./src/*/index.ts"
103-
]
104-
}
83+
"#ui/*": [
84+
"./src/*",
85+
"./src/*.tsx",
86+
"./src/*/index.tsx",
87+
"./src/*.ts",
88+
"./src/*/index.ts"
89+
]
10590
},
106-
"files": [
107-
"dist/**",
108-
"README.md"
109-
],
11091
"engines": {
11192
"node": ">=20"
11293
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { spawnSync } from 'node:child_process';
2+
import { writeFile, copyFile } from 'node:fs/promises';
3+
4+
import pkg from '../package.json' with { type: 'json' };
5+
6+
// Strip the devDependencies, since they aren't needed for publish
7+
// Strip the exports, since we don't want to reference './src'
8+
/* eslint-disable @typescript-eslint/no-unused-vars */
9+
const { devDependencies, exports, ...cleanedPkg } = pkg;
10+
// Change `#ui` to `./` from `./src`, since we are publishing
11+
// from the same directory as the source code (rather, the compiled code).
12+
cleanedPkg.imports['#ui/*'] = ['./*'];
13+
14+
await writeFile(
15+
'dist/package.json',
16+
JSON.stringify(cleanedPkg, null, 2),
17+
'utf8'
18+
);
19+
20+
await copyFile('README.md', 'dist/README.md');
21+
22+
// Now, publish the generated `dist` folder
23+
const { status, error } = spawnSync('pnpm', ['publish', '--no-git-checks'], {
24+
cwd: 'dist',
25+
stdio: 'inherit',
26+
});
27+
28+
if (error) {
29+
throw error;
30+
}
31+
32+
process.exitCode = status;

packages/ui-components/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
"forceConsistentCasingInFileNames": true,
99
"esModuleInterop": true,
1010
"module": "esnext",
11-
"moduleResolution": "bundler",
12-
"customConditions": ["default"],
11+
"moduleResolution": "Bundler",
1312
"resolveJsonModule": true,
1413
"isolatedModules": true,
1514
"jsx": "react-jsx",
16-
"declaration": true,
1715
"incremental": true,
1816
"baseUrl": "./src",
1917
"rootDir": "./src",

0 commit comments

Comments
 (0)