Skip to content

Commit 9a74594

Browse files
committed
ci: fix npm packaging
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 5cdb818 commit 9a74594

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/__shared-ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
4242
with:
4343
name: build
44-
path: .
44+
path: /
4545

4646
- name: Create package tarball
4747
working-directory: packages/theme
@@ -54,10 +54,12 @@ jobs:
5454
5555
npm pack --pack-destination ${{ runner.temp }}/
5656
57-
- name: Install package globally
57+
- name: Install package in the docs package to verify
58+
working-directory: packages/docs
5859
run: |
59-
cd ${{ runner.temp }}
60-
npm install -g ./hoverkraft-docusaurus-theme-*.tgz
60+
npm uninstall @hoverkraft/docusaurus-theme || true
61+
npm install ${{ runner.temp }}/hoverkraft-docusaurus-theme-*.tgz
62+
npm run build
6163
6264
- name: Upload package tarball
6365
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

packages/theme/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
"version": "1.0.0",
44
"description": "Hoverkraft theme for Docusaurus",
55
"main": "lib/index.js",
6+
"exports": {
7+
".": {
8+
"types": "./lib/index.d.ts",
9+
"default": "./lib/index.js"
10+
}
11+
},
612
"types": "lib/index.d.ts",
713
"files": [
8-
"lib",
9-
"src"
14+
"lib"
1015
],
1116
"scripts": {
1217
"build": "tsc && node scripts/copy-static-assets.js",

0 commit comments

Comments
 (0)