mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08:00
build: enhance nx build (#2948)
This commit is contained in:
@@ -5,6 +5,7 @@ import * as path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import * as p from '@clack/prompts';
|
||||
import { spawnSync } from 'child_process';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
@@ -57,7 +58,26 @@ if (dev.debugBlockSuite) {
|
||||
env.LOCAL_BLOCK_SUITE = '';
|
||||
}
|
||||
|
||||
spawn('nx', ['dev', '@affine/web'], {
|
||||
const packages = ['infra', 'plugin-infra'];
|
||||
|
||||
spawnSync('nx', ['run-many', '-t', 'build', '-p', ...packages], {
|
||||
env,
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
});
|
||||
|
||||
packages.forEach(pkg => {
|
||||
const cwd = path.resolve(root, 'packages', pkg);
|
||||
spawn('yarn', ['dev'], {
|
||||
env,
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
});
|
||||
});
|
||||
|
||||
spawn('yarn', ['dev', '-p', '8080'], {
|
||||
env,
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
"./theme/*": "./src/theme/*",
|
||||
"./*": "./src/components/*/index.tsx"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn workspace @affine/i18n build",
|
||||
"dev": "yarn workspace @affine/i18n dev"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@blocksuite/blocks": "*",
|
||||
"@blocksuite/editor": "*",
|
||||
|
||||
2
packages/env/src/global.ts
vendored
2
packages/env/src/global.ts
vendored
@@ -87,7 +87,6 @@ export const publicRuntimeConfigSchema = buildFlagsSchema.extend({
|
||||
gitVersion: z.string(),
|
||||
hash: z.string(),
|
||||
serverAPI: z.string(),
|
||||
editorVersion: z.string(),
|
||||
editorFlags: blockSuiteFeatureFlags,
|
||||
});
|
||||
|
||||
@@ -173,7 +172,6 @@ function printBuildInfo() {
|
||||
'Build date:',
|
||||
config.BUILD_DATE ? new Date(config.BUILD_DATE).toLocaleString() : 'Unknown'
|
||||
);
|
||||
console.log('Editor Version:', config.editorVersion);
|
||||
|
||||
console.log('Version:', config.gitVersion);
|
||||
console.log(
|
||||
|
||||
15
packages/i18n/project.json
Normal file
15
packages/i18n/project.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "i18n",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"sourceRoot": "packages/i18n/src",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "packages/i18n",
|
||||
"command": "node ./build.mjs"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
packages/infra/project.json
Normal file
21
packages/infra/project.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "infra",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"sourceRoot": "packages/infra/src",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/vite:build",
|
||||
"options": {
|
||||
"outputPath": "packages/infra/dist"
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/vite:build",
|
||||
"options": {
|
||||
"outputPath": "packages/infra/dist",
|
||||
"watch": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
packages/plugin-infra/project.json
Normal file
21
packages/plugin-infra/project.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "plugin-infra",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"sourceRoot": "packages/plugin-infra/src",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/vite:build",
|
||||
"options": {
|
||||
"outputPath": "packages/plugin-infra/dist"
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/vite:build",
|
||||
"options": {
|
||||
"outputPath": "packages/plugin-infra/dist",
|
||||
"watch": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
packages/y-indexeddb/project.json
Normal file
21
packages/y-indexeddb/project.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "y-indexeddb",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"sourceRoot": "packages/y-indexeddb/src",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/vite:build",
|
||||
"options": {
|
||||
"outputPath": "packages/y-indexeddb/dist"
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "@nx/vite:build",
|
||||
"options": {
|
||||
"outputPath": "packages/y-indexeddb/dist",
|
||||
"watch": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user