chore: codesandbox setup (#2907)
This commit is contained in:
20
.codesandbox/task.json
Normal file
20
.codesandbox/task.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,6 @@ import * as path from 'node:path';
|
|||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
|
|
||||||
import * as p from '@clack/prompts';
|
import * as p from '@clack/prompts';
|
||||||
import { runCli } from '@magic-works/i18n-codegen';
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
@@ -15,27 +14,6 @@ const cwd = path.resolve(root, 'apps', 'web');
|
|||||||
|
|
||||||
const dev = await p.group(
|
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: () =>
|
debugBlockSuite: () =>
|
||||||
p.confirm({
|
p.confirm({
|
||||||
message: 'Debug blocksuite locally?',
|
message: 'Debug blocksuite locally?',
|
||||||
@@ -51,7 +29,6 @@ const dev = await p.group(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const env = {
|
const env = {
|
||||||
API_SERVER_PROFILE: dev.server,
|
|
||||||
PATH: process.env.PATH,
|
PATH: process.env.PATH,
|
||||||
NODE_ENV: 'development',
|
NODE_ENV: 'development',
|
||||||
PORT: 8080,
|
PORT: 8080,
|
||||||
@@ -77,18 +54,6 @@ if (dev.debugBlockSuite) {
|
|||||||
env.LOCAL_BLOCK_SUITE = '';
|
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'], {
|
spawn('nx', ['dev', '@affine/web'], {
|
||||||
env,
|
env,
|
||||||
cwd,
|
cwd,
|
||||||
|
|||||||
Reference in New Issue
Block a user