ci: speedup ci by reduce installation packages in certain job (#4457)

This commit is contained in:
LongYinan
2023-09-29 11:02:26 +08:00
committed by GitHub
parent b012e615ba
commit dd94ea5b45
84 changed files with 2954 additions and 2271 deletions

View File

@@ -1,11 +1,12 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('node:path');
const { rm, symlink } = require('node:fs/promises');
const {
utils: { fromBuildIdentifier },
} = require('@electron-forge/core');
const path = require('node:path');
const {
arch,
buildType,
@@ -25,7 +26,7 @@ const makers = [
icon: icnsPath,
name: 'AFFiNE',
'icon-size': 128,
background: path.resolve(
background: path.join(
__dirname,
'./resources/icons/dmg-background.png'
),
@@ -34,7 +35,7 @@ const makers = [
x: 176,
y: 192,
type: 'file',
path: path.resolve(
path: path.join(
__dirname,
'out',
buildType,
@@ -45,7 +46,7 @@ const makers = [
{ x: 432, y: 192, type: 'link', path: '/Applications' },
],
iconSize: 118,
file: path.resolve(
file: path.join(
__dirname,
'out',
buildType,
@@ -129,35 +130,14 @@ module.exports = {
packageJson.productName = productName;
},
prePackage: async () => {
const { rm, cp } = require('node:fs/promises');
const { resolve } = require('node:path');
await rm(resolve(__dirname, './node_modules/@toeverything/infra'), {
await rm(path.join(__dirname, 'node_modules'), {
recursive: true,
force: true,
});
await cp(
resolve(__dirname, '../../packages/infra'),
resolve(__dirname, './node_modules/@toeverything/infra'),
{
recursive: true,
force: true,
}
);
await rm(resolve(__dirname, './node_modules/@affine/sdk'), {
recursive: true,
force: true,
});
await cp(
resolve(__dirname, '../../packages/sdk'),
resolve(__dirname, './node_modules/@affine/sdk'),
{
recursive: true,
force: true,
}
await symlink(
path.join(__dirname, '..', '..', 'node_modules'),
path.join(__dirname, 'node_modules')
);
},
generateAssets: async (_, platform, arch) => {

View File

@@ -26,46 +26,53 @@
"main": "./dist/main.js",
"devDependencies": {
"@affine-test/kit": "workspace:*",
"@affine/bookmark-plugin": "workspace:*",
"@affine/copilot-plugin": "workspace:*",
"@affine/env": "workspace:*",
"@affine/hello-world-plugin": "workspace:*",
"@affine/image-preview-plugin": "workspace:*",
"@affine/native": "workspace:*",
"@affine/outline-plugin": "workspace:*",
"@affine/sdk": "workspace:*",
"@affine/templates": "workspace:*",
"@affine/vue-hello-world-plugin": "workspace:*",
"@blocksuite/blocks": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/editor": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/lit": "0.0.0-20230926212737-6d4b1569-nightly",
"@blocksuite/store": "0.0.0-20230926212737-6d4b1569-nightly",
"@electron-forge/cli": "^6.4.1",
"@electron-forge/core": "^6.4.1",
"@electron-forge/core-utils": "^6.4.1",
"@electron-forge/maker-deb": "^6.4.1",
"@electron-forge/maker-squirrel": "^6.4.1",
"@electron-forge/maker-zip": "^6.4.1",
"@electron-forge/shared-types": "^6.4.1",
"@electron-forge/cli": "^6.4.2",
"@electron-forge/core": "^6.4.2",
"@electron-forge/core-utils": "^6.4.2",
"@electron-forge/maker-deb": "^6.4.2",
"@electron-forge/maker-squirrel": "^6.4.2",
"@electron-forge/maker-zip": "^6.4.2",
"@electron-forge/shared-types": "^6.4.2",
"@electron/remote": "2.0.11",
"@reforged/maker-appimage": "^3.3.1",
"@toeverything/infra": "workspace:*",
"@types/uuid": "^9.0.3",
"@types/uuid": "^9.0.4",
"cross-env": "7.0.3",
"electron": "^26.2.1",
"electron-log": "^5.0.0-beta.28",
"electron": "^26.2.2",
"electron-log": "^5.0.0-beta.29",
"electron-squirrel-startup": "1.0.0",
"electron-window-state": "^5.0.3",
"esbuild": "^0.19.2",
"esbuild": "^0.19.3",
"fs-extra": "^11.1.1",
"glob": "^10.3.4",
"jotai": "^2.4.1",
"glob": "^10.3.5",
"jotai": "^2.4.2",
"lodash-es": "^4.17.21",
"rxjs": "^7.8.1",
"tinykeys": "^2.1.0",
"ts-node": "^10.9.1",
"undici": "^5.23.0",
"uuid": "^9.0.0",
"vitest": "0.33.0",
"undici": "^5.25.2",
"uuid": "^9.0.1",
"vitest": "0.34.5",
"which": "^4.0.0",
"zx": "^7.2.3"
},
"dependencies": {
"async-call-rpc": "^6.3.1",
"electron-updater": "^6.1.4",
"electron-updater": "^6.1.5",
"link-preview-js": "^3.0.5",
"nanoid": "^4.0.2",
"yjs": "^13.6.8"
@@ -81,9 +88,6 @@
]
},
"stableVersion": "0.5.3",
"installConfig": {
"hoistingLimits": "workspaces"
},
"peerDependencies": {
"ts-node": "*"
}

View File

@@ -46,13 +46,21 @@ export async function getWorkspaceMeta(
try {
const basePath = await getWorkspaceBasePath(workspaceId);
const metaPath = await getWorkspaceMetaPath(workspaceId);
if (!(await fs.exists(metaPath))) {
if (
!(await fs
.access(metaPath)
.then(() => true)
.catch(() => false))
) {
// since not meta is found, we will migrate symlinked db file if needed
await fs.ensureDir(basePath);
const dbPath = await getWorkspaceDBPath(workspaceId);
// todo: remove this after migration (in stable version)
const realDBPath = (await fs.exists(dbPath))
const realDBPath = (await fs
.access(dbPath)
.then(() => true)
.catch(() => false))
? await fs.realpath(dbPath)
: dbPath;
const isLink = realDBPath !== dbPath;