mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 00:01:40 +03:00
fix(cli): update dev-core
(#3296)
This commit is contained in:
parent
47f12f77f2
commit
1abcdee2f0
11
.env.template
Normal file
11
.env.template
Normal file
@ -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=
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user