Skip to content

Commit

Permalink
chore: upgrade to cdktf 0.17 and tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Jun 15, 2023
1 parent 2eea157 commit 2fc6b8b
Show file tree
Hide file tree
Showing 7 changed files with 2,199 additions and 744 deletions.
4 changes: 2 additions & 2 deletions cdktf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"language": "typescript",
"app": "npm run --silent compile && node main.js",
"app": "npx tsx main.ts",
"projectId": "46fb4da5-e0c7-486d-aba8-24e91527e550"
}
}
16 changes: 7 additions & 9 deletions lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
*/

import { Construct } from "constructs";
import {
Repository,
TeamRepository,
BranchProtection,
IssueLabel,
RepositoryWebhook,
GithubProvider,
DataGithubRepository,
} from "@cdktf/provider-github";
import { SecretFromVariable } from "./secrets";
import { GithubProvider } from "@cdktf/provider-github/lib/provider";
import { Repository } from "@cdktf/provider-github/lib/repository";
import { DataGithubRepository } from "@cdktf/provider-github/lib/data-github-repository";
import { IssueLabel } from "@cdktf/provider-github/lib/issue-label";
import { BranchProtection } from "@cdktf/provider-github/lib/branch-protection";
import { TeamRepository } from "@cdktf/provider-github/lib/team-repository";
import { RepositoryWebhook } from "@cdktf/provider-github/lib/repository-webhook";

export interface ITeam {
id: string;
Expand Down
14 changes: 6 additions & 8 deletions lib/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
*/

import { Construct } from "constructs";
import { Resource, TerraformVariable } from "cdktf";
import {
ActionsSecret,
DataGithubRepository,
GithubProvider,
Repository,
} from "@cdktf/provider-github";
import { TerraformVariable } from "cdktf";
import { constantCase } from "change-case";
import { Repository } from "@cdktf/provider-github/lib/repository";
import { DataGithubRepository } from "@cdktf/provider-github/lib/data-github-repository";
import { GithubProvider } from "@cdktf/provider-github/lib/provider";
import { ActionsSecret } from "@cdktf/provider-github/lib/actions-secret";

export class SecretFromVariable extends Resource {
export class SecretFromVariable extends Construct {
public readonly name: string;
public readonly variable: TerraformVariable;
public secretNames: string[] = [];
Expand Down
3 changes: 2 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
RemoteBackend,
Annotations,
} from "cdktf";
import { GithubProvider, DataGithubTeam } from "@cdktf/provider-github";
import {
GithubRepository,
GithubRepositoryFromExistingRepository,
Expand All @@ -21,6 +20,8 @@ import {
import * as fs from "fs";
import * as path from "path";
import { TerraformVariable } from "cdktf";
import { GithubProvider } from "@cdktf/provider-github/lib/provider";
import { DataGithubTeam } from "@cdktf/provider-github/lib/data-github-team";

type StackShards = {
primaryStack: string;
Expand Down
25 changes: 20 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@
"engines": {
"node": ">=10.12"
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"ignorePatterns": [
"node_modules"
]
},
"dependencies": {
"@cdktf/provider-github": "^2.0.10",
"cdktf": "^0.12.0",
"cdktf-cli": "^0.12.0",
"@cdktf/provider-github": "^9.0.0",
"cdktf": "^0.17.0",
"cdktf-cli": "^0.17.0",
"change-case": "^4.1.2",
"constructs": "^10.0"
},
Expand All @@ -37,8 +51,9 @@
"eslint": "^8.27.0",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "^2.7.1",
"typescript": "^3.9.7"
"prettier": "^2.8.8",
"tsx": "^3.12.7",
"typescript": "^5.1.3"
},
"lint-staged": {
"*.{md,yml}": "prettier --write",
Expand Down
15 changes: 4 additions & 11 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"compilerOptions": {
"alwaysStrict": true,
"charset": "utf8",
"declaration": true,
"experimentalDecorators": true,
"inlineSourceMap": true,
"inlineSources": true,
"lib": [
"es2019"
],
"lib": ["es2019"],
"module": "CommonJS",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
Expand All @@ -24,10 +21,6 @@
"stripInternal": true,
"target": "ES2018"
},
"include": [
"**/*.ts"
],
"exclude": [
"node_modules"
]
}
"include": ["**/*.ts"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 2fc6b8b

Please sign in to comment.