Skip to content

Commit

Permalink
fix: thread poisoning caused by yrs crash (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit authored Mar 4, 2023
1 parent c25b698 commit edb3f2c
Show file tree
Hide file tree
Showing 21 changed files with 1,944 additions and 3,167 deletions.
5 changes: 3 additions & 2 deletions apps/frontend/apps/homepage/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "homepage",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/homepage/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
Expand Down Expand Up @@ -44,7 +45,7 @@
}
},
"serve": {
"executor": "@nrwl/web:dev-server",
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "homepage:build",
Expand Down
11 changes: 0 additions & 11 deletions apps/frontend/apps/homepage/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,5 @@
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}
3 changes: 1 addition & 2 deletions apps/frontend/apps/jwst/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"version": "0.0.1",
"license": "MIT",
"author": "DarkSky <[email protected]>",
"devDependencies": {},
"dependencies": {
"@emotion/babel-plugin": "^11.10.2",
"jotai": "^1.8.3"
"jotai": "^1.13.1"
}
}
5 changes: 3 additions & 2 deletions apps/frontend/apps/jwst/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "jwst",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/jwst/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
Expand Down Expand Up @@ -44,7 +45,7 @@
}
},
"serve": {
"executor": "@nrwl/web:dev-server",
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "jwst:build",
Expand Down
54 changes: 10 additions & 44 deletions apps/frontend/apps/jwst/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
const path = require('path');
const zlib = require('zlib');
const webpack = require('webpack');
const getNxWebpackConfig = require('@nrwl/react/plugins/webpack');
const { composePlugins, withNx } = require('@nrwl/webpack');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

const enableBundleAnalyzer = process.env.BUNDLE_ANALYZER;

module.exports = function (webpackConfig) {
const config = getNxWebpackConfig(webpackConfig);

module.exports = composePlugins(withNx(), (config, { options, context }) => {
const isProd = config.mode === 'production';
const isE2E = process.env.NX_E2E;

config.experiments.topLevelAwait = true;

Expand Down Expand Up @@ -45,34 +40,6 @@ module.exports = function (webpackConfig) {
new CssMinimizerPlugin(),
],
};
config.module.rules.unshift({
test: /\.css$/i,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
sourceMap: false,
},
},
],
});
config.module.rules.unshift({
test: /\.scss$/i,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
sourceMap: false,
},
},
{
loader: 'postcss-loader',
},
],
});
config.module.rules.splice(6);
} else {
config.output = {
...config.output,
Expand Down Expand Up @@ -128,13 +95,13 @@ module.exports = function (webpackConfig) {
JWT_DEV: !isProd,
global: {},
}),
isProd &&
!isE2E &&
new HtmlWebpackPlugin({
title: 'AFFiNE - All In One Workos',
template: path.resolve(__dirname, './src/template.html'),
publicPath: '/',
}),
// isProd &&
// !isE2E &&
// new HtmlWebpackPlugin({
// title: 'AFFiNE - All In One Workos',
// template: path.resolve(__dirname, './src/template.html'),
// publicPath: '/',
// }),
isProd && new MiniCssExtractPlugin(),
isProd &&
new CompressionPlugin({
Expand All @@ -157,9 +124,8 @@ module.exports = function (webpackConfig) {
// followSymlinks: false,
ignored: ['**/*.css'],
};

return config;
};
});

// TODO handle nx issue
// see https://github.com/nrwl/nx/issues/8870
Expand Down
3 changes: 1 addition & 2 deletions apps/frontend/apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"version": "0.0.1",
"license": "MIT",
"author": "DarkSky <[email protected]>",
"devDependencies": {},
"dependencies": {
"@types/wicg-file-system-access": "^2020.9.5",
"file-selector": "^0.6.0",
"yjs": "^13.5.42"
"yjs": "^13.5.48"
}
}
5 changes: 3 additions & 2 deletions apps/frontend/apps/playground/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "playground",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/playground/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/web:webpack",
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
Expand Down Expand Up @@ -44,7 +45,7 @@
}
},
"serve": {
"executor": "@nrwl/web:dev-server",
"executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "playground:build",
Expand Down
11 changes: 0 additions & 11 deletions apps/frontend/apps/playground/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,5 @@
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}
13 changes: 0 additions & 13 deletions apps/frontend/libs/jwt-react/jest.config.ts

This file was deleted.

5 changes: 2 additions & 3 deletions apps/frontend/libs/jwt-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"license": "MIT",
"author": "DarkSky <[email protected]>",
"dependencies": {
"jotai": "^1.9.0",
"nanoid": "^4.0.0",
"preact": "^10.11.2"
"jotai": "^1.13.1",
"nanoid": "^4.0.1"
}
}
9 changes: 1 addition & 8 deletions apps/frontend/libs/jwt-react/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "libs-jwt-react",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/jwt-react/src",
"projectType": "library",
Expand Down Expand Up @@ -31,14 +32,6 @@
"lintFilePatterns": ["libs/jwt-react/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/jwt-react"],
"options": {
"jestConfig": "libs/jwt-react/jest.config.ts",
"passWithNoTests": true
}
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
Expand Down
20 changes: 0 additions & 20 deletions apps/frontend/libs/jwt-react/tsconfig.spec.json

This file was deleted.

9 changes: 1 addition & 8 deletions apps/frontend/libs/jwt-rpc/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "libs-jwt-rpc",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/jwt-rpc/src",
"projectType": "library",
Expand Down Expand Up @@ -32,14 +33,6 @@
"lintFilePatterns": ["libs/jwt-rpc/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/libs/jwt-rpc"],
"options": {
"jestConfig": "libs/jwt-rpc/jest.config.ts",
"passWithNoTests": true
}
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
Expand Down
11 changes: 0 additions & 11 deletions apps/frontend/libs/jwt-rpc/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,5 @@
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}
1 change: 1 addition & 0 deletions apps/frontend/libs/jwt/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "libs-jwt",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/jwt/src",
"projectType": "library",
Expand Down
3 changes: 1 addition & 2 deletions apps/frontend/libs/jwt/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"declaration": true,
"types": ["node"]
},
"include": ["**/*.ts"],
"exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"]
"include": ["**/*.ts"]
}
35 changes: 17 additions & 18 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"start": "nx serve",
"build": "nx build",
"test": "nx test"
"dev": "nx serve",
"build": "nx build"
},
"private": true,
"dependencies": {
"@babel/preset-react": "^7.18.6",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@nrwl/webpack": "^15.8.3",
"core-js": "^3.26.0",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand All @@ -20,18 +21,17 @@
},
"devDependencies": {
"@jscutlery/semver": "^2.29.2",
"@nrwl/cli": "15.0.11",
"@nrwl/eslint-plugin-nx": "15.0.11",
"@nrwl/linter": "15.0.11",
"@nrwl/nx-cloud": "latest",
"@nrwl/react": "15.0.11",
"@nrwl/web": "15.0.11",
"@nrwl/workspace": "15.0.11",
"@nrwl/cli": "15.8.3",
"@nrwl/eslint-plugin-nx": "15.8.3",
"@nrwl/linter": "15.8.3",
"@nrwl/nx-cloud": "^15.1.1",
"@nrwl/react": "15.8.3",
"@nrwl/web": "15.8.3",
"@nrwl/workspace": "15.8.3",
"@rollup/plugin-replace": "^5.0.2",
"@swc/cli": "^0.1.57",
"@swc/core": "^1.3.14",
"@swc/helpers": "^0.4.12",
"@testing-library/react": "13.4.0",
"@types/node": "18.11.9",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.8",
Expand All @@ -47,13 +47,12 @@
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react-hooks": "4.6.0",
"html-webpack-plugin": "^5.5.0",
"nx": "15.0.11",
"prettier": "^2.7.1",
"react-test-renderer": "18.2.0",
"nx": "15.8.3",
"prettier": "^2.8.4",
"terser-webpack-plugin": "^5.3.6",
"ts-node": "10.9.1",
"typescript": "^4.8.4",
"webpack-bundle-analyzer": "^4.7.0"
}
"typescript": "^4.9.5",
"webpack-bundle-analyzer": "^4.8.0"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit edb3f2c

Please sign in to comment.