Skip to content

Commit

Permalink
refactor: use Yarn instead
Browse files Browse the repository at this point in the history
  • Loading branch information
sikhlana committed Nov 2, 2024
1 parent 8f3fc6c commit 58945f3
Show file tree
Hide file tree
Showing 6 changed files with 1,711 additions and 2,075 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
cache: yarn
cache-dependency-path: yarn.lock

- name: Generate terraform bindings
run: |
Expand All @@ -38,7 +35,7 @@ jobs:
- name: Install NPM dependencies
run: |
rm -rf node_modules/
pnpm install --frozen-lockfile
yarn install --frozen-lockfile
- name: Load .env file contents
env:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
cache: yarn
cache-dependency-path: yarn.lock

- name: Generate terraform bindings
run: |
Expand All @@ -37,7 +34,7 @@ jobs:
- name: Install NPM dependencies
run: |
rm -rf node_modules/
pnpm install --frozen-lockfile
yarn install --frozen-lockfile
- name: Load .env file contents
env:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ visit [this repo](https://github.com/sikhlana/terraform).**
- Automatically autoload all stacks and its constructs (resources and data).
- A minimal dependency injector using [tsyringe](https://github.com/microsoft/tsyringe).
- Define Terraform Cloud workspace using the `@Workspace(workspace: string, project?: string)` decorator.
- View all your definitions in a tree format by running `node --import tsx main.ts`.
- GitHub workflows to automatically plan and apply changes (requires `.env` file contents inside `ENV_FILE_CONTENTS` environment secret).
- View all your definitions in a tree format by running `npm ts-node main.ts`.
- GitHub workflows to automatically plan and apply changes (put `.env` file contents inside `ENV_FILE_CONTENTS` environment secret).

## Requirements
- Terraform: `>=1.5`
- CDKTF: `>=0.17`
- NodeJS: `>=20.0`
- pnpm: `>=9.0`
- Yarn: `>=1.22`


## Usage

1. Create a template from this repo.
2. Update the value for `projectId` inside the `cdktf.json` file.
You can generate a random UUID [from here](https://www.uuidgenerator.net/version4).
3. Install dependencies by running `pnpm install --frozen-lockfile`.
3. Install dependencies by running `yarn install --frozen-lockfile`.
4. Install your required providers by running `cdktf provider add <provider...>`.
5. Create your stacks.
6. Run `cdktf apply '*'`.
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"dependencies": {
"@cdktf/provider-null": "^10.0.1",
"@cdktf/provider-tfe": "^11.8.0",
"@types/ejs": "^3.1.5",
"@types/lodash": "^4.17.13",
"@types/node": "^20.17.5",
"cdktf": "^0.20.9",
"constructs": "^10.4.2",
"defu": "^6.1.4",
Expand All @@ -33,26 +36,22 @@
"glob": "^11.0.0",
"lodash": "^4.17.21",
"natural-orderby": "^4.0.0",
"print-tree": "^0.1.5",
"reflect-metadata": "^0.2.2",
"scule": "^1.3.0",
"tsyringe": "^4.8.0"
"tsconfig-paths": "^4.2.0",
"tsyringe": "^4.8.0",
"type-fest": "^4.26.1"
},
"devDependencies": {
"@types/ejs": "^3.1.5",
"@types/lodash": "^4.17.13",
"@types/node": "^20.17.5",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-typescript-sort-keys": "^3.3.0",
"prettier": "^3.3.3",
"print-tree": "^0.1.5",
"tsconfig-paths": "^4.2.0",
"tsx": "^4.19.2",
"type-fest": "^4.26.1"
"prettier": "^3.3.3"
},
"packageManager": "[email protected]+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
Loading

0 comments on commit 58945f3

Please sign in to comment.