declapract-typescript-ehmpathy 0.45.2 → 0.45.3
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.
- package/dist/domain/constants.ts +3 -0
- package/dist/practices/cicd-app-react-native-expo/best-practice/.gitignore.declapract.ts +1 -1
- package/dist/practices/commands/bad-practices/scripts-dir/src/contract/scripts/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/config/bad-practices/configs-contain-wrong-account-id/config/dev.json.declapract.ts +1 -1
- package/dist/practices/config/bad-practices/configs-contain-wrong-account-id/config/prod.json.declapract.ts +1 -1
- package/dist/practices/config/bad-practices/configs-contain-wrong-account-id/config/test.json.declapract.ts +1 -1
- package/dist/practices/config/bad-practices/divergent-config-shapes/config/dev.json.declapract.ts +1 -1
- package/dist/practices/config/bad-practices/divergent-config-shapes/config/prod.json.declapract.ts +1 -1
- package/dist/practices/config/bad-practices/in-util-dir-directly/src/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/config/bad-practices/promise-config/src/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/config/best-practice/provision/aws/product/parameter-store.tf.declapract.ts +1 -1
- package/dist/practices/config/best-practice/src/utils/config/Config.ts.declapract.ts +8 -8
- package/dist/practices/dates-and-times/bad-practices/moment/package.json.declapract.ts +1 -1
- package/dist/practices/declastruct/bad-practices/old-module-name/package.json.declapract.ts +1 -1
- package/dist/practices/directory-structure-src/bad-practices/model-dir/src/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/directory-structure-src/bad-practices/model-dir/src/model/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/directory-structure-src/best-practice/src/domain/constants.ts.declapract.ts +1 -1
- package/dist/practices/domain/bad-practices/schematic-joi-model/src/domain/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/domain/bad-practices/simple-type-guards/package.json.declapract.ts +1 -1
- package/dist/practices/domain/best-practice/package.json +0 -1
- package/dist/practices/errors/bad-practices/error-fns/src/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/format/bad-practices/format-script/package.json.declapract.ts +1 -1
- package/dist/practices/format/bad-practices/prettier/.prettierignore.declapract.ts +1 -1
- package/dist/practices/format/bad-practices/prettier/package.json.declapract.ts +1 -1
- package/dist/practices/format/bad-practices/prettier/prettier.config.js.declapract.ts +1 -1
- package/dist/practices/format/best-practice/package.json.declapract.ts +4 -1
- package/dist/practices/git/best-practice/.gitignore.declapract.ts +1 -1
- package/dist/practices/husky/bad-practices/postinstall/package.json.declapract.ts +1 -1
- package/dist/practices/lambda-clients/bad-practices/lambda-service-client-package/package.json.declapract.ts +1 -1
- package/dist/practices/lint/bad-practices/biome-json-extension/biome.json.declapract.ts +7 -0
- package/dist/practices/lint/bad-practices/depcheck-denylisted-ignores/.depcheckrc.yml.declapract.ts +1 -2
- package/dist/practices/lint/bad-practices/eslint/.eslintrc.js.declapract.ts +1 -1
- package/dist/practices/lint/bad-practices/eslint/package.json.declapract.ts +1 -1
- package/dist/practices/lint/bad-practices/tslint/package.json.declapract.ts +1 -1
- package/dist/practices/lint/best-practice/.depcheckrc.yml +1 -0
- package/dist/practices/lint/best-practice/.depcheckrc.yml.declapract.ts +1 -1
- package/dist/practices/logging/bad-practices/leveled-term/package.json.declapract.ts +1 -1
- package/dist/practices/node-service/bad-practices/license/package.json.declapract.ts +1 -1
- package/dist/practices/nonpublished-modules/bad-practices/ahbode-standard-lambda-handler/src/contract/handlers/<star>.integration.test.ts.declapract.ts +1 -1
- package/dist/practices/nonpublished-modules/bad-practices/ahbode-standard-lambda-handler/src/contract/handlers/<star>.ts.declapract.ts +1 -1
- package/dist/practices/nonpublished-modules/bad-practices/deep-omit/src/data/dao/<star><star>/<star>.integration.test.ts.declapract.ts +2 -2
- package/dist/practices/package-json-order/best-practice/package.json.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/extensions.sql.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/provision/docker/integration_test_db/<star><star>/<star>.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/provision/docker/integration-test-db/<star><star>/<star>.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/best-practice/config/dev.json.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/best-practice/provision/aws/product/parameter-store.tf.declapract.ts +2 -2
- package/dist/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +1 -1
- package/dist/practices/persist-with-rds/best-practice/src/utils/config/Config.ts.declapract.ts +1 -1
- package/dist/practices/runtime-type-checking/bad-practices/joi-types/package.json.declapract.ts +1 -1
- package/dist/practices/runtime-type-checking/bad-practices/old-joi-syntax-valid-input-cant-be-array/src/<star><star>/<star>.ts.declapract.ts +1 -1
- package/dist/practices/serverless/bad-practices/old-sls-plugins/package.json.declapract.ts +1 -1
- package/dist/practices/serverless/best-practice/serverless.yml.declapract.ts +7 -7
- package/dist/practices/terraform-common/bad-practices/terraform-dir/provision/terraform/<star><star>/.gitignore.declapract.ts +1 -1
- package/dist/practices/terraform-common/bad-practices/terraform-dir/provision/terraform/<star><star>/<star>.hcl.declapract.ts +1 -1
- package/dist/practices/terraform-common/bad-practices/terraform-dir/provision/terraform/<star><star>/<star>.tf.declapract.ts +1 -1
- package/dist/practices/tests/bad-practices/deprecated-test-deps/package.json.declapract.ts +1 -1
- package/dist/practices/tests/bad-practices/old-acceptance-test-utils/acceptance/lambdas/<star>.ts.declapract.ts +3 -3
- package/dist/practices/tests/bad-practices/old-acceptance-test-utils-2/acceptance/lambdas/<star>.ts.declapract.ts +1 -1
- package/dist/practices/tests/bad-practices/old-acceptance-test-utils-3/acceptance/lambdas/<star>.ts.declapract.ts +1 -1
- package/dist/practices/tests/bad-practices/old-extension-pattern/<star><star>/<star>.test.acceptance.ts.declapract.ts +1 -1
- package/dist/practices/tests/bad-practices/old-extension-pattern/<star><star>/<star>.test.integration.ts.declapract.ts +1 -1
- package/dist/practices/tests/best-practice/jest.unit.env.ts.declapract.ts +1 -1
- package/dist/practices/tests-service/best-practice/acceptance/lambdas/<star>.acceptance.test.ts.declapract.ts +2 -3
- package/dist/practices/typescript/bad-practices/relative-imports/src/<star><star>/<star>.ts.declapract.ts +22 -1
- package/dist/practices/typescript/best-practice/package.json.declapract.ts +1 -1
- package/dist/practices/uuid/bad-practices/deps-file/package.json.declapract.ts +1 -1
- package/dist/practices/uuid/bad-practices/npm-uuidv4/package.json.declapract.ts +1 -1
- package/package.json +33 -42
- package/dist/practices/tests/bad-practices/old-acceptance-test-utils-2/acceptance/__test_utils__/environment.ts.declapract.ts +0 -3
- /package/dist/practices/lint/best-practice/{biome.json → biome.jsonc} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
export const check: FileCheckFunction = (contents) => {
|
|
4
4
|
if (contents?.includes(`../utils/config'`)) return; // if it includes this string, then its a bad practice
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckType, FileFixFunction } from 'declapract';
|
|
1
|
+
import { FileCheckType, type FileFixFunction } from 'declapract';
|
|
2
2
|
import { UnexpectedCodePathError } from 'helpful-errors';
|
|
3
3
|
|
|
4
4
|
export const check = FileCheckType.CONTAINS;
|
|
@@ -7,10 +7,10 @@ export const fix: FileFixFunction = (contents, { declaredFileContents }) =>
|
|
|
7
7
|
!declaredFileContents
|
|
8
8
|
? UnexpectedCodePathError.throw('expected declared file contents to exist')
|
|
9
9
|
: !contents
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
? { contents: [declaredFileContents.trim(), '}'].join('\n') }
|
|
11
|
+
: {
|
|
12
|
+
contents: contents.replace(
|
|
13
|
+
'export interface Config {',
|
|
14
|
+
declaredFileContents.trim(), // add the prefix
|
|
15
|
+
),
|
|
16
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
export const check: FileCheckFunction = (contents) => {
|
|
4
4
|
if (contents?.includes('SchematicJoiModel')) return; // if it includes that, then this file matches a bad practice
|
package/dist/practices/errors/bad-practices/error-fns/src/<star><star>/<star>.ts.declapract.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
-
import {
|
|
2
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
3
3
|
|
|
4
4
|
export const check: FileCheckFunction = (contents) => {
|
|
5
5
|
if (contents?.includes("from '@ehmpathy/error-fns'")) return; // matches if it includes this
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
export const check: FileCheckFunction = (contents) => {
|
|
4
4
|
if (!contents) throw new Error('fine, does not match bad practice'); // if not defined, doesn't have the script
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
-
import { FileCheckType, FileFixFunction } from 'declapract';
|
|
2
|
+
import { FileCheckType, type FileFixFunction } from 'declapract';
|
|
3
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
4
4
|
import yaml from 'yaml';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckType, FileFixFunction } from 'declapract';
|
|
1
|
+
import { FileCheckType, type FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
export const check = FileCheckType.CONTAINS;
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ export const fix: FileFixFunction = (contents) => {
|
|
|
11
11
|
`import { omitAutogeneratedValues } from 'domain-objects';`,
|
|
12
12
|
)
|
|
13
13
|
.replace(
|
|
14
|
-
/deepOmit\(([\w
|
|
14
|
+
/deepOmit\(([\w|!|?|.]+), \[[\w'", ]+\]\)/g,
|
|
15
15
|
'omitAutogeneratedValues($1)',
|
|
16
16
|
),
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckType, FileFixFunction } from 'declapract';
|
|
1
|
+
import { FileCheckType, type FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
export const check = FileCheckType.CONTAINS; // i.e., check that the contents of the file contains what's declared (default is equals)
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ export const fix: FileFixFunction = (contents, context) => {
|
|
|
7
7
|
return {
|
|
8
8
|
contents: contents
|
|
9
9
|
.replace(
|
|
10
|
-
/value\s
|
|
10
|
+
/value\s+= var\.secret_database_\w+_password/g,
|
|
11
11
|
`value = "__IGNORED__" # "ignored" since we dont want to check in secrets to version control (terraform.lifecycle.ignore_changes -> value isn't overwritten)`,
|
|
12
12
|
)
|
|
13
13
|
.replace(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
export const check: FileCheckFunction = (contents) => {
|
|
4
4
|
if (contents?.includes('.valid(Object.values(')) return; // matches bad practice if this is found
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileCheckType } from 'declapract';
|
|
2
|
-
import { FileFixFunction } from 'declapract/dist/domain';
|
|
2
|
+
import type { FileFixFunction } from 'declapract/dist/domain';
|
|
3
3
|
|
|
4
4
|
export const check = FileCheckType.CONTAINS; // i.e., check that the contents of the file contains what's declared (default is equals)
|
|
5
5
|
|
|
@@ -12,11 +12,11 @@ const listAccountAliasesPolicy = ` # allow inferring access from account alia
|
|
|
12
12
|
export const fix: FileFixFunction = (contents) => {
|
|
13
13
|
if (!contents) return { contents }; // do nothing if file dne; // TODO: update to provision file from declared contents
|
|
14
14
|
let fixed = contents
|
|
15
|
-
.replace(/runtime
|
|
16
|
-
.replace(/
|
|
17
|
-
.replace(/
|
|
18
|
-
.replace(
|
|
19
|
-
.replace(
|
|
15
|
+
.replace(/runtime: nodejs\d\d.x/, 'runtime: nodejs16.x')
|
|
16
|
+
.replace(/ {2}- serverless-offline .*\n/, '') // a plugin we no longer use (never used it, no need to have it)
|
|
17
|
+
.replace(/ {2}- serverless-pseudo-parameters .*\n/, '') // a plugin we no longer use (serverless supports variables natively now)
|
|
18
|
+
.replace(/#\{AWS::Region\}/g, '${aws:region}') // use the serverless native variables, instead of the pseudo-parameters format
|
|
19
|
+
.replace(/#\{AWS::AccountId\}/g, '${aws:accountId}') // use the serverless native variables, instead of the pseudo-parameters format
|
|
20
20
|
.replace('## paramstore access', '# parameter store access')
|
|
21
21
|
.replace(
|
|
22
22
|
'## allow invocation of other lambdas',
|
|
@@ -31,7 +31,7 @@ export const fix: FileFixFunction = (contents) => {
|
|
|
31
31
|
'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: true # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html\n deploymentBucket',
|
|
32
32
|
) // add this env flag
|
|
33
33
|
.replace(
|
|
34
|
-
/service: ([a-zA-Z0-9
|
|
34
|
+
/service: ([a-zA-Z0-9-]+)\n\n?provider:/,
|
|
35
35
|
'service: $1\n\npackage:\n artifact: .artifact/contents.zip\n\nprovider:',
|
|
36
36
|
)
|
|
37
37
|
.replace(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
import { getProjectVariables } from '../../../../../../getVariables';
|
|
4
4
|
|
|
@@ -31,7 +31,7 @@ export const fix: FileFixFunction = async (contents, context) => {
|
|
|
31
31
|
)
|
|
32
32
|
.replace(
|
|
33
33
|
// replace the inputs
|
|
34
|
-
/name
|
|
34
|
+
/name: '(\w+)',/g,
|
|
35
35
|
[
|
|
36
36
|
`service: '${projectName}',`,
|
|
37
37
|
`function: '$1',`,
|
|
@@ -39,6 +39,6 @@ export const fix: FileFixFunction = async (contents, context) => {
|
|
|
39
39
|
`locally,`,
|
|
40
40
|
].join('\n'),
|
|
41
41
|
)
|
|
42
|
-
.replace(/data
|
|
42
|
+
.replace(/data: /g, 'event: '),
|
|
43
43
|
};
|
|
44
44
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
export const check: FileCheckFunction = (contents) => {
|
|
4
4
|
if (contents?.includes(`import { locally } from '../_utils/environment';`))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
import { FileCheckType } from 'declapract';
|
|
3
|
-
import { FileContentsFunction } from 'declapract/dist/domain';
|
|
3
|
+
import type { FileContentsFunction } from 'declapract/dist/domain';
|
|
4
4
|
|
|
5
5
|
import { readFile } from '../../../utils/readFile';
|
|
6
6
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FileCheckFunction } from 'declapract';
|
|
1
|
+
import type { FileCheckFunction } from 'declapract';
|
|
3
2
|
import expect from 'expect';
|
|
4
3
|
|
|
5
4
|
import { defineFunctionNameFromTestFileName } from '../../../defineFunctionNameFromTestFileName';
|
|
@@ -20,7 +19,7 @@ export const check: FileCheckFunction = (contents, context) => {
|
|
|
20
19
|
if (missedImports.length)
|
|
21
20
|
throw new Error(
|
|
22
21
|
`
|
|
23
|
-
${
|
|
22
|
+
${`- Expected imports ${['', ...expectedImports].join('\n - ')}`}
|
|
24
23
|
`.trim(),
|
|
25
24
|
);
|
|
26
25
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FileCheckFunction, FileFixFunction } from 'declapract';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* .what = detects relative imports that should use @src alias
|
|
@@ -8,6 +8,21 @@ import { type FileCheckFunction, type FileFixFunction } from 'declapract';
|
|
|
8
8
|
// matches relative imports that go up directories (../)
|
|
9
9
|
const RELATIVE_IMPORT_PATTERN = /from\s+['"](\.\.\/)+(.*?)['"]/g;
|
|
10
10
|
|
|
11
|
+
const isInPracticesDir = (relativeFilePath: string | undefined): boolean =>
|
|
12
|
+
relativeFilePath?.includes('src/practices/') ?? false;
|
|
13
|
+
|
|
14
|
+
const isDeclapractFile = (relativeFilePath: string | undefined): boolean =>
|
|
15
|
+
relativeFilePath?.endsWith('.declapract.ts') ?? false;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* skip files in src/practices/ because they are templates defining what target
|
|
19
|
+
* codebases should look like - not actual config files to be fixed. however,
|
|
20
|
+
* .declapract.ts files contain check/fix logic (not template content) so they
|
|
21
|
+
* should still be processed normally by other practices.
|
|
22
|
+
*/
|
|
23
|
+
const shouldSkip = (relativeFilePath: string | undefined): boolean =>
|
|
24
|
+
isInPracticesDir(relativeFilePath) && !isDeclapractFile(relativeFilePath);
|
|
25
|
+
|
|
11
26
|
export const check: FileCheckFunction = (contents, { relativeFilePath }) => {
|
|
12
27
|
if (!contents) throw new Error('does not match bad practice');
|
|
13
28
|
|
|
@@ -16,6 +31,11 @@ export const check: FileCheckFunction = (contents, { relativeFilePath }) => {
|
|
|
16
31
|
throw new Error('does not match bad practice');
|
|
17
32
|
}
|
|
18
33
|
|
|
34
|
+
// skip practice template files
|
|
35
|
+
if (shouldSkip(relativeFilePath)) {
|
|
36
|
+
throw new Error('does not match bad practice');
|
|
37
|
+
}
|
|
38
|
+
|
|
19
39
|
// check for relative imports that go up directories (../)
|
|
20
40
|
const matches = contents.match(RELATIVE_IMPORT_PATTERN);
|
|
21
41
|
if (matches && matches.length > 0) {
|
|
@@ -28,6 +48,7 @@ export const check: FileCheckFunction = (contents, { relativeFilePath }) => {
|
|
|
28
48
|
export const fix: FileFixFunction = (contents, { relativeFilePath }) => {
|
|
29
49
|
if (!contents) return {};
|
|
30
50
|
if (!relativeFilePath?.startsWith('src/')) return {};
|
|
51
|
+
if (shouldSkip(relativeFilePath)) return {};
|
|
31
52
|
|
|
32
53
|
// calculate the path parts of the current file
|
|
33
54
|
const pathParts = relativeFilePath.split('/');
|
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.45.
|
|
5
|
+
"version": "0.45.3",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"repository": "ehmpathy/declapract-typescript-ehmpathy",
|
|
@@ -13,26 +13,30 @@
|
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
15
|
"commit:with-cli": "npx cz",
|
|
16
|
-
"
|
|
16
|
+
"biome:nested:readme": "echo 'todo, remove the need for this once https://github.com/biomejs/biome/issues/7942 is fixed'",
|
|
17
|
+
"biome:nested:hide": "mv src/practices/lint/best-practice/biome.jsonc src/practices/lint/best-practice/_biome.jsonc 2>/dev/null || true",
|
|
18
|
+
"biome:nested:restore": "mv src/practices/lint/best-practice/_biome.jsonc src/practices/lint/best-practice/biome.jsonc 2>/dev/null || true",
|
|
19
|
+
"fix:format:biome": "npm run biome:nested:hide && biome check --write; EXIT=$?; npm run biome:nested:restore; exit $EXIT",
|
|
17
20
|
"fix:format:terraform": "terraform fmt -recursive",
|
|
18
|
-
"fix:format": "npm run fix:format:
|
|
19
|
-
"fix:lint": "
|
|
21
|
+
"fix:format": "npm run fix:format:biome",
|
|
22
|
+
"fix:lint": "npm run biome:nested:hide && biome check --write; EXIT=$?; npm run biome:nested:restore; exit $EXIT",
|
|
20
23
|
"fix": "npm run fix:format && npm run fix:lint",
|
|
21
24
|
"build:clean": "rm dist/ -rf",
|
|
22
25
|
"build:compile": "npx declapract compile",
|
|
23
26
|
"build": "npm run build:clean && npm run build:compile",
|
|
24
27
|
"test:commits": "LAST_TAG=$(git describe --tags --abbrev=0 @^ 2> /dev/null || git rev-list --max-parents=0 HEAD) && npx commitlint --from $LAST_TAG --to HEAD --verbose",
|
|
25
|
-
"test:types": "tsc -p ./tsconfig.
|
|
26
|
-
"test:format
|
|
27
|
-
"test:format": "npm run test:format:prettier",
|
|
28
|
+
"test:types": "tsc -p ./tsconfig.json --noEmit",
|
|
29
|
+
"test:format": "npm run test:format:biome",
|
|
28
30
|
"test:lint:deps": "npx depcheck -c ./.depcheckrc.yml",
|
|
29
|
-
"test:
|
|
30
|
-
"test:
|
|
31
|
+
"test:validate": "npm run build && npx declapract validate",
|
|
32
|
+
"test:format:biome": "npm run biome:nested:hide && biome format; EXIT=$?; npm run biome:nested:restore; exit $EXIT",
|
|
33
|
+
"test:lint:biome": "npm run biome:nested:hide && biome check --diagnostic-level=error; EXIT=$?; npm run biome:nested:restore; exit $EXIT",
|
|
34
|
+
"test:lint:biome:all": "npm run biome:nested:hide && biome check; EXIT=$?; npm run biome:nested:restore; exit $EXIT",
|
|
35
|
+
"test:lint": "npm run test:lint:biome && npm run test:lint:deps",
|
|
31
36
|
"test:unit": "jest -c ./jest.unit.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
32
37
|
"test:integration": "jest -c ./jest.integration.config.ts --forceExit --verbose --passWithNoTests $([ -z $THOROUGH ] && echo '--changedSince=main')",
|
|
33
|
-
"test:validate": "npm run build && npx declapract validate",
|
|
34
38
|
"test:acceptance:locally": "npm run build && LOCALLY=true jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests",
|
|
35
|
-
"test": "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 &&
|
|
39
|
+
"test": "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 && test:validate",
|
|
36
40
|
"test:acceptance": "npm run build && jest -c ./jest.acceptance.config.ts --forceExit --verbose --runInBand --passWithNoTests",
|
|
37
41
|
"prepush": "npm run test && npm run build",
|
|
38
42
|
"prepublish": "npm run build",
|
|
@@ -42,55 +46,42 @@
|
|
|
42
46
|
"prepare": "[ -e .git ] && npm run prepare:husky || exit 0"
|
|
43
47
|
},
|
|
44
48
|
"dependencies": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
49
|
+
"domain-objects": "0.31.7",
|
|
50
|
+
"esbuild-register": "3.6.0",
|
|
47
51
|
"expect": "29.4.2",
|
|
48
52
|
"flat": "5.0.2",
|
|
49
53
|
"helpful-errors": "1.5.3",
|
|
50
54
|
"rhachet": "1.13.1",
|
|
51
55
|
"rhachet-roles-ehmpathy": "1.13.7",
|
|
52
|
-
"
|
|
53
|
-
"yaml": "1.10.2"
|
|
56
|
+
"yaml": "2.8.2"
|
|
54
57
|
},
|
|
55
58
|
"peerDependencies": {
|
|
56
|
-
"declapract": ">=0.
|
|
59
|
+
"declapract": ">=0.13.1"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@commitlint/
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@tsconfig/
|
|
62
|
+
"@biomejs/biome": "2.3.8",
|
|
63
|
+
"@commitlint/cli": "19.5.0",
|
|
64
|
+
"@commitlint/config-conventional": "19.5.0",
|
|
65
|
+
"@swc/core": "1.15.3",
|
|
66
|
+
"@swc/jest": "0.2.39",
|
|
67
|
+
"@tsconfig/node20": "20.1.5",
|
|
68
|
+
"@tsconfig/strictest": "2.0.5",
|
|
66
69
|
"@types/flat": "5.0.2",
|
|
67
|
-
"@types/jest": "
|
|
70
|
+
"@types/jest": "30.0.0",
|
|
68
71
|
"@types/node": "22.15.21",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "7.8.0",
|
|
70
|
-
"@typescript-eslint/parser": "7.8.0",
|
|
71
|
-
"babel-jest": "30.2.0",
|
|
72
|
-
"core-js": "3.26.1",
|
|
73
72
|
"cz-conventional-changelog": "3.3.0",
|
|
74
|
-
"declastruct": "1.
|
|
75
|
-
"declastruct-github": "1.0.
|
|
73
|
+
"declastruct": "1.7.0",
|
|
74
|
+
"declastruct-github": "1.0.7",
|
|
76
75
|
"depcheck": "1.4.3",
|
|
77
|
-
"
|
|
78
|
-
"eslint-config-airbnb-typescript": "18.0.0",
|
|
79
|
-
"eslint-config-prettier": "8.5.0",
|
|
80
|
-
"eslint-plugin-import": "2.26.0",
|
|
81
|
-
"eslint-plugin-prettier": "4.2.1",
|
|
82
|
-
"eslint-plugin-unused-imports": "4.1.4",
|
|
76
|
+
"esbuild-register": "3.6.0",
|
|
83
77
|
"husky": "8.0.3",
|
|
84
|
-
"jest": "
|
|
85
|
-
"prettier": "2.8.1",
|
|
78
|
+
"jest": "30.2.0",
|
|
86
79
|
"rhachet": "1.13.1",
|
|
87
80
|
"rhachet-roles-ehmpathy": "1.13.8",
|
|
88
|
-
"
|
|
89
|
-
"ts-jest": "29.4.5",
|
|
81
|
+
"tsc-alias": "1.8.10",
|
|
90
82
|
"tsx": "4.20.6",
|
|
91
83
|
"type-fns": "0.8.1",
|
|
92
|
-
"typescript": "5.4.5"
|
|
93
|
-
"visualogic": "1.2.3"
|
|
84
|
+
"typescript": "5.4.5"
|
|
94
85
|
},
|
|
95
86
|
"config": {
|
|
96
87
|
"commitizen": {
|
|
File without changes
|