Skip to content

Commit

Permalink
feat(cli): add proxy plugin
Browse files Browse the repository at this point in the history
[Finishes #186638334]
  • Loading branch information
ianwremmel committed Feb 2, 2024
1 parent c241cf2 commit c8c0d42
Show file tree
Hide file tree
Showing 23 changed files with 1,128 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .nx-cache-buster
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-01-30T21:24:48-08:00
2024-02-01T19:01:49-08:00
27 changes: 1 addition & 26 deletions jest.d/environments/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,13 @@ import type {
JestEnvironmentConfig,
} from '@jest/environment';
import Environment from 'jest-environment-node';
import camelCase from 'lodash/camelCase.js';
import snakeCase from 'lodash/snakeCase.js';
import upperFirst from 'lodash/upperFirst.js';

import {env} from '@code-like-a-carpenter/env';
import {getStackName} from '@code-like-a-carpenter/tooling-common';

type TestEnv = 'aws' | 'localstack';

function getStackName(projectName: string): string {
const stackName = upperFirst(camelCase(projectName));
let suffix = '';
if (env('GITHUB_SHA', '') !== '') {
suffix = `${env('GITHUB_SHA', '').slice(0, 7)}`;
}

if (env('GITHUB_HEAD_REF', '') !== '') {
suffix = `${suffix}-${env('GITHUB_HEAD_REF')
.replace(/[/_]/g, '-')
.substring(0, 20)}`;
} else if (env('GITHUB_REF', '') !== '') {
const branchName = env('GITHUB_REF', '')
.split('/')
.slice(2)
.join('/')
.replace(/[/_]/g, '-')
.substring(0, 20);
suffix = `${suffix}-${branchName}`;
}

return suffix ? `${stackName}-${suffix}` : stackName;
}

export default class ExampleEnvironment extends Environment {
private readonly exampleName: string;
private readonly stackName: string;
Expand Down
Loading

0 comments on commit c8c0d42

Please sign in to comment.