Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(cli): update `dev-core` (#3296)

Alex Yang1abcdee2f0b8
diff --git a/.env.template b/.env.template
new file mode 100644
index 0000000000..a1b60c7978
--- /dev/null
+++ b/.env.template
@@ -0,0 +1,11 @@
+ENABLE_PLUGIN=
+ENABLE_TEST_PROPERTIES=
+ENABLE_BC_PROVIDER=
+CHANGELOG_URL=
+ENABLE_PRELOADING=
+ENABLE_NEW_SETTING_MODAL=
+ENABLE_SQLITE_PROVIDER=
+ENABLE_NEW_SETTING_UNSTABLE_API=
+ENABLE_NOTIFICATION_CENTER=
+ENABLE_CLOUD=
+ENABLE_MOVE_DATABASE=
diff --git a/packages/cli/src/bin/dev-core.ts b/packages/cli/src/bin/dev-core.ts
index 38651114b0..9eaf1d55f3 100644
--- a/packages/cli/src/bin/dev-core.ts
+++ b/packages/cli/src/bin/dev-core.ts
@@ -1,10 +1,24 @@
import { spawn } from 'node:child_process';
+import { existsSync } from 'node:fs';
import path from 'node:path';
import * as p from '@clack/prompts';
+import { config } from 'dotenv';
import { type BuildFlags, projectRoot } from '../config/index.js';
+const files = ['.env', '.env.local'];
+
+for (const file of files) {
+ if (existsSync(path.resolve(projectRoot, file))) {
+ config({
+ path: path.resolve(projectRoot, file),
+ });
+ console.log(`${file} loaded`);
+ break;
+ }
+}
+
const cwd = path.resolve(projectRoot, 'apps', 'core');
const flags: BuildFlags = {
@@ -16,6 +30,19 @@ const flags: BuildFlags = {
const buildFlags = await p.group(
{
+ distribution: () =>
+ p.select({
+ message: 'Distribution',
+ options: [
+ {
+ value: 'browser',
+ },
+ {
+ value: 'desktop',
+ },
+ ],
+ initialValue: 'browser',
+ }),
mode: () =>
p.select({
message: 'Mode',
@@ -59,6 +86,7 @@ const buildFlags = await p.group(
}
);
+flags.distribution = buildFlags.distribution as any;
flags.mode = buildFlags.mode as any;
flags.channel = buildFlags.channel as any;
flags.coverage = buildFlags.coverage;