Skip to content

Commit

Permalink
feat(monorepo-ts): upgrade syncpack to v12 (#691)
Browse files Browse the repository at this point in the history
Upgrade from Syncpack v8 to v12. Additionally pin syncpack to major version 12 to avoid any future
breaking changes in new major versions from affecting new projects.

BREAKING CHANGE: Syncpack configuration for monorepo updated with breaking changes aligned with
Syncpack upgrade from v8 to v12:

- The `dev`, `overrides`, `peer`, `pnpmOverrides`, `prod`, `resolutions` and `workspace` boolean
flags are replaced by the `dependencyTypes` array.
- The `workspace` dependency type is now named `local`.
- `semverRange` is deprecated in favour of adding a range to `semverGroups`

For more details, please refer to the Syncpack releases between 8 and 12:
- [Syncpack v9](https://github.com/JamieMason/syncpack/releases/tag/9.0.0)
- [Syncpack v10](https://github.com/JamieMason/syncpack/releases/tag/10.0.0)
- [Syncpack v11](https://github.com/JamieMason/syncpack/releases/tag/11.0.0)
- [Syncpack v12](https://github.com/JamieMason/syncpack/releases/tag/12.0.0-alpha.0)

Additionally Syncpack related types and configs are namespaced under a `Syncpack` namespace,
eg. `Syncpack.DEFAULT_CONFIG` for the default monorepo syncpack config.

Fixes #675, #553
  • Loading branch information
cogwirrel authored Jan 30, 2024
1 parent d01935d commit 00dcb53
Show file tree
Hide file tree
Showing 11 changed files with 783 additions and 477 deletions.
1 change: 1 addition & 0 deletions .projen/deps.json

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

27 changes: 17 additions & 10 deletions .syncpackrc.json

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

2 changes: 1 addition & 1 deletion package.json

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

8 changes: 8 additions & 0 deletions packages/monorepo/package.json

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

11 changes: 6 additions & 5 deletions packages/monorepo/src/projects/typescript/monorepo-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { JavaProject } from "projen/lib/java";
import { NodePackageManager, NodeProject } from "projen/lib/javascript";
import { PythonProject } from "projen/lib/python";
import { TypeScriptProject } from "projen/lib/typescript";
import { DEFAULT_CONFIG, SyncpackConfig } from "./syncpack-options";
import { Syncpack } from "./syncpack-options";
import { TypeScriptProjectOptions } from "./typescript-project-options";
import {
NxConfigurator,
Expand Down Expand Up @@ -88,9 +88,9 @@ export interface MonorepoUpgradeDepsOptions {
*
* No merging is performed and as such a complete syncpackConfig is required if supplied.
*
* @default SyncpackConfig.DEFAULT_CONFIG
* @default Syncpack.DEFAULT_CONFIG
*/
readonly syncpackConfig?: SyncpackConfig;
readonly syncpackConfig?: Syncpack.SyncpackConfig;
}

/**
Expand Down Expand Up @@ -306,7 +306,7 @@ export class MonorepoTsProject
);

if (options.monorepoUpgradeDeps !== false) {
this.addDevDeps("npm-check-updates", "syncpack");
this.addDevDeps("npm-check-updates", "syncpack@^12");

const upgradeDepsTask = this.addTask(
options.monorepoUpgradeDepsOptions?.taskName || "upgrade-deps"
Expand Down Expand Up @@ -341,7 +341,8 @@ export class MonorepoTsProject

new JsonFile(this, ".syncpackrc.json", {
obj:
options.monorepoUpgradeDepsOptions?.syncpackConfig || DEFAULT_CONFIG,
options.monorepoUpgradeDepsOptions?.syncpackConfig ||
Syncpack.DEFAULT_CONFIG,
readonly: true,
});
}
Expand Down
Loading

0 comments on commit 00dcb53

Please sign in to comment.