From 60ca7e7d31c887f7454d9794f1052fee89666642 Mon Sep 17 00:00:00 2001 From: Harry Hogg Date: Mon, 23 Sep 2024 09:29:00 +0100 Subject: [PATCH] fix(publishing): Fixed type definiton file not being generated --- .github/workflows/main.yml | 2 ++ workspaces/package/package.json | 2 +- workspaces/package/vite.config.ts | 4 ++-- workspaces/site/package.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a1f87804..5ed6ae3e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,8 @@ jobs: run: yarn - name: 'Linting' run: yarn lint + - name: 'Clean workspace' + run: yarn clean - name: 'Build workspace' run: yarn build - name: 'Prepare PackageJSON for publishing' diff --git a/workspaces/package/package.json b/workspaces/package/package.json index 5ffd7275..576a2f05 100644 --- a/workspaces/package/package.json +++ b/workspaces/package/package.json @@ -13,7 +13,7 @@ "source": "src", "scripts": { "clean": "rm -rf dist", - "build": "yarn clean && tsc && vite build && yarn build:docs && yarn prepare:packageJson", + "build": "vite build && yarn build:docs && yarn prepare:packageJson", "build:docs": "typedoc src/index.ts --exclude lib --excludeExternals --json ../site/src/assets/documentation.json --jsDocCompatibility false", "prepare:packageJson": "node ./scripts/preparePackageJson.js", "tsc:check": "tsc --noEmit --skipLibCheck" diff --git a/workspaces/package/vite.config.ts b/workspaces/package/vite.config.ts index 6d058f0a..66a0d358 100644 --- a/workspaces/package/vite.config.ts +++ b/workspaces/package/vite.config.ts @@ -8,7 +8,7 @@ export default defineConfig(() => ({ plugins: [ react(), dts({ - insertTypesEntry: true, + rollupTypes: true, }), ], build: { @@ -16,7 +16,7 @@ export default defineConfig(() => ({ lib: { entry: resolve(__dirname, 'src/index.ts'), name: 'preshape', - formats: ['es', 'umd'], + formats: ['es'], fileName: (format) => `preshape.${format}.js`, }, rollupOptions: { diff --git a/workspaces/site/package.json b/workspaces/site/package.json index e643a75e..d4a0b463 100644 --- a/workspaces/site/package.json +++ b/workspaces/site/package.json @@ -6,7 +6,7 @@ "scripts": { "clean": "rm -rf dist", "dev": "yarn build:svgs && vite --host localhost --port 4001", - "build": "yarn run clean && yarn run build:client && yarn run build:server && yarn run ssg", + "build": "yarn run build:client && yarn run build:server && yarn run ssg", "build:client": "vite build --outDir dist/client", "build:svgs": "yarn build:svgs:pictograms", "build:svgs:pictograms": "yarn svgr -d ./src/docs/catalog/pictograms ./src/assets/pictogram-svgs --ext tsx --config-file .svgrrc.pictograms.cjs",