Skip to content

Commit

Permalink
Move from the main repo
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov committed Jan 31, 2025
1 parent 78d4dd1 commit 498d2ce
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 1,092 deletions.
26 changes: 25 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import * as path from "node:path";
import type { StorybookConfig } from "@storybook/react-vite";
import { existsSync, readdirSync } from "node:fs";

const isFolderEmptyOrNotExists = (folderPath: string) => {
if (!existsSync(folderPath)) {
return true; // Folder does not exist
}
const contents = readdirSync(folderPath);

return contents.length === 0;
};

const hasPrivateFolders = !isFolderEmptyOrNotExists(
path.join(__dirname, "../../packages/sdk-components-animation/private-src")
);

const visualTestingStories: StorybookConfig["stories"] = [
{
Expand Down Expand Up @@ -67,7 +81,17 @@ export default {
},
resolve: {
...config.resolve,
conditions: ["webstudio", "import", "module", "browser", "default"],
conditions: hasPrivateFolders
? [
"webstudio-private",
"webstudio",
"import",
"module",
"browser",
"default",
]
: ["webstudio", "import", "module", "browser", "default"],

alias: [
{
find: "~",
Expand Down
26 changes: 22 additions & 4 deletions apps/builder/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from "node:path";
import path, { resolve } from "node:path";
import { defineConfig, type CorsOptions } from "vite";
import { vitePlugin as remix } from "@remix-run/dev";
import { vercelPreset } from "@vercel/remix/vite";
Expand All @@ -9,13 +9,28 @@ import {
getAuthorizationServerOrigin,
isBuilderUrl,
} from "./app/shared/router-utils/origins";
import { readFileSync } from "node:fs";
import { readFileSync, readdirSync, existsSync } from "node:fs";

const isFolderEmptyOrNotExists = (folderPath: string) => {
if (!existsSync(folderPath)) {
return true; // Folder does not exist
}
const contents = readdirSync(folderPath);

return contents.length === 0;
};

const hasPrivateFolders = !isFolderEmptyOrNotExists(
path.join(__dirname, "../../packages/sdk-components-animation/private-src")
);

export default defineConfig(({ mode }) => {
if (mode === "test") {
return {
resolve: {
conditions: ["webstudio"],
conditions: hasPrivateFolders
? ["webstudio-private", "webstudio"]
: ["webstudio"],
alias: [
{
find: "~",
Expand Down Expand Up @@ -69,7 +84,10 @@ export default defineConfig(({ mode }) => {
},
],
resolve: {
conditions: ["webstudio"],
conditions: hasPrivateFolders
? ["webstudio-private", "webstudio"]
: ["webstudio"],

alias: [
{
find: "~",
Expand Down
201 changes: 0 additions & 201 deletions packages/sdk-components-animation/LICENSE-scroll-timeline

This file was deleted.

1 change: 1 addition & 0 deletions packages/sdk-components-animation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
],
"exports": {
".": {
"webstudio-private": "./private-src/components.ts",
"webstudio": "./src/components.ts",
"types": "./lib/types/components.d.ts",
"import": "./lib/components.js"
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-animation/private-src
Loading

0 comments on commit 498d2ce

Please sign in to comment.