Skip to content

Commit

Permalink
Merge pull request #2891 from patrick-rodgers/version-4
Browse files Browse the repository at this point in the history
Build System
  • Loading branch information
patrick-rodgers authored Jan 8, 2024
2 parents 50b7a7f + be715bc commit ad04910
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion buildsystem-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Logger.subscribe(ConsoleListener("", {
warning: "yellow",
}));

const logLevel = LogLevel.Info;
const logLevel = LogLevel.Verbose;
const distFolder = "./dist/packages";
const commonPublishTags = ["--access", "public", "--dry-run"];

Expand Down
18 changes: 9 additions & 9 deletions tools/buildsystem/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tools/buildsystem/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pnp/buildsystem",
"version": "4.0.0-beta9",
"version": "4.0.0-beta10",
"bin": {
"pnpbuild": "bin/buildsystem.js"
},
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tools/buildsystem/src/behaviors/copy-package-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {

Expand All @@ -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);

});
});
Expand Down
2 changes: 1 addition & 1 deletion tools/buildsystem/src/behaviors/publish-nightly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {

Expand Down
7 changes: 4 additions & 3 deletions tools/buildsystem/src/behaviors/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tools/buildsystem/src/behaviors/replace-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
Expand Down
2 changes: 2 additions & 0 deletions tools/buildsystem/src/behaviors/write-packagejson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad04910

Please sign in to comment.