Skip to content

Commit 2ba8940

Browse files
committed
autogen: build bundles
1 parent 5a8460e commit 2ba8940

File tree

2 files changed

+98
-34
lines changed

2 files changed

+98
-34
lines changed

distAction/index.js

+55-5
Original file line numberDiff line numberDiff line change
@@ -26065,18 +26065,42 @@ function wrappy (fn, cb) {
2606526065
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2606626066
// See the License for the specific language governing permissions and
2606726067
// limitations under the License.
26068+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26069+
if (k2 === undefined) k2 = k;
26070+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
26071+
}) : (function(o, m, k, k2) {
26072+
if (k2 === undefined) k2 = k;
26073+
o[k2] = m[k];
26074+
}));
26075+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26076+
Object.defineProperty(o, "default", { enumerable: true, value: v });
26077+
}) : function(o, v) {
26078+
o["default"] = v;
26079+
});
26080+
var __importStar = (this && this.__importStar) || function (mod) {
26081+
if (mod && mod.__esModule) return mod;
26082+
var result = {};
26083+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26084+
__setModuleDefault(result, mod);
26085+
return result;
26086+
};
2606826087
var __importDefault = (this && this.__importDefault) || function (mod) {
2606926088
return (mod && mod.__esModule) ? mod : { "default": mod };
2607026089
};
2607126090
Object.defineProperty(exports, "__esModule", ({ value: true }));
26072-
exports.issueIsClosed = exports.issueExists = exports.exitWithReason = exports.shouldIgnore = exports.createIssue = exports.issueBody = exports.issueTitle = void 0;
26091+
exports.readIgnoreFiles = exports.issueIsClosed = exports.issueExists = exports.exitWithReason = exports.shouldIgnore = exports.createIssue = exports.issueBody = exports.issueTitle = void 0;
2607326092
const core_1 = __webpack_require__(2186);
2607426093
const github_1 = __webpack_require__(5438);
2607526094
const ignore_1 = __importDefault(__webpack_require__(1230));
26095+
const fs = __importStar(__webpack_require__(5747));
26096+
const path = __importStar(__webpack_require__(5622));
2607626097
let client;
2607726098
const getClient = () => client || (client = new github_1.GitHub(core_1.getInput('token')));
2607826099
exports.issueTitle = (upstreamReference) => `upstream reference closed: ${upstreamReference}`;
26079-
exports.issueBody = (upstreamReference, type, thisOwner, thisRepo, foundIn) => `The upstream [${type}](https://${upstreamReference}) got closed. It is referenced in: ${foundIn.map(([file, line]) => `[${file}#L${line}](https://github.com/${thisOwner}/${thisRepo}/blob/master/${file}#L${line})`)}`;
26100+
exports.issueBody = (upstreamReference, type, thisOwner, thisRepo, foundIn) => `The upstream [${type}](https://${upstreamReference}) got closed. It is referenced in:
26101+
- [ ] ${foundIn
26102+
.map(([file, line]) => `[${file}#L${line}](https://github.com/${thisOwner}/${thisRepo}/blob/master/${file}#L${line})`)
26103+
.join('\n- [ ] ')}`;
2608026104
exports.createIssue = (params) => getClient()
2608126105
.issues.create(params)
2608226106
.then(() => Promise.resolve());
@@ -26109,6 +26133,10 @@ exports.issueIsClosed = (reference) => {
2610926133
})
2611026134
.then((issue) => issue.data.state === 'closed');
2611126135
};
26136+
exports.readIgnoreFiles = (dir = '.') => Promise.allSettled(['.reference-ignore', '.gitignore'].map((fn) => fs.promises.readFile(path.join(dir, fn)))).then((files) => files
26137+
.filter((file) => file.status === 'fulfilled')
26138+
.map((fulFilled) => fulFilled.value.toString().split('\n'))
26139+
.flat(1));
2611226140
exports.default = {
2611326141
issueExists: exports.issueExists,
2611426142
exitWithReason: exports.exitWithReason,
@@ -26146,7 +26174,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2614626174
Object.defineProperty(exports, "__esModule", ({ value: true }));
2614726175
const walkdir_1 = __importDefault(__webpack_require__(5200));
2614826176
const path_1 = __importDefault(__webpack_require__(5622));
26149-
const referenceRegex = /github\.com\/([a-zA-Z\d-]+)\/([a-zA-Z\d.-_]+)\/(pull|issues)\/(\d+)/gm;
26177+
const referenceRegex = /github\.com\/([a-zA-Z\d-]+)\/([a-zA-Z\d._-]+)\/(pull|issues)\/(\d+)/gm;
2615026178
const mainRunner = ({ shouldIgnore, exitWithReason, issueTitle, createIssue, issueExists, labels, thisOwner, thisRepo, readFile, ignorePaths, issueIsClosed, directory, issueBody, issueLimit }) => walkdir_1.default.async(directory, { return_object: true }).then((files) => Promise.all(Object.entries(files).reduce((allIssues, [filePath, stats]) => stats.isDirectory() ||
2615126179
shouldIgnore(ignorePaths, path_1.default.relative(directory, filePath))
2615226180
? allIssues
@@ -26217,13 +26245,32 @@ exports.default = mainRunner;
2621726245
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2621826246
// See the License for the specific language governing permissions and
2621926247
// limitations under the License.
26248+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26249+
if (k2 === undefined) k2 = k;
26250+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
26251+
}) : (function(o, m, k, k2) {
26252+
if (k2 === undefined) k2 = k;
26253+
o[k2] = m[k];
26254+
}));
26255+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26256+
Object.defineProperty(o, "default", { enumerable: true, value: v });
26257+
}) : function(o, v) {
26258+
o["default"] = v;
26259+
});
26260+
var __importStar = (this && this.__importStar) || function (mod) {
26261+
if (mod && mod.__esModule) return mod;
26262+
var result = {};
26263+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26264+
__setModuleDefault(result, mod);
26265+
return result;
26266+
};
2622026267
var __importDefault = (this && this.__importDefault) || function (mod) {
2622126268
return (mod && mod.__esModule) ? mod : { "default": mod };
2622226269
};
2622326270
Object.defineProperty(exports, "__esModule", ({ value: true }));
2622426271
const core_1 = __webpack_require__(2186);
2622526272
const fs_1 = __importDefault(__webpack_require__(5747));
26226-
const helpers_1 = __importDefault(__webpack_require__(3015));
26273+
const helpers_1 = __importStar(__webpack_require__(3015));
2622726274
const mainRunner_1 = __importDefault(__webpack_require__(2765));
2622826275
const [thisOwner, thisRepo] = process.env.GITHUB_REPOSITORY.split('/', 2);
2622926276
(async () => {
@@ -26233,7 +26280,10 @@ const [thisOwner, thisRepo] = process.env.GITHUB_REPOSITORY.split('/', 2);
2623326280
thisOwner,
2623426281
thisRepo,
2623526282
labels: core_1.getInput('issueLabels').split(','),
26236-
ignorePaths: core_1.getInput('ignore').split(','),
26283+
ignorePaths: [
26284+
...core_1.getInput('ignore').split(','),
26285+
...(await helpers_1.readIgnoreFiles())
26286+
],
2623726287
directory: '.',
2623826288
issueLimit: parseInt(core_1.getInput('issueLimit')) || 5
2623926289
});

distCli/index.js

+43-29
Original file line numberDiff line numberDiff line change
@@ -26076,18 +26076,43 @@ function wrappy (fn, cb) {
2607626076
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2607726077
// See the License for the specific language governing permissions and
2607826078
// limitations under the License.
26079+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26080+
if (k2 === undefined) k2 = k;
26081+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
26082+
}) : (function(o, m, k, k2) {
26083+
if (k2 === undefined) k2 = k;
26084+
o[k2] = m[k];
26085+
}));
26086+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26087+
Object.defineProperty(o, "default", { enumerable: true, value: v });
26088+
}) : function(o, v) {
26089+
o["default"] = v;
26090+
});
26091+
var __importStar = (this && this.__importStar) || function (mod) {
26092+
if (mod && mod.__esModule) return mod;
26093+
var result = {};
26094+
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26095+
__setModuleDefault(result, mod);
26096+
return result;
26097+
};
2607926098
var __importDefault = (this && this.__importDefault) || function (mod) {
2608026099
return (mod && mod.__esModule) ? mod : { "default": mod };
2608126100
};
2608226101
Object.defineProperty(exports, "__esModule", ({ value: true }));
26083-
exports.issueIsClosed = exports.issueExists = exports.exitWithReason = exports.shouldIgnore = exports.createIssue = exports.issueBody = exports.issueTitle = void 0;
26102+
exports.readIgnoreFiles = exports.issueIsClosed = exports.issueExists = exports.exitWithReason = exports.shouldIgnore = exports.createIssue = exports.issueBody = exports.issueTitle = void 0;
2608426103
const core_1 = __webpack_require__(2186);
2608526104
const github_1 = __webpack_require__(5438);
2608626105
const ignore_1 = __importDefault(__webpack_require__(1230));
26106+
const fs = __importStar(__webpack_require__(5747));
26107+
const path = __importStar(__webpack_require__(5622));
2608726108
let client;
2608826109
const getClient = () => client || (client = new github_1.GitHub(core_1.getInput('token')));
2608926110
exports.issueTitle = (upstreamReference) => `upstream reference closed: ${upstreamReference}`;
26090-
exports.issueBody = (upstreamReference, type, thisOwner, thisRepo, foundIn) => `The upstream [${type}](https://${upstreamReference}) got closed. It is referenced in: ${foundIn.map(([file, line]) => `[${file}#L${line}](https://github.com/${thisOwner}/${thisRepo}/blob/master/${file}#L${line})`)}`;
26111+
exports.issueBody = (upstreamReference, type, thisOwner, thisRepo, foundIn) => `The upstream [${type}](https://${upstreamReference}) got closed. It is referenced in:
26112+
- [ ] ${foundIn
26113+
.map(([file, line]) => `[${file}#L${line}](https://github.com/${thisOwner}/${thisRepo}/blob/master/${file}#L${line})`)
26114+
.join('
26115+
- [ ] ')}`;
2609126116
exports.createIssue = (params) => getClient()
2609226117
.issues.create(params)
2609326118
.then(() => Promise.resolve());
@@ -26122,6 +26147,11 @@ ${foundIn.map(([file, line]) => ` ${file}#${line}
2612226147
})
2612326148
.then((issue) => issue.data.state === 'closed');
2612426149
};
26150+
exports.readIgnoreFiles = (dir = '.') => Promise.allSettled(['.reference-ignore', '.gitignore'].map((fn) => fs.promises.readFile(path.join(dir, fn)))).then((files) => files
26151+
.filter((file) => file.status === 'fulfilled')
26152+
.map((fulFilled) => fulFilled.value.toString().split('
26153+
'))
26154+
.flat(1));
2612526155
exports.default = {
2612626156
issueExists: exports.issueExists,
2612726157
exitWithReason: exports.exitWithReason,
@@ -26159,7 +26189,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2615926189
Object.defineProperty(exports, "__esModule", ({ value: true }));
2616026190
const walkdir_1 = __importDefault(__webpack_require__(5200));
2616126191
const path_1 = __importDefault(__webpack_require__(5622));
26162-
const referenceRegex = /github\.com\/([a-zA-Z\d-]+)\/([a-zA-Z\d.-_]+)\/(pull|issues)\/(\d+)/gm;
26192+
const referenceRegex = /github\.com\/([a-zA-Z\d-]+)\/([a-zA-Z\d._-]+)\/(pull|issues)\/(\d+)/gm;
2616326193
const mainRunner = ({ shouldIgnore, exitWithReason, issueTitle, createIssue, issueExists, labels, thisOwner, thisRepo, readFile, ignorePaths, issueIsClosed, directory, issueBody, issueLimit }) => walkdir_1.default.async(directory, { return_object: true }).then((files) => Promise.all(Object.entries(files).reduce((allIssues, [filePath, stats]) => stats.isDirectory() ||
2616426194
shouldIgnore(ignorePaths, path_1.default.relative(directory, filePath))
2616526195
? allIssues
@@ -26218,41 +26248,23 @@ exports.default = mainRunner;
2621826248

2621926249
"use strict";
2622026250

26221-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26222-
if (k2 === undefined) k2 = k;
26223-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
26224-
}) : (function(o, m, k, k2) {
26225-
if (k2 === undefined) k2 = k;
26226-
o[k2] = m[k];
26227-
}));
26228-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26229-
Object.defineProperty(o, "default", { enumerable: true, value: v });
26230-
}) : function(o, v) {
26231-
o["default"] = v;
26232-
});
26233-
var __importStar = (this && this.__importStar) || function (mod) {
26234-
if (mod && mod.__esModule) return mod;
26235-
var result = {};
26236-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26237-
__setModuleDefault(result, mod);
26238-
return result;
26239-
};
2624026251
var __importDefault = (this && this.__importDefault) || function (mod) {
2624126252
return (mod && mod.__esModule) ? mod : { "default": mod };
2624226253
};
2624326254
Object.defineProperty(exports, "__esModule", ({ value: true }));
2624426255
const mainRunner_1 = __importDefault(__webpack_require__(2765));
2624526256
const helpers_1 = __webpack_require__(3015);
26246-
const fs = __importStar(__webpack_require__(5747));
26247-
switch (process.argv[2]) {
26257+
const fs_1 = __importDefault(__webpack_require__(5747));
26258+
const [dir = '-h', ignore = '.git'] = process.argv.slice(2);
26259+
switch (dir) {
2624826260
case '-help':
2624926261
case '-h':
2625026262
case '--help':
2625126263
console.log(`Usage:
2625226264
npx closed-reference-notifier <dir> <ignore>
2625326265

2625426266
<dir>: the directory to traverse
26255-
<ignore>: comma separated list of gitignore style entries to ignore
26267+
<ignore>: comma separated list of gitignore style entries to ignore, defaults to '.git'
2625626268
`);
2625726269
process.exit(0);
2625826270
}
@@ -26263,21 +26275,23 @@ npx closed-reference-notifier <dir> <ignore>
2626326275
thisOwner: '',
2626426276
issueExists: () => Promise.resolve(false),
2626526277
issueTitle: () => '',
26266-
issueBody: (ref, type, thisOwner, thisRepo, file) => `Found reference "${ref}" in file ${file}`,
26278+
issueBody: (ref, type, thisOwner, thisRepo, files) => `Found reference "${ref}" in files
26279+
${files.map((file) => file.join('#')).join('
26280+
')}`,
2626726281
issueIsClosed: () => Promise.resolve(true),
26268-
ignorePaths: process.argv[3] ? process.argv[3].split(',') : [],
26282+
ignorePaths: [...ignore.split(','), ...(await helpers_1.readIgnoreFiles(dir))],
2626926283
createIssue: (issue) => {
2627026284
console.log(issue.body);
2627126285
return Promise.resolve();
2627226286
},
2627326287
shouldIgnore: helpers_1.shouldIgnore,
26274-
directory: process.argv[2],
26288+
directory: dir,
2627526289
exitWithReason: (err) => {
2627626290
console.log('unexpected error:', err);
2627726291
process.exit(1);
2627826292
},
2627926293
labels: [],
26280-
readFile: fs.promises.readFile,
26294+
readFile: fs_1.default.promises.readFile,
2628126295
issueLimit: Number.POSITIVE_INFINITY
2628226296
});
2628326297
})();

0 commit comments

Comments
 (0)