Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update #169

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { email, password } from "../fixtures/auth-data.json";

Cypress.Commands.add("login", () => {
cy.clearCookies();
cy.clearLocalStorage();

cy.clearLocalStorage().then(() => {
indexedDB.deleteDatabase("firebaseLocalStorageDb");
});

cy.get("#email").type(email);
cy.get("#password").type(password);
cy.get("#action").contains("Login").click();
Expand Down
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
85 changes: 39 additions & 46 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const SSRPlugin =
require("next/dist/build/webpack/plugins/nextjs-ssr-import").default;
// const SSRPlugin =
// require("next/dist/build/webpack/plugins/nextjs-ssr-import").default;
const { dirname, relative, resolve, join } = require("path");

module.exports = {
Expand All @@ -12,55 +12,48 @@ module.exports = {
});
});

// This is so hacky, we should remove it once this PR is merged and released: https://github.com/vercel/next.js/pull/26372
// https://github.com/vercel/next.js/issues/22581#issuecomment-864476385
const ssrPlugin = config.plugins.find(
(plugin) => plugin instanceof SSRPlugin
);
if (ssrPlugin) patchSsrPlugin(ssrPlugin);

return config;
},
images: {
disableStaticImages: true
}
};

// Unfortunately there isn't an easy way to override the replacement function body, so we
// have to just replace the whole plugin `apply` body.
function patchSsrPlugin(plugin) {
plugin.apply = function apply(compiler) {
compiler.hooks.compilation.tap("NextJsSSRImport", (compilation) => {
compilation.mainTemplate.hooks.requireEnsure.tap(
"NextJsSSRImport",
(code, chunk) => {
// This is the block that fixes https://github.com/vercel/next.js/issues/22581
if (!chunk.name) {
return;
}
// // Unfortunately there isn't an easy way to override the replacement function body, so we
// // have to just replace the whole plugin `apply` body.
// function patchSsrPlugin(plugin) {
// plugin.apply = function apply(compiler) {
// compiler.hooks.compilation.tap("NextJsSSRImport", (compilation) => {
// compilation.mainTemplate.hooks.requireEnsure.tap(
// "NextJsSSRImport",
// (code, chunk) => {
// // This is the block that fixes https://github.com/vercel/next.js/issues/22581
// if (!chunk.name) {
// return;
// }

// Update to load chunks from our custom chunks directory
const outputPath = resolve("/");
const pagePath = join("/", dirname(chunk.name));
const relativePathToBaseDir = relative(
pagePath,
outputPath
);
// Make sure even in windows, the path looks like in unix
// Node.js require system will convert it accordingly
const relativePathToBaseDirNormalized =
relativePathToBaseDir.replace(/\\/g, "/");
return code
.replace(
'require("./"',
`require("${relativePathToBaseDirNormalized}/"`
)
.replace(
"readFile(join(__dirname",
`readFile(join(__dirname, "${relativePathToBaseDirNormalized}"`
);
}
);
});
};
}
// // Update to load chunks from our custom chunks directory
// const outputPath = resolve("/");
// const pagePath = join("/", dirname(chunk.name));
// const relativePathToBaseDir = relative(
// pagePath,
// outputPath
// );
// // Make sure even in windows, the path looks like in unix
// // Node.js require system will convert it accordingly
// const relativePathToBaseDirNormalized =
// relativePathToBaseDir.replace(/\\/g, "/");
// return code
// .replace(
// 'require("./"',
// `require("${relativePathToBaseDirNormalized}/"`
// )
// .replace(
// "readFile(join(__dirname",
// `readFile(join(__dirname, "${relativePathToBaseDirNormalized}"`
// );
// }
// );
// });
// };
// }
64 changes: 33 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,38 @@
"version": "0.0.1",
"private": true,
"dependencies": {
"@apollo/client": "3.3.19",
"@blockly/block-plus-minus": "2.0.27",
"@emotion/cache": "11.4.0",
"@emotion/react": "11.4.0",
"@apollo/client": "3.5.10",
"@blockly/block-plus-minus": "3.0.7",
"@emotion/cache": "11.7.1",
"@emotion/react": "11.8.1",
"@emotion/server": "11.4.0",
"@emotion/styled": "^11.8.1",
"@kobra-dev/better-react-spreadsheet": "^0.2.0",
"@kobra-dev/react-firebase-auth-hooks": "3.0.3",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^5.0.0-beta.5",
"@material-ui/lab": "^4.0.0-alpha.60",
"blockly": "5.20210325.1",
"@mui/material": "^5.4.4",
"blockly": "7.20211209.4",
"comlink": "^4.3.1",
"firebase": "8.6.2",
"graphql": "15.5.0",
"graphql": "16.3.0",
"intro.js-react": "^0.5.0",
"js-cookie": "2.2.1",
"js-cookie": "3.0.1",
"kbar": "^0.1.0-beta.28",
"kobra.js": "0.1.6",
"next": "11.1.3",
"notistack": "^1.0.10",
"next": "12.1.0",
"notistack": "^2.0.3",
"papaparse": "^5.3.1",
"plotly.js-cartesian-dist-min": "1.58.4",
"plotly.js-cartesian-dist-min": "2.9.0",
"react": "^17.0.2",
"react-code-samples": "0.1.3",
"react-dom": "^17.0.2",
"react-dropzone": "11.3.2",
"react-markdown": "6.0.2",
"react-dropzone": "12.0.4",
"react-markdown": "8.0.0",
"react-plotly.js": "2.5.1",
"react-simplemde-editor": "4.1.5",
"remark-gfm": "1.0.0",
"react-simplemde-editor": "5.0.2",
"remark-gfm": "3.0.1",
"start-server-and-test": "^1.14.0"
},
"scripts": {
Expand Down Expand Up @@ -66,26 +68,26 @@
]
},
"devDependencies": {
"@graphql-codegen/cli": "1.21.4",
"@graphql-codegen/introspection": "1.18.2",
"@graphql-codegen/typescript": "1.22.0",
"@graphql-codegen/cli": "2.6.2",
"@graphql-codegen/introspection": "2.1.1",
"@graphql-codegen/typescript": "2.4.5",
"@graphql-codegen/typescript-operations": "1.17.16",
"@graphql-codegen/typescript-react-apollo": "2.2.4",
"@next/bundle-analyzer": "10.2.2",
"@types/js-cookie": "2.2.6",
"@types/node": "14.17.0",
"@types/papaparse": "^5.2.5",
"@types/plotly.js": "1.54.10",
"@types/react": "17.0.6",
"@types/react-dom": "17.0.5",
"@types/react-plotly.js": "2.2.4",
"autoprefixer": "10.2.5",
"@next/bundle-analyzer": "12.1.0",
"@types/js-cookie": "3.0.1",
"@types/node": "17.0.21",
"@types/papaparse": "^5.3.2",
"@types/plotly.js": "1.54.20",
"@types/react": "17.0.39",
"@types/react-dom": "17.0.12",
"@types/react-plotly.js": "2.5.0",
"autoprefixer": "10.4.2",
"cross-env": "7.0.3",
"cypress": "^7.7.0",
"eslint": "^7.32.0",
"eslint-config-next": "^11.1.4",
"husky": "^6.0.0",
"prettier": "2.3.0",
"cypress": "^9.5.1",
"eslint": "^8.10.0",
"eslint-config-next": "^12.1.0",
"husky": "^7.0.4",
"prettier": "2.5.1",
"pretty-quick": "^3.1.3",
"typescript": "^4.6.2"
},
Expand Down
Loading