Repository navigation
chore(projen): migrate to projen's native ConstructLibraryCdktn project type - #127
Open
so0k (so0k) wants to merge 1 commit into
Open
so0k (so0k) wants to merge 1 commit into
so0k (so0k) wants to merge 1 commit into
Conversation
…ct type
projen 0.104 ships `cdktn.ConstructLibraryCdktn`, so the repo no longer needs
to emulate it with `cdktf.ConstructLibraryCdktf` plus a manual
`removeDependency("cdktf")` and a `keywords` override.
Project type and dependencies
- `.projenrc.ts` now uses `cdktn.ConstructLibraryCdktn({ cdktnVersion: "0.22.0" })`.
cdktn and constructs become peer + dev dependencies (jsii convention);
`cdktn` is removed from runtime `dependencies`, where the old projenrc had
added it explicitly.
- projen ^0.81 -> ^0.104.4.
- constructs minimum 10.4.2 -> 10.5.0 (projen 0.104 peer-depends on
^10.5.0; still within cdktn@0.22.0's ^10.4.2 peer range). API.md gains the
inherited `with(mixins)` method that constructs 10.5 added to every construct.
- minNodeVersion 20.16.0 -> 22.19.0: cdktn@0.22.0 already declares
`engines.node >= 22.19.0`, and cdktn's v0.23 upgrade guide announces Node 22
as the upcoming minimum. Workflows now set up Node 22.19.0.
Pinned to preserve current behaviour
- `tsconfigDevFile: "tsconfig.dev.json"`: newer projen defaults the dev
tsconfig to `<testdir>/tsconfig.json`, which is invalid with `testdir: ""`.
- `tsconfig.compilerOptions.module: "commonjs"`: projen's new jsii default is
`node16`, which rejects the extension-less dynamic `import()` calls in
azapi-resource.ts. jsii's strict ruleset accepts commonjs.
- Drop the empty eslint lint pattern that `testdir: ""` produces; eslint 9
errors on it.
Generated-file churn from the projen upgrade
- eslint 8 -> 9 (legacy config mode), typescript-eslint 6 -> 8,
standard-version -> commit-and-tag-version, jest-junit 15 -> 17.
- GitHub Actions pinned to commit SHAs, package jobs rebuilt from the
build artifact, release workflow gains a dry-run input.
- `package-lock.json` removed (yarn classic is the package manager).
- eslint's new `curly` rule added braces around four single-line throws in
src/testing/index.ts.
Verified locally with `npx projen build`: compile, 59 test suites /
1978 tests, eslint, docgen and jsii-pacmak (js + python) all pass.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
projen 0.104 ships a native
cdktn.ConstructLibraryCdktnproject type. This PR adopts it so.projenrc.tsno longer has to emulate cdktn viacdktf.ConstructLibraryCdktfwith aremoveDependency("cdktf")hack and akeywordsoverride.Part of the CDKTF→CDKTN cleanup series (see #124, #125, #126). Still targets cdktn 0.22.0; the cdktn 0.24 bump and pre-built AZAPI provider adoption are a separate draft PR stacked on this one.
Changes
Project type and dependencies
cdktn.ConstructLibraryCdktn({ cdktnVersion: "0.22.0", ... }). cdktn and constructs become peer + dev dependencies, the jsii convention.cdktnis removed from runtimedependencies, where the previous projenrc had added it explicitly on top of the peer dependency. Consumers already had to installcdktnthemselves because of the peer dependency, so this should be a no-op for them, but worth a reviewer's eye.^0.81.15→^0.104.4.10.4.2→10.5.0. projen 0.104 peer-depends onconstructs@^10.5.0;10.5.0is still inside cdktn@0.22.0's^10.4.2range. Side effect: API.md gains the inheritedwith(mixins)method that constructs 10.5 added to every construct (~3.8k generated lines, no hand edits).minNodeVersion20.16.0→22.19.0. cdktn@0.22.0 already declaresengines.node >= 22.19.0, and the cdktn v0.23 upgrade guide announces Node 22 as the upcoming minimum. CI workflows now use Node 22.19.0.packageManager: YARN_CLASSICset explicitly (projen deprecation warning otherwise).Pinned to preserve current behaviour
tsconfigDevFile: "tsconfig.dev.json": newer projen defaults the dev tsconfig to<testdir>/tsconfig.json, which with this repo'stestdir: ""produced a broken/tsconfig.json.tsconfig.compilerOptions.module: "commonjs": projen's new jsii default isnode16, which rejects the four extension-less dynamicimport()calls inazapi-resource.ts. jsii's strict tsconfig ruleset acceptscommonjs, which is what jsii generated before projen ownedtsconfig.json.testdir: ""is dropped; eslint 9 errors on it. This touches projen's private_lintPatternsset, flagged in a comment.Generated-file churn from the projen upgrade (all under
~~ Generated by projenheaders)ESLINT_USE_FLAT_CONFIG=false), typescript-eslint 6 → 8, standard-version → commit-and-tag-version, jest-junit 15 → 17.package-js/package-pythonjobs now check out the repo and extract the build tarball instead ofmv dist .repo; release workflow gains adry_runinput.package-lock.jsonremoved (yarn classic is the package manager; it was already stale).curlyrule added braces around four single-linethrowstatements insrc/testing/index.tsvia--fix.The existing index-based
include-hidden-filesoverrides in.projenrc.tswere re-checked against the regenerated workflows and still land on the upload/download-artifact steps.Test plan
Verified locally with
npx projen build:import/orderwarnings)CI should run the same
build.yml; please watch for self-mutation diffs, since that is the main risk of a projen version jump.🤖 Generated with Claude Code