Skip to content

Commit 498d2ce

Browse files
committed
Move from the main repo
1 parent 78d4dd1 commit 498d2ce

File tree

16 files changed

+59
-1092
lines changed

16 files changed

+59
-1092
lines changed

.storybook/main.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
import * as path from "node:path";
22
import type { StorybookConfig } from "@storybook/react-vite";
3+
import { existsSync, readdirSync } from "node:fs";
4+
5+
const isFolderEmptyOrNotExists = (folderPath: string) => {
6+
if (!existsSync(folderPath)) {
7+
return true; // Folder does not exist
8+
}
9+
const contents = readdirSync(folderPath);
10+
11+
return contents.length === 0;
12+
};
13+
14+
const hasPrivateFolders = !isFolderEmptyOrNotExists(
15+
path.join(__dirname, "../../packages/sdk-components-animation/private-src")
16+
);
317

418
const visualTestingStories: StorybookConfig["stories"] = [
519
{
@@ -67,7 +81,17 @@ export default {
6781
},
6882
resolve: {
6983
...config.resolve,
70-
conditions: ["webstudio", "import", "module", "browser", "default"],
84+
conditions: hasPrivateFolders
85+
? [
86+
"webstudio-private",
87+
"webstudio",
88+
"import",
89+
"module",
90+
"browser",
91+
"default",
92+
]
93+
: ["webstudio", "import", "module", "browser", "default"],
94+
7195
alias: [
7296
{
7397
find: "~",

apps/builder/vite.config.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { resolve } from "node:path";
1+
import path, { resolve } from "node:path";
22
import { defineConfig, type CorsOptions } from "vite";
33
import { vitePlugin as remix } from "@remix-run/dev";
44
import { vercelPreset } from "@vercel/remix/vite";
@@ -9,13 +9,28 @@ import {
99
getAuthorizationServerOrigin,
1010
isBuilderUrl,
1111
} from "./app/shared/router-utils/origins";
12-
import { readFileSync } from "node:fs";
12+
import { readFileSync, readdirSync, existsSync } from "node:fs";
13+
14+
const isFolderEmptyOrNotExists = (folderPath: string) => {
15+
if (!existsSync(folderPath)) {
16+
return true; // Folder does not exist
17+
}
18+
const contents = readdirSync(folderPath);
19+
20+
return contents.length === 0;
21+
};
22+
23+
const hasPrivateFolders = !isFolderEmptyOrNotExists(
24+
path.join(__dirname, "../../packages/sdk-components-animation/private-src")
25+
);
1326

1427
export default defineConfig(({ mode }) => {
1528
if (mode === "test") {
1629
return {
1730
resolve: {
18-
conditions: ["webstudio"],
31+
conditions: hasPrivateFolders
32+
? ["webstudio-private", "webstudio"]
33+
: ["webstudio"],
1934
alias: [
2035
{
2136
find: "~",
@@ -69,7 +84,10 @@ export default defineConfig(({ mode }) => {
6984
},
7085
],
7186
resolve: {
72-
conditions: ["webstudio"],
87+
conditions: hasPrivateFolders
88+
? ["webstudio-private", "webstudio"]
89+
: ["webstudio"],
90+
7391
alias: [
7492
{
7593
find: "~",

packages/sdk-components-animation/LICENSE-scroll-timeline

Lines changed: 0 additions & 201 deletions
This file was deleted.

packages/sdk-components-animation/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
],
1515
"exports": {
1616
".": {
17+
"webstudio-private": "./private-src/components.ts",
1718
"webstudio": "./src/components.ts",
1819
"types": "./lib/types/components.d.ts",
1920
"import": "./lib/components.js"

0 commit comments

Comments
 (0)