diff --git a/.env.development b/.env.development index a692f21c7..e69de29bb 100644 --- a/.env.development +++ b/.env.development @@ -1 +0,0 @@ -SANDPACK_BARE_COMPONENTS=true \ No newline at end of file diff --git a/.env.production b/.env.production index 445c9c4d0..d25eb7dd4 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1 @@ -NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4' -SANDPACK_BARE_COMPONENTS=true \ No newline at end of file +NEXT_PUBLIC_GA_TRACKING_ID = 'UA-41298772-4' \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 147e54607..f617dea26 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,8 @@ "plugins": ["@typescript-eslint"], "rules": { "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "warn" + "@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }], + "react-hooks/exhaustive-deps": "error" }, "env": { "node": true, diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index c447a2cdb..87dcfdc73 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -16,7 +16,7 @@ jobs: - name: Set up node uses: actions/setup-node@v1 with: - node-version: "14.x" + node-version: '20.x' - name: Install dependencies uses: bahmutov/npm-install@v1.7.10 @@ -38,7 +38,7 @@ jobs: # Here's the first place where next-bundle-analysis' own script is used # This step pulls the raw bundle stats for the current bundle - name: Analyze bundle - run: npx -p nextjs-bundle-analysis report + run: npx -p nextjs-bundle-analysis@0.5.0 report - name: Upload bundle uses: actions/upload-artifact@v2 diff --git a/.github/workflows/analyze_comment.yml b/.github/workflows/analyze_comment.yml index bd73b6b4e..5a3047cfc 100644 --- a/.github/workflows/analyze_comment.yml +++ b/.github/workflows/analyze_comment.yml @@ -47,26 +47,9 @@ jobs: pr_number=$(cat pr_number/pr_number) echo "pr-number=$pr_number" >> $GITHUB_OUTPUT - - name: Find Comment - uses: peter-evans/find-comment@v1 - if: success() - id: fc - with: - issue-number: ${{ steps.get-comment-body.outputs.pr-number }} - body-includes: "" - - - name: Create Comment - uses: peter-evans/create-or-update-comment@v1.4.4 - if: success() && steps.fc.outputs.comment-id == 0 - with: - issue-number: ${{ steps.get-comment-body.outputs.pr-number }} - body: ${{ steps.get-comment-body.outputs.body }} - - - name: Update Comment - uses: peter-evans/create-or-update-comment@v1.4.4 - if: success() && steps.fc.outputs.comment-id != 0 + - name: Comment + uses: marocchino/sticky-pull-request-comment@v2 with: - issue-number: ${{ steps.get-comment-body.outputs.pr-number }} - body: ${{ steps.get-comment-body.outputs.body }} - comment-id: ${{ steps.fc.outputs.comment-id }} - edit-mode: replace + header: next-bundle-analysis + number: ${{ steps.get-comment-body.outputs.pr-number }} + message: ${{ steps.get-comment-body.outputs.body }} diff --git a/.github/workflows/site_lint.yml b/.github/workflows/site_lint.yml index bf446393a..34ca6d7b8 100644 --- a/.github/workflows/site_lint.yml +++ b/.github/workflows/site_lint.yml @@ -11,17 +11,17 @@ jobs: lint: runs-on: ubuntu-latest - name: Lint on node 12.x and ubuntu-latest + name: Lint on node 20.x and ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Use Node.js 12.x - uses: actions/setup-node@v1 + - name: Use Node.js 20.x + uses: actions/setup-node@v3 with: - node-version: 12.x + node-version: 20.x - name: Install deps and build (with cache) - uses: bahmutov/npm-install@v1.7.10 + uses: bahmutov/npm-install@v1.8.32 - name: Lint codebase run: yarn ci-check diff --git a/next.config.js b/next.config.js index 2ea3e916e..61ff1944a 100644 --- a/next.config.js +++ b/next.config.js @@ -9,14 +9,12 @@ const nextConfig = { pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'], reactStrictMode: true, experimental: { - plugins: true, + // TODO: Remove after https://github.com/vercel/next.js/issues/49355 is fixed + appDir: false, scrollRestoration: true, legacyBrowsers: false, - browsersListForSwc: true, - }, - env: { - SANDPACK_BARE_COMPONENTS: process.env.SANDPACK_BARE_COMPONENTS, }, + env: {}, webpack: (config, {dev, isServer, ...options}) => { if (process.env.ANALYZE) { const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer'); @@ -35,10 +33,6 @@ const nextConfig = { const {IgnorePlugin, NormalModuleReplacementPlugin} = require('webpack'); config.plugins.push( - new NormalModuleReplacementPlugin( - /^@stitches\/core$/, - require.resolve('./src/utils/emptyShim.js') - ), new NormalModuleReplacementPlugin( /^raf$/, require.resolve('./src/utils/rafShim.js') diff --git a/package.json b/package.json index f4f9a8026..472ef79c9 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "check-all": "npm-run-all prettier lint:fix tsc" }, "dependencies": { - "@codesandbox/sandpack-react": "1.15.5", + "@codesandbox/sandpack-react": "2.6.0", "@docsearch/css": "3.0.0-alpha.41", "@docsearch/react": "3.0.0-alpha.41", "@headlessui/react": "^1.7.0", @@ -32,12 +32,12 @@ "debounce": "^1.2.1", "ga-lite": "^2.1.4", "github-slugger": "^1.3.0", - "next": "12.3.2-canary.7", + "next": "^13.4.1", "next-remote-watch": "^1.0.0", "parse-numeric-range": "^1.2.0", - "react": "0.0.0-experimental-cb5084d1c-20220924", - "react-collapsed": "npm:@gaearon/react-collapsed@3.1.0-forked.1", - "react-dom": "0.0.0-experimental-cb5084d1c-20220924", + "react": "^0.0.0-experimental-16d053d59-20230506", + "react-collapsed": "4.0.4", + "react-dom": "^0.0.0-experimental-16d053d59-20230506", "remark-frontmatter": "^4.0.1", "remark-gfm": "^3.0.1" }, @@ -92,13 +92,13 @@ "retext": "^7.0.1", "retext-smartypants": "^4.0.0", "rss": "^1.2.2", - "tailwindcss": "^3.0.22", + "tailwindcss": "^3.3.2", "typescript": "^4.0.2", "unist-util-visit": "^2.0.3", "webpack-bundle-analyzer": "^4.5.0" }, "engines": { - "node": ">=12.x" + "node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0" }, "nextBundleAnalysis": { "budget": null, diff --git a/patches/@codemirror+lang-javascript+0.19.6.patch b/patches/@codemirror+lang-javascript+0.19.6.patch deleted file mode 100644 index 3436b8e37..000000000 --- a/patches/@codemirror+lang-javascript+0.19.6.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/node_modules/@codemirror/lang-javascript/dist/index.cjs b/node_modules/@codemirror/lang-javascript/dist/index.cjs -index 4475e4f..e1255c9 100644 ---- a/node_modules/@codemirror/lang-javascript/dist/index.cjs -+++ b/node_modules/@codemirror/lang-javascript/dist/index.cjs -@@ -135,7 +135,9 @@ const javascriptLanguage = language.LRLanguage.define({ - JSXText: highlight.tags.content, - "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": highlight.tags.angleBracket, - "JSXIdentifier JSXNameSpacedName": highlight.tags.tagName, -- "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": highlight.tags.attributeName -+ "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": highlight.tags.attributeName, -+ "JSXAttribute/JSXLowerIdentifier JSXAttribute/JSXNameSpacedName": highlight.tags.attributeName, -+ "JSXBuiltin/JSXIdentifier": highlight.tags.standard(highlight.tags.tagName) - }) - ] - }), -diff --git a/node_modules/@codemirror/lang-javascript/dist/index.js b/node_modules/@codemirror/lang-javascript/dist/index.js -index d089f6b..db09ea6 100644 ---- a/node_modules/@codemirror/lang-javascript/dist/index.js -+++ b/node_modules/@codemirror/lang-javascript/dist/index.js -@@ -131,7 +131,9 @@ const javascriptLanguage = /*@__PURE__*/LRLanguage.define({ - JSXText: tags.content, - "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": tags.angleBracket, - "JSXIdentifier JSXNameSpacedName": tags.tagName, -- "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName -+ "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName, -+ "JSXAttribute/JSXLowerIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName, -+ "JSXBuiltin/JSXIdentifier": tags.standard(tags.tagName), - }) - ] - }), diff --git a/patches/@codesandbox+sandpack-react+1.15.5.patch b/patches/@codesandbox+sandpack-react+1.15.5.patch deleted file mode 100644 index b68a5303d..000000000 --- a/patches/@codesandbox+sandpack-react+1.15.5.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/node_modules/@codesandbox/sandpack-react/dist/cjs/index.js b/node_modules/@codesandbox/sandpack-react/dist/cjs/index.js -index 6b8518e..ada84f5 100644 ---- a/node_modules/@codesandbox/sandpack-react/dist/cjs/index.js -+++ b/node_modules/@codesandbox/sandpack-react/dist/cjs/index.js -@@ -92,7 +92,7 @@ h1 { -
- - --