Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

feat: support self-hosting animations (#5341)

Bogdan Chadkinc2bf7d4af249
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1a19e3e25d..c0aebd25c8 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -63,10 +63,16 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
+ environment:
+ name: development
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # tag name
+ - uses: ./.github/actions/submodules-checkout
+ with:
+ submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
+
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
diff --git a/packages/sdk-components-animation/package.json b/packages/sdk-components-animation/package.json
index 3e68f10509..0831803658 100644
--- a/packages/sdk-components-animation/package.json
+++ b/packages/sdk-components-animation/package.json
@@ -36,7 +36,7 @@
}
},
"scripts": {
- "build": "vite build --config ../../vite.sdk-components.config.ts",
+ "build": "vite build && esbuild './lib/*' --outdir=./lib --minify --allow-overwrite --banner:js='//! SPDX-License-Identifier: LicenseRef-Webstudio,Inc-Proprietary'",
"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\"",
"build:stories": "webstudio-sdk generate-stories && prettier --write \"src/__generated__/*.stories.tsx\"",
"dts": "tsc --project tsconfig.dts.json",
diff --git a/packages/sdk-components-animation/vite.config.ts b/packages/sdk-components-animation/vite.config.ts
new file mode 100644
index 0000000000..855912b0cb
--- /dev/null
+++ b/packages/sdk-components-animation/vite.config.ts
@@ -0,0 +1,30 @@
+import { defineConfig } from "vite";
+import { existsSync } from "node:fs";
+import path from "node:path";
+
+const hasPrivateFolders = existsSync(
+ path.join(process.cwd(), "private-src", "README.md")
+);
+
+const isBareImport = (id: string) =>
+ id.startsWith("@") || id.includes(".") === false;
+
+export default defineConfig({
+ build: {
+ lib: {
+ entry: [
+ hasPrivateFolders ? "private-src/components.ts" : "src/components.ts",
+ "src/metas.ts",
+ "src/hooks.ts",
+ "src/templates.ts",
+ ],
+ formats: ["es"],
+ },
+ rollupOptions: {
+ external: isBareImport,
+ output: {
+ dir: "lib",
+ },
+ },
+ },
+});