Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update JSII and TS #3819

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
05e3e1f
chore: Upgrade typescript to 5.4.5
mutahhir Feb 5, 2025
0338786
chore: Update jsii version and dockerfile
mutahhir Feb 5, 2025
e2d1879
chore: Update test yarn.lock
mutahhir Feb 6, 2025
511e135
chore: Ugrade eslint parser and plugins
mutahhir Feb 6, 2025
ec30005
chore: Bump ts version to 5.7.3
mutahhir Feb 6, 2025
7fb5f2c
chore: Update jsii to 5.7.3 as well
mutahhir Feb 6, 2025
9a60e7c
chore: Upgrade eslint, and align version requirements
mutahhir Feb 11, 2025
3daa603
chore: update lockfile
mutahhir Feb 11, 2025
ceca196
chore: Remove lines as recommended by husky warning
mutahhir Feb 11, 2025
f6e5ba6
chore: Add dependency types file
mutahhir Feb 11, 2025
99177fa
chore: add required copyright headers
hashicorp-copywrite[bot] Feb 11, 2025
0ce9089
chore: Update jsii-pacmak
mutahhir Feb 11, 2025
4f3df62
chore: Use yarn 2 cache folder cli command
mutahhir Feb 12, 2025
eb9aa91
chore: Check if build works with corepack enabled, and ignore .yarn f…
mutahhir Feb 12, 2025
6cfc13e
chore: Make package jsons more yarn 4 friendly
mutahhir Feb 12, 2025
ffe6b4a
fix: Premature shell expansion on yarn 4
mutahhir Feb 12, 2025
d9965cd
fix: unexpected react usage within function generator tool
mutahhir Feb 12, 2025
9a93791
fix: Errors building generate-function-bindings
mutahhir Feb 13, 2025
5d0b74f
fix: Lerna config no longer needs packages field and useWorkspaces
mutahhir Feb 13, 2025
470216f
chore: Enable yarn 2 for all CI jobs requiring the cache
mutahhir Feb 13, 2025
746de31
fix: Missing workflows that don't have Yarn 2 enabled
mutahhir Feb 13, 2025
1dba902
chore: Update test lockfile
mutahhir Feb 13, 2025
a3ace19
chore: Update lerna version to latest
mutahhir Feb 13, 2025
7bfbaec
fix: Remove @cdktf/cli-core imported as both dev and prod dependency …
mutahhir Feb 13, 2025
7f5f3e3
fix: Add typescript to generate-function-bindings tool
mutahhir Feb 13, 2025
e45ef9c
chore: Add files to eslingConfig
mutahhir Feb 13, 2025
ec2ee1d
chore: Remove --ext argument from eslint as it's deprecated
mutahhir Feb 13, 2025
168c46c
fix: Running integration tests on yarn 2 requires changes to config k…
mutahhir Feb 18, 2025
d692392
feat: Eslint 9 flat file support
mutahhir Feb 20, 2025
5c67928
chore: add required copyright headers
hashicorp-copywrite[bot] Feb 20, 2025
54b4d27
fix: Run prettier on missing files
mutahhir Feb 20, 2025
37053cb
fix: Prettier version, eslint config, run prettier, and solve errors
mutahhir Feb 20, 2025
0947d3b
fix: dependencies missing and extra
mutahhir Feb 20, 2025
e48efd2
fix: Use prettier 2 within hcl2cdk because prettier 3 uses promises
mutahhir Feb 21, 2025
f6f0005
fix: Install prettier and types for generate-function-bindings
mutahhir Feb 25, 2025
b98502a
test: See if jest likes importing with extension
mutahhir Feb 25, 2025
9371710
fix: Yarn 2 requires pre and post tasks to be explicitly called
mutahhir Feb 25, 2025
f5d1ca0
feat: Add ability to bundle dependencies to CDKTF in yarn 4
mutahhir Mar 4, 2025
9b5f7e0
chore: add required copyright headers
hashicorp-copywrite[bot] Mar 4, 2025
cc1f194
fix: Need to use build-and-package since provider-generator requires …
mutahhir Mar 4, 2025
1097c0c
chore: Use build-and-package for all github workflows
mutahhir Mar 4, 2025
8881883
fix: Missing JSDoc
mutahhir Mar 4, 2025
c77a6cc
fix: Install esbuild on missing packages
mutahhir Mar 4, 2025
8737c35
fix: Build and package for examples
mutahhir Mar 4, 2025
2a27672
fix: Upgrade tsx to prevent node 18 errors
mutahhir Mar 4, 2025
4165577
fix: [Experiment] to see if we can hack a no-hoist system within yarn 4
mutahhir Mar 4, 2025
5ac009e
chore: [Experiment] type modules for hoisted packages also to not be …
mutahhir Mar 5, 2025
4e5bebe
chore: Add a hard reset script to reset lerna and npx cache for local…
mutahhir Mar 6, 2025
08579d2
chore: [experiment] Add more information about installed CDKTF CLI
mutahhir Mar 7, 2025
1405a17
fix: CLI not working because of not calling argv on yargs
mutahhir Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Enable Yarn 2
run: corepack enable
# Setup caches for yarn, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
Expand All @@ -52,8 +54,7 @@ jobs:
run: yarn install
- name: build and package
run: |
yarn build
yarn package
yarn build-and-package
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
12 changes: 7 additions & 5 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Enable Yarn 2
run: corepack enable
# Setup caches for yarn, terraform, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
Expand All @@ -81,20 +83,20 @@ jobs:
go-${{ runner.os }}-
- name: installing dependencies
run: |
yarn install --frozen-lockfile --prefer-offline
yarn install --immutable
env:
YARN_ENABLE_HARDENED_MODE: 0
- name: lint
run: yarn lint:examples
- name: align version (Python only)
if: startsWith(matrix.target, '@examples/python') # lint:examples ensures this prefix
run: tools/align-version.sh "-dev.$GITHUB_RUN_ID"
- name: compile
run: yarn build
run: yarn build-and-package
env:
TERRAFORM_BINARY_NAME: "terraform${{ matrix.terraform }}"
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.terraform }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
- name: create bundle
run: yarn package
- name: examples integration tests
run: test/run-against-dist node tools/build-example.js ${TEST_TARGET}
env:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Add Git safe.directory" # Go 1.18+ started embedding repo info in the build and e.g. building @cdktf/hcl2json fails without this
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: Enable Yarn 2
run: corepack enable
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
# Setup caches for yarn, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
Expand All @@ -55,15 +57,14 @@ jobs:
go-${{ runner.os }}-${{ hashFiles('**/go.sum') }}-
go-${{ runner.os }}-
- name: install dependencies
run: yarn install --frozen-lockfile --prefer-offline
run: yarn install --immutable
- name: set version
if: ${{ !inputs.skip_setup }}
run: tools/align-version.sh "-dev.$GITHUB_RUN_ID"
- name: build and package
if: ${{ !inputs.skip_setup }}
run: |
yarn build
yarn package
yarn build-and-package
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
Expand All @@ -81,7 +82,7 @@ jobs:
path: packages/@cdktf/provider-generator/edge-provider-bindings
- name: installing test dependencies
run: |
cd test && yarn install --frozen-lockfile --prefer-offline
cd test && yarn install --immutable
- id: build-test-matrix
run: |
./tools/build-test-matrix.sh
Expand All @@ -106,11 +107,13 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Enable Yarn 2
run: corepack enable
# Setup caches for yarn, terraform, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
Expand Down Expand Up @@ -182,7 +185,7 @@ jobs:
id: global-cache-dir-path
shell: bash
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ jobs:
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Enable Yarn 2
run: corepack enable
- name: installing dependencies
run: |
yarn install --frozen-lockfile
yarn install --immutable
- name: run prettier
run: |
yarn lint:prettier
Expand All @@ -34,9 +36,11 @@ jobs:
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Enable Yarn 2
run: corepack enable
- name: installing dependencies
run: |
yarn install --frozen-lockfile
yarn install --immutable
- name: run workspace linting
run: |
yarn lint:workspace
13 changes: 7 additions & 6 deletions .github/workflows/provider-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Enable Yarn 2
run: corepack enable
# Setup caches for yarn, and go
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
Expand All @@ -62,10 +64,9 @@ jobs:
- name: installing dependencies and build
if: ${{ !inputs.skip_setup }}
run: |
yarn install --frozen-lockfile --prefer-offline
yarn install --immutable
tools/align-version.sh "-dev.$GITHUB_RUN_ID"
yarn build
yarn package
yarn build-and-package
env:
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
- name: install test dependencies to warm up cache for matrix jobs to use
Expand Down Expand Up @@ -107,7 +108,7 @@ jobs:
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
# Only restoring yarn caches as the dependencies are not indiviual to each matrix job
Expand Down Expand Up @@ -168,7 +169,7 @@ jobs:
id: global-cache-dir-path
shell: bash
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/terraform
echo "terraform=/usr/local/share/.cache/terraform" >> $GITHUB_OUTPUT
# Only restoring yarn caches to save available cache storage size
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Enable Yarn 2
run: corepack enable
- name: version
id: get_version
run: |
Expand All @@ -54,10 +56,9 @@ jobs:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_TOKEN }}
- name: create bundle
run: |
yarn install --frozen-lockfile
yarn install --immutable
tools/align-version.sh
yarn build
yarn package
yarn build-and-package
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Add sourcemap and commit info to sentry
Expand Down Expand Up @@ -158,7 +159,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: installing dependencies
run: |
yarn install --frozen-lockfile
yarn install --immutable
- name: Download build artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Enable Yarn 2
run: corepack enable
- name: installing dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable
- name: Configure git user
run: |
git config user.name github-team-tf-cdk
Expand Down Expand Up @@ -61,9 +63,8 @@ jobs:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_TOKEN }}
- name: create bundle
run: |
yarn install --frozen-lockfile
yarn build
yarn package
yarn install --immutable
yarn build-and-package
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Add sourcemap and commit info to sentry
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ jobs:
run: git config --global --add safe.directory /__w/terraform-cdk/terraform-cdk
- name: ensure correct user
run: chown -R root /__w/terraform-cdk
- name: Enable Yarn 2
run: corepack enable

# Setup caches for yarn, terraform, go, and provider schema
- name: Get cache directory paths
id: global-cache-dir-path
run: |
echo "yarn=$(yarn cache dir)" >> $GITHUB_OUTPUT
echo "yarn=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/go
echo "go=/usr/local/share/.cache/go" >> $GITHUB_OUTPUT
mkdir -p /usr/local/share/.cache/providerSchema
Expand All @@ -63,12 +65,11 @@ jobs:

- name: installing dependencies
run: |
yarn install --frozen-lockfile --prefer-offline
yarn install --immutable
- name: compile
run: |
tools/align-version.sh
yarn build
yarn package
yarn build-and-package
env:
TERRAFORM_BINARY_NAME: "terraform${{ inputs.terraform_version }}"
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ jobs:
steps:
- name: Check Out
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Enable Yarn 2
run: corepack enable
- name: Get yarn cache directory path
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
Expand All @@ -54,7 +56,7 @@ jobs:

# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn upgrade" to run)
- name: Run "yarn install"
run: yarn install --prefer-offline
run: yarn install

# Next, create and upload the changes as a patch file. This will later be downloaded to create a pull request
# Creating a pull request requires write permissions and it's best to keep write privileges isolated.
Expand Down Expand Up @@ -151,7 +153,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get yarn cache directory path
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
Expand Down Expand Up @@ -217,7 +219,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get yarn cache directory path
id: global-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ steps.global-cache-dir-path.outputs.dir }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ tsconfig.tsbuildinfo
examples/java/gradle-shared-module/.gradle/

.nx/
.yarn
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

nodeLinker: node-modules
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ const bucket = new s3.S3Bucket(this, "bucket");
const firstRuleStage = Fn.lookup(
bucket.lifecycleRule("0").tags,
"stage",
"no-stage"
"no-stage",
);
const firstRuleTags = bucket.lifecycleRule("0").tags;

Expand Down
Loading
Loading