Socket
Socket
Sign inDemoInstall

@fluentui/bundle-size

Package Overview
Dependencies
226
Maintainers
13
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.6 to 1.1.7

17

CHANGELOG.json

@@ -5,3 +5,18 @@ {

{
"date": "Thu, 12 May 2022 07:41:39 GMT",
"date": "Wed, 28 Sep 2022 07:36:56 GMT",
"tag": "@fluentui/bundle-size_v1.1.7",
"version": "1.1.7",
"comments": {
"patch": [
{
"author": "martinhochel@microsoft.com",
"package": "@fluentui/bundle-size",
"commit": "b7fc0c2998a2ed7584b6b7ca8a969b17793afd28",
"comment": "fix: bump workspace-tools and add options to collectLocalReport api"
}
]
}
},
{
"date": "Thu, 12 May 2022 07:41:44 GMT",
"tag": "@fluentui/bundle-size_v1.1.6",

@@ -8,0 +23,0 @@ "version": "1.1.6",

# Change Log - @fluentui/bundle-size
This log was last generated on Thu, 12 May 2022 07:41:39 GMT and should not be manually modified.
This log was last generated on Wed, 28 Sep 2022 07:36:56 GMT and should not be manually modified.
<!-- Start content -->
## [1.1.7](https://github.com/microsoft/fluentui/tree/@fluentui/bundle-size_v1.1.7)
Wed, 28 Sep 2022 07:36:56 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/bundle-size_v1.1.6..@fluentui/bundle-size_v1.1.7)
### Patches
- fix: bump workspace-tools and add options to collectLocalReport api ([PR #24891](https://github.com/microsoft/fluentui/pull/24891) by martinhochel@microsoft.com)
## [1.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/bundle-size_v1.1.6)
Thu, 12 May 2022 07:41:39 GMT
Thu, 12 May 2022 07:41:44 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/bundle-size_v1.1.5..@fluentui/bundle-size_v1.1.6)

@@ -11,0 +20,0 @@

4

package.json
{
"name": "@fluentui/bundle-size",
"version": "1.1.6",
"version": "1.1.7",
"bin": {

@@ -26,3 +26,3 @@ "bundle-size": "./bin/bundle-size.js"

"webpack": "^5.21.2",
"workspace-tools": "^0.16.2",
"workspace-tools": "^0.27.0",
"ci-info": "^3.2.0",

@@ -29,0 +29,0 @@ "node-fetch": "^2.6.1",

@@ -42,11 +42,16 @@ const fs = require('fs').promises;

const collectLocalReportDefaultOptions = {
root: /** @type {string | undefined} */ (undefined),
reportFilesGlob: 'packages/**/dist/bundle-size/bundle-size.json',
};
/**
* Collects all reports for packages to a single one.
*
* @param {Partial<typeof collectLocalReportDefaultOptions>} options
* @return {Promise<BundleSizeReport>}
*/
async function collectLocalReport() {
/** @type {string[]} */
const reportFiles = glob.sync('packages/**/dist/bundle-size/bundle-size.json', {
cwd: /** @type {string} */ (findGitRoot(process.cwd())),
async function collectLocalReport(options = {}) {
const { reportFilesGlob, root = findGitRoot(process.cwd()) } = { ...collectLocalReportDefaultOptions, ...options };
const reportFiles = glob.sync(reportFilesGlob, {
cwd: root,
});

@@ -53,0 +58,0 @@

@@ -19,5 +19,2 @@ const fs = require('fs').promises;

/**
* @return {string}
*/
function mkPackagesDir() {

@@ -32,6 +29,3 @@ const projectDir = tmp.dirSync({ prefix: 'collectLocalReport', unsafeCleanup: true });

// is required as root directory is determined based on Git project
tmp.dirSync({ dir: projectDir.name, name: '.git', unsafeCleanup: true });
return packagesDir.name;
return { packagesDir: packagesDir.name, rootDir: projectDir.name };
}

@@ -58,3 +52,3 @@

it('aggregates all local reports to a single one', async () => {
const packagesDir = mkPackagesDir();
const { packagesDir, rootDir } = mkPackagesDir();

@@ -81,3 +75,3 @@ const reportAPath = mkReportDir(tmp.dirSync({ dir: packagesDir, name: 'package-a', unsafeCleanup: true }).name);

expect(await collectLocalReport()).toMatchInlineSnapshot(`
expect(await collectLocalReport({ root: rootDir })).toMatchInlineSnapshot(`
Array [

@@ -117,3 +111,3 @@ Object {

it('throws an error if a report file contains invalid JSON', async () => {
const packagesDir = mkPackagesDir();
const { packagesDir, rootDir } = mkPackagesDir();

@@ -135,4 +129,4 @@ const reportAPath = mkReportDir(tmp.dirSync({ dir: packagesDir, name: 'package-a', unsafeCleanup: true }).name);

await expect(collectLocalReport()).rejects.toThrow(/Failed to read JSON/);
await expect(collectLocalReport({ root: rootDir })).rejects.toThrow(/Failed to read JSON/);
});
});

@@ -37,3 +37,3 @@ const fs = require('fs').promises;

const config = await readConfig();
const config = await readConfig(true);

@@ -44,3 +44,3 @@ expect(config.webpack({})).toEqual({ foo: 'bar' });

it('should return default webpack config if no config file defined', async () => {
const config = await readConfig();
const config = await readConfig(true);

@@ -54,5 +54,5 @@ expect(config.webpack({})).toEqual({});

await setup(`module.exports = { webpack: (config) => config }`);
const firstConfig = await readConfig();
const firstConfig = await readConfig(true);
await setup(`module.exports = { webpack: (config) => { config.foo = 'bar'; return config; } }`);
const config = await readConfig();
const config = await readConfig(true);

@@ -67,3 +67,3 @@ expect(firstConfig).toBe(config);

await setup(`module.exports = { webpack: (config) => { config.foo = 'bar'; return config; } }`, nesting);
const config = await readConfig();
const config = await readConfig(true);

@@ -70,0 +70,0 @@ expect(config.webpack({})).toEqual({ foo: 'bar' });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc