mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
chore: remove blocksuite local debug option (#8386)
This PR removes the blocksuite local debug option when running `yarn dev`. After this, to enable local debugging, simply run ```sh yarn link <path-to-blocksuite> -A yarn dev ``` You can disable local debugging by running ```sh yarn unlink <path-to-blocksuite> -A ```
This commit is contained in:
@@ -18,7 +18,6 @@ const flags: BuildFlags = {
|
||||
static: false,
|
||||
channel: 'canary',
|
||||
coverage: process.env.COVERAGE === 'true',
|
||||
localBlockSuite: undefined,
|
||||
};
|
||||
|
||||
const files = ['.env', '.env.local'];
|
||||
@@ -34,7 +33,7 @@ for (const file of files) {
|
||||
}
|
||||
|
||||
const buildFlags = process.argv.includes('--static')
|
||||
? { ...flags, debugBlockSuite: false, static: true }
|
||||
? { ...flags, static: true }
|
||||
: ((await p.group(
|
||||
{
|
||||
distribution: () =>
|
||||
@@ -90,11 +89,6 @@ const buildFlags = process.argv.includes('--static')
|
||||
message: 'Enable coverage',
|
||||
initialValue: process.env.COVERAGE === 'true',
|
||||
}),
|
||||
debugBlockSuite: () =>
|
||||
p.confirm({
|
||||
message: 'Debug blocksuite locally?',
|
||||
initialValue: false,
|
||||
}),
|
||||
},
|
||||
{
|
||||
onCancel: () => {
|
||||
@@ -102,7 +96,7 @@ const buildFlags = process.argv.includes('--static')
|
||||
process.exit(0);
|
||||
},
|
||||
}
|
||||
)) as BuildFlags & { debugBlockSuite: boolean });
|
||||
)) as BuildFlags);
|
||||
|
||||
flags.distribution = buildFlags.distribution;
|
||||
flags.mode = buildFlags.mode;
|
||||
@@ -122,27 +116,6 @@ if (flags.distribution === 'desktop') {
|
||||
};
|
||||
}
|
||||
|
||||
if (buildFlags.debugBlockSuite) {
|
||||
const { config } = await import('dotenv');
|
||||
const envLocal = config({
|
||||
path: join(cwd, '.env.local'),
|
||||
});
|
||||
|
||||
const localBlockSuite = await p.text({
|
||||
message: 'local blocksuite PATH',
|
||||
initialValue: envLocal.error
|
||||
? undefined
|
||||
: envLocal.parsed?.LOCAL_BLOCK_SUITE,
|
||||
});
|
||||
if (typeof localBlockSuite !== 'string') {
|
||||
throw new Error('local blocksuite PATH is required');
|
||||
}
|
||||
if (!existsSync(localBlockSuite)) {
|
||||
throw new Error(`local blocksuite not found: ${localBlockSuite}`);
|
||||
}
|
||||
flags.localBlockSuite = localBlockSuite;
|
||||
}
|
||||
|
||||
console.info(flags);
|
||||
|
||||
if (!flags.static) {
|
||||
|
||||
Reference in New Issue
Block a user