Skip to content

Commit

Permalink
chore: bump monosize to latest (#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter authored Jul 10, 2024
1 parent b5dd894 commit 7100d71
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 240 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
- name: Compare results with "main" branch
if: ${{ github.event_name == 'pull_request' }}
run: |
yarn monosize compare-reports --branch main --output markdown
cp node_modules/monosize/dist/monosize.md monosize.md
npx monosize compare-reports --branch main --output markdown --quiet > monosize.md
- name: Save PR number
run: echo ${{ github.event.number }} > pr.txt
Expand Down
27 changes: 13 additions & 14 deletions monosize.config.mjs
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import path from 'path';
import path from 'node:path';
import upstashStorage from 'monosize-storage-upstash';
import webpackBundler from 'monosize-bundler-webpack';

const dirname = new URL('.', import.meta.url).pathname;

export default {
repository: 'https://github.com/microsoft/griffel',
bundler: webpackBundler(config => ({
...config,
resolve: {
...config.resolve,
alias: {
'@griffel/core': path.resolve(dirname, './dist/packages/core/index.esm.js'),
'@griffel/shadow-dom': path.resolve(dirname, './dist/packages/shadow-dom/index.esm.js'),
'@griffel/react': path.resolve(dirname, './dist/packages/react/index.esm.js'),
},
},
})),
storage: upstashStorage({
url: 'https://us1-nearby-hyena-35747.upstash.io',
readonlyToken:
'AoujASQgNGQwNGI0YjAtNmExNy00MzNjLWIwNTQtMTIyMGRlODQwZDk2QaCJNVtEfHj6pDLLscOcgMEt-Be1VWcMYbMRR_EqVCw=',
}),
webpack: config => {
return {
...config,
resolve: {
...config.resolve,
alias: {
'@griffel/core': path.resolve(dirname, './dist/packages/core/index.esm.js'),
'@griffel/shadow-dom': path.resolve(dirname, './dist/packages/shadow-dom/index.esm.js'),
'@griffel/react': path.resolve(dirname, './dist/packages/react/index.esm.js'),
},
},
};
},
};
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@
"js-beautify": "^1.14.0",
"log-symbols": "4.1.0",
"lz-string": "1.4.4",
"memfs": "3.4.12",
"memfs": "3.6.0",
"mini-css-extract-plugin": "2.6.0",
"module-alias": "^2.2.3",
"monosize": "0.0.9",
"monosize-storage-upstash": "0.0.8",
"monosize": "0.6.2",
"monosize-bundler-webpack": "0.1.4",
"monosize-storage-upstash": "0.0.20",
"nano-staged": "0.5.0",
"next": "14.1.1",
"nx": "19.3.2",
Expand All @@ -141,7 +142,7 @@
"tsconfig-paths": "4.1.1",
"typescript": "5.4.5",
"vite": "^5.3.2",
"webpack": "5.89.0",
"webpack": "5.92.1",
"webpack-merge": "5.10.0",
"yargs": "^17.5.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function compileSourceWithWebpack(

const virtualFsVolume = createFsFromVolume(new Volume());

compiler.outputFileSystem = virtualFsVolume;
compiler.outputFileSystem = virtualFsVolume as NonNullable<webpack.Compiler['outputFileSystem']>;
compiler.outputFileSystem.join = path.join.bind(path);

return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-loader/src/webpackLoader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function compileSourceWithWebpack(entryPath: string, options: CompileOptio
const webpackConfig = merge(defaultConfig, options.webpackConfig || {});
const compiler = webpack(webpackConfig);

compiler.outputFileSystem = createFsFromVolume(new Volume());
compiler.outputFileSystem = createFsFromVolume(new Volume()) as NonNullable<webpack.Compiler['outputFileSystem']>;
compiler.outputFileSystem.join = path.join.bind(path);

return new Promise((resolve, reject) => {
Expand Down
Loading

0 comments on commit 7100d71

Please sign in to comment.