Skip to content

Commit

Permalink
build: update @discovery/json-ext to v0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin committed Jul 2, 2024
1 parent 394e761 commit d449c9d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@bazel/concatjs": "patch:@bazel/concatjs@npm%3A5.8.1#~/.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch",
"@bazel/esbuild": "5.8.1",
"@bazel/jasmine": "patch:@bazel/jasmine@npm%3A5.8.1#~/.yarn/patches/@bazel-jasmine-npm-5.8.1-3370fee155.patch",
"@discoveryjs/json-ext": "0.5.7",
"@discoveryjs/json-ext": "0.6.0",
"@inquirer/confirm": "3.1.12",
"@inquirer/prompts": "5.1.0",
"@listr2/prompt-adapter-inquirer": "2.0.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.24.7",
"@babel/runtime": "7.24.7",
"@discoveryjs/json-ext": "0.5.7",
"@discoveryjs/json-ext": "0.6.0",
"@ngtools/webpack": "0.0.0-PLACEHOLDER",
"@vitejs/plugin-basic-ssl": "1.1.0",
"ansi-colors": "4.1.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
* found in the LICENSE file at https://angular.dev/license
*/

import { createWriteStream, promises as fsPromises } from 'fs';
import { dirname } from 'path';
import { createWriteStream } from 'node:fs';
import { mkdir } from 'node:fs/promises';
import { dirname } from 'node:path';
import { pipeline } from 'node:stream/promises';
import { Compiler } from 'webpack';
import { assertIsError } from '../../../utils/error';
import { addError } from '../../../utils/webpack-diagnostics';
Expand All @@ -17,17 +19,12 @@ export class JsonStatsPlugin {

apply(compiler: Compiler) {
compiler.hooks.done.tapPromise('angular-json-stats', async (stats) => {
const { stringifyStream } = await import('@discoveryjs/json-ext');
const { stringifyChunked } = await import('@discoveryjs/json-ext');
const data = stats.toJson('verbose');

try {
await fsPromises.mkdir(dirname(this.statsOutputPath), { recursive: true });
await new Promise<void>((resolve, reject) =>
stringifyStream(data)
.pipe(createWriteStream(this.statsOutputPath))
.on('close', resolve)
.on('error', reject),
);
await mkdir(dirname(this.statsOutputPath), { recursive: true });
await pipeline(stringifyChunked(data), createWriteStream(this.statsOutputPath));
} catch (error) {
assertIsError(error);
addError(
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ __metadata:
"@babel/plugin-transform-runtime": "npm:7.24.7"
"@babel/preset-env": "npm:7.24.7"
"@babel/runtime": "npm:7.24.7"
"@discoveryjs/json-ext": "npm:0.5.7"
"@discoveryjs/json-ext": "npm:0.6.0"
"@ngtools/webpack": "npm:0.0.0-PLACEHOLDER"
"@vitejs/plugin-basic-ssl": "npm:1.1.0"
ansi-colors: "npm:4.1.3"
Expand Down Expand Up @@ -669,7 +669,7 @@ __metadata:
"@bazel/concatjs": "patch:@bazel/concatjs@npm%3A5.8.1#~/.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch"
"@bazel/esbuild": "npm:5.8.1"
"@bazel/jasmine": "patch:@bazel/jasmine@npm%3A5.8.1#~/.yarn/patches/@bazel-jasmine-npm-5.8.1-3370fee155.patch"
"@discoveryjs/json-ext": "npm:0.5.7"
"@discoveryjs/json-ext": "npm:0.6.0"
"@inquirer/confirm": "npm:3.1.12"
"@inquirer/prompts": "npm:5.1.0"
"@listr2/prompt-adapter-inquirer": "npm:2.0.13"
Expand Down Expand Up @@ -2585,10 +2585,10 @@ __metadata:
languageName: node
linkType: hard

"@discoveryjs/json-ext@npm:0.5.7":
version: 0.5.7
resolution: "@discoveryjs/json-ext@npm:0.5.7"
checksum: 10c0/e10f1b02b78e4812646ddf289b7d9f2cb567d336c363b266bd50cd223cf3de7c2c74018d91cd2613041568397ef3a4a2b500aba588c6e5bd78c38374ba68f38c
"@discoveryjs/json-ext@npm:0.6.0":
version: 0.6.0
resolution: "@discoveryjs/json-ext@npm:0.6.0"
checksum: 10c0/a6af8aac44b19aee9940f818f8ddfde9341c220a4d6f91805ef6808b3f11dbe7d07566ab03ee106f629d783cc301fe6d15bf4de548f1e06a1b75bda17d004cbe
languageName: node
linkType: hard

Expand Down

0 comments on commit d449c9d

Please sign in to comment.