skuba 11.0.0-main-20250511022834 → 11.0.1-fix-nested-repo-usage-20250522060154

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 (46) hide show
  1. package/README.md +2 -1
  2. package/jest/transform.js +5 -1
  3. package/lib/api/github/push.js +8 -1
  4. package/lib/api/github/push.js.map +2 -2
  5. package/lib/cli/configure/processing/configFile.d.ts +2 -2
  6. package/lib/cli/configure/processing/configFile.js +18 -21
  7. package/lib/cli/configure/processing/configFile.js.map +2 -2
  8. package/lib/cli/init/types.d.ts +3 -3
  9. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +6 -2
  10. package/lib/cli/lint/internalLints/refreshConfigFiles.js +26 -22
  11. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +3 -3
  12. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +5 -0
  13. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +2 -2
  14. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +2 -0
  15. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +167 -0
  16. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +7 -0
  17. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +0 -9
  18. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +2 -2
  19. package/lib/utils/copy.js +1 -1
  20. package/lib/utils/copy.js.map +2 -2
  21. package/lib/utils/dir.d.ts +10 -0
  22. package/lib/utils/dir.js +74 -2
  23. package/lib/utils/dir.js.map +3 -3
  24. package/lib/utils/npmrc.d.ts +0 -1
  25. package/lib/utils/npmrc.js +0 -3
  26. package/lib/utils/npmrc.js.map +2 -2
  27. package/package.json +4 -4
  28. package/template/base/_.gitignore +2 -0
  29. package/template/base/_pnpm-workspace.yaml +10 -0
  30. package/template/express-rest-api/.buildkite/pipeline.yml +2 -2
  31. package/template/express-rest-api/Dockerfile.dev-deps +2 -2
  32. package/template/greeter/.buildkite/pipeline.yml +2 -2
  33. package/template/greeter/Dockerfile +2 -2
  34. package/template/greeter/package.json +1 -1
  35. package/template/koa-rest-api/.buildkite/pipeline.yml +2 -2
  36. package/template/koa-rest-api/Dockerfile.dev-deps +2 -2
  37. package/template/koa-rest-api/package.json +1 -1
  38. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +3 -3
  39. package/template/lambda-sqs-worker-cdk/Dockerfile +2 -2
  40. package/template/lambda-sqs-worker-cdk/package.json +1 -1
  41. package/template/oss-npm-package/_package.json +1 -1
  42. package/template/private-npm-package/_package.json +1 -1
  43. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.d.ts +0 -2
  44. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js +0 -95
  45. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js.map +0 -7
  46. package/template/base/_.npmrc +0 -9
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var moveNpmrcOutOfIgnoreManagedSection_exports = {};
30
- __export(moveNpmrcOutOfIgnoreManagedSection_exports, {
31
- tryMoveNpmrcOutOfIgnoreManagedSection: () => tryMoveNpmrcOutOfIgnoreManagedSection
32
- });
33
- module.exports = __toCommonJS(moveNpmrcOutOfIgnoreManagedSection_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_util = require("util");
36
- var import_fs_extra = __toESM(require("fs-extra"));
37
- var import_logging = require("../../../../../../utils/logging");
38
- var import_npmrc = require("../../../../../../utils/npmrc");
39
- var import_project = require("../../../../../configure/analysis/project");
40
- const NPMRC_IGNORE_SECTION = `
41
-
42
- # Ignore .npmrc. This is no longer managed by skuba as pnpm projects use a managed .npmrc.
43
- # IMPORTANT: if migrating to pnpm, remove this line and add an .npmrc IN THE SAME COMMIT.
44
- # You can use \`skuba format\` to generate the file or otherwise commit an empty file.
45
- # Doing so will conflict with a local .npmrc and make it more difficult to unintentionally commit auth secrets.
46
- .npmrc
47
- `;
48
- const moveNpmrcOutOfIgnoreManagedSection = async (mode, dir, fileName) => {
49
- const readFile = (0, import_project.createDestinationFileReader)(dir);
50
- const ignoreFile = await readFile(fileName);
51
- if (!ignoreFile) {
52
- return { result: "skip", reason: `no ${fileName} file found` };
53
- }
54
- let isIgnored;
55
- let currentlyInManagedSection = false;
56
- for (const line of ignoreFile.split("\n")) {
57
- if (line.trim() === "# managed by skuba") {
58
- currentlyInManagedSection = true;
59
- } else if (line.trim() === "# end managed by skuba") {
60
- currentlyInManagedSection = false;
61
- }
62
- if (line.trim() === ".npmrc" || line.trim() === "/.npmrc") {
63
- isIgnored = { inManaged: currentlyInManagedSection };
64
- }
65
- if (line.trim() === "!.npmrc" || line.trim() === "!/.npmrc") {
66
- isIgnored = void 0;
67
- }
68
- }
69
- if (isIgnored && !isIgnored.inManaged) {
70
- return { result: "skip", reason: "already ignored in unmanaged section" };
71
- }
72
- if (!isIgnored) {
73
- return { result: "skip", reason: "not ignored" };
74
- }
75
- if (mode === "lint") {
76
- return { result: "apply" };
77
- }
78
- const newIgnoreFile = ignoreFile.split("\n").filter((line) => !import_npmrc.NPMRC_LINES.includes(line.trim())).join("\n").trim() + NPMRC_IGNORE_SECTION;
79
- await import_fs_extra.default.promises.writeFile(import_path.default.join(dir, fileName), newIgnoreFile);
80
- return { result: "apply" };
81
- };
82
- const tryMoveNpmrcOutOfIgnoreManagedSection = (type) => async ({ mode, dir = process.cwd() }) => {
83
- try {
84
- return await moveNpmrcOutOfIgnoreManagedSection(mode, dir, type);
85
- } catch (err) {
86
- import_logging.log.warn(`Failed to move .npmrc out of ${type} managed sections.`);
87
- import_logging.log.subtle((0, import_util.inspect)(err));
88
- return { result: "skip", reason: "due to an error" };
89
- }
90
- };
91
- // Annotate the CommonJS export names for ESM import in node:
92
- 0 && (module.exports = {
93
- tryMoveNpmrcOutOfIgnoreManagedSection
94
- });
95
- //# sourceMappingURL=moveNpmrcOutOfIgnoreManagedSection.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.ts"],
4
- "sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\n\nimport type { PatchFunction, PatchReturnType } from '../..';\nimport { log } from '../../../../../../utils/logging';\nimport { NPMRC_LINES } from '../../../../../../utils/npmrc';\nimport { createDestinationFileReader } from '../../../../../configure/analysis/project';\n\nconst NPMRC_IGNORE_SECTION = `\n\n# Ignore .npmrc. This is no longer managed by skuba as pnpm projects use a managed .npmrc.\n# IMPORTANT: if migrating to pnpm, remove this line and add an .npmrc IN THE SAME COMMIT.\n# You can use \\`skuba format\\` to generate the file or otherwise commit an empty file.\n# Doing so will conflict with a local .npmrc and make it more difficult to unintentionally commit auth secrets.\n.npmrc\n`;\n\nconst moveNpmrcOutOfIgnoreManagedSection = async (\n mode: 'format' | 'lint',\n dir: string,\n fileName: '.gitignore' | '.dockerignore',\n): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(dir);\n\n const ignoreFile = await readFile(fileName);\n\n if (!ignoreFile) {\n return { result: 'skip', reason: `no ${fileName} file found` };\n }\n\n let isIgnored: { inManaged: boolean } | undefined;\n let currentlyInManagedSection = false;\n\n for (const line of ignoreFile.split('\\n')) {\n if (line.trim() === '# managed by skuba') {\n currentlyInManagedSection = true;\n } else if (line.trim() === '# end managed by skuba') {\n currentlyInManagedSection = false;\n }\n\n if (line.trim() === '.npmrc' || line.trim() === '/.npmrc') {\n isIgnored = { inManaged: currentlyInManagedSection };\n }\n\n if (line.trim() === '!.npmrc' || line.trim() === '!/.npmrc') {\n isIgnored = undefined;\n }\n }\n\n if (isIgnored && !isIgnored.inManaged) {\n return { result: 'skip', reason: 'already ignored in unmanaged section' };\n }\n\n if (!isIgnored) {\n return { result: 'skip', reason: 'not ignored' };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n const newIgnoreFile =\n ignoreFile\n .split('\\n')\n .filter((line) => !NPMRC_LINES.includes(line.trim()))\n .join('\\n')\n .trim() + NPMRC_IGNORE_SECTION;\n\n await fs.promises.writeFile(path.join(dir, fileName), newIgnoreFile);\n\n return { result: 'apply' };\n};\n\nexport const tryMoveNpmrcOutOfIgnoreManagedSection = (\n type: '.gitignore' | '.dockerignore',\n) =>\n (async ({ mode, dir = process.cwd() }) => {\n try {\n return await moveNpmrcOutOfIgnoreManagedSection(mode, dir, type);\n } catch (err) {\n log.warn(`Failed to move .npmrc out of ${type} managed sections.`);\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n }) satisfies PatchFunction;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAwB;AAExB,sBAAe;AAGf,qBAAoB;AACpB,mBAA4B;AAC5B,qBAA4C;AAE5C,MAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,qCAAqC,OACzC,MACA,KACA,aAC6B;AAC7B,QAAM,eAAW,4CAA4B,GAAG;AAEhD,QAAM,aAAa,MAAM,SAAS,QAAQ;AAE1C,MAAI,CAAC,YAAY;AACf,WAAO,EAAE,QAAQ,QAAQ,QAAQ,MAAM,QAAQ,cAAc;AAAA,EAC/D;AAEA,MAAI;AACJ,MAAI,4BAA4B;AAEhC,aAAW,QAAQ,WAAW,MAAM,IAAI,GAAG;AACzC,QAAI,KAAK,KAAK,MAAM,sBAAsB;AACxC,kCAA4B;AAAA,IAC9B,WAAW,KAAK,KAAK,MAAM,0BAA0B;AACnD,kCAA4B;AAAA,IAC9B;AAEA,QAAI,KAAK,KAAK,MAAM,YAAY,KAAK,KAAK,MAAM,WAAW;AACzD,kBAAY,EAAE,WAAW,0BAA0B;AAAA,IACrD;AAEA,QAAI,KAAK,KAAK,MAAM,aAAa,KAAK,KAAK,MAAM,YAAY;AAC3D,kBAAY;AAAA,IACd;AAAA,EACF;AAEA,MAAI,aAAa,CAAC,UAAU,WAAW;AACrC,WAAO,EAAE,QAAQ,QAAQ,QAAQ,uCAAuC;AAAA,EAC1E;AAEA,MAAI,CAAC,WAAW;AACd,WAAO,EAAE,QAAQ,QAAQ,QAAQ,cAAc;AAAA,EACjD;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,QAAM,gBACJ,WACG,MAAM,IAAI,EACV,OAAO,CAAC,SAAS,CAAC,yBAAY,SAAS,KAAK,KAAK,CAAC,CAAC,EACnD,KAAK,IAAI,EACT,KAAK,IAAI;AAEd,QAAM,gBAAAA,QAAG,SAAS,UAAU,YAAAC,QAAK,KAAK,KAAK,QAAQ,GAAG,aAAa;AAEnE,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,wCAAwC,CACnD,SAEC,OAAO,EAAE,MAAM,MAAM,QAAQ,IAAI,EAAE,MAAM;AACxC,MAAI;AACF,WAAO,MAAM,mCAAmC,MAAM,KAAK,IAAI;AAAA,EACjE,SAAS,KAAK;AACZ,uBAAI,KAAK,gCAAgC,IAAI,oBAAoB;AACjE,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
6
- "names": ["fs", "path"]
7
- }
@@ -1,9 +0,0 @@
1
- # managed by skuba
2
- package-manager-strict-version=true
3
- public-hoist-pattern[]="@types*"
4
- public-hoist-pattern[]="*eslint*"
5
- public-hoist-pattern[]="*prettier*"
6
- public-hoist-pattern[]="esbuild"
7
- public-hoist-pattern[]="jest"
8
- public-hoist-pattern[]="tsconfig-seek"
9
- # end managed by skuba