chore: disable rules in oxlint (#9154)

This commit is contained in:
Brooooooklyn
2024-12-13 10:49:35 +00:00
parent 2452ccd1e5
commit ea746e3d77
53 changed files with 621 additions and 269 deletions

View File

@@ -1,63 +1,5 @@
const { join } = require('node:path'); const { join } = require('node:path');
const createPattern = packageName => [
{
group: ['**/dist', '**/dist/**'],
message: 'Do not import from dist',
allowTypeImports: false,
},
{
group: ['**/src', '**/src/**'],
message: 'Do not import from src',
allowTypeImports: false,
},
{
group: [`@affine/${packageName}`],
message: 'Do not import package itself',
allowTypeImports: false,
},
{
group: [`@toeverything/${packageName}`],
message: 'Do not import package itself',
allowTypeImports: false,
},
{
group: ['@blocksuite/store'],
message: "Import from '@blocksuite/global/utils'",
importNames: ['assertExists', 'assertEquals'],
},
{
group: ['react-router-dom'],
message: 'Use `useNavigateHelper` instead',
importNames: ['useNavigate'],
},
{
group: ['@affine/env/constant'],
message:
'Do not import from @affine/env/constant. Use `BUILD_CONFIG.isElectron` instead',
importNames: ['isElectron'],
},
];
const allPackages = [
'packages/backend/server',
'packages/frontend/component',
'packages/frontend/core',
'packages/frontend/apps/electron',
'packages/frontend/apps/web',
'packages/frontend/apps/mobile',
'packages/frontend/graphql',
'packages/frontend/i18n',
'packages/frontend/native',
'packages/frontend/templates',
'packages/frontend/track',
'packages/common/debug',
'packages/common/env',
'packages/common/infra',
'packages/common/nbstore',
'tools/cli',
];
/** /**
* @type {import('eslint').Linter.Config} * @type {import('eslint').Linter.Config}
*/ */
@@ -93,54 +35,116 @@ const config = {
plugins: [ plugins: [
'react', 'react',
'@typescript-eslint', '@typescript-eslint',
'simple-import-sort',
'sonarjs', 'sonarjs',
'import-x', 'import-x',
'unused-imports', 'unused-imports',
'unicorn',
'rxjs', 'rxjs',
'unicorn',
], ],
rules: { rules: {
'array-callback-return': 'error', // enabled in oxlint
'no-undef': 'off', 'array-callback-return': 'off',
'constructor-super': 'off',
eqeqeq: 'off',
'getter-return': 'off',
'for-direction': 'off',
'require-yield': 'off',
'use-isnan': 'off',
'valid-typeof': 'off',
'no-self-compare': 'off',
'no-empty': 'off', 'no-empty': 'off',
'no-constant-binary-expression': 'off',
'no-constructor-return': 'off',
'no-func-assign': 'off', 'no-func-assign': 'off',
'no-global-assign': 'off',
'no-ex-assign': 'off',
'no-fallthrough': 'off',
'no-irregular-whitespace': 'off',
'no-control-regex': 'off',
'no-with': 'off',
'no-debugger': 'off',
'no-const-assign': 'off',
'no-import-assign': 'off',
'no-setter-return': 'off',
'no-obj-calls': 'off',
'no-unsafe-negation': 'off',
'no-dupe-class-members': 'off',
'no-dupe-keys': 'off',
'no-this-before-super': 'off',
'no-empty-character-class': 'off',
'no-useless-catch': 'off',
'no-async-promise-executor': 'off',
'no-unreachable': 'off',
'no-duplicate-case': 'off',
'no-empty-pattern': 'off',
'no-unused-labels': 'off',
'no-sparse-arrays': 'off',
'no-delete-var': 'off',
'no-compare-neg-zero': 'off',
'no-redeclare': 'off',
'no-case-declarations': 'off',
'no-class-assign': 'off',
'no-var': 'off',
'no-self-assign': 'off',
'no-inner-declarations': 'off',
'no-dupe-else-if': 'off',
'no-invalid-regexp': 'off',
'no-unsafe-finally': 'off',
'no-prototype-builtins': 'off',
'no-shadow-restricted-names': 'off',
'no-nonoctal-decimal-escape': 'off',
'no-constant-condition': 'off',
'no-useless-escape': 'off',
'no-unsafe-optional-chaining': 'off',
'no-extra-boolean-cast': 'off',
'no-regex-spaces': 'off',
'react/jsx-no-useless-fragment': 'off',
'react/no-unknown-property': 'off',
'react/no-string-refs': 'off',
'react/no-direct-mutation-state': 'off',
'react/require-render-return': 'off',
'react/jsx-no-undef': 'off',
'react/jsx-no-duplicate-props': 'off',
'react/jsx-key': 'off',
'react/no-danger-with-children': 'off',
'react/no-unescaped-entities': 'off',
'react/no-is-mounted': 'off',
'react/no-find-dom-node': 'off',
'react/no-children-prop': 'off',
'react/no-render-return-value': 'off',
'react/jsx-no-target-blank': 'off',
'react/jsx-no-comment-textnodes': 'off',
'sonarjs/no-useless-catch': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-loss-of-precision': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/no-extra-non-null-assertion': 'off',
'@typescript-eslint/no-misused-new': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/prefer-as-const': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
'@typescript-eslint/no-array-constructor': 'off',
'@typescript-eslint/ban-types': 'off',
// enable in typescript-eslint
'no-undef': 'off',
'no-cond-assign': 'off', 'no-cond-assign': 'off',
'no-constant-binary-expression': 'error',
'no-constructor-return': 'error',
'no-self-compare': 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'react/prop-types': 'off', 'react/prop-types': 'off',
'react/jsx-no-useless-fragment': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/await-thenable': 'error', '@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/require-array-sort-compare': 'error', '@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/unified-signatures': 'error', '@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/prefer-for-of': 'error', '@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'unused-imports/no-unused-imports': 'error', 'unused-imports/no-unused-imports': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import-x/no-duplicates': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': true,
'ts-nocheck': true,
'ts-check': false,
},
],
'@typescript-eslint/no-restricted-imports': [ '@typescript-eslint/no-restricted-imports': [
'error', 'error',
{ {
@@ -163,26 +167,7 @@ const config = {
], ],
}, },
], ],
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
ignore: ['^\\[[a-zA-Z0-9-_]+\\]\\.tsx$'],
},
],
'unicorn/no-unnecessary-await': 'error',
'unicorn/no-useless-fallback-in-spread': 'error',
'unicorn/prefer-dom-node-dataset': 'error',
'unicorn/prefer-dom-node-append': 'error',
'unicorn/prefer-dom-node-remove': 'error',
'unicorn/prefer-array-some': 'error',
'unicorn/prefer-date-now': 'error',
'unicorn/prefer-blob-reading-methods': 'error',
'unicorn/no-typeof-undefined': 'error',
'unicorn/no-useless-promise-resolve-reject': 'error',
'unicorn/no-new-array': 'error',
'unicorn/new-for-builtins': 'error',
'unicorn/prefer-node-protocol': 'error',
'sonarjs/no-all-duplicated-branches': 'error', 'sonarjs/no-all-duplicated-branches': 'error',
'sonarjs/no-element-overwrite': 'error', 'sonarjs/no-element-overwrite': 'error',
'sonarjs/no-empty-collection': 'error', 'sonarjs/no-empty-collection': 'error',
@@ -197,7 +182,6 @@ const config = {
'sonarjs/no-same-line-conditional': 'error', 'sonarjs/no-same-line-conditional': 'error',
'sonarjs/no-duplicated-branches': 'error', 'sonarjs/no-duplicated-branches': 'error',
'sonarjs/no-collection-size-mischeck': 'error', 'sonarjs/no-collection-size-mischeck': 'error',
'sonarjs/no-useless-catch': 'error',
'sonarjs/no-identical-functions': 'error', 'sonarjs/no-identical-functions': 'error',
'rxjs/finnish': [ 'rxjs/finnish': [
'error', 'error',
@@ -217,26 +201,11 @@ const config = {
}, },
overrides: [ overrides: [
{ {
files: 'packages/backend/server/**/*.ts', files: [
`packages/**/*.{ts,tsx,js,mjs}`,
'tools/cli/**/*.{ts,tsx,js,mjs}',
],
rules: { rules: {
'@typescript-eslint/consistent-type-imports': 0,
},
},
{
files: '*.cjs',
rules: {
'@typescript-eslint/no-var-requires': 0,
},
},
...allPackages.map(pkg => ({
files: [`${pkg}/src/**/*.ts`, `${pkg}/src/**/*.tsx`, `${pkg}/**/*.mjs`],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: createPattern(pkg),
},
],
'@typescript-eslint/no-floating-promises': [ '@typescript-eslint/no-floating-promises': [
'error', 'error',
{ {
@@ -255,7 +224,7 @@ const config = {
}, },
], ],
}, },
})), },
{ {
files: [ files: [
'**/__tests__/**/*', '**/__tests__/**/*',
@@ -268,21 +237,17 @@ const config = {
'**/e2e/**/*', '**/e2e/**/*',
], ],
rules: { rules: {
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': false,
'ts-ignore': true,
'ts-nocheck': true,
'ts-check': false,
},
],
'@typescript-eslint/no-floating-promises': 0, '@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/no-misused-promises': 0, '@typescript-eslint/no-misused-promises': 0,
'@typescript-eslint/no-restricted-imports': 0, '@typescript-eslint/no-restricted-imports': 0,
}, },
}, },
{
files: ['packages/frontend/apps/electron/scripts/**/*'],
rules: {
'import-x/no-extraneous-dependencies': 'off',
},
},
], ],
}; };

View File

@@ -5,21 +5,150 @@
"correctness": "error", "correctness": "error",
"perf": "error" "perf": "error"
}, },
"ignorePatterns": ["tools/cli/src/webpack/error-handler.js"],
"rules": { "rules": {
// allow
"import/named": "allow", "import/named": "allow",
"no-await-in-loop": "allow", "no-await-in-loop": "allow",
"promise/no-callback-in-promise": "allow", "promise/no-callback-in-promise": "allow",
// deny
"array-callback-return": "error",
"constructor-super": "error",
"eqeqeq": ["error", "smart"],
"getter-return": "error",
"for-direction": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-empty-character-class": "error",
"no-self-compare": "error",
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-constant-binary-expression": "error",
"no-constructor-return": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-unused-vars": "error",
"no-ex-assign": "error",
"no-loss-of-precision": "error",
"no-fallthrough": "error",
"no-nonoctal-decimal-escape": "error",
"no-irregular-whitespace": "error",
"no-control-regex": "error",
"no-with": "error",
"no-debugger": "error",
"no-const-assign": "error",
"no-setter-return": "error",
"no-obj-calls": "error",
"no-unsafe-negation": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-this-before-super": "error",
"no-useless-catch": "error",
"no-async-promise-executor": "error",
"no-unreachable": "error",
"no-duplicate-case": "error",
"no-empty-pattern": "error",
"no-unused-labels": "error",
"no-sparse-arrays": "error",
"no-delete-var": "error",
"no-compare-neg-zero": "error",
"no-redeclare": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-var": "error",
"no-self-assign": "error",
"no-inner-declarations": "error",
"no-dupe-else-if": "error",
"no-invalid-regexp": "error",
"no-unsafe-finally": "error",
"no-prototype-builtins": "error",
"no-array-constructor": "error",
"no-shadow-restricted-names": "error",
"no-constant-condition": "error",
"no-useless-escape": "error",
"no-unsafe-optional-chaining": "error",
"no-extra-boolean-cast": "error",
"no-regex-spaces": "error",
"react/jsx-no-useless-fragment": "error",
"react/jsx-no-undef": "error",
"react/no-direct-mutation-state": "error",
"react/no-string-refs": "error",
"react/no-unknown-property": "error",
"react/no-danger-with-children": "error",
"react/no-unescaped-entities": "error",
"react/require-render-return": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-key": "error",
"react/no-is-mounted": "error",
"react/no-find-dom-node": "error",
"react/no-children-prop": "error",
"react/no-render-return-value": "error",
"react/jsx-no-target-blank": "error",
"react/jsx-no-comment-textnodes": "error",
"typescript/consistent-type-imports": "error",
"typescript/no-non-null-assertion": "error",
"typescript/triple-slash-reference": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/prefer-for-of": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/ban-types": "error",
"typescript/no-this-alias": [
"error",
{
"allow_destructuring": true
}
],
"typescript/prefer-as-const": "error",
"typescript/no-var-requires": "error",
"typescript/no-namespace": "error",
"typescript/ban-ts-comment": [
"error",
{
"ts-expect-error": "allow-with-description",
"ts-ignore": true,
"ts-nocheck": true,
"ts-check": false
}
],
"unicorn/prefer-array-some": "error", "unicorn/prefer-array-some": "error",
"unicorn/no-useless-promise-resolve-reject": "error", "unicorn/no-useless-promise-resolve-reject": "error",
"unicorn/no-unnecessary-await": "error",
"unicorn/no-useless-fallback-in-spread": "error",
"unicorn/filename-case": [
"error",
{
"case": "kebabCase"
}
],
"unicorn/prefer-dom-node-dataset": "error",
"unicorn/prefer-dom-node-append": "error",
"unicorn/prefer-dom-node-remove": "error",
"unicorn/prefer-date-now": "error",
"unicorn/prefer-blob-reading-methods": "error",
"unicorn/no-typeof-undefined": "error",
"unicorn/no-new-array": "error",
"unicorn/new-for-builtins": "error",
"unicorn/prefer-node-protocol": "error",
"import/no-cycle": [ "import/no-cycle": [
"error", "error",
{ {
"ignoreTypes": true "ignoreTypes": true
} }
], ],
"import/namespace": "off" "import/sort-imports": "error",
"import/namespace": "off",
"import/no-webpack-loader-syntax": "error",
"import/no-duplicates": "error",
"import/no-import-assign": "error",
"import/no-self-import": "error"
}, },
"overrides": [ "overrides": [
{ {
@@ -27,6 +156,31 @@
"rules": { "rules": {
"react/no-array-index-key": "off" "react/no-array-index-key": "off"
} }
},
{
"files": ["packages/backend/**/*.ts"],
"rules": {
"typescript/consistent-type-imports": "off"
}
},
{
"files": [
"*.{spec,test,e2e,stories}.{ts,tsx}",
"tests/**/*.ts",
"packages/backend/server/tests/**/*.ts"
],
"rules": {
"typescript/no-non-null-assertion": "off",
"typescript/ban-ts-comment": [
"error",
{
"ts-expect-error": false,
"ts-ignore": true,
"ts-nocheck": true,
"ts-check": false
}
]
}
} }
] ]
} }

View File

@@ -78,7 +78,6 @@
"eslint-plugin-react": "^7.37.2", "eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-rxjs": "^5.0.3", "eslint-plugin-rxjs": "^5.0.3",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sonarjs": "^3.0.1", "eslint-plugin-sonarjs": "^3.0.1",
"eslint-plugin-unicorn": "^56.0.1", "eslint-plugin-unicorn": "^56.0.1",
"eslint-plugin-unused-imports": "^4.1.4", "eslint-plugin-unused-imports": "^4.1.4",

View File

@@ -2,4 +2,6 @@ export type { DocCustomPropertyInfo, DocProperties } from './schema';
export { export {
AFFiNE_WORKSPACE_DB_SCHEMA, AFFiNE_WORKSPACE_DB_SCHEMA,
AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA, AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA,
type AFFiNEWorkspaceDbSchema,
type AFFiNEWorkspaceUserdataDbSchema,
} from './schema'; } from './schema';

View File

@@ -30,14 +30,12 @@ export const AFFiNE_WORKSPACE_DB_SCHEMA = {
// we will keep deleted properties in the database, for override legacy data // we will keep deleted properties in the database, for override legacy data
}, },
} as const satisfies DBSchemaBuilder; } as const satisfies DBSchemaBuilder;
export type AFFiNE_WORKSPACE_DB_SCHEMA = typeof AFFiNE_WORKSPACE_DB_SCHEMA; export type AFFiNEWorkspaceDbSchema = typeof AFFiNE_WORKSPACE_DB_SCHEMA;
export type DocProperties = ORMEntity< export type DocProperties = ORMEntity<AFFiNEWorkspaceDbSchema['docProperties']>;
AFFiNE_WORKSPACE_DB_SCHEMA['docProperties']
>;
export type DocCustomPropertyInfo = ORMEntity< export type DocCustomPropertyInfo = ORMEntity<
AFFiNE_WORKSPACE_DB_SCHEMA['docCustomPropertyInfo'] AFFiNEWorkspaceDbSchema['docCustomPropertyInfo']
>; >;
export const AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA = { export const AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA = {
@@ -46,5 +44,5 @@ export const AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA = {
index: f.string(), index: f.string(),
}, },
} as const satisfies DBSchemaBuilder; } as const satisfies DBSchemaBuilder;
export type AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA = export type AFFiNEWorkspaceUserdataDbSchema =
typeof AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA; typeof AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA;

View File

@@ -9,6 +9,8 @@ import { WorkspaceDB, type WorkspaceDBWithTables } from '../entities/db';
import { import {
AFFiNE_WORKSPACE_DB_SCHEMA, AFFiNE_WORKSPACE_DB_SCHEMA,
AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA, AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA,
type AFFiNEWorkspaceDbSchema,
type AFFiNEWorkspaceUserdataDbSchema,
} from '../schema'; } from '../schema';
const WorkspaceDBClient = createORMClient(AFFiNE_WORKSPACE_DB_SCHEMA); const WorkspaceDBClient = createORMClient(AFFiNE_WORKSPACE_DB_SCHEMA);
@@ -17,10 +19,10 @@ const WorkspaceUserdataDBClient = createORMClient(
); );
export class WorkspaceDBService extends Service { export class WorkspaceDBService extends Service {
db: WorkspaceDBWithTables<AFFiNE_WORKSPACE_DB_SCHEMA>; db: WorkspaceDBWithTables<AFFiNEWorkspaceDbSchema>;
userdataDBPool = new ObjectPool< userdataDBPool = new ObjectPool<
string, string,
WorkspaceDB<AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA> WorkspaceDB<AFFiNEWorkspaceUserdataDbSchema>
>({ >({
onDangling() { onDangling() {
return false; // never release return false; // never release
@@ -30,7 +32,7 @@ export class WorkspaceDBService extends Service {
constructor(private readonly workspaceService: WorkspaceService) { constructor(private readonly workspaceService: WorkspaceService) {
super(); super();
this.db = this.framework.createEntity( this.db = this.framework.createEntity(
WorkspaceDB<AFFiNE_WORKSPACE_DB_SCHEMA>, WorkspaceDB<AFFiNEWorkspaceDbSchema>,
{ {
db: new WorkspaceDBClient( db: new WorkspaceDBClient(
new YjsDBAdapter(AFFiNE_WORKSPACE_DB_SCHEMA, { new YjsDBAdapter(AFFiNE_WORKSPACE_DB_SCHEMA, {
@@ -52,7 +54,7 @@ export class WorkspaceDBService extends Service {
storageDocId: tableName => storageDocId: tableName =>
`db$${this.workspaceService.workspace.id}$${tableName}`, `db$${this.workspaceService.workspace.id}$${tableName}`,
} }
) as WorkspaceDBWithTables<AFFiNE_WORKSPACE_DB_SCHEMA>; ) as WorkspaceDBWithTables<AFFiNEWorkspaceDbSchema>;
} }
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
@@ -60,11 +62,11 @@ export class WorkspaceDBService extends Service {
// __local__ for local workspace // __local__ for local workspace
const userdataDb = this.userdataDBPool.get(userId); const userdataDb = this.userdataDBPool.get(userId);
if (userdataDb) { if (userdataDb) {
return userdataDb.obj as WorkspaceDBWithTables<AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA>; return userdataDb.obj as WorkspaceDBWithTables<AFFiNEWorkspaceUserdataDbSchema>;
} }
const newDB = this.framework.createEntity( const newDB = this.framework.createEntity(
WorkspaceDB<AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA>, WorkspaceDB<AFFiNEWorkspaceUserdataDbSchema>,
{ {
db: new WorkspaceUserdataDBClient( db: new WorkspaceUserdataDBClient(
new YjsDBAdapter(AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA, { new YjsDBAdapter(AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA, {
@@ -89,7 +91,7 @@ export class WorkspaceDBService extends Service {
); );
this.userdataDBPool.put(userId, newDB); this.userdataDBPool.put(userId, newDB);
return newDB as WorkspaceDBWithTables<AFFiNE_WORKSPACE_USERDATA_DB_SCHEMA>; return newDB as WorkspaceDBWithTables<AFFiNEWorkspaceUserdataDbSchema>;
} }
static isDBDocId(docId: string) { static isDBDocId(docId: string) {

View File

@@ -236,4 +236,5 @@ export const AFFINE_FLAGS = {
}, },
} satisfies { [key in string]: FlagInfo }; } satisfies { [key in string]: FlagInfo };
// eslint-disable-next-line no-redeclare
export type AFFINE_FLAGS = typeof AFFINE_FLAGS; export type AFFINE_FLAGS = typeof AFFINE_FLAGS;

View File

@@ -25,7 +25,6 @@ test('fractional-indexing', () => {
if (set.has(s1) || set.has(s2) || s1 === s2) { if (set.has(s1) || set.has(s2) || s1 === s2) {
throw new Error('Duplicate key, ' + set.size + ', ' + s1 + ', ' + s2); throw new Error('Duplicate key, ' + set.size + ', ' + s1 + ', ' + s2);
break;
} }
set.add(s1); set.add(s1);
set.add(s2); set.add(s2);

View File

@@ -118,7 +118,7 @@ export function uint8ArrayToBase64(array: Uint8Array): Promise<string> {
export function base64ToUint8Array(base64: string) { export function base64ToUint8Array(base64: string) {
const binaryString = atob(base64); const binaryString = atob(base64);
const binaryArray = binaryString.split('').map(function (char) { const binaryArray = [...binaryString].map(function (char) {
return char.charCodeAt(0); return char.charCodeAt(0);
}); });
return new Uint8Array(binaryArray); return new Uint8Array(binaryArray);

View File

@@ -1,7 +1,7 @@
import EventEmitter2 from 'eventemitter2'; import EventEmitter2 from 'eventemitter2';
import type { ConnectionStatus } from '../connection'; import type { ConnectionStatus } from '../connection';
import { type Storage, type StorageType } from '../storage'; import { type Storage, type StorageType } from './storage';
import type { BlobStorage } from './blob'; import type { BlobStorage } from './blob';
import type { DocStorage } from './doc'; import type { DocStorage } from './doc';
import type { SyncStorage } from './sync'; import type { SyncStorage } from './sync';

View File

@@ -3,6 +3,7 @@
"version": "0.18.0", "version": "0.18.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@affine/component": "workspace:*",
"@affine/core": "workspace:*", "@affine/core": "workspace:*",
"@affine/graphql": "workspace:*", "@affine/graphql": "workspace:*",
"@radix-ui/react-accordion": "^1.2.2", "@radix-ui/react-accordion": "^1.2.2",

View File

@@ -38,7 +38,11 @@ export function DataTableRowActions({ user }: DataTableRowActionsProps) {
const { resetPasswordLink, onResetPassword } = useResetUserPassword(); const { resetPasswordLink, onResetPassword } = useResetUserPassword();
const openResetPasswordDialog = useCallback(() => { const openResetPasswordDialog = useCallback(() => {
onResetPassword(user.id, () => setResetPasswordDialogOpen(true)); onResetPassword(user.id, () => setResetPasswordDialogOpen(true)).catch(
e => {
console.error(e);
}
);
}, [onResetPassword, user.id]); }, [onResetPassword, user.id]);
const handleCopy = useCallback(() => { const handleCopy = useCallback(() => {

View File

@@ -53,7 +53,7 @@ export const useCreateUser = () => {
toast.error('Failed to update account: ' + (e as Error).message); toast.error('Failed to update account: ' + (e as Error).message);
} }
}, },
[createAccount, revalidate] [createAccount, revalidate, updateAccountFeatures]
); );
return { creating: creating || !!error, create }; return { creating: creating || !!error, create };
@@ -99,7 +99,7 @@ export const useUpdateUser = () => {
toast.error('Failed to update account: ' + (e as Error).message); toast.error('Failed to update account: ' + (e as Error).message);
} }
}, },
[revalidate, updateAccount] [revalidate, updateAccount, updateAccountFeatures]
); );
return { updating: updating || !!error, update }; return { updating: updating || !!error, update };

View File

@@ -26,7 +26,7 @@ export function UserDropdown() {
fetch('/api/auth/sign-out') fetch('/api/auth/sign-out')
.then(() => { .then(() => {
toast.success('Logged out successfully'); toast.success('Logged out successfully');
relative(); return relative();
}) })
.catch(err => { .catch(err => {
toast.error(`Failed to logout: ${err.message}`); toast.error(`Failed to logout: ${err.message}`);

View File

@@ -6,6 +6,7 @@ import {
CarouselItem, CarouselItem,
} from '@affine/admin/components/ui/carousel'; } from '@affine/admin/components/ui/carousel';
import { validateEmailAndPassword } from '@affine/admin/utils'; import { validateEmailAndPassword } from '@affine/admin/utils';
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
import { useCallback, useEffect, useState } from 'react'; import { useCallback, useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { toast } from 'sonner'; import { toast } from 'sonner';
@@ -120,7 +121,7 @@ export const Form = () => {
} }
}, [emailValue, passwordValue, refreshServerConfig]); }, [emailValue, passwordValue, refreshServerConfig]);
const onNext = useCallback(async () => { const onNext = useAsyncCallback(async () => {
if (isCreateAdminStep) { if (isCreateAdminStep) {
if ( if (
!validateEmailAndPassword( !validateEmailAndPassword(

View File

@@ -26,6 +26,7 @@
"@affine-test/kit": "workspace:*", "@affine-test/kit": "workspace:*",
"@affine/component": "workspace:*", "@affine/component": "workspace:*",
"@affine/core": "workspace:*", "@affine/core": "workspace:*",
"@affine/electron-api": "workspace:*",
"@affine/i18n": "workspace:*", "@affine/i18n": "workspace:*",
"@affine/native": "workspace:*", "@affine/native": "workspace:*",
"@affine/nbstore": "workspace:*", "@affine/nbstore": "workspace:*",
@@ -48,9 +49,12 @@
"@toeverything/infra": "workspace:*", "@toeverything/infra": "workspace:*",
"@types/set-cookie-parser": "^2.4.10", "@types/set-cookie-parser": "^2.4.10",
"@types/uuid": "^10.0.0", "@types/uuid": "^10.0.0",
"@vanilla-extract/css": "^1.16.1",
"@vitejs/plugin-react-swc": "^3.7.2", "@vitejs/plugin-react-swc": "^3.7.2",
"app-builder-lib": "^25.1.8",
"builder-util-runtime": "^9.2.10", "builder-util-runtime": "^9.2.10",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"debug": "^4.4.0",
"electron": "^33.3.0", "electron": "^33.3.0",
"electron-log": "^5.2.4", "electron-log": "^5.2.4",
"electron-squirrel-startup": "1.0.1", "electron-squirrel-startup": "1.0.1",
@@ -59,6 +63,7 @@
"fs-extra": "^11.2.0", "fs-extra": "^11.2.0",
"glob": "^11.0.0", "glob": "^11.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"msw": "^2.6.8",
"nanoid": "^5.0.9", "nanoid": "^5.0.9",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0", "react-dom": "^19.0.0",

View File

@@ -80,7 +80,9 @@ async function watchLayers() {
console.log(`[layers] has changed, [re]launching electron...`); console.log(`[layers] has changed, [re]launching electron...`);
spawnOrReloadElectron(); spawnOrReloadElectron();
} else { } else {
buildContextPromise.then(resolve); buildContextPromise.then(resolve).catch(e => {
console.error(e);
});
initialBuild = true; initialBuild = true;
} }
}); });
@@ -88,9 +90,13 @@ async function watchLayers() {
}, },
], ],
}); });
buildContextPromise.then(async buildContext => { buildContextPromise
await buildContext.watch(); .then(buildContext => {
}); return buildContext.watch();
})
.catch(e => {
console.error(e);
});
}); });
} }

View File

@@ -89,4 +89,6 @@ async function make() {
await fs.remove(tmpPath); await fs.remove(tmpPath);
} }
make(); make().catch(e => {
console.error(e);
});

View File

@@ -79,4 +79,6 @@ async function make() {
return artifacts; return artifacts;
} }
make(); make().catch(e => {
console.error(e);
});

View File

@@ -33,6 +33,7 @@ if (overrideSession) {
app.setPath('sessionData', userDataPath); app.setPath('sessionData', userDataPath);
} }
// eslint-disable-next-line @typescript-eslint/no-var-requires
if (require('electron-squirrel-startup')) app.quit(); if (require('electron-squirrel-startup')) app.quit();
if (process.env.SKIP_ONBOARDING) { if (process.env.SKIP_ONBOARDING) {

View File

@@ -50,6 +50,6 @@ export const SpellCheckStateSchema = z.object({
enabled: z.boolean().optional(), enabled: z.boolean().optional(),
}); });
export const SpellCheckStateKey = 'spellCheckState'; export const SpellCheckStateKey = 'spellCheckState' as const;
export type SpellCheckStateKey = typeof SpellCheckStateKey; // eslint-disable-next-line no-redeclare
export type SpellCheckStateSchema = z.infer<typeof SpellCheckStateSchema>; export type SpellCheckStateSchema = z.infer<typeof SpellCheckStateSchema>;

View File

@@ -86,10 +86,14 @@ framework.impl(ValidatorProvider, {
}); });
framework.impl(VirtualKeyboardProvider, { framework.impl(VirtualKeyboardProvider, {
addEventListener: (event, callback) => { addEventListener: (event, callback) => {
Keyboard.addListener(event as any, callback as any); Keyboard.addListener(event as any, callback as any).catch(e => {
console.error(e);
});
}, },
removeAllListeners: () => { removeAllListeners: () => {
Keyboard.removeAllListeners(); Keyboard.removeAllListeners().catch(e => {
console.error(e);
});
}, },
}); });
framework.impl(NavigationGestureProvider, { framework.impl(NavigationGestureProvider, {
@@ -145,6 +149,8 @@ CapacitorApp.addListener('appUrlOpen', ({ url }) => {
.catch(console.error); .catch(console.error);
} }
} }
}).catch(e => {
console.error(e);
}); });
export function App() { export function App() {

View File

@@ -115,7 +115,7 @@ const convertBody = async (body: unknown, contentType: string) => {
}; };
function base64ToUint8Array(base64: string) { function base64ToUint8Array(base64: string) {
const binaryString = atob(base64); const binaryString = atob(base64);
const binaryArray = binaryString.split('').map(function (char) { const binaryArray = [...binaryString].map(function (char) {
return char.charCodeAt(0); return char.charCodeAt(0);
}); });
return new Uint8Array(binaryArray); return new Uint8Array(binaryArray);

View File

@@ -13,7 +13,7 @@ class NavigatorVirtualKeyboard implements VirtualKeyboard {
private readonly _overlaysContent = false; private readonly _overlaysContent = false;
private _listeners = new Map< private readonly _listeners = new Map<
string, string,
Set<{ Set<{
cb: VirtualKeyboardCallback; cb: VirtualKeyboardCallback;
@@ -53,11 +53,17 @@ class NavigatorVirtualKeyboard implements VirtualKeyboard {
}; };
constructor() { constructor() {
this._bindListener(); this._bindListener().catch(e => {
console.error(e);
});
} }
destroy() { destroy() {
this._capacitorListenerHandles.forEach(handle => handle.remove()); this._capacitorListenerHandles.forEach(handle => {
handle.remove().catch(e => {
console.error(e);
});
});
} }
get boundingRect(): DOMRect { get boundingRect(): DOMRect {
@@ -75,11 +81,15 @@ class NavigatorVirtualKeyboard implements VirtualKeyboard {
} }
hide() { hide() {
Keyboard.hide(); Keyboard.hide().catch(e => {
console.error(e);
});
} }
show() { show() {
Keyboard.show(); Keyboard.show().catch(e => {
console.error(e);
});
} }
ongeometrychange: ((this: VirtualKeyboard, ev: Event) => any) | null = null; ongeometrychange: ((this: VirtualKeyboard, ev: Event) => any) | null = null;

View File

@@ -1,8 +1,7 @@
import { type PasswordLimitsFragment } from '@affine/graphql'; import { type PasswordLimitsFragment } from '@affine/graphql';
import { useI18n } from '@affine/i18n'; import { useI18n } from '@affine/i18n';
import { type Options, passwordStrength } from 'check-password-strength'; import { type Options, passwordStrength } from 'check-password-strength';
import { type FC, useEffect, useMemo } from 'react'; import { type FC, useEffect, useMemo, useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
import { z, type ZodCustomIssue, ZodIssueCode } from 'zod'; import { z, type ZodCustomIssue, ZodIssueCode } from 'zod';
import type { InputProps } from '../../../ui/input'; import type { InputProps } from '../../../ui/input';

View File

@@ -97,7 +97,7 @@ export const DayPicker = memo(function DayPicker(
const focused = document.activeElement; const focused = document.activeElement;
// check if focused is a date cell // check if focused is a date cell
if (!focused?.hasAttribute('data-is-date-cell')) return; if (!(focused as HTMLElement | null)?.dataset.isDateCell) return;
if (e.shiftKey) return; if (e.shiftKey) return;
e.preventDefault(); e.preventDefault();

View File

@@ -4,8 +4,9 @@ import { type EditorHost } from '@blocksuite/affine/block-std';
import { import {
type AIItemGroupConfig, type AIItemGroupConfig,
EdgelessRootService, EdgelessRootService,
createLitPortal,
HoverController,
} from '@blocksuite/affine/blocks'; } from '@blocksuite/affine/blocks';
import { createLitPortal, HoverController } from '@blocksuite/affine/blocks';
import { WithDisposable } from '@blocksuite/affine/global/utils'; import { WithDisposable } from '@blocksuite/affine/global/utils';
import { flip, offset } from '@floating-ui/dom'; import { flip, offset } from '@floating-ui/dom';
import { css, html, LitElement, nothing } from 'lit'; import { css, html, LitElement, nothing } from 'lit';

View File

@@ -6,8 +6,6 @@ import {
type AffineSlashSubMenu, type AffineSlashSubMenu,
type AIItemConfig, type AIItemConfig,
DocModeProvider, DocModeProvider,
} from '@blocksuite/affine/blocks';
import {
AFFINE_AI_PANEL_WIDGET, AFFINE_AI_PANEL_WIDGET,
AffineSlashMenuWidget, AffineSlashMenuWidget,
AIStarIcon, AIStarIcon,

View File

@@ -6,8 +6,8 @@ import {
DocModeProvider, DocModeProvider,
type EdgelessRootService, type EdgelessRootService,
TelemetryProvider, TelemetryProvider,
NotificationProvider,
} from '@blocksuite/affine/blocks'; } from '@blocksuite/affine/blocks';
import { NotificationProvider } from '@blocksuite/affine/blocks';
import { import {
type AIChatBlockModel, type AIChatBlockModel,
type ChatMessage, type ChatMessage,

View File

@@ -4,8 +4,9 @@ import {
type FrameBlockModel, type FrameBlockModel,
ImageBlockModel, ImageBlockModel,
type SurfaceBlockComponent, type SurfaceBlockComponent,
BlocksUtils,
EdgelessRootService,
} from '@blocksuite/affine/blocks'; } from '@blocksuite/affine/blocks';
import { BlocksUtils, EdgelessRootService } from '@blocksuite/affine/blocks';
import { assertExists } from '@blocksuite/affine/global/utils'; import { assertExists } from '@blocksuite/affine/global/utils';
import { import {
type BlockModel, type BlockModel,

View File

@@ -236,6 +236,7 @@ export function revertUpdate(
} else if (type === 'Array') { } else if (type === 'Array') {
return snapshotDoc.getArray(key); return snapshotDoc.getArray(key);
} }
// eslint-disable-next-line array-callback-return
throw new Error('Unknown type'); throw new Error('Unknown type');
}) })
); );

View File

@@ -27,12 +27,12 @@ import { DebugLogger } from '@affine/debug';
import { track } from '@affine/track'; import { track } from '@affine/track';
import { import {
type BlockService, type BlockService,
BlockServiceWatcher,
BlockViewIdentifier, BlockViewIdentifier,
ConfigIdentifier, ConfigIdentifier,
type ExtensionType, type ExtensionType,
type WidgetComponent, type WidgetComponent,
} from '@blocksuite/affine/block-std'; } from '@blocksuite/affine/block-std';
import { BlockServiceWatcher } from '@blocksuite/affine/block-std';
import type { import type {
AffineReference, AffineReference,
DocMode, DocMode,

View File

@@ -11,8 +11,6 @@ import { GlobalDialogService } from '@affine/core/modules/dialogs';
import { import {
type CreateCheckoutSessionInput, type CreateCheckoutSessionInput,
SubscriptionRecurring, SubscriptionRecurring,
} from '@affine/graphql';
import {
SubscriptionPlan, SubscriptionPlan,
SubscriptionStatus, SubscriptionStatus,
SubscriptionVariant, SubscriptionVariant,

View File

@@ -3,7 +3,7 @@ import {
ExplorerService, ExplorerService,
ExplorerTreeRoot, ExplorerTreeRoot,
} from '@affine/core/modules/explorer'; } from '@affine/core/modules/explorer';
import type { FavoriteSupportType } from '@affine/core/modules/favorite'; import type { FavoriteSupportTypeUnion } from '@affine/core/modules/favorite';
import { FavoriteService } from '@affine/core/modules/favorite'; import { FavoriteService } from '@affine/core/modules/favorite';
import { useI18n } from '@affine/i18n'; import { useI18n } from '@affine/i18n';
import { import {
@@ -73,7 +73,7 @@ export const FavoriteNode = ({
}: { }: {
favorite: { favorite: {
id: string; id: string;
type: FavoriteSupportType; type: FavoriteSupportTypeUnion;
}; };
}) => { }) => {
return favorite.type === 'doc' ? ( return favorite.type === 'doc' ? (

View File

@@ -2,8 +2,8 @@ import {
type SubscriptionQuery, type SubscriptionQuery,
SubscriptionRecurring, SubscriptionRecurring,
SubscriptionVariant, SubscriptionVariant,
SubscriptionPlan,
} from '@affine/graphql'; } from '@affine/graphql';
import { SubscriptionPlan } from '@affine/graphql';
import { import {
backoffRetry, backoffRetry,
catchErrorInto, catchErrorInto,

View File

@@ -32,4 +32,5 @@ export const EditorSettingSchema = BSEditorSettingSchema.merge(
AffineEditorSettingSchema AffineEditorSettingSchema
); );
// eslint-disable-next-line no-redeclare
export type EditorSettingSchema = z.infer<typeof EditorSettingSchema>; export type EditorSettingSchema = z.infer<typeof EditorSettingSchema>;

View File

@@ -9,7 +9,7 @@ import { LiveData, Service } from '@toeverything/infra';
import type { DesktopApiService } from '../../desktop-api'; import type { DesktopApiService } from '../../desktop-api';
import type { I18n } from '../../i18n'; import type { I18n } from '../../i18n';
const SPELL_CHECK_SETTING_KEY: SpellCheckStateKey = 'spellCheckState'; const SPELL_CHECK_SETTING_KEY: typeof SpellCheckStateKey = 'spellCheckState';
export class SpellCheckSettingService extends Service { export class SpellCheckSettingService extends Service {
constructor( constructor(

View File

@@ -8,7 +8,7 @@ import {
DropEffect, DropEffect,
ExplorerTreeRoot, ExplorerTreeRoot,
} from '@affine/core/modules/explorer/views/tree'; } from '@affine/core/modules/explorer/views/tree';
import type { FavoriteSupportType } from '@affine/core/modules/favorite'; import type { FavoriteSupportTypeUnion } from '@affine/core/modules/favorite';
import { import {
FavoriteService, FavoriteService,
isFavoriteSupportType, isFavoriteSupportType,
@@ -97,7 +97,7 @@ export const ExplorerFavorites = () => {
const handleOnChildrenDrop = useCallback( const handleOnChildrenDrop = useCallback(
( (
favorite: { id: string; type: FavoriteSupportType }, favorite: { id: string; type: FavoriteSupportTypeUnion },
data: DropTargetDropEvent<AffineDNDData> data: DropTargetDropEvent<AffineDNDData>
) => { ) => {
if ( if (
@@ -220,12 +220,12 @@ const ExplorerFavoriteNode = ({
}: { }: {
favorite: { favorite: {
id: string; id: string;
type: FavoriteSupportType; type: FavoriteSupportTypeUnion;
}; };
onDrop: ( onDrop: (
favorite: { favorite: {
id: string; id: string;
type: FavoriteSupportType; type: FavoriteSupportTypeUnion;
}, },
data: DropTargetDropEvent<AffineDNDData> data: DropTargetDropEvent<AffineDNDData>
) => void; ) => void;

View File

@@ -4,8 +4,8 @@ export const FavoriteSupportType = [
'tag', 'tag',
'folder', 'folder',
] as const; ] as const;
export type FavoriteSupportType = 'collection' | 'doc' | 'tag' | 'folder'; export type FavoriteSupportTypeUnion = 'collection' | 'doc' | 'tag' | 'folder';
export const isFavoriteSupportType = ( export const isFavoriteSupportType = (
type: string type: string
): type is FavoriteSupportType => ): type is FavoriteSupportTypeUnion =>
FavoriteSupportType.includes(type as FavoriteSupportType); FavoriteSupportType.includes(type as FavoriteSupportTypeUnion);

View File

@@ -3,7 +3,7 @@ import {
generateFractionalIndexingKeyBetween, generateFractionalIndexingKeyBetween,
} from '@toeverything/infra'; } from '@toeverything/infra';
import type { FavoriteSupportType } from '../constant'; import type { FavoriteSupportTypeUnion } from '../constant';
import type { FavoriteRecord, FavoriteStore } from '../stores/favorite'; import type { FavoriteRecord, FavoriteStore } from '../stores/favorite';
export class FavoriteList extends Entity { export class FavoriteList extends Entity {
@@ -20,16 +20,16 @@ export class FavoriteList extends Entity {
/** /**
* get favorite record by type and id * get favorite record by type and id
*/ */
favorite$(type: FavoriteSupportType, id: string) { favorite$(type: FavoriteSupportTypeUnion, id: string) {
return this.store.watchFavorite(type, id); return this.store.watchFavorite(type, id);
} }
isFavorite$(type: FavoriteSupportType, id: string) { isFavorite$(type: FavoriteSupportTypeUnion, id: string) {
return this.favorite$(type, id).map(v => !!v); return this.favorite$(type, id).map(v => !!v);
} }
add( add(
type: FavoriteSupportType, type: FavoriteSupportTypeUnion,
id: string, id: string,
index: string = this.indexAt('before') index: string = this.indexAt('before')
) { ) {
@@ -37,7 +37,7 @@ export class FavoriteList extends Entity {
} }
toggle( toggle(
type: FavoriteSupportType, type: FavoriteSupportTypeUnion,
id: string, id: string,
index: string = this.indexAt('before') index: string = this.indexAt('before')
) { ) {
@@ -48,18 +48,18 @@ export class FavoriteList extends Entity {
} }
} }
remove(type: FavoriteSupportType, id: string) { remove(type: FavoriteSupportTypeUnion, id: string) {
return this.store.removeFavorite(type, id); return this.store.removeFavorite(type, id);
} }
reorder(type: FavoriteSupportType, id: string, index: string) { reorder(type: FavoriteSupportTypeUnion, id: string, index: string) {
return this.store.reorderFavorite(type, id, index); return this.store.reorderFavorite(type, id, index);
} }
indexAt( indexAt(
at: 'before' | 'after', at: 'before' | 'after',
targetRecord?: { targetRecord?: {
type: FavoriteSupportType; type: FavoriteSupportTypeUnion;
id: string; id: string;
} }
) { ) {

View File

@@ -14,7 +14,11 @@ import {
} from './services/old/adapter'; } from './services/old/adapter';
import { FavoriteStore } from './stores/favorite'; import { FavoriteStore } from './stores/favorite';
export { FavoriteSupportType, isFavoriteSupportType } from './constant'; export {
FavoriteSupportType,
type FavoriteSupportTypeUnion,
isFavoriteSupportType,
} from './constant';
export type { FavoriteList } from './entities/favorite-list'; export type { FavoriteList } from './entities/favorite-list';
export { FavoriteService } from './services/favorite'; export { FavoriteService } from './services/favorite';
export { export {

View File

@@ -6,7 +6,7 @@ import { LiveData, Service } from '@toeverything/infra';
import { defaultsDeep } from 'lodash-es'; import { defaultsDeep } from 'lodash-es';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import type { FavoriteSupportType } from '../../constant'; import type { FavoriteSupportTypeUnion } from '../../constant';
import type { FavoriteService } from '../favorite'; import type { FavoriteService } from '../favorite';
import { import {
PagePropertyType, PagePropertyType,
@@ -192,7 +192,7 @@ export class MigrationFavoriteItemsAdapter extends Service {
} }
} }
type CompatibleFavoriteSupportType = FavoriteSupportType; type CompatibleFavoriteSupportType = FavoriteSupportTypeUnion;
/** /**
* A service written for compatibility,with the same API as old FavoriteItemsAdapter. * A service written for compatibility,with the same API as old FavoriteItemsAdapter.

View File

@@ -3,11 +3,11 @@ import { LiveData, Store } from '@toeverything/infra';
import { map } from 'rxjs'; import { map } from 'rxjs';
import { AuthService, type WorkspaceServerService } from '../../cloud'; import { AuthService, type WorkspaceServerService } from '../../cloud';
import type { FavoriteSupportType } from '../constant'; import type { FavoriteSupportTypeUnion } from '../constant';
import { isFavoriteSupportType } from '../constant'; import { isFavoriteSupportType } from '../constant';
export interface FavoriteRecord { export interface FavoriteRecord {
type: FavoriteSupportType; type: FavoriteSupportTypeUnion;
id: string; id: string;
index: string; index: string;
} }
@@ -58,7 +58,7 @@ export class FavoriteStore extends Store {
} }
addFavorite( addFavorite(
type: FavoriteSupportType, type: FavoriteSupportTypeUnion,
id: string, id: string,
index: string index: string
): FavoriteRecord { ): FavoriteRecord {
@@ -70,17 +70,17 @@ export class FavoriteStore extends Store {
return this.toRecord(raw) as FavoriteRecord; return this.toRecord(raw) as FavoriteRecord;
} }
reorderFavorite(type: FavoriteSupportType, id: string, index: string) { reorderFavorite(type: FavoriteSupportTypeUnion, id: string, index: string) {
const db = this.userdataDB$.value; const db = this.userdataDB$.value;
db.favorite.update(this.encodeKey(type, id), { index }); db.favorite.update(this.encodeKey(type, id), { index });
} }
removeFavorite(type: FavoriteSupportType, id: string) { removeFavorite(type: FavoriteSupportTypeUnion, id: string) {
const db = this.userdataDB$.value; const db = this.userdataDB$.value;
db.favorite.delete(this.encodeKey(type, id)); db.favorite.delete(this.encodeKey(type, id));
} }
watchFavorite(type: FavoriteSupportType, id: string) { watchFavorite(type: FavoriteSupportTypeUnion, id: string) {
const db = this.userdataDB$.value; const db = this.userdataDB$.value;
return LiveData.from<FavoriteRecord | undefined>( return LiveData.from<FavoriteRecord | undefined>(
db.favorite db.favorite
@@ -112,7 +112,7 @@ export class FavoriteStore extends Store {
* @returns null if key is invalid * @returns null if key is invalid
*/ */
private parseKey(key: string): { private parseKey(key: string): {
type: FavoriteSupportType; type: FavoriteSupportTypeUnion;
id: string; id: string;
} | null { } | null {
const [type, id] = key.split(':'); const [type, id] = key.split(':');
@@ -122,10 +122,10 @@ export class FavoriteStore extends Store {
if (!isFavoriteSupportType(type)) { if (!isFavoriteSupportType(type)) {
return null; return null;
} }
return { type: type as FavoriteSupportType, id }; return { type: type as FavoriteSupportTypeUnion, id };
} }
private encodeKey(type: FavoriteSupportType, id: string) { private encodeKey(type: FavoriteSupportTypeUnion, id: string) {
return `${type}:${id}`; return `${type}:${id}`;
} }
} }

View File

@@ -4,9 +4,9 @@ export const OrganizeSupportType = [
'collection', 'collection',
'tag', 'tag',
] as const; ] as const;
export type OrganizeSupportType = 'folder' | 'doc' | 'collection' | 'tag'; export type OrganizeSupportTypeUnion = 'folder' | 'doc' | 'collection' | 'tag';
export const isOrganizeSupportType = ( export const isOrganizeSupportType = (
type: string type: string
): type is OrganizeSupportType => ): type is OrganizeSupportTypeUnion =>
OrganizeSupportType.includes(type as OrganizeSupportType); OrganizeSupportType.includes(type as OrganizeSupportTypeUnion);

View File

@@ -1,7 +1,7 @@
import { createORMClient, Entity, YjsDBAdapter } from '@toeverything/infra'; import { createORMClient, Entity, YjsDBAdapter } from '@toeverything/infra';
import { Doc as YDoc } from 'yjs'; import { Doc as YDoc } from 'yjs';
import { USER_DB_SCHEMA } from '../schema'; import { USER_DB_SCHEMA, type UserDbSchema } from '../schema';
import { UserDBEngine } from './user-db-engine'; import { UserDBEngine } from './user-db-engine';
import { UserDBTable } from './user-db-table'; import { UserDBTable } from './user-db-table';
@@ -42,5 +42,5 @@ export class UserDB extends Entity<{
} }
export type UserDBWithTables = UserDB & { export type UserDBWithTables = UserDB & {
[K in keyof USER_DB_SCHEMA]: UserDBTable<USER_DB_SCHEMA[K]>; [K in keyof UserDbSchema]: UserDBTable<UserDbSchema[K]>;
}; };

View File

@@ -6,4 +6,4 @@ export const USER_DB_SCHEMA = {
value: f.string(), value: f.string(),
}, },
} as const satisfies DBSchemaBuilder; } as const satisfies DBSchemaBuilder;
export type USER_DB_SCHEMA = typeof USER_DB_SCHEMA; export type UserDbSchema = typeof USER_DB_SCHEMA;

View File

@@ -24,8 +24,9 @@ import {
type WorkspaceFlavoursProvider, type WorkspaceFlavoursProvider,
type WorkspaceMetadata, type WorkspaceMetadata,
type WorkspaceProfileInfo, type WorkspaceProfileInfo,
effect,
getAFFiNEWorkspaceSchema,
} from '@toeverything/infra'; } from '@toeverything/infra';
import { effect, getAFFiNEWorkspaceSchema } from '@toeverything/infra';
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
import { EMPTY, map, mergeMap, Observable, switchMap } from 'rxjs'; import { EMPTY, map, mergeMap, Observable, switchMap } from 'rxjs';

View File

@@ -21,7 +21,7 @@ export function uint8ArrayToBase64(array: Uint8Array): Promise<string> {
export function base64ToUint8Array(base64: string) { export function base64ToUint8Array(base64: string) {
const binaryString = atob(base64); const binaryString = atob(base64);
const binaryArray = binaryString.split('').map(function (char) { const binaryArray = [...binaryString].map(function (char) {
return char.charCodeAt(0); return char.charCodeAt(0);
}); });
return new Uint8Array(binaryArray); return new Uint8Array(binaryArray);

View File

@@ -16,16 +16,12 @@ export function fuzzyMatch(
query: string, query: string,
matchInitial?: boolean matchInitial?: boolean
) { ) {
const pureName = name const pureName = [...name.trim().toLowerCase()]
.trim()
.toLowerCase()
.split('')
.filter(char => char !== ' ') .filter(char => char !== ' ')
.join(''); .join('');
const regex = new RegExp( const regex = new RegExp(
query [...query]
.split('')
.filter(char => char !== ' ') .filter(char => char !== ' ')
.map(item => `${escapeRegExp(item)}.*`) .map(item => `${escapeRegExp(item)}.*`)
.join(''), .join(''),

View File

@@ -158,4 +158,4 @@ export function createI18nWrapper(getI18nFn: () => i18n) {
* I18n['com.affine.xxx']({ arg1: 'hello' }) -> '中文 hello' * I18n['com.affine.xxx']({ arg1: 'hello' }) -> '中文 hello'
*/ */
export const I18n = createI18nWrapper(getOrCreateI18n); export const I18n = createI18nWrapper(getOrCreateI18n);
export type I18n = typeof I18n; export type I18nInstance = typeof I18n;

View File

@@ -1,6 +1,6 @@
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { I18n } from '../i18next'; import { type I18nInstance, I18n } from '../i18next';
export type TimeUnit = export type TimeUnit =
| 'second' | 'second'
@@ -46,7 +46,7 @@ export function i18nTime(
time: dayjs.ConfigType, time: dayjs.ConfigType,
options: { options: {
// override i18n instance, default is global I18n instance // override i18n instance, default is global I18n instance
i18n?: I18n; i18n?: I18nInstance;
// override now time, default is current time // override now time, default is current time
now?: dayjs.ConfigType; now?: dayjs.ConfigType;
relative?: relative?:

View File

@@ -24,7 +24,7 @@ vi.mock('@blocksuite/affine/presets', () => ({
})); }));
if (typeof window !== 'undefined' && HTMLCanvasElement) { if (typeof window !== 'undefined' && HTMLCanvasElement) {
// @ts-expect-error // @ts-expect-error allow vitest global mock
HTMLCanvasElement.prototype.getContext = () => { HTMLCanvasElement.prototype.getContext = () => {
return { return {
fillRect: vi.fn(), fillRect: vi.fn(),

250
yarn.lock
View File

@@ -150,6 +150,7 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@affine/admin@workspace:packages/frontend/admin" resolution: "@affine/admin@workspace:packages/frontend/admin"
dependencies: dependencies:
"@affine/component": "workspace:*"
"@affine/core": "workspace:*" "@affine/core": "workspace:*"
"@affine/graphql": "workspace:*" "@affine/graphql": "workspace:*"
"@radix-ui/react-accordion": "npm:^1.2.2" "@radix-ui/react-accordion": "npm:^1.2.2"
@@ -514,6 +515,7 @@ __metadata:
"@affine-test/kit": "workspace:*" "@affine-test/kit": "workspace:*"
"@affine/component": "workspace:*" "@affine/component": "workspace:*"
"@affine/core": "workspace:*" "@affine/core": "workspace:*"
"@affine/electron-api": "workspace:*"
"@affine/i18n": "workspace:*" "@affine/i18n": "workspace:*"
"@affine/native": "workspace:*" "@affine/native": "workspace:*"
"@affine/nbstore": "workspace:*" "@affine/nbstore": "workspace:*"
@@ -536,10 +538,13 @@ __metadata:
"@toeverything/infra": "workspace:*" "@toeverything/infra": "workspace:*"
"@types/set-cookie-parser": "npm:^2.4.10" "@types/set-cookie-parser": "npm:^2.4.10"
"@types/uuid": "npm:^10.0.0" "@types/uuid": "npm:^10.0.0"
"@vanilla-extract/css": "npm:^1.16.1"
"@vitejs/plugin-react-swc": "npm:^3.7.2" "@vitejs/plugin-react-swc": "npm:^3.7.2"
app-builder-lib: "npm:^25.1.8"
async-call-rpc: "npm:^6.4.2" async-call-rpc: "npm:^6.4.2"
builder-util-runtime: "npm:^9.2.10" builder-util-runtime: "npm:^9.2.10"
cross-env: "npm:^7.0.3" cross-env: "npm:^7.0.3"
debug: "npm:^4.4.0"
electron: "npm:^33.3.0" electron: "npm:^33.3.0"
electron-log: "npm:^5.2.4" electron-log: "npm:^5.2.4"
electron-squirrel-startup: "npm:1.0.1" electron-squirrel-startup: "npm:1.0.1"
@@ -550,6 +555,7 @@ __metadata:
glob: "npm:^11.0.0" glob: "npm:^11.0.0"
link-preview-js: "npm:^3.0.12" link-preview-js: "npm:^3.0.12"
lodash-es: "npm:^4.17.21" lodash-es: "npm:^4.17.21"
msw: "npm:^2.6.8"
nanoid: "npm:^5.0.9" nanoid: "npm:^5.0.9"
next-themes: "npm:^0.4.4" next-themes: "npm:^0.4.4"
react: "npm:^19.0.0" react: "npm:^19.0.0"
@@ -691,7 +697,6 @@ __metadata:
eslint-plugin-react: "npm:^7.37.2" eslint-plugin-react: "npm:^7.37.2"
eslint-plugin-react-hooks: "npm:^4.6.2" eslint-plugin-react-hooks: "npm:^4.6.2"
eslint-plugin-rxjs: "npm:^5.0.3" eslint-plugin-rxjs: "npm:^5.0.3"
eslint-plugin-simple-import-sort: "npm:^12.1.1"
eslint-plugin-sonarjs: "npm:^3.0.1" eslint-plugin-sonarjs: "npm:^3.0.1"
eslint-plugin-unicorn: "npm:^56.0.1" eslint-plugin-unicorn: "npm:^56.0.1"
eslint-plugin-unused-imports: "npm:^4.1.4" eslint-plugin-unused-imports: "npm:^4.1.4"
@@ -4535,7 +4540,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@electron/notarize@npm:^2.1.0": "@electron/notarize@npm:2.5.0, @electron/notarize@npm:^2.1.0":
version: 2.5.0 version: 2.5.0
resolution: "@electron/notarize@npm:2.5.0" resolution: "@electron/notarize@npm:2.5.0"
dependencies: dependencies:
@@ -4563,7 +4568,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@electron/osx-sign@npm:^1.0.5": "@electron/osx-sign@npm:1.3.1, @electron/osx-sign@npm:^1.0.5":
version: 1.3.1 version: 1.3.1
resolution: "@electron/osx-sign@npm:1.3.1" resolution: "@electron/osx-sign@npm:1.3.1"
dependencies: dependencies:
@@ -4609,6 +4614,30 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@electron/rebuild@npm:3.6.1":
version: 3.6.1
resolution: "@electron/rebuild@npm:3.6.1"
dependencies:
"@malept/cross-spawn-promise": "npm:^2.0.0"
chalk: "npm:^4.0.0"
debug: "npm:^4.1.1"
detect-libc: "npm:^2.0.1"
fs-extra: "npm:^10.0.0"
got: "npm:^11.7.0"
node-abi: "npm:^3.45.0"
node-api-version: "npm:^0.2.0"
node-gyp: "npm:^9.0.0"
ora: "npm:^5.1.0"
read-binary-file-arch: "npm:^1.0.6"
semver: "npm:^7.3.5"
tar: "npm:^6.0.5"
yargs: "npm:^17.0.1"
bin:
electron-rebuild: lib/cli.js
checksum: 10/baedb09a8b109347fd1e7ee16559b4519ebc56a4ec624b3eec5215282a66def5fa4b96c19a26df0f53cd3ab60f077e88cd03429b46ddc63e70279f30c8e20c8a
languageName: node
linkType: hard
"@electron/rebuild@npm:^3.7.0": "@electron/rebuild@npm:^3.7.0":
version: 3.7.1 version: 3.7.1
resolution: "@electron/rebuild@npm:3.7.1" resolution: "@electron/rebuild@npm:3.7.1"
@@ -4649,7 +4678,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@electron/universal@npm:^2.0.1": "@electron/universal@npm:2.0.1, @electron/universal@npm:^2.0.1":
version: 2.0.1 version: 2.0.1
resolution: "@electron/universal@npm:2.0.1" resolution: "@electron/universal@npm:2.0.1"
dependencies: dependencies:
@@ -15871,6 +15900,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"app-builder-bin@npm:5.0.0-alpha.10":
version: 5.0.0-alpha.10
resolution: "app-builder-bin@npm:5.0.0-alpha.10"
checksum: 10/842dc0cade3f1dc2c3fc2809511a4ecb86146d17d22e35d97a493bf3c8bd131552e935abd8ed8df40f6f62d8b231b7b705c81df709becdd55dc28dc6f247af31
languageName: node
linkType: hard
"app-builder-lib@npm:^24.13.3": "app-builder-lib@npm:^24.13.3":
version: 24.13.3 version: 24.13.3
resolution: "app-builder-lib@npm:24.13.3" resolution: "app-builder-lib@npm:24.13.3"
@@ -15909,6 +15945,49 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"app-builder-lib@npm:^25.1.8":
version: 25.1.8
resolution: "app-builder-lib@npm:25.1.8"
dependencies:
"@develar/schema-utils": "npm:~2.6.5"
"@electron/notarize": "npm:2.5.0"
"@electron/osx-sign": "npm:1.3.1"
"@electron/rebuild": "npm:3.6.1"
"@electron/universal": "npm:2.0.1"
"@malept/flatpak-bundler": "npm:^0.4.0"
"@types/fs-extra": "npm:9.0.13"
async-exit-hook: "npm:^2.0.1"
bluebird-lst: "npm:^1.0.9"
builder-util: "npm:25.1.7"
builder-util-runtime: "npm:9.2.10"
chromium-pickle-js: "npm:^0.2.0"
config-file-ts: "npm:0.2.8-rc1"
debug: "npm:^4.3.4"
dotenv: "npm:^16.4.5"
dotenv-expand: "npm:^11.0.6"
ejs: "npm:^3.1.8"
electron-publish: "npm:25.1.7"
form-data: "npm:^4.0.0"
fs-extra: "npm:^10.1.0"
hosted-git-info: "npm:^4.1.0"
is-ci: "npm:^3.0.0"
isbinaryfile: "npm:^5.0.0"
js-yaml: "npm:^4.1.0"
json5: "npm:^2.2.3"
lazy-val: "npm:^1.0.5"
minimatch: "npm:^10.0.0"
resedit: "npm:^1.7.0"
sanitize-filename: "npm:^1.6.3"
semver: "npm:^7.3.8"
tar: "npm:^6.1.12"
temp-file: "npm:^3.4.0"
peerDependencies:
dmg-builder: 25.1.8
electron-builder-squirrel-windows: 25.1.8
checksum: 10/0af82ffd8389b6dbacffd0ee3191ed056b411f069c362e0f676bf00413d8cb14f0d6d9047e1ab388a578e7f41c8338daa489a259de1203d4b9fc465254dda685
languageName: node
linkType: hard
"appdmg@npm:^0.6.4": "appdmg@npm:^0.6.4":
version: 0.6.6 version: 0.6.6
resolution: "appdmg@npm:0.6.6" resolution: "appdmg@npm:0.6.6"
@@ -15961,6 +16040,16 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"are-we-there-yet@npm:^3.0.0":
version: 3.0.1
resolution: "are-we-there-yet@npm:3.0.1"
dependencies:
delegates: "npm:^1.0.0"
readable-stream: "npm:^3.6.0"
checksum: 10/390731720e1bf9ed5d0efc635ea7df8cbc4c90308b0645a932f06e8495a0bf1ecc7987d3b97e805f62a17d6c4b634074b25200aa4d149be2a7b17250b9744bc4
languageName: node
linkType: hard
"arg@npm:5.0.2, arg@npm:^5.0.2": "arg@npm:5.0.2, arg@npm:^5.0.2":
version: 5.0.2 version: 5.0.2
resolution: "arg@npm:5.0.2" resolution: "arg@npm:5.0.2"
@@ -16874,6 +16963,30 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"builder-util@npm:25.1.7":
version: 25.1.7
resolution: "builder-util@npm:25.1.7"
dependencies:
7zip-bin: "npm:~5.2.0"
"@types/debug": "npm:^4.1.6"
app-builder-bin: "npm:5.0.0-alpha.10"
bluebird-lst: "npm:^1.0.9"
builder-util-runtime: "npm:9.2.10"
chalk: "npm:^4.1.2"
cross-spawn: "npm:^7.0.3"
debug: "npm:^4.3.4"
fs-extra: "npm:^10.1.0"
http-proxy-agent: "npm:^7.0.0"
https-proxy-agent: "npm:^7.0.0"
is-ci: "npm:^3.0.0"
js-yaml: "npm:^4.1.0"
source-map-support: "npm:^0.5.19"
stat-mode: "npm:^1.0.0"
temp-file: "npm:^3.4.0"
checksum: 10/180817a9f5e24770050a2b23acb6b47e55156ee83c7296329ee538a1ec202cf21a626de9d731f4b674ab1d63bd995b152b02d8e8a4b3133a1964a586f0cc9037
languageName: node
linkType: hard
"builtin-modules@npm:3.3.0, builtin-modules@npm:^3.3.0": "builtin-modules@npm:3.3.0, builtin-modules@npm:^3.3.0":
version: 3.3.0 version: 3.3.0
resolution: "builtin-modules@npm:3.3.0" resolution: "builtin-modules@npm:3.3.0"
@@ -17812,7 +17925,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"color-support@npm:^1.1.2": "color-support@npm:^1.1.2, color-support@npm:^1.1.3":
version: 1.1.3 version: 1.1.3
resolution: "color-support@npm:1.1.3" resolution: "color-support@npm:1.1.3"
bin: bin:
@@ -18062,6 +18175,16 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"config-file-ts@npm:0.2.8-rc1":
version: 0.2.8-rc1
resolution: "config-file-ts@npm:0.2.8-rc1"
dependencies:
glob: "npm:^10.3.12"
typescript: "npm:^5.4.3"
checksum: 10/30884f67de343e2fa7914246c14296c6f4ed6dfcf86c833698fb97be46bc7d8cc9897b53a559d2267e711fbd83deda05d0baeba499151353bd245bfe10f23387
languageName: node
linkType: hard
"config-file-ts@npm:^0.2.4": "config-file-ts@npm:^0.2.4":
version: 0.2.6 version: 0.2.6
resolution: "config-file-ts@npm:0.2.6" resolution: "config-file-ts@npm:0.2.6"
@@ -19327,14 +19450,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"dotenv-expand@npm:^5.1.0": "dotenv-expand@npm:^11.0.6, dotenv-expand@npm:~11.0.6":
version: 5.1.0
resolution: "dotenv-expand@npm:5.1.0"
checksum: 10/d52af2a6e4642979ae4221408f1b75102508dbe4f5bac1c0613f92a3cf3880d5c31f86b2f5cff3273f7c23e10421e75028546e8b6cd0376fcd20e3803b374e15
languageName: node
linkType: hard
"dotenv-expand@npm:~11.0.6":
version: 11.0.7 version: 11.0.7
resolution: "dotenv-expand@npm:11.0.7" resolution: "dotenv-expand@npm:11.0.7"
dependencies: dependencies:
@@ -19343,6 +19459,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"dotenv-expand@npm:^5.1.0":
version: 5.1.0
resolution: "dotenv-expand@npm:5.1.0"
checksum: 10/d52af2a6e4642979ae4221408f1b75102508dbe4f5bac1c0613f92a3cf3880d5c31f86b2f5cff3273f7c23e10421e75028546e8b6cd0376fcd20e3803b374e15
languageName: node
linkType: hard
"dotenv@npm:^16.0.0, dotenv@npm:^16.3.1, dotenv@npm:^16.4.5, dotenv@npm:^16.4.7, dotenv@npm:~16.4.5": "dotenv@npm:^16.0.0, dotenv@npm:^16.3.1, dotenv@npm:^16.4.5, dotenv@npm:^16.4.7, dotenv@npm:~16.4.5":
version: 16.4.7 version: 16.4.7
resolution: "dotenv@npm:16.4.7" resolution: "dotenv@npm:16.4.7"
@@ -19494,6 +19617,21 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"electron-publish@npm:25.1.7":
version: 25.1.7
resolution: "electron-publish@npm:25.1.7"
dependencies:
"@types/fs-extra": "npm:^9.0.11"
builder-util: "npm:25.1.7"
builder-util-runtime: "npm:9.2.10"
chalk: "npm:^4.1.2"
fs-extra: "npm:^10.1.0"
lazy-val: "npm:^1.0.5"
mime: "npm:^2.5.2"
checksum: 10/75a3e6bcb796423456e01fb79d7c39257ae9a9ea9820ddbc64321ac888867da33198693af87366137d6c13b66a4273e89d15c268184bbddc24db6585d16067c1
languageName: node
linkType: hard
"electron-squirrel-startup@npm:1.0.1": "electron-squirrel-startup@npm:1.0.1":
version: 1.0.1 version: 1.0.1
resolution: "electron-squirrel-startup@npm:1.0.1" resolution: "electron-squirrel-startup@npm:1.0.1"
@@ -20348,15 +20486,6 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"eslint-plugin-simple-import-sort@npm:^12.1.1":
version: 12.1.1
resolution: "eslint-plugin-simple-import-sort@npm:12.1.1"
peerDependencies:
eslint: ">=5.0.0"
checksum: 10/2a690cea9243fbefa70345687bca8952f5e185fa459b7a8db687a908cc31082435cfee236c619d5245548fa5f89a2f2c4f8499f80512e048d2bedc60e3662d5a
languageName: node
linkType: hard
"eslint-plugin-sonarjs@npm:^3.0.1": "eslint-plugin-sonarjs@npm:^3.0.1":
version: 3.0.1 version: 3.0.1
resolution: "eslint-plugin-sonarjs@npm:3.0.1" resolution: "eslint-plugin-sonarjs@npm:3.0.1"
@@ -21666,6 +21795,22 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"gauge@npm:^4.0.3":
version: 4.0.4
resolution: "gauge@npm:4.0.4"
dependencies:
aproba: "npm:^1.0.3 || ^2.0.0"
color-support: "npm:^1.1.3"
console-control-strings: "npm:^1.1.0"
has-unicode: "npm:^2.0.1"
signal-exit: "npm:^3.0.7"
string-width: "npm:^4.2.3"
strip-ansi: "npm:^6.0.1"
wide-align: "npm:^1.1.5"
checksum: 10/09535dd53b5ced6a34482b1fa9f3929efdeac02f9858569cde73cef3ed95050e0f3d095706c1689614059898924b7a74aa14042f51381a1ccc4ee5c29d2389c4
languageName: node
linkType: hard
"gaxios@npm:^6.0.0, gaxios@npm:^6.0.3, gaxios@npm:^6.1.1": "gaxios@npm:^6.0.0, gaxios@npm:^6.0.3, gaxios@npm:^6.1.1":
version: 6.7.1 version: 6.7.1
resolution: "gaxios@npm:6.7.1" resolution: "gaxios@npm:6.7.1"
@@ -21914,7 +22059,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"glob@npm:^10.0.0, glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.4.1": "glob@npm:^10.0.0, glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.12, glob@npm:^10.4.1":
version: 10.4.5 version: 10.4.5
resolution: "glob@npm:10.4.5" resolution: "glob@npm:10.4.5"
dependencies: dependencies:
@@ -25087,7 +25232,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"make-fetch-happen@npm:^10.2.1": "make-fetch-happen@npm:^10.0.3, make-fetch-happen@npm:^10.2.1":
version: 10.2.1 version: 10.2.1
resolution: "make-fetch-happen@npm:10.2.1" resolution: "make-fetch-happen@npm:10.2.1"
dependencies: dependencies:
@@ -26680,6 +26825,27 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"node-gyp@npm:^9.0.0":
version: 9.4.1
resolution: "node-gyp@npm:9.4.1"
dependencies:
env-paths: "npm:^2.2.0"
exponential-backoff: "npm:^3.1.1"
glob: "npm:^7.1.4"
graceful-fs: "npm:^4.2.6"
make-fetch-happen: "npm:^10.0.3"
nopt: "npm:^6.0.0"
npmlog: "npm:^6.0.0"
rimraf: "npm:^3.0.2"
semver: "npm:^7.3.5"
tar: "npm:^6.1.2"
which: "npm:^2.0.2"
bin:
node-gyp: bin/node-gyp.js
checksum: 10/329b109b138e48cb0416a6bca56e171b0e479d6360a548b80f06eced4bef3cf37652a3d20d171c20023fb18d996bd7446a49d4297ddb59fc48100178a92f432d
languageName: node
linkType: hard
"node-gyp@npm:latest": "node-gyp@npm:latest":
version: 10.3.1 version: 10.3.1
resolution: "node-gyp@npm:10.3.1" resolution: "node-gyp@npm:10.3.1"
@@ -26886,6 +27052,18 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"npmlog@npm:^6.0.0":
version: 6.0.2
resolution: "npmlog@npm:6.0.2"
dependencies:
are-we-there-yet: "npm:^3.0.0"
console-control-strings: "npm:^1.1.0"
gauge: "npm:^4.0.3"
set-blocking: "npm:^2.0.0"
checksum: 10/82b123677e62deb9e7472e27b92386c09e6e254ee6c8bcd720b3011013e4168bc7088e984f4fbd53cb6e12f8b4690e23e4fa6132689313e0d0dc4feea45489bb
languageName: node
linkType: hard
"nth-check@npm:^2.0.1": "nth-check@npm:^2.0.1":
version: 2.1.1 version: 2.1.1
resolution: "nth-check@npm:2.1.1" resolution: "nth-check@npm:2.1.1"
@@ -27864,6 +28042,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"pe-library@npm:^0.4.1":
version: 0.4.1
resolution: "pe-library@npm:0.4.1"
checksum: 10/39aa0a756a6521b23326fbb2ccaa157406feb695146aa32f9a2b901c6a6d788ae290a2d3272880df2bc514ad73cd9b2e5fcd4ef4968bcaf626d7a9459a8c7d31
languageName: node
linkType: hard
"pe-library@npm:^1.0.1": "pe-library@npm:^1.0.1":
version: 1.0.1 version: 1.0.1
resolution: "pe-library@npm:1.0.1" resolution: "pe-library@npm:1.0.1"
@@ -29816,6 +30001,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"resedit@npm:^1.7.0":
version: 1.7.2
resolution: "resedit@npm:1.7.2"
dependencies:
pe-library: "npm:^0.4.1"
checksum: 10/0fc470cb320a6dbbc85c38abd695cb90ca075d9dbea96846fa5f84ab8add23aa39a02520d70f14c93c84181ba4812a5513da7c79df7491826e7b423cee4e058f
languageName: node
linkType: hard
"resedit@npm:^2.0.0": "resedit@npm:^2.0.0":
version: 2.0.3 version: 2.0.3
resolution: "resedit@npm:2.0.3" resolution: "resedit@npm:2.0.3"
@@ -31992,7 +32186,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"tar@npm:6.2.1, tar@npm:^6.0.5, tar@npm:^6.1.11, tar@npm:^6.1.12, tar@npm:^6.2.0, tar@npm:^6.2.1": "tar@npm:6.2.1, tar@npm:^6.0.5, tar@npm:^6.1.11, tar@npm:^6.1.12, tar@npm:^6.1.2, tar@npm:^6.2.0, tar@npm:^6.2.1":
version: 6.2.1 version: 6.2.1
resolution: "tar@npm:6.2.1" resolution: "tar@npm:6.2.1"
dependencies: dependencies:
@@ -32738,7 +32932,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"typescript@npm:^5, typescript@npm:^5.3.3, typescript@npm:^5.7.2": "typescript@npm:^5, typescript@npm:^5.3.3, typescript@npm:^5.4.3, typescript@npm:^5.7.2":
version: 5.7.2 version: 5.7.2
resolution: "typescript@npm:5.7.2" resolution: "typescript@npm:5.7.2"
bin: bin:
@@ -32748,7 +32942,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"typescript@patch:typescript@npm%3A^5#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.7.2#optional!builtin<compat/typescript>": "typescript@patch:typescript@npm%3A^5#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.3.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.4.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.7.2#optional!builtin<compat/typescript>":
version: 5.7.2 version: 5.7.2
resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>::version=5.7.2&hash=5786d5" resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin<compat/typescript>::version=5.7.2&hash=5786d5"
bin: bin:
@@ -33900,7 +34094,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"wide-align@npm:^1.1.2": "wide-align@npm:^1.1.2, wide-align@npm:^1.1.5":
version: 1.1.5 version: 1.1.5
resolution: "wide-align@npm:1.1.5" resolution: "wide-align@npm:1.1.5"
dependencies: dependencies: