mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 00:28:33 +00:00
refactor(infra): no bundle infra (#5414)
This commit is contained in:
9
.github/actions/setup-node/action.yml
vendored
9
.github/actions/setup-node/action.yml
vendored
@@ -21,10 +21,6 @@ inputs:
|
||||
description: 'set nmMode to hardlinks-local in .yarnrc.yml'
|
||||
required: false
|
||||
default: 'true'
|
||||
build-infra:
|
||||
description: 'Build infra'
|
||||
required: false
|
||||
default: 'true'
|
||||
nmHoistingLimits:
|
||||
description: 'Set nmHoistingLimits in .yarnrc.yml'
|
||||
required: false
|
||||
@@ -186,8 +182,3 @@ runs:
|
||||
run: node ./node_modules/electron/install.js
|
||||
env:
|
||||
electron_config_cache: ./node_modules/.cache/electron
|
||||
|
||||
- name: Build Infra
|
||||
shell: bash
|
||||
if: inputs.build-infra == 'true'
|
||||
run: yarn run build:infra
|
||||
|
||||
2
.github/workflows/build-test.yml
vendored
2
.github/workflows/build-test.yml
vendored
@@ -216,7 +216,6 @@ jobs:
|
||||
with:
|
||||
extra-flags: workspaces focus @affine/native
|
||||
electron-install: false
|
||||
build-infra: false
|
||||
- name: Setup filename
|
||||
id: filename
|
||||
shell: bash
|
||||
@@ -248,7 +247,6 @@ jobs:
|
||||
with:
|
||||
extra-flags: workspaces focus @affine/storage
|
||||
electron-install: false
|
||||
build-infra: false
|
||||
- name: Build Rust
|
||||
uses: ./.github/actions/build-rust
|
||||
with:
|
||||
|
||||
@@ -67,12 +67,6 @@ Note: use `strip` from system instead of `binutils` if you are running MacOS. [s
|
||||
yarn workspace @affine/native build
|
||||
```
|
||||
|
||||
### Build Infra
|
||||
|
||||
```sh
|
||||
yarn run build:infra
|
||||
```
|
||||
|
||||
### Build Server Dependencies
|
||||
|
||||
```sh
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
"build": "yarn nx build @affine/core",
|
||||
"build:electron": "yarn nx build @affine/electron",
|
||||
"build:storage": "yarn nx run-many -t build -p @affine/storage",
|
||||
"build:infra": "yarn nx run-many -t build --projects=tag:infra",
|
||||
"build:storybook": "yarn nx build @affine/storybook",
|
||||
"start:web-static": "yarn workspace @affine/core static-server",
|
||||
"start:storybook": "yarn exec serve tests/storybook/storybook-static -l 6006",
|
||||
|
||||
@@ -1,39 +1,13 @@
|
||||
{
|
||||
"name": "@toeverything/infra",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"exports": {
|
||||
"./blocksuite": {
|
||||
"types": "./dist/src/blocksuite/index.d.ts",
|
||||
"import": "./dist/blocksuite.js",
|
||||
"require": "./dist/blocksuite.cjs"
|
||||
},
|
||||
"./command": {
|
||||
"types": "./dist/src/command/index.d.ts",
|
||||
"import": "./dist/command.js",
|
||||
"require": "./dist/command.cjs"
|
||||
},
|
||||
"./atom": {
|
||||
"type": "./dist/src/atom.d.ts",
|
||||
"import": "./dist/atom.js",
|
||||
"require": "./dist/atom.cjs"
|
||||
},
|
||||
"./app-config-storage": {
|
||||
"type": "./dist/src/app-config-storage.d.ts",
|
||||
"import": "./dist/app-config-storage.js",
|
||||
"require": "./dist/app-config-storage.cjs"
|
||||
},
|
||||
"./__internal__/*": {
|
||||
"type": "./dist/src/__internal__/*.d.ts",
|
||||
"import": "./dist/__internal__/*.js",
|
||||
"require": "./dist/__internal__/*.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"dev": "vite build --watch"
|
||||
"./blocksuite": "./src/blocksuite/index.ts",
|
||||
"./command": "./src/command/index.ts",
|
||||
"./atom": "./src/atom/index.ts",
|
||||
"./app-config-storage": "./src/app-config-storage.ts",
|
||||
"./__internal__/*": "./src/__internal__/*.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@affine/debug": "workspace:*",
|
||||
@@ -51,9 +25,7 @@
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/lit": "0.11.0-nightly-202312220916-e3abcbb",
|
||||
"@blocksuite/presets": "0.11.0-nightly-202312220916-e3abcbb",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"async-call-rpc": "^6.3.1",
|
||||
"electron": "link:../../frontend/electron/node_modules/electron",
|
||||
"nanoid": "^5.0.3",
|
||||
"react": "^18.2.0",
|
||||
"rxjs": "^7.8.1",
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "infra",
|
||||
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
||||
"projectType": "library",
|
||||
"sourceRoot": "packages/common/src",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-script",
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["{projectRoot}/**/*"],
|
||||
"options": {
|
||||
"script": "build"
|
||||
},
|
||||
"outputs": ["{projectRoot}/dist"]
|
||||
}
|
||||
},
|
||||
"tags": ["infra"]
|
||||
}
|
||||
@@ -4,7 +4,6 @@
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"noEmit": false,
|
||||
"moduleResolution": "bundler",
|
||||
"outDir": "lib"
|
||||
},
|
||||
"references": [
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { fileURLToPath } from 'url';
|
||||
import { defineConfig } from 'vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
|
||||
const root = fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
minify: false,
|
||||
lib: {
|
||||
entry: {
|
||||
blocksuite: resolve(root, 'src/blocksuite/index.ts'),
|
||||
atom: resolve(root, 'src/atom/index.ts'),
|
||||
command: resolve(root, 'src/command/index.ts'),
|
||||
'app-config-storage': resolve(root, 'src/app-config-storage.ts'),
|
||||
},
|
||||
formats: ['es', 'cjs'],
|
||||
name: 'AffineInfra',
|
||||
},
|
||||
rollupOptions: {
|
||||
external: [
|
||||
'electron',
|
||||
'async-call-rpc',
|
||||
'rxjs',
|
||||
'zod',
|
||||
'react',
|
||||
'yjs',
|
||||
'nanoid',
|
||||
/^jotai/,
|
||||
/^@blocksuite/,
|
||||
/^@affine\/templates/,
|
||||
],
|
||||
},
|
||||
},
|
||||
plugins: [dts()],
|
||||
});
|
||||
@@ -46,9 +46,6 @@ export default {
|
||||
assetsInclude: ['**/*.md'],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@toeverything/infra': fileURLToPath(
|
||||
new URL('../../../packages/common/infra/src', import.meta.url)
|
||||
),
|
||||
// workaround for https://github.com/vitejs/vite/issues/9731
|
||||
// it seems vite does not resolve self reference correctly?
|
||||
'@affine/core': fileURLToPath(
|
||||
|
||||
@@ -171,16 +171,6 @@ function awaitChildProcess(child: ChildProcess): Promise<number> {
|
||||
}
|
||||
|
||||
try {
|
||||
// Build:infra
|
||||
await awaitChildProcess(
|
||||
spawn('yarn', ['build:infra'], {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
env: process.env,
|
||||
})
|
||||
);
|
||||
|
||||
// Start webpack
|
||||
await awaitChildProcess(
|
||||
spawn(
|
||||
|
||||
@@ -13515,9 +13515,7 @@ __metadata:
|
||||
"@blocksuite/lit": "npm:0.11.0-nightly-202312220916-e3abcbb"
|
||||
"@blocksuite/presets": "npm:0.11.0-nightly-202312220916-e3abcbb"
|
||||
"@blocksuite/store": "npm:0.11.0-nightly-202312220916-e3abcbb"
|
||||
"@testing-library/react": "npm:^14.0.0"
|
||||
async-call-rpc: "npm:^6.3.1"
|
||||
electron: "link:../../frontend/electron/node_modules/electron"
|
||||
jotai: "npm:^2.5.1"
|
||||
jotai-effect: "npm:^0.2.3"
|
||||
nanoid: "npm:^5.0.3"
|
||||
@@ -19745,12 +19743,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"electron@link:../../frontend/electron/node_modules/electron::locator=%40toeverything%2Finfra%40workspace%3Apackages%2Fcommon%2Finfra":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "electron@link:../../frontend/electron/node_modules/electron::locator=%40toeverything%2Finfra%40workspace%3Apackages%2Fcommon%2Finfra"
|
||||
languageName: node
|
||||
linkType: soft
|
||||
|
||||
"electron@npm:^27.1.0":
|
||||
version: 27.1.2
|
||||
resolution: "electron@npm:27.1.2"
|
||||
|
||||
Reference in New Issue
Block a user