chore: codesandbox setup (#2907)

This commit is contained in:
Alex Yang 2023-06-28 20:32:56 +08:00 committed by GitHub
parent d6addc0d0b
commit 0a91c41e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 35 deletions

20
.codesandbox/task.json Normal file
View File

@ -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
}
}
}
}

View File

@ -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,