skuba 5.2.0-beta.0 → 5.2.0-beta.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.
- package/lib/cli/configure/modules/renovate.d.ts +1 -0
- package/lib/cli/configure/modules/renovate.js +6 -0
- package/lib/cli/configure/modules/renovate.js.map +2 -2
- package/lib/cli/configure/patchRenovateConfig.d.ts +1 -0
- package/lib/cli/configure/patchRenovateConfig.js +132 -0
- package/lib/cli/configure/patchRenovateConfig.js.map +7 -0
- package/lib/cli/format.js +6 -1
- package/lib/cli/format.js.map +2 -2
- package/lib/cli/init/index.js +2 -0
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/lint/index.js +6 -1
- package/lib/cli/lint/index.js.map +2 -2
- package/package.json +6 -5
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/package.json +1 -1
- package/template/express-rest-api/src/listen.ts +7 -0
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/package.json +2 -2
- package/template/koa-rest-api/src/listen.ts +7 -0
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker/package.json +1 -1
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
|
@@ -18,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var renovate_exports = {};
|
|
20
20
|
__export(renovate_exports, {
|
|
21
|
+
RENOVATE_CONFIG_FILENAMES: () => RENOVATE_CONFIG_FILENAMES,
|
|
21
22
|
renovateModule: () => renovateModule
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(renovate_exports);
|
|
@@ -33,6 +34,10 @@ const OTHER_CONFIG_FILENAMES = [
|
|
|
33
34
|
"renovate.json",
|
|
34
35
|
"renovate.json5"
|
|
35
36
|
];
|
|
37
|
+
const RENOVATE_CONFIG_FILENAMES = [
|
|
38
|
+
".github/renovate.json5",
|
|
39
|
+
...OTHER_CONFIG_FILENAMES
|
|
40
|
+
];
|
|
36
41
|
const renovateModule = async ({ type }) => {
|
|
37
42
|
const configFile = await (0, import_template.readBaseTemplateFile)(".github/renovate.json5");
|
|
38
43
|
return {
|
|
@@ -58,6 +63,7 @@ const renovateModule = async ({ type }) => {
|
|
|
58
63
|
};
|
|
59
64
|
// Annotate the CommonJS export names for ESM import in node:
|
|
60
65
|
0 && (module.exports = {
|
|
66
|
+
RENOVATE_CONFIG_FILENAMES,
|
|
61
67
|
renovateModule
|
|
62
68
|
});
|
|
63
69
|
//# sourceMappingURL=renovate.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/modules/renovate.ts"],
|
|
4
|
-
"sourcesContent": ["import { readBaseTemplateFile } from '../../../utils/template';\nimport { deleteFiles } from '../processing/deleteFiles';\nimport { withPackage } from '../processing/package';\nimport { formatPrettier } from '../processing/prettier';\nimport { getFirstDefined } from '../processing/record';\nimport type { Module, Options } from '../types';\n\nconst OTHER_CONFIG_FILENAMES = [\n '.github/renovate.json',\n '.renovaterc',\n '.renovaterc.json',\n 'renovate.json',\n 'renovate.json5',\n];\n\nexport const renovateModule = async ({ type }: Options): Promise<Module> => {\n const configFile = await readBaseTemplateFile('.github/renovate.json5');\n\n return {\n ...deleteFiles(...OTHER_CONFIG_FILENAMES),\n\n '.github/renovate.json5': (_inputFile, _files, initialFiles) => {\n // allow migration from other Renovate config files\n const inputFile = getFirstDefined(initialFiles, [\n '.github/renovate.json5',\n ...OTHER_CONFIG_FILENAMES,\n ]);\n\n // allow customised Renovate configs that extend a SEEK configuration\n return inputFile?.includes('seek')\n ? formatPrettier(inputFile, { parser: 'json5' })\n : configFile;\n },\n\n /**\n * Ensure Renovate correctly detects the project as an application/library.\n *\n * @see {@link https://docs.renovatebot.com/configuration-options/#rangestrategy }\n * @see {@link https://github.com/renovatebot/renovate/blob/8c361082842bb157d85ca39ecf4f6075730e74bb/lib/manager/npm/extract/type.ts#L3 }\n */\n 'package.json': withPackage(({ private: _, renovate, ...data }) => ({\n ...data,\n private: type !== 'package',\n })),\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqC;AACrC,yBAA4B;AAC5B,qBAA4B;AAC5B,sBAA+B;AAC/B,oBAAgC;AAGhC,MAAM,yBAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,iBAAiB,OAAO,EAAE,KAAK,MAAgC;AAC1E,QAAM,aAAa,UAAM,sCAAqB,wBAAwB;AAEtE,SAAO;AAAA,IACL,OAAG,gCAAY,GAAG,sBAAsB;AAAA,IAExC,0BAA0B,CAAC,YAAY,QAAQ,iBAAiB;AAE9D,YAAM,gBAAY,+BAAgB,cAAc;AAAA,QAC9C;AAAA,QACA,GAAG;AAAA,MACL,CAAC;AAGD,aAAO,WAAW,SAAS,MAAM,QAC7B,gCAAe,WAAW,EAAE,QAAQ,QAAQ,CAAC,IAC7C;AAAA,IACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,oBAAgB,4BAAY,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,OAAO;AAAA,MAClE,GAAG;AAAA,MACH,SAAS,SAAS;AAAA,IACpB,EAAE;AAAA,EACJ;AACF;",
|
|
4
|
+
"sourcesContent": ["import { readBaseTemplateFile } from '../../../utils/template';\nimport { deleteFiles } from '../processing/deleteFiles';\nimport { withPackage } from '../processing/package';\nimport { formatPrettier } from '../processing/prettier';\nimport { getFirstDefined } from '../processing/record';\nimport type { Module, Options } from '../types';\n\nconst OTHER_CONFIG_FILENAMES = [\n '.github/renovate.json',\n '.renovaterc',\n '.renovaterc.json',\n 'renovate.json',\n 'renovate.json5',\n];\n\nexport const RENOVATE_CONFIG_FILENAMES = [\n '.github/renovate.json5',\n ...OTHER_CONFIG_FILENAMES,\n];\n\nexport const renovateModule = async ({ type }: Options): Promise<Module> => {\n const configFile = await readBaseTemplateFile('.github/renovate.json5');\n\n return {\n ...deleteFiles(...OTHER_CONFIG_FILENAMES),\n\n '.github/renovate.json5': (_inputFile, _files, initialFiles) => {\n // allow migration from other Renovate config files\n const inputFile = getFirstDefined(initialFiles, [\n '.github/renovate.json5',\n ...OTHER_CONFIG_FILENAMES,\n ]);\n\n // allow customised Renovate configs that extend a SEEK configuration\n return inputFile?.includes('seek')\n ? formatPrettier(inputFile, { parser: 'json5' })\n : configFile;\n },\n\n /**\n * Ensure Renovate correctly detects the project as an application/library.\n *\n * @see {@link https://docs.renovatebot.com/configuration-options/#rangestrategy }\n * @see {@link https://github.com/renovatebot/renovate/blob/8c361082842bb157d85ca39ecf4f6075730e74bb/lib/manager/npm/extract/type.ts#L3 }\n */\n 'package.json': withPackage(({ private: _, renovate, ...data }) => ({\n ...data,\n private: type !== 'package',\n })),\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqC;AACrC,yBAA4B;AAC5B,qBAA4B;AAC5B,sBAA+B;AAC/B,oBAAgC;AAGhC,MAAM,yBAAyB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,4BAA4B;AAAA,EACvC;AAAA,EACA,GAAG;AACL;AAEO,MAAM,iBAAiB,OAAO,EAAE,KAAK,MAAgC;AAC1E,QAAM,aAAa,UAAM,sCAAqB,wBAAwB;AAEtE,SAAO;AAAA,IACL,OAAG,gCAAY,GAAG,sBAAsB;AAAA,IAExC,0BAA0B,CAAC,YAAY,QAAQ,iBAAiB;AAE9D,YAAM,gBAAY,+BAAgB,cAAc;AAAA,QAC9C;AAAA,QACA,GAAG;AAAA,MACL,CAAC;AAGD,aAAO,WAAW,SAAS,MAAM,QAC7B,gCAAe,WAAW,EAAE,QAAQ,QAAQ,CAAC,IAC7C;AAAA,IACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,oBAAgB,4BAAY,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,OAAO;AAAA,MAClE,GAAG;AAAA,MACH,SAAS,SAAS;AAAA,IACpB,EAAE;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tryPatchRenovateConfig: (dir?: string) => Promise<void>;
|
|
@@ -0,0 +1,132 @@
|
|
|
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 patchRenovateConfig_exports = {};
|
|
30
|
+
__export(patchRenovateConfig_exports, {
|
|
31
|
+
tryPatchRenovateConfig: () => tryPatchRenovateConfig
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(patchRenovateConfig_exports);
|
|
34
|
+
var import_util = require("util");
|
|
35
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
36
|
+
var fleece = __toESM(require("golden-fleece"));
|
|
37
|
+
var t = __toESM(require("runtypes"));
|
|
38
|
+
var Git = __toESM(require("../../api/git"));
|
|
39
|
+
var import_logging = require("../../utils/logging");
|
|
40
|
+
var import_project = require("./analysis/project");
|
|
41
|
+
var import_renovate = require("./modules/renovate");
|
|
42
|
+
var import_prettier = require("./processing/prettier");
|
|
43
|
+
const RENOVATE_PRESETS = [
|
|
44
|
+
"local>seekasia/renovate-config",
|
|
45
|
+
"local>seek-jobs/renovate-config"
|
|
46
|
+
];
|
|
47
|
+
const RenovateConfig = t.Record({
|
|
48
|
+
extends: t.Array(t.String)
|
|
49
|
+
});
|
|
50
|
+
const ownerToRenovatePreset = (owner) => {
|
|
51
|
+
const lowercaseOwner = owner.toLowerCase();
|
|
52
|
+
switch (lowercaseOwner) {
|
|
53
|
+
case "seekasia":
|
|
54
|
+
return "local>seekasia/renovate-config";
|
|
55
|
+
case "seek-jobs":
|
|
56
|
+
return "local>seek-jobs/renovate-config";
|
|
57
|
+
default:
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const patchJson = async ({ filepath, input, presetToAdd }) => {
|
|
62
|
+
const config = JSON.parse(input);
|
|
63
|
+
if (!RenovateConfig.guard(config)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
config.extends.unshift(presetToAdd);
|
|
67
|
+
await import_fs_extra.default.promises.writeFile(
|
|
68
|
+
filepath,
|
|
69
|
+
(0, import_prettier.formatPrettier)(JSON.stringify(config), { parser: "json" })
|
|
70
|
+
);
|
|
71
|
+
return;
|
|
72
|
+
};
|
|
73
|
+
const patchJson5 = async ({ filepath, input, presetToAdd }) => {
|
|
74
|
+
const config = fleece.evaluate(input);
|
|
75
|
+
if (!RenovateConfig.guard(config)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
config.extends.unshift(presetToAdd);
|
|
79
|
+
await import_fs_extra.default.promises.writeFile(
|
|
80
|
+
filepath,
|
|
81
|
+
(0, import_prettier.formatPrettier)(fleece.patch(input, config), { parser: "json5" })
|
|
82
|
+
);
|
|
83
|
+
return;
|
|
84
|
+
};
|
|
85
|
+
const patchByFiletype = {
|
|
86
|
+
json: patchJson,
|
|
87
|
+
json5: patchJson5
|
|
88
|
+
};
|
|
89
|
+
const patchRenovateConfig = async (dir) => {
|
|
90
|
+
const readFile = (0, import_project.createDestinationFileReader)(dir);
|
|
91
|
+
const { owner } = await Git.getOwnerAndRepo({ dir });
|
|
92
|
+
const presetToAdd = ownerToRenovatePreset(owner);
|
|
93
|
+
if (!presetToAdd) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const maybeConfigs = await Promise.all(
|
|
97
|
+
import_renovate.RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({
|
|
98
|
+
input: await readFile(filepath),
|
|
99
|
+
filepath
|
|
100
|
+
}))
|
|
101
|
+
);
|
|
102
|
+
const config = maybeConfigs.find((maybeConfig) => Boolean(maybeConfig.input));
|
|
103
|
+
if (
|
|
104
|
+
// No file was found.
|
|
105
|
+
!config?.input || // The file appears to mention the baseline preset for the configured Git
|
|
106
|
+
// owner. This is a very naive check that we don't want to overcomplicate
|
|
107
|
+
// because it is invoked before each skuba format and lint.
|
|
108
|
+
config.input.includes(presetToAdd)
|
|
109
|
+
) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const filetype = config.filepath.toLowerCase().endsWith(".json5") ? "json5" : "json";
|
|
113
|
+
const patchFile = patchByFiletype[filetype];
|
|
114
|
+
await patchFile({
|
|
115
|
+
filepath: config.filepath,
|
|
116
|
+
input: config.input,
|
|
117
|
+
presetToAdd
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
const tryPatchRenovateConfig = async (dir = process.cwd()) => {
|
|
121
|
+
try {
|
|
122
|
+
await patchRenovateConfig(dir);
|
|
123
|
+
} catch (err) {
|
|
124
|
+
import_logging.log.warn("Failed to patch Renovate config.");
|
|
125
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
129
|
+
0 && (module.exports = {
|
|
130
|
+
tryPatchRenovateConfig
|
|
131
|
+
});
|
|
132
|
+
//# sourceMappingURL=patchRenovateConfig.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/cli/configure/patchRenovateConfig.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable new-cap */\n\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\nimport * as fleece from 'golden-fleece';\nimport * as t from 'runtypes';\n\nimport * as Git from '../../api/git';\nimport { log } from '../../utils/logging';\n\nimport { createDestinationFileReader } from './analysis/project';\nimport { RENOVATE_CONFIG_FILENAMES } from './modules/renovate';\nimport { formatPrettier } from './processing/prettier';\n\nconst RENOVATE_PRESETS = [\n 'local>seekasia/renovate-config',\n 'local>seek-jobs/renovate-config',\n] as const;\n\ntype RenovateFiletype = 'json' | 'json5';\n\ntype RenovatePreset = (typeof RENOVATE_PRESETS)[number];\n\nconst RenovateConfig = t.Record({\n extends: t.Array(t.String),\n});\n\nconst ownerToRenovatePreset = (owner: string): RenovatePreset | undefined => {\n const lowercaseOwner = owner.toLowerCase();\n\n switch (lowercaseOwner) {\n case 'seekasia':\n return 'local>seekasia/renovate-config';\n\n case 'seek-jobs':\n return 'local>seek-jobs/renovate-config';\n\n default:\n return;\n }\n};\n\ntype PatchFile = (props: {\n filepath: string;\n input: string;\n presetToAdd: RenovatePreset;\n}) => Promise<void>;\n\nconst patchJson: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const config: unknown = JSON.parse(input);\n\n if (!RenovateConfig.guard(config)) {\n return;\n }\n\n config.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n formatPrettier(JSON.stringify(config), { parser: 'json' }),\n );\n\n return;\n};\n\nconst patchJson5: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const config: unknown = fleece.evaluate(input);\n\n if (!RenovateConfig.guard(config)) {\n return;\n }\n\n config.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n formatPrettier(fleece.patch(input, config), { parser: 'json5' }),\n );\n\n return;\n};\n\nconst patchByFiletype: Record<RenovateFiletype, PatchFile> = {\n json: patchJson,\n json5: patchJson5,\n};\n\nconst patchRenovateConfig = async (dir: string) => {\n const readFile = createDestinationFileReader(dir);\n\n const { owner } = await Git.getOwnerAndRepo({ dir });\n\n const presetToAdd = ownerToRenovatePreset(owner);\n\n if (!presetToAdd) {\n // No baseline preset needs to be added for the configured Git owner.\n return;\n }\n\n const maybeConfigs = await Promise.all(\n RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({\n input: await readFile(filepath),\n filepath,\n })),\n );\n\n const config = maybeConfigs.find((maybeConfig) => Boolean(maybeConfig.input));\n\n if (\n // No file was found.\n !config?.input ||\n // The file appears to mention the baseline preset for the configured Git\n // owner. This is a very naive check that we don't want to overcomplicate\n // because it is invoked before each skuba format and lint.\n config.input.includes(presetToAdd)\n ) {\n return;\n }\n\n const filetype: RenovateFiletype = config.filepath\n .toLowerCase()\n .endsWith('.json5')\n ? 'json5'\n : 'json';\n\n const patchFile = patchByFiletype[filetype];\n\n await patchFile({\n filepath: config.filepath,\n input: config.input,\n presetToAdd,\n });\n};\n\nexport const tryPatchRenovateConfig = async (dir = process.cwd()) => {\n try {\n await patchRenovateConfig(dir);\n } catch (err) {\n log.warn('Failed to patch Renovate config.');\n log.subtle(inspect(err));\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAwB;AAExB,sBAAe;AACf,aAAwB;AACxB,QAAmB;AAEnB,UAAqB;AACrB,qBAAoB;AAEpB,qBAA4C;AAC5C,sBAA0C;AAC1C,sBAA+B;AAE/B,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AACF;AAMA,MAAM,iBAAiB,EAAE,OAAO;AAAA,EAC9B,SAAS,EAAE,MAAM,EAAE,MAAM;AAC3B,CAAC;AAED,MAAM,wBAAwB,CAAC,UAA8C;AAC3E,QAAM,iBAAiB,MAAM,YAAY;AAEzC,UAAQ,gBAAgB;AAAA,IACtB,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AACH,aAAO;AAAA,IAET;AACE;AAAA,EACJ;AACF;AAQA,MAAM,YAAuB,OAAO,EAAE,UAAU,OAAO,YAAY,MAAM;AACvE,QAAM,SAAkB,KAAK,MAAM,KAAK;AAExC,MAAI,CAAC,eAAe,MAAM,MAAM,GAAG;AACjC;AAAA,EACF;AAEA,SAAO,QAAQ,QAAQ,WAAW;AAElC,QAAM,gBAAAA,QAAG,SAAS;AAAA,IAChB;AAAA,QACA,gCAAe,KAAK,UAAU,MAAM,GAAG,EAAE,QAAQ,OAAO,CAAC;AAAA,EAC3D;AAEA;AACF;AAEA,MAAM,aAAwB,OAAO,EAAE,UAAU,OAAO,YAAY,MAAM;AACxE,QAAM,SAAkB,OAAO,SAAS,KAAK;AAE7C,MAAI,CAAC,eAAe,MAAM,MAAM,GAAG;AACjC;AAAA,EACF;AAEA,SAAO,QAAQ,QAAQ,WAAW;AAElC,QAAM,gBAAAA,QAAG,SAAS;AAAA,IAChB;AAAA,QACA,gCAAe,OAAO,MAAM,OAAO,MAAM,GAAG,EAAE,QAAQ,QAAQ,CAAC;AAAA,EACjE;AAEA;AACF;AAEA,MAAM,kBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,OAAO;AACT;AAEA,MAAM,sBAAsB,OAAO,QAAgB;AACjD,QAAM,eAAW,4CAA4B,GAAG;AAEhD,QAAM,EAAE,MAAM,IAAI,MAAM,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAEnD,QAAM,cAAc,sBAAsB,KAAK;AAE/C,MAAI,CAAC,aAAa;AAEhB;AAAA,EACF;AAEA,QAAM,eAAe,MAAM,QAAQ;AAAA,IACjC,0CAA0B,IAAI,OAAO,cAAc;AAAA,MACjD,OAAO,MAAM,SAAS,QAAQ;AAAA,MAC9B;AAAA,IACF,EAAE;AAAA,EACJ;AAEA,QAAM,SAAS,aAAa,KAAK,CAAC,gBAAgB,QAAQ,YAAY,KAAK,CAAC;AAE5E;AAAA;AAAA,IAEE,CAAC,QAAQ;AAAA;AAAA;AAAA,IAIT,OAAO,MAAM,SAAS,WAAW;AAAA,IACjC;AACA;AAAA,EACF;AAEA,QAAM,WAA6B,OAAO,SACvC,YAAY,EACZ,SAAS,QAAQ,IAChB,UACA;AAEJ,QAAM,YAAY,gBAAgB,QAAQ;AAE1C,QAAM,UAAU;AAAA,IACd,UAAU,OAAO;AAAA,IACjB,OAAO,OAAO;AAAA,IACd;AAAA,EACF,CAAC;AACH;AAEO,MAAM,yBAAyB,OAAO,MAAM,QAAQ,IAAI,MAAM;AACnE,MAAI;AACF,UAAM,oBAAoB,GAAG;AAAA,EAC/B,SAAS,KAAP;AACA,uBAAI,KAAK,kCAAkC;AAC3C,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AAAA,EACzB;AACF;",
|
|
6
|
+
"names": ["fs"]
|
|
7
|
+
}
|
package/lib/cli/format.js
CHANGED
|
@@ -37,9 +37,14 @@ var import_logging = require("../utils/logging");
|
|
|
37
37
|
var import_eslint = require("./adapter/eslint");
|
|
38
38
|
var import_prettier = require("./adapter/prettier");
|
|
39
39
|
var import_addEmptyExports = require("./configure/addEmptyExports");
|
|
40
|
+
var import_patchRenovateConfig = require("./configure/patchRenovateConfig");
|
|
40
41
|
var import_refreshIgnoreFiles = require("./configure/refreshIgnoreFiles");
|
|
41
42
|
const format = async (args = process.argv.slice(2)) => {
|
|
42
|
-
await Promise.all([
|
|
43
|
+
await Promise.all([
|
|
44
|
+
(0, import_addEmptyExports.tryAddEmptyExports)(),
|
|
45
|
+
(0, import_patchRenovateConfig.tryPatchRenovateConfig)(),
|
|
46
|
+
(0, import_refreshIgnoreFiles.tryRefreshIgnoreFiles)()
|
|
47
|
+
]);
|
|
43
48
|
const debug = (0, import_args.hasDebugFlag)(args);
|
|
44
49
|
const logger = (0, import_logging.createLogger)(debug);
|
|
45
50
|
import_logging.log.plain(import_chalk.default.magenta("ESLint"));
|
package/lib/cli/format.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cli/format.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../utils/args';\nimport { createLogger, log } from '../utils/logging';\n\nimport { runESLint } from './adapter/eslint';\nimport { runPrettier } from './adapter/prettier';\nimport { tryAddEmptyExports } from './configure/addEmptyExports';\nimport { tryRefreshIgnoreFiles } from './configure/refreshIgnoreFiles';\n\nexport const format = async (args = process.argv.slice(2)): Promise<void> => {\n await Promise.all([tryAddEmptyExports()
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,kBAA6B;AAC7B,qBAAkC;AAElC,oBAA0B;AAC1B,sBAA4B;AAC5B,6BAAmC;AACnC,gCAAsC;AAE/B,MAAM,SAAS,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAqB;AAC3E,QAAM,QAAQ,IAAI,
|
|
4
|
+
"sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../utils/args';\nimport { createLogger, log } from '../utils/logging';\n\nimport { runESLint } from './adapter/eslint';\nimport { runPrettier } from './adapter/prettier';\nimport { tryAddEmptyExports } from './configure/addEmptyExports';\nimport { tryPatchRenovateConfig } from './configure/patchRenovateConfig';\nimport { tryRefreshIgnoreFiles } from './configure/refreshIgnoreFiles';\n\nexport const format = async (args = process.argv.slice(2)): Promise<void> => {\n await Promise.all([\n tryAddEmptyExports(),\n tryPatchRenovateConfig(),\n tryRefreshIgnoreFiles(),\n ]);\n\n const debug = hasDebugFlag(args);\n const logger = createLogger(debug);\n\n log.plain(chalk.magenta('ESLint'));\n\n const eslint = await runESLint('format', logger);\n\n log.newline();\n log.plain(chalk.cyan('Prettier'));\n\n const prettier = await runPrettier('format', logger);\n\n if (eslint.ok && prettier.ok) {\n return;\n }\n\n const tools = [\n ...(eslint.ok ? [] : ['ESLint']),\n ...(prettier.ok ? [] : ['Prettier']),\n ];\n\n log.newline();\n log.err(tools.join(', '), 'found issues that require triage.');\n\n process.exitCode = 1;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,kBAA6B;AAC7B,qBAAkC;AAElC,oBAA0B;AAC1B,sBAA4B;AAC5B,6BAAmC;AACnC,iCAAuC;AACvC,gCAAsC;AAE/B,MAAM,SAAS,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAqB;AAC3E,QAAM,QAAQ,IAAI;AAAA,QAChB,2CAAmB;AAAA,QACnB,mDAAuB;AAAA,QACvB,iDAAsB;AAAA,EACxB,CAAC;AAED,QAAM,YAAQ,0BAAa,IAAI;AAC/B,QAAM,aAAS,6BAAa,KAAK;AAEjC,qBAAI,MAAM,aAAAA,QAAM,QAAQ,QAAQ,CAAC;AAEjC,QAAM,SAAS,UAAM,yBAAU,UAAU,MAAM;AAE/C,qBAAI,QAAQ;AACZ,qBAAI,MAAM,aAAAA,QAAM,KAAK,UAAU,CAAC;AAEhC,QAAM,WAAW,UAAM,6BAAY,UAAU,MAAM;AAEnD,MAAI,OAAO,MAAM,SAAS,IAAI;AAC5B;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,GAAI,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ;AAAA,IAC9B,GAAI,SAAS,KAAK,CAAC,IAAI,CAAC,UAAU;AAAA,EACpC;AAEA,qBAAI,QAAQ;AACZ,qBAAI,IAAI,MAAM,KAAK,IAAI,GAAG,mCAAmC;AAE7D,UAAQ,WAAW;AACrB;",
|
|
6
6
|
"names": ["chalk"]
|
|
7
7
|
}
|
package/lib/cli/init/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_exec = require("../../utils/exec");
|
|
|
39
39
|
var import_logging = require("../../utils/logging");
|
|
40
40
|
var import_logo = require("../../utils/logo");
|
|
41
41
|
var import_template = require("../../utils/template");
|
|
42
|
+
var import_patchRenovateConfig = require("../configure/patchRenovateConfig");
|
|
42
43
|
var import_getConfig = require("./getConfig");
|
|
43
44
|
var import_git2 = require("./git");
|
|
44
45
|
var import_writePackageJson = require("./writePackageJson");
|
|
@@ -91,6 +92,7 @@ const init = async () => {
|
|
|
91
92
|
});
|
|
92
93
|
import_logging.log.newline();
|
|
93
94
|
await (0, import_git2.initialiseRepo)(destinationDir, templateData);
|
|
95
|
+
await (0, import_patchRenovateConfig.tryPatchRenovateConfig)(destinationDir);
|
|
94
96
|
const skubaSlug = `skuba@${skubaVersionInfo.local}`;
|
|
95
97
|
let depsInstalled = false;
|
|
96
98
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/init/index.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport { commitAllChanges } from '../../api/git';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy';\nimport { createInclusionFilter } from '../../utils/dir';\nimport { createExec, ensureCommands } from '../../utils/exec';\nimport { log } from '../../utils/logging';\nimport { showLogoAndVersionInfo } from '../../utils/logo';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template';\n\nimport { getConfig } from './getConfig';\nimport { initialiseRepo } from './git';\nimport { writePackageJson } from './writePackageJson';\n\nexport const init = async () => {\n const skubaVersionInfo = await showLogoAndVersionInfo();\n\n await ensureCommands('yarn');\n\n const {\n destinationDir,\n entryPoint,\n templateComplete,\n templateData,\n templateName,\n type,\n } = await getConfig();\n\n const include = await createInclusionFilter([\n path.join(destinationDir, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]);\n\n const processors = [createEjsRenderer(templateData)];\n\n await copyFiles({\n sourceRoot: BASE_TEMPLATE_DIR,\n destinationRoot: destinationDir,\n include,\n // prefer template-specific files\n overwrite: false,\n processors,\n // base template has files like _.eslintrc.js\n stripUnderscorePrefix: true,\n });\n\n await copyFiles({\n sourceRoot: destinationDir,\n destinationRoot: destinationDir,\n include,\n processors,\n });\n\n await Promise.all([\n templateComplete\n ? ensureTemplateConfigDeletion(destinationDir)\n : Promise.resolve(),\n\n writePackageJson({\n cwd: destinationDir,\n entryPoint,\n template: templateName,\n type,\n version: skubaVersionInfo.local,\n }),\n ]);\n\n const exec = createExec({\n cwd: destinationDir,\n stdio: 'pipe',\n streamStdio: 'yarn',\n });\n\n log.newline();\n await initialiseRepo(destinationDir, templateData);\n\n const skubaSlug = `skuba@${skubaVersionInfo.local}`;\n\n let depsInstalled = false;\n try {\n await exec('yarn', 'add', '--dev', skubaSlug);\n depsInstalled = true;\n await exec('npx', 'yarn-deduplicate', '--strategy=highest');\n } catch {}\n\n await commitAllChanges({\n dir: destinationDir,\n message: `Clone ${templateName}`,\n });\n\n const logGitHubRepoCreation = () => {\n log.plain(\n 'Next, create an empty',\n log.bold(`${templateData.orgName}/${templateData.repoName}`),\n 'repository:',\n );\n log.ok('https://github.com/new');\n };\n\n if (!depsInstalled) {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies.'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, resume initialisation:');\n log.ok('cd', destinationDir);\n log.ok('yarn add --dev', skubaSlug);\n log.ok('git add --all');\n log.ok('git commit --message', `'Pin ${skubaSlug}'`);\n log.ok('git push --set-upstream origin master');\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n\n log.newline();\n log.ok(log.bold('\u2714 Project initialised!'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, push your local changes:');\n log.ok('cd', destinationDir);\n log.ok('git push --set-upstream origin master');\n\n log.newline();\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,iBAAiC;AACjC,kBAA6C;AAC7C,iBAAsC;AACtC,kBAA2C;AAC3C,qBAAoB;AACpB,kBAAuC;AACvC,sBAGO;
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport { commitAllChanges } from '../../api/git';\nimport { copyFiles, createEjsRenderer } from '../../utils/copy';\nimport { createInclusionFilter } from '../../utils/dir';\nimport { createExec, ensureCommands } from '../../utils/exec';\nimport { log } from '../../utils/logging';\nimport { showLogoAndVersionInfo } from '../../utils/logo';\nimport {\n BASE_TEMPLATE_DIR,\n ensureTemplateConfigDeletion,\n} from '../../utils/template';\nimport { tryPatchRenovateConfig } from '../configure/patchRenovateConfig';\n\nimport { getConfig } from './getConfig';\nimport { initialiseRepo } from './git';\nimport { writePackageJson } from './writePackageJson';\n\nexport const init = async () => {\n const skubaVersionInfo = await showLogoAndVersionInfo();\n\n await ensureCommands('yarn');\n\n const {\n destinationDir,\n entryPoint,\n templateComplete,\n templateData,\n templateName,\n type,\n } = await getConfig();\n\n const include = await createInclusionFilter([\n path.join(destinationDir, '.gitignore'),\n path.join(BASE_TEMPLATE_DIR, '_.gitignore'),\n ]);\n\n const processors = [createEjsRenderer(templateData)];\n\n await copyFiles({\n sourceRoot: BASE_TEMPLATE_DIR,\n destinationRoot: destinationDir,\n include,\n // prefer template-specific files\n overwrite: false,\n processors,\n // base template has files like _.eslintrc.js\n stripUnderscorePrefix: true,\n });\n\n await copyFiles({\n sourceRoot: destinationDir,\n destinationRoot: destinationDir,\n include,\n processors,\n });\n\n await Promise.all([\n templateComplete\n ? ensureTemplateConfigDeletion(destinationDir)\n : Promise.resolve(),\n\n writePackageJson({\n cwd: destinationDir,\n entryPoint,\n template: templateName,\n type,\n version: skubaVersionInfo.local,\n }),\n ]);\n\n const exec = createExec({\n cwd: destinationDir,\n stdio: 'pipe',\n streamStdio: 'yarn',\n });\n\n log.newline();\n await initialiseRepo(destinationDir, templateData);\n\n // Patch in a baseline Renovate preset based on the configured Git owner.\n await tryPatchRenovateConfig(destinationDir);\n\n const skubaSlug = `skuba@${skubaVersionInfo.local}`;\n\n let depsInstalled = false;\n try {\n await exec('yarn', 'add', '--dev', skubaSlug);\n depsInstalled = true;\n await exec('npx', 'yarn-deduplicate', '--strategy=highest');\n } catch {}\n\n await commitAllChanges({\n dir: destinationDir,\n message: `Clone ${templateName}`,\n });\n\n const logGitHubRepoCreation = () => {\n log.plain(\n 'Next, create an empty',\n log.bold(`${templateData.orgName}/${templateData.repoName}`),\n 'repository:',\n );\n log.ok('https://github.com/new');\n };\n\n if (!depsInstalled) {\n log.newline();\n log.warn(log.bold('\u2717 Failed to install dependencies.'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, resume initialisation:');\n log.ok('cd', destinationDir);\n log.ok('yarn add --dev', skubaSlug);\n log.ok('git add --all');\n log.ok('git commit --message', `'Pin ${skubaSlug}'`);\n log.ok('git push --set-upstream origin master');\n\n log.newline();\n process.exitCode = 1;\n return;\n }\n\n log.newline();\n log.ok(log.bold('\u2714 Project initialised!'));\n\n log.newline();\n logGitHubRepoCreation();\n\n log.newline();\n log.plain('Then, push your local changes:');\n log.ok('cd', destinationDir);\n log.ok('git push --set-upstream origin master');\n\n log.newline();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,iBAAiC;AACjC,kBAA6C;AAC7C,iBAAsC;AACtC,kBAA2C;AAC3C,qBAAoB;AACpB,kBAAuC;AACvC,sBAGO;AACP,iCAAuC;AAEvC,uBAA0B;AAC1B,IAAAA,cAA+B;AAC/B,8BAAiC;AAE1B,MAAM,OAAO,YAAY;AAC9B,QAAM,mBAAmB,UAAM,oCAAuB;AAEtD,YAAM,4BAAe,MAAM;AAE3B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,UAAM,4BAAU;AAEpB,QAAM,UAAU,UAAM,kCAAsB;AAAA,IAC1C,YAAAC,QAAK,KAAK,gBAAgB,YAAY;AAAA,IACtC,YAAAA,QAAK,KAAK,mCAAmB,aAAa;AAAA,EAC5C,CAAC;AAED,QAAM,aAAa,KAAC,+BAAkB,YAAY,CAAC;AAEnD,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA;AAAA,IAEA,WAAW;AAAA,IACX;AAAA;AAAA,IAEA,uBAAuB;AAAA,EACzB,CAAC;AAED,YAAM,uBAAU;AAAA,IACd,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,QAAQ,IAAI;AAAA,IAChB,uBACI,8CAA6B,cAAc,IAC3C,QAAQ,QAAQ;AAAA,QAEpB,0CAAiB;AAAA,MACf,KAAK;AAAA,MACL;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,SAAS,iBAAiB;AAAA,IAC5B,CAAC;AAAA,EACH,CAAC;AAED,QAAM,WAAO,wBAAW;AAAA,IACtB,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aAAa;AAAA,EACf,CAAC;AAED,qBAAI,QAAQ;AACZ,YAAM,4BAAe,gBAAgB,YAAY;AAGjD,YAAM,mDAAuB,cAAc;AAE3C,QAAM,YAAY,SAAS,iBAAiB;AAE5C,MAAI,gBAAgB;AACpB,MAAI;AACF,UAAM,KAAK,QAAQ,OAAO,SAAS,SAAS;AAC5C,oBAAgB;AAChB,UAAM,KAAK,OAAO,oBAAoB,oBAAoB;AAAA,EAC5D,QAAE;AAAA,EAAO;AAET,YAAM,6BAAiB;AAAA,IACrB,KAAK;AAAA,IACL,SAAS,SAAS;AAAA,EACpB,CAAC;AAED,QAAM,wBAAwB,MAAM;AAClC,uBAAI;AAAA,MACF;AAAA,MACA,mBAAI,KAAK,GAAG,aAAa,WAAW,aAAa,UAAU;AAAA,MAC3D;AAAA,IACF;AACA,uBAAI,GAAG,wBAAwB;AAAA,EACjC;AAEA,MAAI,CAAC,eAAe;AAClB,uBAAI,QAAQ;AACZ,uBAAI,KAAK,mBAAI,KAAK,wCAAmC,CAAC;AAEtD,uBAAI,QAAQ;AACZ,0BAAsB;AAEtB,uBAAI,QAAQ;AACZ,uBAAI,MAAM,8BAA8B;AACxC,uBAAI,GAAG,MAAM,cAAc;AAC3B,uBAAI,GAAG,kBAAkB,SAAS;AAClC,uBAAI,GAAG,eAAe;AACtB,uBAAI,GAAG,wBAAwB,QAAQ,YAAY;AACnD,uBAAI,GAAG,uCAAuC;AAE9C,uBAAI,QAAQ;AACZ,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,qBAAI,QAAQ;AACZ,qBAAI,GAAG,mBAAI,KAAK,6BAAwB,CAAC;AAEzC,qBAAI,QAAQ;AACZ,wBAAsB;AAEtB,qBAAI,QAAQ;AACZ,qBAAI,MAAM,gCAAgC;AAC1C,qBAAI,GAAG,MAAM,cAAc;AAC3B,qBAAI,GAAG,uCAAuC;AAE9C,qBAAI,QAAQ;AACd;",
|
|
6
6
|
"names": ["import_git", "path"]
|
|
7
7
|
}
|
package/lib/cli/lint/index.js
CHANGED
|
@@ -23,11 +23,16 @@ __export(lint_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(lint_exports);
|
|
24
24
|
var import_args = require("../../utils/args");
|
|
25
25
|
var import_addEmptyExports = require("../configure/addEmptyExports");
|
|
26
|
+
var import_patchRenovateConfig = require("../configure/patchRenovateConfig");
|
|
26
27
|
var import_refreshIgnoreFiles = require("../configure/refreshIgnoreFiles");
|
|
27
28
|
var import_external = require("./external");
|
|
28
29
|
var import_internal = require("./internal");
|
|
29
30
|
const lint = async (args = process.argv.slice(2), tscOutputStream = void 0, workerThreads = true) => {
|
|
30
|
-
await Promise.all([
|
|
31
|
+
await Promise.all([
|
|
32
|
+
(0, import_addEmptyExports.tryAddEmptyExports)(),
|
|
33
|
+
(0, import_patchRenovateConfig.tryPatchRenovateConfig)(),
|
|
34
|
+
(0, import_refreshIgnoreFiles.tryRefreshIgnoreFiles)()
|
|
35
|
+
]);
|
|
31
36
|
const opts = {
|
|
32
37
|
debug: (0, import_args.hasDebugFlag)(args),
|
|
33
38
|
serial: (0, import_args.hasSerialFlag)(args),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/lint/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Writable } from 'stream';\n\nimport { hasDebugFlag, hasSerialFlag } from '../../utils/args';\nimport { tryAddEmptyExports } from '../configure/addEmptyExports';\nimport { tryRefreshIgnoreFiles } from '../configure/refreshIgnoreFiles';\n\nimport { externalLint } from './external';\nimport { internalLint } from './internal';\nimport type { Input } from './types';\n\nexport const lint = async (\n args = process.argv.slice(2),\n tscOutputStream: Writable | undefined = undefined,\n workerThreads = true,\n) => {\n await Promise.all([tryAddEmptyExports()
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAA4C;AAC5C,6BAAmC;AACnC,gCAAsC;AAEtC,sBAA6B;AAC7B,sBAA6B;AAGtB,MAAM,OAAO,OAClB,OAAO,QAAQ,KAAK,MAAM,CAAC,GAC3B,kBAAwC,QACxC,gBAAgB,SACb;AACH,QAAM,QAAQ,IAAI,
|
|
4
|
+
"sourcesContent": ["import type { Writable } from 'stream';\n\nimport { hasDebugFlag, hasSerialFlag } from '../../utils/args';\nimport { tryAddEmptyExports } from '../configure/addEmptyExports';\nimport { tryPatchRenovateConfig } from '../configure/patchRenovateConfig';\nimport { tryRefreshIgnoreFiles } from '../configure/refreshIgnoreFiles';\n\nimport { externalLint } from './external';\nimport { internalLint } from './internal';\nimport type { Input } from './types';\n\nexport const lint = async (\n args = process.argv.slice(2),\n tscOutputStream: Writable | undefined = undefined,\n workerThreads = true,\n) => {\n await Promise.all([\n tryAddEmptyExports(),\n tryPatchRenovateConfig(),\n tryRefreshIgnoreFiles(),\n ]);\n\n const opts: Input = {\n debug: hasDebugFlag(args),\n serial: hasSerialFlag(args),\n tscOutputStream,\n workerThreads,\n };\n\n await externalLint(opts);\n\n await internalLint();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAA4C;AAC5C,6BAAmC;AACnC,iCAAuC;AACvC,gCAAsC;AAEtC,sBAA6B;AAC7B,sBAA6B;AAGtB,MAAM,OAAO,OAClB,OAAO,QAAQ,KAAK,MAAM,CAAC,GAC3B,kBAAwC,QACxC,gBAAgB,SACb;AACH,QAAM,QAAQ,IAAI;AAAA,QAChB,2CAAmB;AAAA,QACnB,mDAAuB;AAAA,QACvB,iDAAsB;AAAA,EACxB,CAAC;AAED,QAAM,OAAc;AAAA,IAClB,WAAO,0BAAa,IAAI;AAAA,IACxB,YAAQ,2BAAc,IAAI;AAAA,IAC1B;AAAA,IACA;AAAA,EACF;AAEA,YAAM,8BAAa,IAAI;AAEvB,YAAM,8BAAa;AACrB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "5.2.0-beta.
|
|
3
|
+
"version": "5.2.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
6
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"fs-extra": "^11.0.0",
|
|
90
90
|
"function-arguments": "^1.0.9",
|
|
91
91
|
"get-port": "^5.1.1",
|
|
92
|
+
"golden-fleece": "^1.0.9",
|
|
92
93
|
"ignore": "^5.1.8",
|
|
93
94
|
"is-installed-globally": "^0.4.0",
|
|
94
95
|
"isomorphic-git": "^1.11.1",
|
|
@@ -121,9 +122,9 @@
|
|
|
121
122
|
"devDependencies": {
|
|
122
123
|
"@changesets/cli": "2.26.0",
|
|
123
124
|
"@changesets/get-github-info": "0.5.2",
|
|
124
|
-
"@jest/reporters": "29.4.
|
|
125
|
-
"@types/ejs": "3.1.
|
|
126
|
-
"@types/express": "4.17.
|
|
125
|
+
"@jest/reporters": "29.4.3",
|
|
126
|
+
"@types/ejs": "3.1.2",
|
|
127
|
+
"@types/express": "4.17.17",
|
|
127
128
|
"@types/fs-extra": "11.0.1",
|
|
128
129
|
"@types/koa": "2.13.5",
|
|
129
130
|
"@types/libnpmsearch": "2.0.3",
|
|
@@ -135,7 +136,7 @@
|
|
|
135
136
|
"@types/validate-npm-package-name": "4.0.0",
|
|
136
137
|
"enhanced-resolve": "5.12.0",
|
|
137
138
|
"express": "4.18.2",
|
|
138
|
-
"fastify": "4.
|
|
139
|
+
"fastify": "4.13.0",
|
|
139
140
|
"jsonfile": "6.1.0",
|
|
140
141
|
"koa": "2.14.1",
|
|
141
142
|
"memfs": "3.4.13",
|
|
@@ -14,3 +14,10 @@ const listener = app.listen(config.port, () => {
|
|
|
14
14
|
rootLogger.debug(`listening on port ${address.port}`);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
|
|
18
|
+
// Gantry ALB default idle timeout is 30 seconds
|
|
19
|
+
// https://nodejs.org/docs/latest-v18.x/api/http.html#serverkeepalivetimeout
|
|
20
|
+
// Node default is 5 seconds
|
|
21
|
+
// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout
|
|
22
|
+
// AWS recommends setting an application timeout larger than the load balancer
|
|
23
|
+
listener.keepAliveTimeout = 31000;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@opentelemetry/api": "^1.1.0",
|
|
17
17
|
"@opentelemetry/exporter-collector-grpc": "^0.25.0",
|
|
18
18
|
"@opentelemetry/instrumentation-aws-sdk": "^0.34.0",
|
|
19
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
19
|
+
"@opentelemetry/instrumentation-http": "^0.36.0",
|
|
20
20
|
"@opentelemetry/sdk-node": "^0.35.0",
|
|
21
21
|
"@seek/logger": "^5.0.1",
|
|
22
22
|
"aws-sdk": "^2.1039.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@types/node": "^18.11.5",
|
|
38
38
|
"@types/supertest": "^2.0.11",
|
|
39
39
|
"chance": "^1.1.8",
|
|
40
|
-
"pino-pretty": "^
|
|
40
|
+
"pino-pretty": "^10.0.0",
|
|
41
41
|
"skuba": "*",
|
|
42
42
|
"supertest": "^6.1.6"
|
|
43
43
|
},
|
|
@@ -15,3 +15,10 @@ const listener = app.listen(config.port, () => {
|
|
|
15
15
|
logger.debug(`listening on port ${address.port}`);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
|
|
19
|
+
// Gantry ALB default idle timeout is 30 seconds
|
|
20
|
+
// https://nodejs.org/docs/latest-v18.x/api/http.html#serverkeepalivetimeout
|
|
21
|
+
// Node default is 5 seconds
|
|
22
|
+
// https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout
|
|
23
|
+
// AWS recommends setting an application timeout larger than the load balancer
|
|
24
|
+
listener.keepAliveTimeout = 31000;
|
|
@@ -32,7 +32,7 @@ configs:
|
|
|
32
32
|
- *aws-sm
|
|
33
33
|
- *private-npm
|
|
34
34
|
- *docker-ecr-cache
|
|
35
|
-
- docker-compose#v4.
|
|
35
|
+
- docker-compose#v4.11.0:
|
|
36
36
|
dependencies: false
|
|
37
37
|
run: app
|
|
38
38
|
retry:
|
|
@@ -60,7 +60,7 @@ steps:
|
|
|
60
60
|
- *aws-sm
|
|
61
61
|
- *private-npm
|
|
62
62
|
- *docker-ecr-cache
|
|
63
|
-
- docker-compose#v4.
|
|
63
|
+
- docker-compose#v4.11.0:
|
|
64
64
|
run: app
|
|
65
65
|
timeout_in_minutes: 10
|
|
66
66
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"aws-sdk-client-mock": "^2.0.1",
|
|
32
32
|
"aws-sdk-client-mock-jest": "^2.0.1",
|
|
33
33
|
"chance": "^1.1.8",
|
|
34
|
-
"pino-pretty": "^
|
|
34
|
+
"pino-pretty": "^10.0.0",
|
|
35
35
|
"serverless": "^3.25.0",
|
|
36
36
|
"serverless-plugin-canary-deployments": "^0.8.0",
|
|
37
37
|
"serverless-plugin-datadog": "^5.12.0",
|
|
@@ -32,7 +32,7 @@ configs:
|
|
|
32
32
|
- *aws-sm
|
|
33
33
|
- *private-npm
|
|
34
34
|
- *docker-ecr-cache
|
|
35
|
-
- docker-compose#v4.
|
|
35
|
+
- docker-compose#v4.11.0:
|
|
36
36
|
dependencies: false
|
|
37
37
|
run: app
|
|
38
38
|
retry:
|
|
@@ -57,7 +57,7 @@ steps:
|
|
|
57
57
|
- *aws-sm
|
|
58
58
|
- *private-npm
|
|
59
59
|
- *docker-ecr-cache
|
|
60
|
-
- docker-compose#v4.
|
|
60
|
+
- docker-compose#v4.11.0:
|
|
61
61
|
run: app
|
|
62
62
|
timeout_in_minutes: 10
|
|
63
63
|
|