@dword-design/base 16.2.7 → 17.0.1

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.
Files changed (79) hide show
  1. package/LICENSE.md +9 -9
  2. package/dist/cli.js +25 -19
  3. package/dist/commands/check-unknown-files/index.d.ts +3 -1
  4. package/dist/commands/check-unknown-files/index.js +9 -9
  5. package/dist/commands/check-unknown-files/unknown-files-error.d.ts +1 -1
  6. package/dist/commands/check-unknown-files/unknown-files-error.js +1 -2
  7. package/dist/commands/command-options-input.d.ts +4 -5
  8. package/dist/commands/command-options-input.js +0 -0
  9. package/dist/commands/commit/index.d.ts +10 -1
  10. package/dist/commands/commit/index.js +6 -7
  11. package/dist/commands/depcheck/index.d.ts +3 -1
  12. package/dist/commands/depcheck/index.js +18 -18
  13. package/dist/commands/lint/index.d.ts +3 -1
  14. package/dist/commands/lint/index.js +9 -10
  15. package/dist/commands/lint/lint-packagejson.d.ts +3 -1
  16. package/dist/commands/lint/lint-packagejson.js +3 -3
  17. package/dist/commands/lint/package-json-schema.js +3 -3
  18. package/dist/commands/prepare/index.d.ts +4 -1
  19. package/dist/commands/prepare/index.js +8 -8
  20. package/dist/commands/test/index.d.ts +10 -1
  21. package/dist/commands/test/index.js +1 -3
  22. package/dist/commands/test-docker/index.d.ts +12 -1
  23. package/dist/commands/test-docker/index.js +21 -17
  24. package/dist/commands/test-raw/index.d.ts +17 -1
  25. package/dist/commands/test-raw/index.js +15 -13
  26. package/dist/commands/typecheck/index.d.ts +3 -1
  27. package/dist/commands/typecheck/index.js +8 -8
  28. package/dist/commands/verify/index.d.ts +8 -1
  29. package/dist/commands/verify/index.js +7 -8
  30. package/dist/get-depcheck-special-base/index.d.ts +1 -1
  31. package/dist/get-depcheck-special-base/index.js +1 -1
  32. package/dist/get-generated-files/editorconfig.js +1 -1
  33. package/dist/get-generated-files/get-editor-ignore/index.d.ts +3 -1
  34. package/dist/get-generated-files/get-editor-ignore/index.js +1 -3
  35. package/dist/get-generated-files/get-eslint/index.d.ts +3 -1
  36. package/dist/get-generated-files/get-eslint/index.js +13 -15
  37. package/dist/get-generated-files/get-github-sync-metadata/index.d.ts +3 -1
  38. package/dist/get-generated-files/get-github-sync-metadata/index.js +28 -30
  39. package/dist/get-generated-files/get-github-workflow/index.d.ts +28 -2
  40. package/dist/get-generated-files/get-github-workflow/index.js +8 -8
  41. package/dist/get-generated-files/get-github-workflow/steps/get-release.d.ts +12 -1
  42. package/dist/get-generated-files/get-github-workflow/steps/get-release.js +18 -20
  43. package/dist/get-generated-files/get-github-workflow/steps/get-test.d.ts +3 -1
  44. package/dist/get-generated-files/get-github-workflow/steps/get-test.js +16 -16
  45. package/dist/get-generated-files/get-github-workflow/strategies/job-matrix.d.ts +6 -4
  46. package/dist/get-generated-files/get-github-workflow/strategies/job-matrix.js +19 -19
  47. package/dist/get-generated-files/get-github-workflow/strategies/simple.d.ts +3 -1
  48. package/dist/get-generated-files/get-github-workflow/strategies/simple.js +30 -32
  49. package/dist/get-generated-files/get-gitignore/index.d.ts +3 -1
  50. package/dist/get-generated-files/get-gitignore/index.js +3 -5
  51. package/dist/get-generated-files/get-gitpod/index.d.ts +3 -1
  52. package/dist/get-generated-files/get-gitpod/index.js +3 -3
  53. package/dist/get-generated-files/get-gitpod-dockerfile.d.ts +3 -1
  54. package/dist/get-generated-files/get-gitpod-dockerfile.js +3 -5
  55. package/dist/get-generated-files/get-license-string.d.ts +3 -1
  56. package/dist/get-generated-files/get-license-string.js +4 -4
  57. package/dist/get-generated-files/get-lint-staged/index.d.ts +5 -2
  58. package/dist/get-generated-files/get-lint-staged/index.js +1 -3
  59. package/dist/get-generated-files/get-lint-staged/merge-lint-staged-configs/index.d.ts +1 -1
  60. package/dist/get-generated-files/get-lint-staged/merge-lint-staged-configs/index.js +9 -8
  61. package/dist/get-generated-files/get-package-config/index.d.ts +3 -1
  62. package/dist/get-generated-files/get-package-config/index.js +19 -20
  63. package/dist/get-generated-files/get-readme-string/index.d.ts +3 -1
  64. package/dist/get-generated-files/get-readme-string/index.js +5 -5
  65. package/dist/get-generated-files/get-readme-string/replacements.d.ts +6 -5
  66. package/dist/get-generated-files/get-readme-string/replacements.js +79 -89
  67. package/dist/get-generated-files/get-release/index.d.ts +3 -1
  68. package/dist/get-generated-files/get-release/index.js +9 -11
  69. package/dist/get-generated-files/get-renovate/index.d.ts +3 -1
  70. package/dist/get-generated-files/get-renovate/index.js +29 -31
  71. package/dist/get-generated-files/get-typescript/index.d.ts +3 -1
  72. package/dist/get-generated-files/get-typescript/index.js +17 -19
  73. package/dist/get-generated-files/get-vscode/index.d.ts +3 -1
  74. package/dist/get-generated-files/get-vscode/index.js +6 -8
  75. package/dist/get-generated-files/index.d.ts +5 -3
  76. package/dist/get-generated-files/index.js +16 -16
  77. package/dist/index.d.ts +236 -46
  78. package/dist/index.js +133 -93
  79. 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 function (options = {}) {
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 this.config.typecheck.call(this, options);
11
+ await base.config.typecheck(base, options);
12
12
  const {
13
13
  config
14
- } = ts.readConfigFile(pathLib.join(this.cwd, "tsconfig.json"), ts.sys.readFile);
14
+ } = ts.readConfigFile(pathLib.join(base.cwd, "tsconfig.json"), ts.sys.readFile);
15
15
  const {
16
16
  fileNames
17
- } = ts.parseJsonConfigFileContent(config, ts.sys, this.cwd);
17
+ } = ts.parseJsonConfigFileContent(config, ts.sys, base.cwd);
18
18
  const vueFiles = await globby("**/*.vue", {
19
- cwd: this.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 = !!this.getTypescriptConfig().references;
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: this.cwd,
30
+ cwd: base.cwd,
31
31
  stderr: options.stderr
32
32
  });
33
33
  }
34
- }
34
+ };
@@ -1 +1,8 @@
1
- export default function (options: any): Promise<void>;
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 function (options) {
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 this.lint(options);
9
- await this.typecheck(options);
10
- await this.depcheck();
11
- await this.checkUnknownFiles();
12
- await this.test(options);
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: any) => (filePath: any) => any[];
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 => pathLib.basename(filePath) === "package.json" && name !== "@dword-design/base-config-node" ? [name] : [];
2
+ export default name => filePath => name && name !== "@dword-design/base-config-node" && pathLib.basename(filePath) === "package.json" ? [name] : [];
@@ -1,6 +1,6 @@
1
1
  import endent from "endent";
2
2
  export default endent`
3
- # Editor configuration, see http://editorconfig.org
3
+ # Editor configuration, see https://editorconfig.org
4
4
  root = true
5
5
 
6
6
  [*]
@@ -1 +1,3 @@
1
- export default function (): any[];
1
+ import type { Base } from '@/src';
2
+ declare const _default: (base: Base) => any[];
3
+ export default _default;
@@ -1,5 +1,3 @@
1
1
  import { identity, sortBy } from "lodash-es";
2
2
  import commonEditorIgnore from "../common-editor-ignore.js";
3
- export default function () {
4
- return sortBy([...commonEditorIgnore, ...this.config.editorIgnore], identity);
5
- }
3
+ export default base => sortBy([...commonEditorIgnore, ...base.config.editorIgnore], identity);
@@ -1 +1,3 @@
1
- export default function (): any;
1
+ import type { Base } from '@/src';
2
+ declare const _default: (base: Base) => any;
3
+ export default _default;
@@ -1,19 +1,17 @@
1
1
  import packageName from "depcheck-package-name";
2
2
  import endent from "endent";
3
- export default function () {
4
- return this.config.eslintConfig || endent`
5
- ${this.packageConfig.name === "@dword-design/eslint-config" ? endent`
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
- import config from './src';
9
- ` : endent`
10
- import config from '${packageName`@dword-design/eslint-config`}';
11
- import { defineConfig, globalIgnores } from '${packageName`eslint`}/config';
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
- export default defineConfig([
15
- globalIgnores(['eslint.config.ts', 'eslint.lint-staged.config.ts']),
16
- config,
17
- ]);\n
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
- export default function (): {
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 function () {
3
- return {
4
- jobs: {
5
- build: {
6
- "runs-on": "ubuntu-latest",
7
- steps: [{
8
- uses: gitHubAction`actions/checkout@v4`
9
- }, {
10
- uses: gitHubAction`jaid/action-sync-node-meta@v2.0.0`,
11
- with: {
12
- approve: false,
13
- ...(!this.config.syncKeywords && {
14
- syncKeywords: false
15
- }),
16
- commitMessage: "fix: write GitHub metadata to package.json [{changes}]",
17
- githubToken: "${{ secrets.GITHUB_TOKEN }}"
18
- }
19
- }, {
20
- uses: gitHubAction`liskin/gh-workflow-keepalive@v1`
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
- export default function (): {
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: any;
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 function () {
4
- const environments = [...this.config.supportedNodeVersions.map(version => ({
3
+ export default base => {
4
+ const environments = [...base.config.supportedNodeVersions.map(version => ({
5
5
  node: version,
6
6
  os: "ubuntu-latest"
7
- })), ...(this.config.macos ? [{
8
- node: this.config.nodeVersion,
7
+ })), ...(base.config.macos ? [{
8
+ node: base.config.nodeVersion,
9
9
  os: "macos-latest"
10
- }] : []), ...(this.config.windows ? [{
11
- node: this.config.nodeVersion,
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 && !this.config.testInContainer ? jobMatrixStrategy.call(this, environments) : simpleStrategy.call(this),
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
- export default function (): any[];
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 function () {
5
- return [{
6
- env: {
7
- GITHUB_REPOSITORY: "${{ secrets.GITHUB_REPOSITORY }}",
8
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
9
- },
10
- name: "Push changed files",
11
- run: `pnpm ${ci} push-changed-files`
12
- }, ...[...this.config.preDeploySteps, {
13
- env: {
14
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
15
- ...this.config.deployEnv
16
- },
17
- name: "Release",
18
- run: "pnpm semantic-release"
19
- }].map(step => ({
20
- if: "github.ref == 'refs/heads/master'",
21
- ...step
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
- export default function (): ({
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 function () {
8
- const envSchemaPath = findUpSync(path => {
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: this.cwd
16
+ cwd: base.cwd
17
17
  });
18
- const localEnvVariableNames = Object.keys(envSchemaPath ? fs.readJsonSync(envSchemaPath) : {}).map(name => constantCase(name));
19
- const envVariables = {
20
- ...(this.config.doppler ? {
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(localEnvVariableNames.map(name => [name, `\${{ secrets.${name} }}`]))),
23
- ...(this.config.githubActionsTypecheckMemoryLimitMb && {
24
- NODE_OPTIONS: `--max-old-space-size=${this.config.githubActionsTypecheckMemoryLimitMb}`
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(this.packageConfig.name).fullName;
28
- return [...(this.config.doppler ? [{
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(envVariables).length > 0 ? {
33
- env: envVariables
34
- } : {}),
35
- run: `${this.config.doppler ? `doppler run -p ${packageName} -c test -- ` : ""}pnpm verify`
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
- export default function (environments: Array<{
2
- node: string;
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: string;
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 function (environments) {
11
- const envSchemaPath = findUpSync(path => {
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: this.cwd
19
+ cwd: base.cwd
20
20
  });
21
- const localEnvVariableNames = Object.keys(envSchemaPath ? fs.readJsonSync(envSchemaPath) : {}).map(name => constantCase(name));
22
- const envVariables = {
23
- ...(this.config.doppler ? {
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(localEnvVariableNames.map(name => [name, `\${{ secrets.${name} }}`])))
25
+ } : Object.fromEntries(localEnvironmentVariableNames.map(name => [name, `\${{ secrets.${name} }}`])))
26
26
  };
27
- const packageName = parsePackagejsonName(this.packageConfig.name).fullName;
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": this.config.nodeVersion
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
- }, ...(this.config.doppler ? [{
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(envVariables).length > 0 ? {
56
- env: envVariables
57
- } : {}),
58
- run: `${this.config.doppler ? `doppler run -p ${packageName} -c test -- ` : ""}pnpm lint`
59
- }, ...getReleaseSteps.call(this)]
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
- ...(this.config.fetchGitHistory && {
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.call(this), ...coverageSteps.map(step => ({
82
- if: `matrix.os == 'ubuntu-latest'${this.config.supportedNodeVersions.length > 1 ? ` && matrix.node == ${this.config.nodeVersion}` : ""}`,
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
+ };
@@ -1,7 +1,9 @@
1
- export default function (): {
1
+ import type { Base } from '@/src';
2
+ declare const _default: (base: Base) => {
2
3
  build: {
3
4
  if: string;
4
5
  'runs-on': string;
5
6
  steps: any[];
6
7
  };
7
8
  };
9
+ export default _default;
@@ -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 function () {
6
- return {
7
- build: {
8
- if: "!contains(github.event.head_commit.message, '[skip ci]')",
9
- "runs-on": "ubuntu-latest",
10
- steps: [{
11
- uses: gitHubAction`actions/checkout@v4`,
12
- with: {
13
- ...(this.config.fetchGitHistory && {
14
- "fetch-depth": 0
15
- }),
16
- lfs: true,
17
- ref: "${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.ref || '' }}"
18
- }
19
- }, {
20
- uses: gitHubAction`actions/setup-node@v4`,
21
- with: {
22
- "check-latest": true,
23
- "node-version": this.config.nodeVersion
24
- }
25
- }, {
26
- run: "corepack enable"
27
- }, {
28
- run: 'git config --global user.email "actions@github.com"'
29
- }, {
30
- run: 'git config --global user.name "GitHub Actions"'
31
- }, {
32
- run: "pnpm install --frozen-lockfile"
33
- }, ...getTestSteps.call(this), ...coverageSteps, ...getReleaseSteps.call(this)]
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 +1,3 @@
1
- export default function (): any[];
1
+ import type { Base } from '@/src';
2
+ declare const _default: (base: Base) => any[];
3
+ export default _default;
@@ -1,6 +1,4 @@
1
1
  import { identity, sortBy } from "lodash-es";
2
- export default function () {
3
- return sortBy([".DS_Store", "/.pnpm-store",
4
- // https://github.com/orgs/pnpm/discussions/6936#discussioncomment-6746063
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);