From 0a91c41e0a8d78958f729e484d34001f800482aa Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Wed, 28 Jun 2023 20:32:56 +0800 Subject: [PATCH] chore: codesandbox setup (#2907) --- .codesandbox/task.json | 20 ++++++++++++++++++++ packages/cli/src/dev.mjs | 35 ----------------------------------- 2 files changed, 20 insertions(+), 35 deletions(-) create mode 100644 .codesandbox/task.json diff --git a/.codesandbox/task.json b/.codesandbox/task.json new file mode 100644 index 0000000000..a90d7adb8e --- /dev/null +++ b/.codesandbox/task.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://codesandbox.io/schemas/tasks.json", + "setupTasks": [ + { + "name": "Install Dependencies", + "command": "yarn install" + } + ], + + "tasks": { + "start-web": { + "name": "Start Web", + "command": "yarn nx dev @affine/web --port 8080", + "runAtStart": true, + "preview": { + "port": 8080 + } + } + } +} diff --git a/packages/cli/src/dev.mjs b/packages/cli/src/dev.mjs index e5f807839c..8621d0f25e 100755 --- a/packages/cli/src/dev.mjs +++ b/packages/cli/src/dev.mjs @@ -5,7 +5,6 @@ import * as path from 'node:path'; import { fileURLToPath } from 'node:url'; import * as p from '@clack/prompts'; -import { runCli } from '@magic-works/i18n-codegen'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); @@ -15,27 +14,6 @@ const cwd = path.resolve(root, 'apps', 'web'); const dev = await p.group( { - server: () => - p.select({ - message: `Select dev server`, - initialValue: 'local', - options: [ - { - value: 'local', - label: 'local - 127.0.0.1:3000', - hint: 'recommend', - }, - { value: 'dev', label: 'dev - 100.84.105.99:11001' }, - { - value: 'ac', - label: 'ac - 100.85.73.88:12001', - }, - { - value: 'test', - label: 'test - 100.84.105.99:11001', - }, - ], - }), debugBlockSuite: () => p.confirm({ message: 'Debug blocksuite locally?', @@ -51,7 +29,6 @@ const dev = await p.group( ); const env = { - API_SERVER_PROFILE: dev.server, PATH: process.env.PATH, NODE_ENV: 'development', PORT: 8080, @@ -77,18 +54,6 @@ if (dev.debugBlockSuite) { env.LOCAL_BLOCK_SUITE = ''; } -if (dev.server === 'local') { - console.log('You might need setup OctoBase dev server first.'); -} - -runCli( - { - watch: true, - cwd: root, - }, - console.error -); - spawn('nx', ['dev', '@affine/web'], { env, cwd,