Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Update dependencies - May 2021 #349

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"refmt": 3,
"bs-dependencies": [
"reason-react",
"@rescript/react",
"@glennsl/bs-json",
"ood"
],
Expand Down
32 changes: 31 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
const bsconfig = require('./bsconfig.json');
const fs = require("fs");

const transpileModules = ["bs-platform"].concat(bsconfig["bs-dependencies"]);
const withTM = require("next-transpile-modules")(transpileModules);


function patchResDeps() {
["bs-platform"].concat(bsconfig["bs-dependencies"]).forEach((bsDep) => {
fs.writeFileSync(`./node_modules/${bsDep}/index.js`, "");
const json = require(`./node_modules/${bsDep}/package.json`);
json.main = "index.js";
fs.writeFileSync(
`./node_modules/${bsDep}/package.json`,
JSON.stringify(json, null, 2)
);
});
}
patchResDeps(); // update package.json and create empty `index.js` before transpiling

const config = {
target: "serverless",
pageExtensions: ["jsx", "js"],
Expand All @@ -16,9 +31,21 @@ const config = {
// We shim fs for things like the blog slugs component
// where we need fs access in the server-side part
config.node = {
fs: 'empty'
fs: false
}
}

// We need this additional rule to make sure that mjs files are
// correctly detected within our src/ folder
config.module.rules.push({
test: /\.m?js$/,
use: options.defaultLoaders.babel,
exclude: /node_modules/,
type: "javascript/auto",
resolve: {
fullySpecified: false,
}
});
return config
},
// Might need to move this to nginx or other config,
Expand Down Expand Up @@ -96,6 +123,9 @@ const config = {
}
*/
]
},
future: {
webpack5: true
}
};

Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
},
"dependencies": {
"@glennsl/bs-json": "^5.0.2",
"bs-platform": "9.0.0",
"next": "^10.0.6",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"reason-react": "^0.9.1",
"ood": "*"
"@rescript/react": "^0.10.3",
"bs-platform": "9.0.2",
"next": "10.2.0",
"ood": "file:./vendor/ood/lib",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"dependenciesDescription": {
"bs-platform": "This a regular dependency because the included standard libraries are used during runtime"
Expand All @@ -37,20 +37,20 @@
},
"devDependencies": {
"@tailwindcss/typography": "^0.4.0",
"autoprefixer": "^10.2.4",
"concurrently": "^6.0.2",
"gray-matter": "^4.0.2",
"autoprefixer": "10.2.5",
"concurrently": "6.1.0",
"gray-matter": "4.0.3",
"http-server": "^0.12.3",
"js-yaml": "^4.0.0",
"js-yaml": "4.1.0",
"mdast-util-to-string": "^2.0.0",
"next-transpile-modules": "4.1.0",
"postcss": "^8.2.5",
"next-transpile-modules": "^7.0.0",
"postcss": "8.2.15",
"rehype-highlight": "^4.1.0",
"rehype-stringify": "^8.0.0",
"remark-parse": "^9.0.0",
"remark-rehype": "^8.1.0",
"remark-slug": "^6.0.0",
"tailwindcss": "^2.0.3",
"tailwindcss": "2.1.2",
"unified": "^9.2.1"
},
"devDependenciesDescription": {
Expand Down
Loading