declapract-typescript-ehmpathy 0.47.66 → 0.47.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { createGetVariables } from 'declapract';
3
3
  export const getProjectVariables = createGetVariables({
4
4
  organizationName: 'awesum',
5
5
  projectName: 'svc-awesome-thing',
6
+ reviewers: { users: ['user1', 'user2'] },
6
7
  });
7
8
 
8
9
  export const getServiceVariables = createGetVariables({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "devDependencies": {
3
- "declastruct": "@declapract{check.minVersion('1.7.3')}",
4
- "declastruct-aws": "@declapract{check.minVersion('1.4.3')}",
3
+ "declastruct": "@declapract{check.minVersion('1.9.1')}",
4
+ "declastruct-aws": "@declapract{check.minVersion('1.5.0')}",
5
5
  "declastruct-unix-network": "@declapract{check.minVersion('1.0.5')}"
6
6
  }
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "devDependencies": {
3
- "declastruct": "@declapract{check.minVersion('1.7.3')}",
4
- "declastruct-github": "@declapract{check.minVersion('1.3.5')}"
3
+ "declastruct": "@declapract{check.minVersion('1.9.1')}",
4
+ "declastruct-github": "@declapract{check.minVersion('1.4.0')}"
5
5
  }
6
6
  }
@@ -2,6 +2,7 @@ import type { DeclastructProvider } from 'declastruct';
2
2
  import {
3
3
  type DeclaredGithubBranch,
4
4
  DeclaredGithubBranchProtection,
5
+ DeclaredGithubEnvironment,
5
6
  DeclaredGithubRepo,
6
7
  DeclaredGithubRepoConfig,
7
8
  getDeclastructGithubProvider,
@@ -119,6 +120,32 @@ export const getResources = async (): Promise<DomainEntity<any>[]> => {
119
120
  restrictions: null,
120
121
  });
121
122
 
123
+ // declare environment for production deployments from main (auto-approved)
124
+ const envProductionOnMain = DeclaredGithubEnvironment.as({
125
+ repo,
126
+ name: 'production-on-main',
127
+ reviewers: null, // no approval required — PR merge is the gate
128
+ waitTimer: null, // no delay
129
+ deploymentBranchPolicy: { customBranches: ['main'] }, // only main branch
130
+ preventSelfReview: false,
131
+ });
132
+
133
+ // declare environment for production deployments from other branches (requires approval)
134
+ const envProductionOnElse = DeclaredGithubEnvironment.as({
135
+ repo,
136
+ name: 'production-on-else',
137
+ reviewers: { users: @declapract{variable.reviewers.users}, teams: null },
138
+ waitTimer: null, // no delay once approved
139
+ deploymentBranchPolicy: null, // any branch
140
+ preventSelfReview: false, // self-approval allowed if in reviewers list
141
+ });
142
+
122
143
  // and return the full set
123
- return [repo, repoConfig, branchMainProtection];
144
+ return [
145
+ repo,
146
+ repoConfig,
147
+ branchMainProtection,
148
+ envProductionOnMain,
149
+ envProductionOnElse,
150
+ ];
124
151
  };
@@ -10,10 +10,10 @@
10
10
  "@swc/jest": "@declapract{check.minVersion('0.2.39')}"
11
11
  },
12
12
  "scripts": {
13
- "test:unit": "set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ -z \"${THOROUGH:-}\" ] && echo '--changedSince=main') $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')",
14
- "test:integration": "set -eu && jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ -z \"${THOROUGH:-}\" ] && echo '--changedSince=main') $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')",
15
- "test:acceptance:locally": "set -eu && npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')",
13
+ "test:unit": "set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
14
+ "test:integration": "set -eu && jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
15
+ "test:acceptance:locally": "set -eu && npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
16
16
  "test": "set -eu && npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally",
17
- "test:acceptance": "set -eu && npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')"
17
+ "test:acceptance": "set -eu && npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')"
18
18
  }
19
19
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "declapract-typescript-ehmpathy",
3
3
  "author": "ehmpathy",
4
4
  "description": "declapract best practices declarations for typescript",
5
- "version": "0.47.66",
5
+ "version": "0.47.68",
6
6
  "license": "MIT",
7
7
  "main": "src/index.js",
8
8
  "repository": "ehmpathy/declapract-typescript-ehmpathy",
@@ -33,11 +33,11 @@
33
33
  "test:lint:biome": "npm run biome:nested:hide && biome check --diagnostic-level=error; EXIT=$?; npm run biome:nested:restore; exit $EXIT",
34
34
  "test:lint:biome:all": "npm run biome:nested:hide && biome check; EXIT=$?; npm run biome:nested:restore; exit $EXIT",
35
35
  "test:lint": "npm run test:lint:biome && npm run test:lint:deps",
36
- "test:unit": "set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ -z \"${THOROUGH:-}\" ] && echo '--changedSince=main') $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')",
37
- "test:integration": "set -eu && jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ -z \"${THOROUGH:-}\" ] && echo '--changedSince=main') $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')",
38
- "test:acceptance:locally": "set -eu && npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')",
36
+ "test:unit": "set -eu && jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
37
+ "test:integration": "set -eu && jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${THOROUGH:-}\" != \"true\" ] && echo '--changedSince=main') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
38
+ "test:acceptance:locally": "set -eu && npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
39
39
  "test": "set -eu && npm run test:commits && npm run test:types && npm run test:format && npm run test:lint && npm run test:unit && npm run test:integration && npm run test:acceptance:locally && npm run test:validate",
40
- "test:acceptance": "set -eu && npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ -n \"${RESNAP:-}\" ] && echo '--updateSnapshot')",
40
+ "test:acceptance": "set -eu && npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests $([ -n \"${CI:-}\" ] && echo '--ci') $([ \"${RESNAP:-}\" = \"true\" ] && echo '--updateSnapshot')",
41
41
  "prepush": "npm run test && npm run build",
42
42
  "prepublish": "npm run build",
43
43
  "preversion": "npm run prepush",
@@ -69,8 +69,8 @@
69
69
  "@types/jest": "30.0.0",
70
70
  "@types/node": "22.15.21",
71
71
  "cz-conventional-changelog": "3.3.0",
72
- "declastruct": "1.7.0",
73
- "declastruct-github": "1.0.7",
72
+ "declastruct": "1.9.1",
73
+ "declastruct-github": "1.4.0",
74
74
  "depcheck": "1.4.3",
75
75
  "esbuild-register": "3.6.0",
76
76
  "husky": "8.0.3",