Skip to content

Commit c2bf7d4

Browse files
authored
feat: support self-hosting animations (#5341)
While animations source code is still private here enabled publishing minified version of it so users who self-hosting websites could deploy. them with working animations.
1 parent dda59fd commit c2bf7d4

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,16 @@ jobs:
6363
runs-on: ubuntu-latest
6464
permissions:
6565
contents: write
66+
environment:
67+
name: development
6668
steps:
6769
- uses: actions/checkout@v4
6870
with:
6971
ref: ${{ github.ref }} # tag name
72+
- uses: ./.github/actions/submodules-checkout
73+
with:
74+
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
75+
7076
- uses: pnpm/action-setup@v4
7177
- uses: actions/setup-node@v4
7278
with:

packages/sdk-components-animation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737
},
3838
"scripts": {
39-
"build": "vite build --config ../../vite.sdk-components.config.ts",
39+
"build": "vite build && esbuild './lib/*' --outdir=./lib --minify --allow-overwrite --banner:js='//! SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary'",
4040
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.ws.ts !./src/*.template.tsx !./src/*.test.{ts,tsx}' -e asChild -e modal -e defaultOpen -e defaultChecked && prettier --write \"**/*.props.ts\"",
4141
"build:stories": "webstudio-sdk generate-stories && prettier --write \"src/__generated__/*.stories.tsx\"",
4242
"dts": "tsc --project tsconfig.dts.json",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { defineConfig } from "vite";
2+
import { existsSync } from "node:fs";
3+
import path from "node:path";
4+
5+
const hasPrivateFolders = existsSync(
6+
path.join(process.cwd(), "private-src", "README.md")
7+
);
8+
9+
const isBareImport = (id: string) =>
10+
id.startsWith("@") || id.includes(".") === false;
11+
12+
export default defineConfig({
13+
build: {
14+
lib: {
15+
entry: [
16+
hasPrivateFolders ? "private-src/components.ts" : "src/components.ts",
17+
"src/metas.ts",
18+
"src/hooks.ts",
19+
"src/templates.ts",
20+
],
21+
formats: ["es"],
22+
},
23+
rollupOptions: {
24+
external: isBareImport,
25+
output: {
26+
dir: "lib",
27+
},
28+
},
29+
},
30+
});

0 commit comments

Comments
 (0)