From 2a869e1b6a680991282ec9208a71136bf238023d Mon Sep 17 00:00:00 2001 From: Kevin Schaul Date: Mon, 24 Jun 2024 20:52:08 -0500 Subject: [PATCH] chore: remove unnecessary symlink step --- bin/buildStorybook.ts | 3 +-- bin/storybook.ts | 3 +-- bin/updateReadme.ts | 5 ----- bin/util.ts | 12 +----------- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/bin/buildStorybook.ts b/bin/buildStorybook.ts index f77c039..0bd1adf 100644 --- a/bin/buildStorybook.ts +++ b/bin/buildStorybook.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; import { spawn } from "node:child_process"; -import { copyJumpStartTools, spawnWithIO, symlinkStarters } from "./util"; +import { copyJumpStartTools, spawnWithIO } from "./util"; import updateStories from "../src/util/updateStories"; import updateScreenshots from "../src/util/updateScreenshots"; const root = join(import.meta.dirname, "../"); @@ -40,7 +40,6 @@ const buildStorybook = async (opts: BuildStorybookOpts) => { console.log(`Using startersDir: ${opts.startersDir}`); const toolsRoot = copyJumpStartTools(root, opts.startersDir); - symlinkStarters(toolsRoot, opts.startersDir); // Rewrite stories now console.log("Updating stories"); diff --git a/bin/storybook.ts b/bin/storybook.ts index 6d67443..746c764 100644 --- a/bin/storybook.ts +++ b/bin/storybook.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; import { watch } from "chokidar"; -import { copyJumpStartTools, spawnWithIO, symlinkStarters } from "./util"; +import { copyJumpStartTools, spawnWithIO } from "./util"; import updateStories from "../src/util/updateStories"; import { Command } from "commander"; import updateScreenshots from "../src/util/updateScreenshots"; @@ -16,7 +16,6 @@ const storybook = async (opts: StorybookOpts, command: Command) => { console.log(`Using startersDir: ${opts.startersDir}`); const toolsRoot = copyJumpStartTools(root, opts.startersDir); - symlinkStarters(toolsRoot, opts.startersDir); // Rewrite stories now and any time a change is made to the starters console.log("Updating stories"); diff --git a/bin/updateReadme.ts b/bin/updateReadme.ts index 5b3820e..f8cc394 100644 --- a/bin/updateReadme.ts +++ b/bin/updateReadme.ts @@ -1,7 +1,4 @@ -import { join } from "node:path"; -import { symlinkStarters } from "./util"; import updateReadme from "../src/util/updateReadme"; -const root = join(import.meta.dirname, "../"); type UpdateReadmeOpts = { startersDir: string; @@ -10,8 +7,6 @@ type UpdateReadmeOpts = { const task = async (opts: UpdateReadmeOpts) => { console.log(`Using startersDir: ${opts.startersDir}`); - symlinkStarters(root, opts.startersDir); - updateReadme(opts.startersDir); console.log(`Readme updated`) }; diff --git a/bin/util.ts b/bin/util.ts index e8327d8..51ff7a5 100644 --- a/bin/util.ts +++ b/bin/util.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; import { SpawnOptions, spawn } from "node:child_process"; -import { cpSync, rmSync, symlinkSync, unlinkSync } from "node:fs"; +import { cpSync, rmSync } from "node:fs"; export function getToolsRoot(startersDir: string) { return join(startersDir, "./.build/jump-start-tools"); @@ -15,16 +15,6 @@ export function copyJumpStartTools(root: string, startersDir: string) { cpSync(root, toolsRoot, { recursive: true }); return toolsRoot; } -export function symlinkStarters(root: string, startersDir: string) { - // Add a symlink to where the starters exist (But - // first, remove the symlink if it already exists) - const symlinkPath = join(root, "./src/starters"); - console.log(`Symlinking ${startersDir} to ${symlinkPath}`); - try { - unlinkSync(symlinkPath); - } catch (e: any) {} - symlinkSync(startersDir, symlinkPath); -} export function spawnWithIO(command: string, args: string[], options: SpawnOptions) { console.log("Starting server");