From 1feec645fbe59640534f3ab963dd2dc92b6e65c6 Mon Sep 17 00:00:00 2001 From: Patrick Rodgers Date: Mon, 8 Jan 2024 13:26:32 -0500 Subject: [PATCH] build system updates --- buildsystem-config.ts | 4 ++-- tools/buildsystem/package-lock.json | 18 +++++++++--------- tools/buildsystem/package.json | 4 ++-- .../src/behaviors/copy-package-files.ts | 4 ++-- .../src/behaviors/publish-nightly.ts | 2 +- tools/buildsystem/src/behaviors/publish.ts | 7 ++++--- .../src/behaviors/replace-version.ts | 2 +- .../src/behaviors/write-packagejson.ts | 2 ++ 8 files changed, 23 insertions(+), 20 deletions(-) diff --git a/buildsystem-config.ts b/buildsystem-config.ts index 4e3b97e78..69fb43aea 100644 --- a/buildsystem-config.ts +++ b/buildsystem-config.ts @@ -25,9 +25,9 @@ Logger.subscribe(ConsoleListener("", { warning: "yellow", })); -const logLevel = LogLevel.Info; +const logLevel = LogLevel.Verbose; const distFolder = "./dist/packages"; -const commonPublishTags = [".", "--access", "public"]; +const commonPublishTags = ["--access", "public", "--dry-run"]; function PnPBuild(buildFlags?: string[]): (b: BuildTimeline) => BuildTimeline { diff --git a/tools/buildsystem/package-lock.json b/tools/buildsystem/package-lock.json index cc1241abc..9a437bc6d 100644 --- a/tools/buildsystem/package-lock.json +++ b/tools/buildsystem/package-lock.json @@ -1,15 +1,15 @@ { "name": "@pnp/buildsystem", - "version": "4.0.0-beta8", + "version": "4.0.0-beta9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@pnp/buildsystem", - "version": "4.0.0-beta8", + "version": "4.0.0-beta9", "license": "MIT", "dependencies": { - "@pnp/core": "^4.0.0-alpha0-v4nightly.20231229", + "@pnp/core": "^4.0.0-alpha0-v4nightly.20240105", "globby": "^14.0.0", "liftoff": "^4.0.0", "webpack": "^5.89.0", @@ -153,9 +153,9 @@ } }, "node_modules/@pnp/core": { - "version": "4.0.0-alpha0-v4nightly.20231229", - "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.0.0-alpha0-v4nightly.20231229.tgz", - "integrity": "sha512-3N58DjsoiqQTw3eablg4cO0HjL1RPTzV47DGYGBdeFS6p/IKWLLDG59jevuhKV6eoRVWpvaJguQoDMyiGlRNrg==", + "version": "4.0.0-alpha0-v4nightly.20240105", + "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.0.0-alpha0-v4nightly.20240105.tgz", + "integrity": "sha512-AdjLkyHZu5+ynwdxHwtD/hJzi6MIoSkmbh8MfIsf7FQ6hq/87YQhJjOKHPkt8nw2TUjHp7F4+nLoVUUouT/E9g==", "dependencies": { "tslib": "2.4.1" }, @@ -2749,9 +2749,9 @@ } }, "@pnp/core": { - "version": "4.0.0-alpha0-v4nightly.20231229", - "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.0.0-alpha0-v4nightly.20231229.tgz", - "integrity": "sha512-3N58DjsoiqQTw3eablg4cO0HjL1RPTzV47DGYGBdeFS6p/IKWLLDG59jevuhKV6eoRVWpvaJguQoDMyiGlRNrg==", + "version": "4.0.0-alpha0-v4nightly.20240105", + "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.0.0-alpha0-v4nightly.20240105.tgz", + "integrity": "sha512-AdjLkyHZu5+ynwdxHwtD/hJzi6MIoSkmbh8MfIsf7FQ6hq/87YQhJjOKHPkt8nw2TUjHp7F4+nLoVUUouT/E9g==", "requires": { "tslib": "2.4.1" } diff --git a/tools/buildsystem/package.json b/tools/buildsystem/package.json index 2e5bc17bc..3831780a6 100644 --- a/tools/buildsystem/package.json +++ b/tools/buildsystem/package.json @@ -1,6 +1,6 @@ { "name": "@pnp/buildsystem", - "version": "4.0.0-beta9", + "version": "4.0.0-beta10", "bin": { "pnpbuild": "bin/buildsystem.js" }, @@ -9,7 +9,7 @@ "type": "module", "typings": "./index", "dependencies": { - "@pnp/core": "^4.0.0-alpha0-v4nightly.20231229", + "@pnp/core": "^4.0.0-alpha0-v4nightly.20240105", "globby": "^14.0.0", "liftoff": "^4.0.0", "webpack": "^5.89.0", diff --git a/tools/buildsystem/src/behaviors/copy-package-files.ts b/tools/buildsystem/src/behaviors/copy-package-files.ts index e2ace2858..c8de6da66 100644 --- a/tools/buildsystem/src/behaviors/copy-package-files.ts +++ b/tools/buildsystem/src/behaviors/copy-package-files.ts @@ -20,7 +20,7 @@ export function CopyPackageFiles(source: "src" | "built", pattern: string[]): Ti this.context.targets.forEach(async (target) => { - this.log(`Starting CopyPackageFiles with pattern ${stringPattern} on target '${target.tsconfigPath}'`); + this.log(`Starting CopyPackageFiles with pattern ${stringPattern} on target '${target.tsconfigPath}'`, 1); const files = await target.packages.reduce((p, pkg) => { @@ -46,7 +46,7 @@ export function CopyPackageFiles(source: "src" | "built", pattern: string[]): Ti await Promise.all(files.map(f => buildCopyFile(f.src, f.dest))); - this.log(`Completing CopyPackageFiles with pattern ${stringPattern} on target '${target.tsconfigPath}'`); + this.log(`Completing CopyPackageFiles with pattern ${stringPattern} on target '${target.tsconfigPath}'`, 1); }); }); diff --git a/tools/buildsystem/src/behaviors/publish-nightly.ts b/tools/buildsystem/src/behaviors/publish-nightly.ts index 2b9560053..ee1db7579 100644 --- a/tools/buildsystem/src/behaviors/publish-nightly.ts +++ b/tools/buildsystem/src/behaviors/publish-nightly.ts @@ -26,7 +26,7 @@ export function PublishNightly(flags: string[], nightlyName: "v3nightly" | "v4ni const versionStr = `-${nightlyName}.${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, "0")}${date.getDate().toString().padStart(2, "0")}`; - this.log(`Updating nightly package.json version to ${versionStr}`); + this.log(`Updating nightly package.json version to ${versionStr}`, 1); await Promise.all(targets[0].packages.map(pkg => { diff --git a/tools/buildsystem/src/behaviors/publish.ts b/tools/buildsystem/src/behaviors/publish.ts index 39d8a8b40..de3c8d38c 100644 --- a/tools/buildsystem/src/behaviors/publish.ts +++ b/tools/buildsystem/src/behaviors/publish.ts @@ -18,15 +18,16 @@ export function Publish(flags?: string[]): TimelinePipe { promises.push(new Promise((resolve, reject) => { - this.log(`Publishing ${pkg.resolvedPkgDistRoot} with flags ${stringFlags}`); + this.log(`Publishing ${pkg.resolvedPkgDistRoot} with flags ${stringFlags}`, 1); exec(`npm publish ${stringFlags}`, { cwd: pkg.resolvedPkgDistRoot, - }, (error, _stdout, _stderr) => { + }, (error, stdout, _stderr) => { if (error === null) { - this.log(`Published ${pkg.resolvedPkgDistRoot} with flags ${stringFlags}`); + this.log(`Published ${pkg.resolvedPkgDistRoot} with flags ${stringFlags}`, 1); + this.log(stdout); resolve(); } else { this.log(`${error}`, 3); diff --git a/tools/buildsystem/src/behaviors/replace-version.ts b/tools/buildsystem/src/behaviors/replace-version.ts index f61e82d7b..325394c97 100644 --- a/tools/buildsystem/src/behaviors/replace-version.ts +++ b/tools/buildsystem/src/behaviors/replace-version.ts @@ -29,7 +29,7 @@ export function ReplaceVersion(paths: string[], options?: IReplaceVersionOptions paths.forEach(async (path) => { const resolvedPath = options?.pathsResolved ? path : resolve(target.resolvedOutDir, path); - this.log(`Resolving path '${path}' to '${resolvedPath}'.`, 0); + this.log(`Resolving path '${path}' to '${resolvedPath}'.`); const file = await readFile(resolve(resolvedPath)); await buildWriteFile(resolvedPath, file.toString().replace(options.versionMask, version)); }); diff --git a/tools/buildsystem/src/behaviors/write-packagejson.ts b/tools/buildsystem/src/behaviors/write-packagejson.ts index 5dfb52feb..0142a73e0 100644 --- a/tools/buildsystem/src/behaviors/write-packagejson.ts +++ b/tools/buildsystem/src/behaviors/write-packagejson.ts @@ -18,6 +18,8 @@ export function WritePackageJSON(transform?: (p: any) => typeof p): TimelinePipe let pkgFile = importJSON(resolve(pkg.resolvedPkgSrcRoot, "package.json")); + this.log(`Updating package version at ${pkgFile} to ${version}`, 1); + pkgFile.version = version; // update our peer dependencies and dependencies placeholder if needed