Skip to content

Commit 1b3bfcb

Browse files
add build cjs
1 parent 34555c7 commit 1b3bfcb

File tree

3 files changed

+10
-32
lines changed

3 files changed

+10
-32
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
env:
16-
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1818

1919
steps:
20-
- name: 📂 Check repository
20+
- name: 📂 Check repository
2121
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 2
24-
24+
2525
- name: 📦 Setup pnpm # https://github.com/marketplace/actions/setup-pnpm
2626
uses: pnpm/action-setup@v4
2727

2828
- name: 📦 Setup Node.js # https://github.com/actions/setup-node
29-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v4
3030
with:
3131
node-version-file: './package.json'
3232
cache: 'pnpm'
3333

34-
- name: 🔑 Set pnpm token
34+
- name: 🔑 Set pnpm token
3535
run: pnpm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
3636

3737
- name: 📦 Install dependencies
@@ -42,8 +42,8 @@ jobs:
4242

4343
# - name: 🛠️ Build project
4444
# run: pnpm build
45-
46-
- name: 🚀 Release
45+
46+
- name: 🚀 Release
4747
run: pnpm release
4848

4949
- name: 🧹 Clean up pnpm token

packages/minimal-shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "minimal-shared",
33
"author": "Minimals",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"description": "Shared hooks and utils used by Mnimal UI and Zone UI.",
66
"keywords": [
77
"typescript",
Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
1-
import path from 'path';
2-
import fs from 'fs-extra';
3-
import glob from 'fast-glob';
41
import { defineConfig } from 'tsup';
52

63
// ----------------------------------------------------------------------
74

8-
const excludedFiles = ['!src/**/*.d.ts', '!src/**/*.test.*'];
9-
const copyFiles = ['src/**/index.ts'];
10-
115
export default defineConfig((options) => ({
126
dts: true,
137
clean: true,
148
outDir: 'dist',
15-
format: ['esm'],
9+
format: ['cjs', 'esm'],
1610
splitting: false,
1711
sourcemap: false,
1812
minify: !options.watch,
19-
entry: ['src/**/*', ...excludedFiles],
20-
onSuccess: async () => {
21-
try {
22-
const srcIndexTsFiles: string[] = glob.sync(copyFiles);
23-
24-
await Promise.all(
25-
srcIndexTsFiles.map(async (file) => {
26-
const dest = path.join('dist', path.relative('src', file)).replace('.ts', '.js');
27-
await fs.copy(file, dest);
28-
})
29-
);
30-
31-
console.log('>> Files copied successfully!');
32-
} catch (error) {
33-
console.error('>> Error during onSuccess:', error);
34-
}
35-
},
13+
entry: ['src/**/*', '!src/**/*.test.*'],
3614
}));

0 commit comments

Comments
 (0)