chore: unify version (#1123)

This commit is contained in:
Himself65
2023-02-19 02:40:39 -06:00
committed by GitHub
parent aa1de57d96
commit ae4105e961
26 changed files with 1286 additions and 1694 deletions

View File

@@ -1,4 +1,5 @@
{
"root": false,
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"reportUnusedDisableDirectives": true
}

View File

@@ -1,8 +1,12 @@
/* eslint @typescript-eslint/no-var-requires: "off" */
const { getGitVersion, getCommitHash } = require('./scripts/gitInfo');
const { dependencies } = require('./package.json');
const path = require('node:path');
const printer = require('./scripts/printer').printer;
import { getGitVersion, getCommitHash } from './scripts/gitInfo.mjs';
import fs from 'node:fs';
import path from 'node:path';
import { printer } from './scripts/printer.mjs';
import debugLocal from 'next-debug-local';
const dependencies = JSON.parse(fs.readFileSync('./package.json', 'utf8'))[
'dependencies'
];
const enableDebugLocal = path.isAbsolute(process.env.LOCAL_BLOCK_SUITE ?? '');
const EDITOR_VERSION = enableDebugLocal
@@ -56,7 +60,6 @@ const nextConfig = {
],
webpack: config => {
config.experiments = { ...config.experiments, topLevelAwait: true };
config.resolve.alias['yjs'] = require.resolve('yjs');
config.module.rules.push({
test: /\.md$/i,
loader: 'raw-loader',
@@ -81,7 +84,7 @@ const nextConfig = {
};
const baseDir = process.env.LOCAL_BLOCK_SUITE ?? '/';
const withDebugLocal = require('next-debug-local')(
const withDebugLocal = debugLocal(
{
'@blocksuite/editor': path.resolve(baseDir, 'packages', 'editor'),
'@blocksuite/blocks/models': path.resolve(
@@ -115,4 +118,4 @@ const detectFirebaseConfig = () => {
};
detectFirebaseConfig();
module.exports = withDebugLocal(nextConfig);
export default withDebugLocal(nextConfig);

View File

@@ -16,50 +16,42 @@
"@blocksuite/blocks": "0.4.1",
"@blocksuite/editor": "0.4.1",
"@blocksuite/global": "0.4.1",
"@blocksuite/icons": "^2.0.14",
"@blocksuite/icons": "2.0.12",
"@blocksuite/store": "0.4.1",
"@emotion/css": "^11.10.5",
"@emotion/react": "^11.10.5",
"@emotion/css": "^11.10.6",
"@emotion/react": "^11.10.6",
"@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.5",
"@emotion/styled": "^11.10.6",
"@fontsource/poppins": "^4.5.10",
"@fontsource/space-mono": "^4.5.10",
"@mui/base": "=5.0.0-alpha.117",
"@mui/icons-material": "=5.11.0",
"@mui/material": "=5.11.8",
"@fontsource/space-mono": "^4.5.12",
"@mui/base": "5.0.0-alpha.118",
"@mui/icons-material": "^5.11.9",
"@mui/material": "^5.11.9",
"@toeverything/pathfinder-logger": "workspace:@affine/logger@*",
"cmdk": "^0.1.20",
"cmdk": "^0.1.22",
"css-spring": "^4.1.0",
"dayjs": "^1.11.7",
"lit": "^2.6.1",
"next": "13.1.0",
"next-debug-local": "^0.1.5",
"prettier": "^2.7.1",
"prettier": "^2.8.4",
"quill": "^1.3.7",
"quill-cursors": "^4.0.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"yjs": "^13.5.45",
"zustand": "^4.3.2"
"yjs": "^13.5.46",
"zustand": "^4.3.3"
},
"devDependencies": {
"@types/node": "18.7.18",
"@types/react": "18.0.20",
"@types/react-dom": "18.0.6",
"@types/node": "18.14.0",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/wicg-file-system-access": "^2020.9.5",
"chalk": "^4.1.2",
"eslint-config-next": "12.3.1",
"chalk": "^5.2.0",
"eslint": "^8.34.0",
"eslint-config-next": "13.1.6",
"raw-loader": "^4.0.2",
"typescript": "^4.9.5"
},
"eslintConfig": {
"extends": [
"next/core-web-vitals",
"plugin:@next/next/recommended"
],
"rules": {
"prettier/prettier": "warn"
},
"reportUnusedDisableDirectives": true
"typescript": "^4.9.5",
"webpack": "^5.75.0"
}
}

View File

@@ -1,8 +1,5 @@
// @ts-check
// import { execSync } from 'child_process'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { execSync } = require('child_process');
import { execSync } from 'node:child_process';
const hasGit = () => {
try {
@@ -41,7 +38,4 @@ const getGitVersion = () => {
const getCommitHash = (rev = 'HEAD') =>
execSync(`git rev-parse --short ${rev}`).toString();
module.exports = {
getGitVersion,
getCommitHash,
};
export { getCommitHash, getGitVersion };

View File

@@ -1,6 +1,5 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const chalk = require('chalk');
const printer = {
import chalk from 'chalk';
export const printer = {
debug: msg => {
const result = chalk.green`debug` + chalk.white(' - ' + msg);
console.log(result);
@@ -17,5 +16,3 @@ const printer = {
return result;
},
};
module.exports = { printer };

View File

@@ -1,5 +1,4 @@
import { displayFlex, keyframes, styled } from '@affine/component';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import spring, { toString } from 'css-spring';

View File

@@ -1,5 +1,4 @@
import { displayFlex, keyframes, styled } from '@affine/component';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import spring, { toString } from 'css-spring';
import { CSSProperties } from 'react';

View File

@@ -2,12 +2,10 @@ import { cloneElement, FC, PropsWithChildren, ReactNode } from 'react';
export const ProviderComposer: FC<
PropsWithChildren<{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
contexts: any;
}>
> = ({ contexts, children }) =>
contexts.reduceRight(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(kids: ReactNode, parent: any) =>
cloneElement(parent, {
children: kids,

View File

@@ -52,22 +52,18 @@ export const WorkspaceDelete = ({
<StyledTextContent>
<Trans i18nKey="Delete Workspace Description">
Deleting (
<StyledWorkspaceName>
{{ workspace: workspace.name }}
</StyledWorkspaceName>
) cannot be undone, please proceed with caution. along with all
its content.
<StyledWorkspaceName>{workspace.name}</StyledWorkspaceName>)
cannot be undone, please proceed with caution. along with all its
content.
</Trans>
</StyledTextContent>
) : (
<StyledTextContent>
<Trans i18nKey="Delete Workspace Description2">
Deleting (
<StyledWorkspaceName>
{{ workspace: workspace.name }}
</StyledWorkspaceName>
) will delete both local and cloud data, this operation cannot be
undone, please proceed with caution.
<StyledWorkspaceName>{workspace.name}</StyledWorkspaceName>) will
delete both local and cloud data, this operation cannot be undone,
please proceed with caution.
</Trans>
</StyledTextContent>
)}

View File

@@ -15,17 +15,16 @@ interface LoginModalProps {
workspaceId: string;
onInviteSuccess: () => void;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const debounce = <T extends (...args: any) => any>(
fn: T,
time?: number,
immediate?: boolean
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): ((...args: any) => any) => {
let timeoutId: null | number;
let defaultImmediate = immediate || false;
const delay = time || 300;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (...args: any) => {
if (defaultImmediate) {
fn.apply(this, args);
@@ -35,7 +34,7 @@ export const debounce = <T extends (...args: any) => any>(
if (timeoutId) {
clearTimeout(timeoutId);
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
timeoutId = setTimeout(() => {
fn.apply(this, args);

View File

@@ -102,7 +102,7 @@ export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
<MenuItem
onClick={async () => {
// FIXME: remove ignore
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
await removeMember(member.id);
toast(

View File

@@ -119,7 +119,7 @@ export const usePageHelper = (): EditorHandlers => {
},
permanentlyDeletePage: pageId => {
// TODO: workspace.meta.removePage or workspace.removePage?
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
currentWorkspace!.blocksuiteWorkspace?.meta.removePage(pageId);
},
openPage: (pageId, query = {}, newTab = false) => {

View File

@@ -76,7 +76,6 @@ export const useConfirm: UseBoundStore<Store> = ((
) => {
const api = useConfirmApi();
return useStore(api, selector, equals);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}) as any;
function Records() {

View File

@@ -30,7 +30,7 @@ import useCurrentPageMeta from '@/hooks/use-current-page-meta';
export const ThemeContext = createContext<ThemeProviderValue>({
mode: 'light',
// eslint-disable-next-line @typescript-eslint/no-empty-function
changeMode: () => {},
theme: getLightTheme('page'),
});
@@ -124,10 +124,7 @@ export const ThemeProvider = ({
<Global
styles={css`
:root {
${
// eslint-disable-next-line @typescript-eslint/no-explicit-any
globalThemeVariables(mode, themeStyle) as any
}
${globalThemeVariables(mode, themeStyle) as any}
}
`}
/>

View File

@@ -118,7 +118,6 @@ export const useModal: UseBoundStore<Store> = ((
) => {
const api = useModalApi();
return useStore(api, selector, equals);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}) as any;
const Modals: React.FC = function Modal() {

View File

@@ -13,7 +13,6 @@ export function isMobile(userAgent: string) {
export const getIsMobile = function () {
return isMobile(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
navigator?.userAgent || navigator?.vendor || (window as any)?.opera
);
};

View File

@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
// eslint-disable-next-line @typescript-eslint/ban-types
export function debounce(fn: Function, timeout: number) {
let timeoutId: any;