@dword-design/base 16.2.7 → 17.0.0
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/LICENSE.md +9 -9
- package/dist/cli.js +25 -19
- package/dist/commands/check-unknown-files/index.d.ts +3 -1
- package/dist/commands/check-unknown-files/index.js +9 -9
- package/dist/commands/check-unknown-files/unknown-files-error.d.ts +1 -1
- package/dist/commands/check-unknown-files/unknown-files-error.js +1 -2
- package/dist/commands/command-options-input.d.ts +4 -5
- package/dist/commands/command-options-input.js +0 -0
- package/dist/commands/commit/index.d.ts +10 -1
- package/dist/commands/commit/index.js +6 -7
- package/dist/commands/depcheck/index.d.ts +3 -1
- package/dist/commands/depcheck/index.js +18 -18
- package/dist/commands/lint/index.d.ts +3 -1
- package/dist/commands/lint/index.js +9 -10
- package/dist/commands/lint/lint-packagejson.d.ts +3 -1
- package/dist/commands/lint/lint-packagejson.js +3 -3
- package/dist/commands/lint/package-json-schema.js +3 -3
- package/dist/commands/prepare/index.d.ts +4 -1
- package/dist/commands/prepare/index.js +8 -8
- package/dist/commands/test/index.d.ts +10 -1
- package/dist/commands/test/index.js +1 -3
- package/dist/commands/test-docker/index.d.ts +12 -1
- package/dist/commands/test-docker/index.js +21 -17
- package/dist/commands/test-raw/index.d.ts +17 -1
- package/dist/commands/test-raw/index.js +15 -13
- package/dist/commands/typecheck/index.d.ts +3 -1
- package/dist/commands/typecheck/index.js +8 -8
- package/dist/commands/verify/index.d.ts +8 -1
- package/dist/commands/verify/index.js +7 -8
- package/dist/get-depcheck-special-base/index.d.ts +1 -1
- package/dist/get-depcheck-special-base/index.js +1 -1
- package/dist/get-generated-files/editorconfig.js +1 -1
- package/dist/get-generated-files/get-editor-ignore/index.d.ts +3 -1
- package/dist/get-generated-files/get-editor-ignore/index.js +1 -3
- package/dist/get-generated-files/get-eslint/index.d.ts +3 -1
- package/dist/get-generated-files/get-eslint/index.js +13 -15
- package/dist/get-generated-files/get-github-sync-metadata/index.d.ts +3 -1
- package/dist/get-generated-files/get-github-sync-metadata/index.js +28 -30
- package/dist/get-generated-files/get-github-workflow/index.d.ts +28 -2
- package/dist/get-generated-files/get-github-workflow/index.js +8 -8
- package/dist/get-generated-files/get-github-workflow/steps/get-release.d.ts +12 -1
- package/dist/get-generated-files/get-github-workflow/steps/get-release.js +18 -20
- package/dist/get-generated-files/get-github-workflow/steps/get-test.d.ts +3 -1
- package/dist/get-generated-files/get-github-workflow/steps/get-test.js +16 -16
- package/dist/get-generated-files/get-github-workflow/strategies/job-matrix.d.ts +6 -4
- package/dist/get-generated-files/get-github-workflow/strategies/job-matrix.js +19 -19
- package/dist/get-generated-files/get-github-workflow/strategies/simple.d.ts +3 -1
- package/dist/get-generated-files/get-github-workflow/strategies/simple.js +30 -32
- package/dist/get-generated-files/get-gitignore/index.d.ts +3 -1
- package/dist/get-generated-files/get-gitignore/index.js +3 -5
- package/dist/get-generated-files/get-gitpod/index.d.ts +3 -1
- package/dist/get-generated-files/get-gitpod/index.js +3 -3
- package/dist/get-generated-files/get-gitpod-dockerfile.d.ts +3 -1
- package/dist/get-generated-files/get-gitpod-dockerfile.js +3 -5
- package/dist/get-generated-files/get-license-string.d.ts +3 -1
- package/dist/get-generated-files/get-license-string.js +4 -4
- package/dist/get-generated-files/get-lint-staged/index.d.ts +5 -2
- package/dist/get-generated-files/get-lint-staged/index.js +1 -3
- package/dist/get-generated-files/get-lint-staged/merge-lint-staged-configs/index.d.ts +1 -1
- package/dist/get-generated-files/get-lint-staged/merge-lint-staged-configs/index.js +9 -8
- package/dist/get-generated-files/get-package-config/index.d.ts +3 -1
- package/dist/get-generated-files/get-package-config/index.js +19 -20
- package/dist/get-generated-files/get-readme-string/index.d.ts +3 -1
- package/dist/get-generated-files/get-readme-string/index.js +5 -5
- package/dist/get-generated-files/get-readme-string/replacements.d.ts +6 -5
- package/dist/get-generated-files/get-readme-string/replacements.js +79 -89
- package/dist/get-generated-files/get-release/index.d.ts +3 -1
- package/dist/get-generated-files/get-release/index.js +9 -11
- package/dist/get-generated-files/get-renovate/index.d.ts +3 -1
- package/dist/get-generated-files/get-renovate/index.js +29 -31
- package/dist/get-generated-files/get-typescript/index.d.ts +3 -1
- package/dist/get-generated-files/get-typescript/index.js +17 -19
- package/dist/get-generated-files/get-vscode/index.d.ts +3 -1
- package/dist/get-generated-files/get-vscode/index.js +6 -8
- package/dist/get-generated-files/index.d.ts +5 -3
- package/dist/get-generated-files/index.js +16 -16
- package/dist/index.d.ts +234 -46
- package/dist/index.js +131 -93
- package/package.json +31 -29
|
@@ -2,33 +2,33 @@ import pathLib from "node:path";
|
|
|
2
2
|
import { execaCommand } from "execa";
|
|
3
3
|
import { globby } from "globby";
|
|
4
4
|
import ts from "typescript";
|
|
5
|
-
export default async
|
|
5
|
+
export default async (base, options = {}) => {
|
|
6
6
|
options = {
|
|
7
7
|
log: process.env.NODE_ENV !== "test",
|
|
8
8
|
stderr: "inherit",
|
|
9
9
|
...options
|
|
10
10
|
};
|
|
11
|
-
await
|
|
11
|
+
await base.config.typecheck(base, options);
|
|
12
12
|
const {
|
|
13
13
|
config
|
|
14
|
-
} = ts.readConfigFile(pathLib.join(
|
|
14
|
+
} = ts.readConfigFile(pathLib.join(base.cwd, "tsconfig.json"), ts.sys.readFile);
|
|
15
15
|
const {
|
|
16
16
|
fileNames
|
|
17
|
-
} = ts.parseJsonConfigFileContent(config, ts.sys,
|
|
17
|
+
} = ts.parseJsonConfigFileContent(config, ts.sys, base.cwd);
|
|
18
18
|
const vueFiles = await globby("**/*.vue", {
|
|
19
|
-
cwd:
|
|
19
|
+
cwd: base.cwd,
|
|
20
20
|
dot: true,
|
|
21
21
|
ignore: ["**/node_modules/**"]
|
|
22
22
|
});
|
|
23
23
|
const allFileNames = [...fileNames, ...vueFiles];
|
|
24
24
|
if (allFileNames.length > 0) {
|
|
25
|
-
const hasProjectReferences = !!
|
|
25
|
+
const hasProjectReferences = !!base.getTypescriptConfig().references;
|
|
26
26
|
return execaCommand(`vue-tsc ${hasProjectReferences ? "-b" : ""} --noEmit`, {
|
|
27
27
|
...(options.log && {
|
|
28
28
|
stdout: "inherit"
|
|
29
29
|
}),
|
|
30
|
-
cwd:
|
|
30
|
+
cwd: base.cwd,
|
|
31
31
|
stderr: options.stderr
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Base } from '@/src';
|
|
2
|
+
import type { PartialCommandOptions } from '@/src/commands/command-options-input';
|
|
3
|
+
declare const _default: (base: Base, options?: PartialCommandOptions & {
|
|
4
|
+
grep?: string;
|
|
5
|
+
patterns?: string[];
|
|
6
|
+
updateSnapshots?: boolean;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
export default _default;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export default async
|
|
1
|
+
export default async (base, options = {}) => {
|
|
2
2
|
options = {
|
|
3
3
|
log: process.env.NODE_ENV !== "test",
|
|
4
|
-
patterns: [],
|
|
5
4
|
stderr: "inherit",
|
|
6
5
|
...options
|
|
7
6
|
};
|
|
8
|
-
await
|
|
9
|
-
await
|
|
10
|
-
await
|
|
11
|
-
await
|
|
12
|
-
await
|
|
13
|
-
}
|
|
7
|
+
await base.lint(options);
|
|
8
|
+
await base.typecheck(options);
|
|
9
|
+
await base.depcheck();
|
|
10
|
+
await base.checkUnknownFiles();
|
|
11
|
+
await base.test(options);
|
|
12
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (name
|
|
1
|
+
declare const _default: (name?: string) => (filePath: string) => string[];
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import pathLib from "node:path";
|
|
2
|
-
export default name => filePath =>
|
|
2
|
+
export default name => filePath => name && name !== "@dword-design/base-config-node" && pathLib.basename(filePath) === "package.json" ? [name] : [];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { identity, sortBy } from "lodash-es";
|
|
2
2
|
import commonEditorIgnore from "../common-editor-ignore.js";
|
|
3
|
-
export default
|
|
4
|
-
return sortBy([...commonEditorIgnore, ...this.config.editorIgnore], identity);
|
|
5
|
-
}
|
|
3
|
+
export default base => sortBy([...commonEditorIgnore, ...base.config.editorIgnore], identity);
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import packageName from "depcheck-package-name";
|
|
2
2
|
import endent from "endent";
|
|
3
|
-
export default
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { defineConfig, globalIgnores } from '${packageName`eslint`}/config';
|
|
3
|
+
export default base => base.config.eslintConfig || endent`
|
|
4
|
+
${base.packageConfig.name === "@dword-design/eslint-config" ? endent`
|
|
5
|
+
import { defineConfig, globalIgnores } from '${packageName`eslint`}/config';
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import config from './src';
|
|
8
|
+
` : endent`
|
|
9
|
+
import config from '${packageName`@dword-design/eslint-config`}';
|
|
10
|
+
import { defineConfig, globalIgnores } from '${packageName`eslint`}/config';
|
|
11
|
+
`}
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
13
|
+
export default defineConfig([
|
|
14
|
+
globalIgnores(['eslint.config.ts', 'eslint.lint-staged.config.ts']),
|
|
15
|
+
config,
|
|
16
|
+
]);\n
|
|
17
|
+
`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Base } from '@/src';
|
|
2
|
+
declare const _default: (base: Base) => {
|
|
2
3
|
jobs: {
|
|
3
4
|
build: {
|
|
4
5
|
'runs-on': string;
|
|
@@ -24,3 +25,4 @@ export default function (): {
|
|
|
24
25
|
workflow_dispatch: {};
|
|
25
26
|
};
|
|
26
27
|
};
|
|
28
|
+
export default _default;
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import gitHubAction from "tagged-template-noop";
|
|
2
|
-
export default
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}]
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
name: "sync-metadata",
|
|
25
|
-
on: {
|
|
26
|
-
schedule: [{
|
|
27
|
-
cron: "0 5 * * *"
|
|
28
|
-
}],
|
|
29
|
-
workflow_dispatch: {}
|
|
2
|
+
export default base => ({
|
|
3
|
+
jobs: {
|
|
4
|
+
build: {
|
|
5
|
+
"runs-on": "ubuntu-latest",
|
|
6
|
+
steps: [{
|
|
7
|
+
uses: gitHubAction`actions/checkout@v4`
|
|
8
|
+
}, {
|
|
9
|
+
uses: gitHubAction`jaid/action-sync-node-meta@v2.0.0`,
|
|
10
|
+
with: {
|
|
11
|
+
approve: false,
|
|
12
|
+
...(!base.config.syncKeywords && {
|
|
13
|
+
syncKeywords: false
|
|
14
|
+
}),
|
|
15
|
+
commitMessage: "fix: write GitHub metadata to package.json [{changes}]",
|
|
16
|
+
githubToken: "${{ secrets.GITHUB_TOKEN }}"
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
uses: gitHubAction`liskin/gh-workflow-keepalive@v1`
|
|
20
|
+
}]
|
|
30
21
|
}
|
|
31
|
-
}
|
|
32
|
-
|
|
22
|
+
},
|
|
23
|
+
name: "sync-metadata",
|
|
24
|
+
on: {
|
|
25
|
+
schedule: [{
|
|
26
|
+
cron: "0 5 * * *"
|
|
27
|
+
}],
|
|
28
|
+
workflow_dispatch: {}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Base } from '@/src';
|
|
2
|
+
declare const _default: (base: Base) => {
|
|
2
3
|
concurrency: {
|
|
3
4
|
'cancel-in-progress': boolean;
|
|
4
5
|
group: string;
|
|
5
6
|
};
|
|
6
|
-
jobs:
|
|
7
|
+
jobs: {
|
|
8
|
+
release: {
|
|
9
|
+
needs: string;
|
|
10
|
+
'runs-on': string;
|
|
11
|
+
steps: any[];
|
|
12
|
+
};
|
|
13
|
+
test: {
|
|
14
|
+
'runs-on': string;
|
|
15
|
+
steps: any[];
|
|
16
|
+
strategy: {
|
|
17
|
+
matrix: {
|
|
18
|
+
include: {
|
|
19
|
+
node: number;
|
|
20
|
+
os: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
build: {
|
|
27
|
+
if: string;
|
|
28
|
+
'runs-on': string;
|
|
29
|
+
steps: any[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
7
32
|
name: string;
|
|
8
33
|
on: {
|
|
9
34
|
pull_request: {};
|
|
@@ -25,3 +50,4 @@ export default function (): {
|
|
|
25
50
|
'pull-requests': string;
|
|
26
51
|
};
|
|
27
52
|
};
|
|
53
|
+
export default _default;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import jobMatrixStrategy from "./strategies/job-matrix.js";
|
|
2
2
|
import simpleStrategy from "./strategies/simple.js";
|
|
3
|
-
export default
|
|
4
|
-
const environments = [...
|
|
3
|
+
export default base => {
|
|
4
|
+
const environments = [...base.config.supportedNodeVersions.map(version => ({
|
|
5
5
|
node: version,
|
|
6
6
|
os: "ubuntu-latest"
|
|
7
|
-
})), ...(
|
|
8
|
-
node:
|
|
7
|
+
})), ...(base.config.macos ? [{
|
|
8
|
+
node: base.config.nodeVersion,
|
|
9
9
|
os: "macos-latest"
|
|
10
|
-
}] : []), ...(
|
|
11
|
-
node:
|
|
10
|
+
}] : []), ...(base.config.windows ? [{
|
|
11
|
+
node: base.config.nodeVersion,
|
|
12
12
|
os: "windows-latest"
|
|
13
13
|
}] : [])];
|
|
14
14
|
return {
|
|
@@ -16,7 +16,7 @@ export default function () {
|
|
|
16
16
|
"cancel-in-progress": true,
|
|
17
17
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
18
18
|
},
|
|
19
|
-
jobs: environments.length > 1 && !
|
|
19
|
+
jobs: environments.length > 1 && !base.config.testInContainer ? jobMatrixStrategy(base, environments) : simpleStrategy(base),
|
|
20
20
|
name: "build",
|
|
21
21
|
on: {
|
|
22
22
|
pull_request: {},
|
|
@@ -39,4 +39,4 @@ export default function () {
|
|
|
39
39
|
"pull-requests": "write"
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
}
|
|
42
|
+
};
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Base } from '@/src';
|
|
2
|
+
declare const _default: (base: Base) => ({
|
|
3
|
+
if: string;
|
|
4
|
+
} | {
|
|
5
|
+
env: {
|
|
6
|
+
GITHUB_REPOSITORY: string;
|
|
7
|
+
GITHUB_TOKEN: string;
|
|
8
|
+
};
|
|
9
|
+
name: string;
|
|
10
|
+
run: string;
|
|
11
|
+
})[];
|
|
12
|
+
export default _default;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import packageName from "depcheck-package-name";
|
|
2
2
|
import parsePackagejsonName from "parse-packagejson-name";
|
|
3
3
|
const ci = `dw-${parsePackagejsonName(packageName`@dword-design/ci`).fullName}`;
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}))];
|
|
23
|
-
}
|
|
4
|
+
export default base => [{
|
|
5
|
+
env: {
|
|
6
|
+
GITHUB_REPOSITORY: "${{ secrets.GITHUB_REPOSITORY }}",
|
|
7
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
8
|
+
},
|
|
9
|
+
name: "Push changed files",
|
|
10
|
+
run: `pnpm ${ci} push-changed-files`
|
|
11
|
+
}, ...[...base.config.preDeploySteps, {
|
|
12
|
+
env: {
|
|
13
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
|
|
14
|
+
...base.config.deployEnv
|
|
15
|
+
},
|
|
16
|
+
name: "Release",
|
|
17
|
+
run: "pnpm semantic-release"
|
|
18
|
+
}].map(step => ({
|
|
19
|
+
if: "github.ref == 'refs/heads/master'",
|
|
20
|
+
...step
|
|
21
|
+
}))];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Base } from '@/src';
|
|
2
|
+
declare const _default: (base: Base) => ({
|
|
2
3
|
name: string;
|
|
3
4
|
uses: any;
|
|
4
5
|
if?: undefined;
|
|
@@ -20,3 +21,4 @@ export default function (): ({
|
|
|
20
21
|
};
|
|
21
22
|
name?: undefined;
|
|
22
23
|
})[];
|
|
24
|
+
export default _default;
|
|
@@ -4,8 +4,8 @@ import { findUpStop, findUpSync } from "find-up";
|
|
|
4
4
|
import fs from "fs-extra";
|
|
5
5
|
import parsePackagejsonName from "parse-packagejson-name";
|
|
6
6
|
import gitHubAction from "tagged-template-noop";
|
|
7
|
-
export default
|
|
8
|
-
const
|
|
7
|
+
export default base => {
|
|
8
|
+
const environmentSchemaPath = findUpSync(path => {
|
|
9
9
|
if (fs.existsSync(pathLib.join(path, ".env.schema.json"))) {
|
|
10
10
|
return ".env.schema.json";
|
|
11
11
|
}
|
|
@@ -13,26 +13,26 @@ export default function () {
|
|
|
13
13
|
return findUpStop;
|
|
14
14
|
}
|
|
15
15
|
}, {
|
|
16
|
-
cwd:
|
|
16
|
+
cwd: base.cwd
|
|
17
17
|
});
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
...(
|
|
18
|
+
const localEnvironmentVariableNames = Object.keys(environmentSchemaPath ? fs.readJsonSync(environmentSchemaPath) : {}).map(name => constantCase(name));
|
|
19
|
+
const environmentVariables = {
|
|
20
|
+
...(base.config.doppler ? {
|
|
21
21
|
DOPPLER_TOKEN: "${{ secrets.DOPPLER_TOKEN }}"
|
|
22
|
-
} : Object.fromEntries(
|
|
23
|
-
...(
|
|
24
|
-
NODE_OPTIONS: `--max-old-space-size=${
|
|
22
|
+
} : Object.fromEntries(localEnvironmentVariableNames.map(name => [name, `\${{ secrets.${name} }}`]))),
|
|
23
|
+
...(base.config.githubActionsTypecheckMemoryLimitMb && {
|
|
24
|
+
NODE_OPTIONS: `--max-old-space-size=${base.config.githubActionsTypecheckMemoryLimitMb}`
|
|
25
25
|
})
|
|
26
26
|
};
|
|
27
|
-
const packageName = parsePackagejsonName(
|
|
28
|
-
return [...(
|
|
27
|
+
const packageName = parsePackagejsonName(base.packageConfig.name).fullName;
|
|
28
|
+
return [...(base.config.doppler ? [{
|
|
29
29
|
name: "Install Doppler CLI",
|
|
30
30
|
uses: gitHubAction`dword-design/doppler-cli-action-fork@fork`
|
|
31
31
|
}] : []), {
|
|
32
|
-
...(Object.keys(
|
|
33
|
-
env:
|
|
34
|
-
}
|
|
35
|
-
run: `${
|
|
32
|
+
...(Object.keys(environmentVariables).length > 0 && {
|
|
33
|
+
env: environmentVariables
|
|
34
|
+
}),
|
|
35
|
+
run: `${base.config.doppler ? `doppler run -p ${packageName} -c test -- ` : ""}pnpm verify`
|
|
36
36
|
}, {
|
|
37
37
|
if: "always()",
|
|
38
38
|
uses: gitHubAction`actions/upload-artifact@v4`,
|
|
@@ -42,4 +42,4 @@ export default function () {
|
|
|
42
42
|
path: "test-results/*/**"
|
|
43
43
|
}
|
|
44
44
|
}];
|
|
45
|
-
}
|
|
45
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { Base } from '@/src';
|
|
2
|
+
declare const _default: (base: Base, environments: Array<{
|
|
3
|
+
node: number;
|
|
3
4
|
os: string;
|
|
4
|
-
}>)
|
|
5
|
+
}>) => {
|
|
5
6
|
release: {
|
|
6
7
|
needs: string;
|
|
7
8
|
'runs-on': string;
|
|
@@ -13,10 +14,11 @@ export default function (environments: Array<{
|
|
|
13
14
|
strategy: {
|
|
14
15
|
matrix: {
|
|
15
16
|
include: {
|
|
16
|
-
node:
|
|
17
|
+
node: number;
|
|
17
18
|
os: string;
|
|
18
19
|
}[];
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
};
|
|
24
|
+
export default _default;
|
|
@@ -7,8 +7,8 @@ import gitHubAction from "tagged-template-noop";
|
|
|
7
7
|
import coverageSteps from "../steps/coverage.js";
|
|
8
8
|
import getReleaseSteps from "../steps/get-release.js";
|
|
9
9
|
import getTestSteps from "../steps/get-test.js";
|
|
10
|
-
export default
|
|
11
|
-
const
|
|
10
|
+
export default (base, environments) => {
|
|
11
|
+
const environmentSchemaPath = findUpSync(path => {
|
|
12
12
|
if (fs.existsSync(pathLib.join(path, ".env.schema.json"))) {
|
|
13
13
|
return ".env.schema.json";
|
|
14
14
|
}
|
|
@@ -16,15 +16,15 @@ export default function (environments) {
|
|
|
16
16
|
return findUpStop;
|
|
17
17
|
}
|
|
18
18
|
}, {
|
|
19
|
-
cwd:
|
|
19
|
+
cwd: base.cwd
|
|
20
20
|
});
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
...(
|
|
21
|
+
const localEnvironmentVariableNames = Object.keys(environmentSchemaPath ? fs.readJsonSync(environmentSchemaPath) : {}).map(name => constantCase(name));
|
|
22
|
+
const environmentVariables = {
|
|
23
|
+
...(base.config.doppler ? {
|
|
24
24
|
DOPPLER_TOKEN: "${{ secrets.DOPPLER_TOKEN }}"
|
|
25
|
-
} : Object.fromEntries(
|
|
25
|
+
} : Object.fromEntries(localEnvironmentVariableNames.map(name => [name, `\${{ secrets.${name} }}`])))
|
|
26
26
|
};
|
|
27
|
-
const packageName = parsePackagejsonName(
|
|
27
|
+
const packageName = parsePackagejsonName(base.packageConfig.name).fullName;
|
|
28
28
|
return {
|
|
29
29
|
release: {
|
|
30
30
|
needs: "test",
|
|
@@ -38,7 +38,7 @@ export default function (environments) {
|
|
|
38
38
|
}, {
|
|
39
39
|
uses: gitHubAction`actions/setup-node@v4`,
|
|
40
40
|
with: {
|
|
41
|
-
"node-version":
|
|
41
|
+
"node-version": base.config.nodeVersion
|
|
42
42
|
}
|
|
43
43
|
}, {
|
|
44
44
|
run: "corepack enable"
|
|
@@ -48,22 +48,22 @@ export default function (environments) {
|
|
|
48
48
|
run: 'git config --global user.name "GitHub Actions"'
|
|
49
49
|
}, {
|
|
50
50
|
run: "pnpm install --frozen-lockfile"
|
|
51
|
-
}, ...(
|
|
51
|
+
}, ...(base.config.doppler ? [{
|
|
52
52
|
name: "Install Doppler CLI",
|
|
53
53
|
uses: gitHubAction`dword-design/doppler-cli-action-fork@fork`
|
|
54
54
|
}] : []), {
|
|
55
|
-
...(Object.keys(
|
|
56
|
-
env:
|
|
57
|
-
}
|
|
58
|
-
run: `${
|
|
59
|
-
}, ...getReleaseSteps
|
|
55
|
+
...(Object.keys(environmentVariables).length > 0 && {
|
|
56
|
+
env: environmentVariables
|
|
57
|
+
}),
|
|
58
|
+
run: `${base.config.doppler ? `doppler run -p ${packageName} -c test -- ` : ""}pnpm lint`
|
|
59
|
+
}, ...getReleaseSteps(base)]
|
|
60
60
|
},
|
|
61
61
|
test: {
|
|
62
62
|
"runs-on": "${{ matrix.os }}",
|
|
63
63
|
steps: [{
|
|
64
64
|
uses: gitHubAction`actions/checkout@v4`,
|
|
65
65
|
with: {
|
|
66
|
-
...(
|
|
66
|
+
...(base.config.fetchGitHistory && {
|
|
67
67
|
"fetch-depth": 0
|
|
68
68
|
}),
|
|
69
69
|
lfs: true
|
|
@@ -78,8 +78,8 @@ export default function (environments) {
|
|
|
78
78
|
run: "corepack enable"
|
|
79
79
|
}, {
|
|
80
80
|
run: "pnpm install --frozen-lockfile"
|
|
81
|
-
}, ...getTestSteps
|
|
82
|
-
if: `matrix.os == 'ubuntu-latest'${
|
|
81
|
+
}, ...getTestSteps(base), ...coverageSteps.map(step => ({
|
|
82
|
+
if: `matrix.os == 'ubuntu-latest'${base.config.supportedNodeVersions.length > 1 ? ` && matrix.node == ${base.config.nodeVersion}` : ""}`,
|
|
83
83
|
...step
|
|
84
84
|
}))],
|
|
85
85
|
strategy: {
|
|
@@ -89,4 +89,4 @@ export default function (environments) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
}
|
|
92
|
+
};
|
|
@@ -2,35 +2,33 @@ import gitHubAction from "tagged-template-noop";
|
|
|
2
2
|
import coverageSteps from "../steps/coverage.js";
|
|
3
3
|
import getReleaseSteps from "../steps/get-release.js";
|
|
4
4
|
import getTestSteps from "../steps/get-test.js";
|
|
5
|
-
export default
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
}
|
|
5
|
+
export default base => ({
|
|
6
|
+
build: {
|
|
7
|
+
if: "!contains(github.event.head_commit.message, '[skip ci]')",
|
|
8
|
+
"runs-on": "ubuntu-latest",
|
|
9
|
+
steps: [{
|
|
10
|
+
uses: gitHubAction`actions/checkout@v4`,
|
|
11
|
+
with: {
|
|
12
|
+
...(base.config.fetchGitHistory && {
|
|
13
|
+
"fetch-depth": 0
|
|
14
|
+
}),
|
|
15
|
+
lfs: true,
|
|
16
|
+
ref: "${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.ref || '' }}"
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
uses: gitHubAction`actions/setup-node@v4`,
|
|
20
|
+
with: {
|
|
21
|
+
"check-latest": true,
|
|
22
|
+
"node-version": base.config.nodeVersion
|
|
23
|
+
}
|
|
24
|
+
}, {
|
|
25
|
+
run: "corepack enable"
|
|
26
|
+
}, {
|
|
27
|
+
run: 'git config --global user.email "actions@github.com"'
|
|
28
|
+
}, {
|
|
29
|
+
run: 'git config --global user.name "GitHub Actions"'
|
|
30
|
+
}, {
|
|
31
|
+
run: "pnpm install --frozen-lockfile"
|
|
32
|
+
}, ...getTestSteps(base), ...coverageSteps, ...getReleaseSteps(base)]
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { identity, sortBy } from "lodash-es";
|
|
2
|
-
export default
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"/.env.json", "/.test.env.json", "/codecov", "/codecov.SHA256SUM", "/codecov.SHA256SUM.sig", "/coverage", "/node_modules", "/test-results", ...(this.getTypescriptConfig().references ? ["/tsconfig.tsbuildinfo"] : []), ...this.config.gitignore], identity);
|
|
6
|
-
}
|
|
2
|
+
export default base => sortBy([".DS_Store", "/.pnpm-store",
|
|
3
|
+
// https://github.com/orgs/pnpm/discussions/6936#discussioncomment-6746063
|
|
4
|
+
"/.env.json", "/.test.env.json", "/codecov", "/codecov.SHA256SUM", "/codecov.SHA256SUM.sig", "/coverage", "/node_modules", "/test-results", ...(base.getTypescriptConfig().references ? ["/tsconfig.tsbuildinfo"] : []), ...base.config.gitignore], identity);
|