@icebreakers/monorepo 0.1.0 → 0.1.2
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/README.md +2 -0
- package/dist/{chunk-J3MNI6VD.js → chunk-LKAY3H44.js} +8 -94
- package/dist/cli.cjs +16 -90
- package/dist/cli.js +12 -2
- package/dist/index.cjs +7 -89
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -4,16 +4,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
7
|
var __esm = (fn, res) => function __init() {
|
|
14
8
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
9
|
};
|
|
16
|
-
var __commonJS = (cb, mod) => function
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
17
11
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
12
|
};
|
|
19
13
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -309,85 +303,6 @@ var require_set_value = __commonJS({
|
|
|
309
303
|
}
|
|
310
304
|
});
|
|
311
305
|
|
|
312
|
-
// ../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js
|
|
313
|
-
var require_src = __commonJS({
|
|
314
|
-
"../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js"(exports, module) {
|
|
315
|
-
"use strict";
|
|
316
|
-
init_esm_shims();
|
|
317
|
-
var { strictEqual } = __require("assert");
|
|
318
|
-
var path2 = __require("path");
|
|
319
|
-
var fs2 = __require("fs");
|
|
320
|
-
var { Readable } = __require("stream");
|
|
321
|
-
var { fileURLToPath: fileURLToPath2 } = __require("url");
|
|
322
|
-
var Walker = class extends Readable {
|
|
323
|
-
/**
|
|
324
|
-
* @param {string} dir
|
|
325
|
-
* @param {Object} options
|
|
326
|
-
*/
|
|
327
|
-
constructor(dir, options) {
|
|
328
|
-
if (dir instanceof URL) {
|
|
329
|
-
dir = fileURLToPath2(dir);
|
|
330
|
-
}
|
|
331
|
-
strictEqual(typeof dir, "string", "`dir` parameter should be of type string or file URL. Got type: " + typeof dir);
|
|
332
|
-
options = {
|
|
333
|
-
queueMethod: "shift",
|
|
334
|
-
pathSorter: void 0,
|
|
335
|
-
filter: void 0,
|
|
336
|
-
depthLimit: void 0,
|
|
337
|
-
preserveSymlinks: false,
|
|
338
|
-
...options,
|
|
339
|
-
objectMode: true
|
|
340
|
-
};
|
|
341
|
-
super(options);
|
|
342
|
-
this.root = path2.resolve(dir);
|
|
343
|
-
this.paths = [this.root];
|
|
344
|
-
this.options = options;
|
|
345
|
-
if (options.depthLimit > -1) {
|
|
346
|
-
this.rootDepth = this.root.split(path2.sep).length + 1;
|
|
347
|
-
}
|
|
348
|
-
this.fs = options.fs || fs2;
|
|
349
|
-
}
|
|
350
|
-
_read() {
|
|
351
|
-
if (this.paths.length === 0) {
|
|
352
|
-
return this.push(null);
|
|
353
|
-
}
|
|
354
|
-
const pathItem = this.paths[this.options.queueMethod]();
|
|
355
|
-
const statFunction = this.options.preserveSymlinks ? this.fs.lstat : this.fs.stat;
|
|
356
|
-
statFunction(pathItem, (err, stats) => {
|
|
357
|
-
const item = { path: pathItem, stats };
|
|
358
|
-
if (err) {
|
|
359
|
-
return this.emit("error", err, item);
|
|
360
|
-
}
|
|
361
|
-
if (!stats.isDirectory() || this.rootDepth && pathItem.split(path2.sep).length - this.rootDepth >= this.options.depthLimit) {
|
|
362
|
-
return this.push(item);
|
|
363
|
-
}
|
|
364
|
-
this.fs.readdir(pathItem, (err2, pathItems) => {
|
|
365
|
-
if (err2) {
|
|
366
|
-
this.push(item);
|
|
367
|
-
return this.emit("error", err2, item);
|
|
368
|
-
}
|
|
369
|
-
pathItems = pathItems.map(function(part) {
|
|
370
|
-
return path2.join(pathItem, part);
|
|
371
|
-
});
|
|
372
|
-
if (this.options.filter) {
|
|
373
|
-
pathItems = pathItems.filter(this.options.filter);
|
|
374
|
-
}
|
|
375
|
-
if (this.options.pathSorter) {
|
|
376
|
-
pathItems.sort(this.options.pathSorter);
|
|
377
|
-
}
|
|
378
|
-
this.paths.push.apply(this.paths, pathItems);
|
|
379
|
-
this.push(item);
|
|
380
|
-
});
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
function walk(root, options) {
|
|
385
|
-
return new Walker(root, options);
|
|
386
|
-
}
|
|
387
|
-
module.exports = walk;
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
|
|
391
306
|
// src/index.ts
|
|
392
307
|
init_esm_shims();
|
|
393
308
|
|
|
@@ -395,11 +310,10 @@ init_esm_shims();
|
|
|
395
310
|
init_esm_shims();
|
|
396
311
|
var import_get_value2 = __toESM(require_get_value(), 1);
|
|
397
312
|
var import_set_value = __toESM(require_set_value(), 1);
|
|
398
|
-
var import_klaw = __toESM(require_src(), 1);
|
|
399
|
-
import { fileURLToPath } from "node:url";
|
|
400
313
|
import process from "node:process";
|
|
401
314
|
import path from "pathe";
|
|
402
315
|
import fs from "fs-extra";
|
|
316
|
+
import klaw from "klaw";
|
|
403
317
|
|
|
404
318
|
// src/git.ts
|
|
405
319
|
init_esm_shims();
|
|
@@ -425,17 +339,16 @@ var GitClient = class {
|
|
|
425
339
|
};
|
|
426
340
|
|
|
427
341
|
// src/lib.ts
|
|
428
|
-
var
|
|
429
|
-
var __dirname2 = path.dirname(__filename2);
|
|
430
|
-
var assetsDir = path.join(__dirname2, "../assets");
|
|
342
|
+
var assetsDir = path.join(import.meta.dirname, "../assets");
|
|
431
343
|
var cwd = process.cwd();
|
|
432
|
-
async function main(
|
|
433
|
-
const
|
|
344
|
+
async function main(opts) {
|
|
345
|
+
const { outDir = "" } = opts;
|
|
346
|
+
const absOutDir = path.isAbsolute(outDir) ? outDir : path.join(cwd, outDir);
|
|
434
347
|
const gitClient = new GitClient({
|
|
435
348
|
baseDir: cwd
|
|
436
349
|
});
|
|
437
350
|
const repoName = await gitClient.getRepoName();
|
|
438
|
-
for await (const file of (
|
|
351
|
+
for await (const file of klaw(assetsDir)) {
|
|
439
352
|
if (file.stats.isFile()) {
|
|
440
353
|
const relPath = path.relative(assetsDir, file.path);
|
|
441
354
|
const targetPath = path.resolve(absOutDir, relPath);
|
|
@@ -459,6 +372,7 @@ async function main(outdir = "") {
|
|
|
459
372
|
} else if (relPath === ".changeset/config.json" && repoName && await fs.exists(file.path)) {
|
|
460
373
|
const changesetJson = await fs.readJson(file.path);
|
|
461
374
|
(0, import_set_value.default)(changesetJson, "changelog.1.repo", repoName);
|
|
375
|
+
await fs.ensureDir(path.dirname(targetPath));
|
|
462
376
|
await fs.writeJson(targetPath, changesetJson, {
|
|
463
377
|
spaces: 2
|
|
464
378
|
});
|
package/dist/cli.cjs
CHANGED
|
@@ -29,12 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
));
|
|
30
30
|
|
|
31
31
|
// ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
|
|
32
|
-
var getImportMetaUrl, importMetaUrl;
|
|
33
32
|
var init_cjs_shims = __esm({
|
|
34
33
|
"../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
|
|
35
34
|
"use strict";
|
|
36
|
-
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
37
|
-
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
38
35
|
}
|
|
39
36
|
});
|
|
40
37
|
|
|
@@ -307,97 +304,22 @@ var require_set_value = __commonJS({
|
|
|
307
304
|
}
|
|
308
305
|
});
|
|
309
306
|
|
|
310
|
-
// ../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js
|
|
311
|
-
var require_src = __commonJS({
|
|
312
|
-
"../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js"(exports2, module2) {
|
|
313
|
-
"use strict";
|
|
314
|
-
init_cjs_shims();
|
|
315
|
-
var { strictEqual } = require("assert");
|
|
316
|
-
var path2 = require("path");
|
|
317
|
-
var fs2 = require("fs");
|
|
318
|
-
var { Readable } = require("stream");
|
|
319
|
-
var { fileURLToPath: fileURLToPath2 } = require("url");
|
|
320
|
-
var Walker = class extends Readable {
|
|
321
|
-
/**
|
|
322
|
-
* @param {string} dir
|
|
323
|
-
* @param {Object} options
|
|
324
|
-
*/
|
|
325
|
-
constructor(dir, options) {
|
|
326
|
-
if (dir instanceof URL) {
|
|
327
|
-
dir = fileURLToPath2(dir);
|
|
328
|
-
}
|
|
329
|
-
strictEqual(typeof dir, "string", "`dir` parameter should be of type string or file URL. Got type: " + typeof dir);
|
|
330
|
-
options = {
|
|
331
|
-
queueMethod: "shift",
|
|
332
|
-
pathSorter: void 0,
|
|
333
|
-
filter: void 0,
|
|
334
|
-
depthLimit: void 0,
|
|
335
|
-
preserveSymlinks: false,
|
|
336
|
-
...options,
|
|
337
|
-
objectMode: true
|
|
338
|
-
};
|
|
339
|
-
super(options);
|
|
340
|
-
this.root = path2.resolve(dir);
|
|
341
|
-
this.paths = [this.root];
|
|
342
|
-
this.options = options;
|
|
343
|
-
if (options.depthLimit > -1) {
|
|
344
|
-
this.rootDepth = this.root.split(path2.sep).length + 1;
|
|
345
|
-
}
|
|
346
|
-
this.fs = options.fs || fs2;
|
|
347
|
-
}
|
|
348
|
-
_read() {
|
|
349
|
-
if (this.paths.length === 0) {
|
|
350
|
-
return this.push(null);
|
|
351
|
-
}
|
|
352
|
-
const pathItem = this.paths[this.options.queueMethod]();
|
|
353
|
-
const statFunction = this.options.preserveSymlinks ? this.fs.lstat : this.fs.stat;
|
|
354
|
-
statFunction(pathItem, (err, stats) => {
|
|
355
|
-
const item = { path: pathItem, stats };
|
|
356
|
-
if (err) {
|
|
357
|
-
return this.emit("error", err, item);
|
|
358
|
-
}
|
|
359
|
-
if (!stats.isDirectory() || this.rootDepth && pathItem.split(path2.sep).length - this.rootDepth >= this.options.depthLimit) {
|
|
360
|
-
return this.push(item);
|
|
361
|
-
}
|
|
362
|
-
this.fs.readdir(pathItem, (err2, pathItems) => {
|
|
363
|
-
if (err2) {
|
|
364
|
-
this.push(item);
|
|
365
|
-
return this.emit("error", err2, item);
|
|
366
|
-
}
|
|
367
|
-
pathItems = pathItems.map(function(part) {
|
|
368
|
-
return path2.join(pathItem, part);
|
|
369
|
-
});
|
|
370
|
-
if (this.options.filter) {
|
|
371
|
-
pathItems = pathItems.filter(this.options.filter);
|
|
372
|
-
}
|
|
373
|
-
if (this.options.pathSorter) {
|
|
374
|
-
pathItems.sort(this.options.pathSorter);
|
|
375
|
-
}
|
|
376
|
-
this.paths.push.apply(this.paths, pathItems);
|
|
377
|
-
this.push(item);
|
|
378
|
-
});
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
function walk(root, options) {
|
|
383
|
-
return new Walker(root, options);
|
|
384
|
-
}
|
|
385
|
-
module2.exports = walk;
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
|
|
389
307
|
// src/cli.ts
|
|
390
308
|
init_cjs_shims();
|
|
309
|
+
var import_commander = require("commander");
|
|
310
|
+
|
|
311
|
+
// package.json
|
|
312
|
+
var name = "@icebreakers/monorepo";
|
|
313
|
+
var version = "0.1.2";
|
|
391
314
|
|
|
392
315
|
// src/lib.ts
|
|
393
316
|
init_cjs_shims();
|
|
394
|
-
var import_node_url = require("url");
|
|
395
317
|
var import_node_process = __toESM(require("process"), 1);
|
|
396
318
|
var import_pathe = __toESM(require("pathe"), 1);
|
|
397
319
|
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
398
320
|
var import_get_value2 = __toESM(require_get_value(), 1);
|
|
399
321
|
var import_set_value = __toESM(require_set_value(), 1);
|
|
400
|
-
var import_klaw = __toESM(
|
|
322
|
+
var import_klaw = __toESM(require("klaw"), 1);
|
|
401
323
|
|
|
402
324
|
// src/git.ts
|
|
403
325
|
init_cjs_shims();
|
|
@@ -423,12 +345,12 @@ var GitClient = class {
|
|
|
423
345
|
};
|
|
424
346
|
|
|
425
347
|
// src/lib.ts
|
|
426
|
-
var
|
|
427
|
-
var
|
|
428
|
-
var assetsDir = import_pathe.default.join(__dirname, "../assets");
|
|
348
|
+
var import_meta = {};
|
|
349
|
+
var assetsDir = import_pathe.default.join(import_meta.dirname, "../assets");
|
|
429
350
|
var cwd = import_node_process.default.cwd();
|
|
430
|
-
async function main(
|
|
431
|
-
const
|
|
351
|
+
async function main(opts) {
|
|
352
|
+
const { outDir = "" } = opts;
|
|
353
|
+
const absOutDir = import_pathe.default.isAbsolute(outDir) ? outDir : import_pathe.default.join(cwd, outDir);
|
|
432
354
|
const gitClient = new GitClient({
|
|
433
355
|
baseDir: cwd
|
|
434
356
|
});
|
|
@@ -457,6 +379,7 @@ async function main(outdir = "") {
|
|
|
457
379
|
} else if (relPath === ".changeset/config.json" && repoName && await import_fs_extra.default.exists(file.path)) {
|
|
458
380
|
const changesetJson = await import_fs_extra.default.readJson(file.path);
|
|
459
381
|
(0, import_set_value.default)(changesetJson, "changelog.1.repo", repoName);
|
|
382
|
+
await import_fs_extra.default.ensureDir(import_pathe.default.dirname(targetPath));
|
|
460
383
|
await import_fs_extra.default.writeJson(targetPath, changesetJson, {
|
|
461
384
|
spaces: 2
|
|
462
385
|
});
|
|
@@ -471,9 +394,12 @@ async function main(outdir = "") {
|
|
|
471
394
|
}
|
|
472
395
|
|
|
473
396
|
// src/cli.ts
|
|
474
|
-
|
|
397
|
+
import_commander.program.name(name).version(version);
|
|
398
|
+
import_commander.program.option("-i,--interactive").option("--raw", "raw mode").option("--outDir <dir>", "Output directory").action(async (opts) => {
|
|
399
|
+
await main(opts);
|
|
475
400
|
console.log("upgrade @icebreakers/monorepo ok!");
|
|
476
401
|
});
|
|
402
|
+
import_commander.program.parse();
|
|
477
403
|
/*! Bundled license information:
|
|
478
404
|
|
|
479
405
|
isobject/index.js:
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_esm_shims,
|
|
3
3
|
main
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LKAY3H44.js";
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
init_esm_shims();
|
|
8
|
-
|
|
8
|
+
import { program } from "commander";
|
|
9
|
+
|
|
10
|
+
// package.json
|
|
11
|
+
var name = "@icebreakers/monorepo";
|
|
12
|
+
var version = "0.1.2";
|
|
13
|
+
|
|
14
|
+
// src/cli.ts
|
|
15
|
+
program.name(name).version(version);
|
|
16
|
+
program.option("-i,--interactive").option("--raw", "raw mode").option("--outDir <dir>", "Output directory").action(async (opts) => {
|
|
17
|
+
await main(opts);
|
|
9
18
|
console.log("upgrade @icebreakers/monorepo ok!");
|
|
10
19
|
});
|
|
20
|
+
program.parse();
|
package/dist/index.cjs
CHANGED
|
@@ -34,12 +34,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
35
|
|
|
36
36
|
// ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
|
|
37
|
-
var getImportMetaUrl, importMetaUrl;
|
|
38
37
|
var init_cjs_shims = __esm({
|
|
39
38
|
"../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
|
|
40
39
|
"use strict";
|
|
41
|
-
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
42
|
-
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
43
40
|
}
|
|
44
41
|
});
|
|
45
42
|
|
|
@@ -312,85 +309,6 @@ var require_set_value = __commonJS({
|
|
|
312
309
|
}
|
|
313
310
|
});
|
|
314
311
|
|
|
315
|
-
// ../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js
|
|
316
|
-
var require_src = __commonJS({
|
|
317
|
-
"../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js"(exports2, module2) {
|
|
318
|
-
"use strict";
|
|
319
|
-
init_cjs_shims();
|
|
320
|
-
var { strictEqual } = require("assert");
|
|
321
|
-
var path2 = require("path");
|
|
322
|
-
var fs2 = require("fs");
|
|
323
|
-
var { Readable } = require("stream");
|
|
324
|
-
var { fileURLToPath: fileURLToPath2 } = require("url");
|
|
325
|
-
var Walker = class extends Readable {
|
|
326
|
-
/**
|
|
327
|
-
* @param {string} dir
|
|
328
|
-
* @param {Object} options
|
|
329
|
-
*/
|
|
330
|
-
constructor(dir, options) {
|
|
331
|
-
if (dir instanceof URL) {
|
|
332
|
-
dir = fileURLToPath2(dir);
|
|
333
|
-
}
|
|
334
|
-
strictEqual(typeof dir, "string", "`dir` parameter should be of type string or file URL. Got type: " + typeof dir);
|
|
335
|
-
options = {
|
|
336
|
-
queueMethod: "shift",
|
|
337
|
-
pathSorter: void 0,
|
|
338
|
-
filter: void 0,
|
|
339
|
-
depthLimit: void 0,
|
|
340
|
-
preserveSymlinks: false,
|
|
341
|
-
...options,
|
|
342
|
-
objectMode: true
|
|
343
|
-
};
|
|
344
|
-
super(options);
|
|
345
|
-
this.root = path2.resolve(dir);
|
|
346
|
-
this.paths = [this.root];
|
|
347
|
-
this.options = options;
|
|
348
|
-
if (options.depthLimit > -1) {
|
|
349
|
-
this.rootDepth = this.root.split(path2.sep).length + 1;
|
|
350
|
-
}
|
|
351
|
-
this.fs = options.fs || fs2;
|
|
352
|
-
}
|
|
353
|
-
_read() {
|
|
354
|
-
if (this.paths.length === 0) {
|
|
355
|
-
return this.push(null);
|
|
356
|
-
}
|
|
357
|
-
const pathItem = this.paths[this.options.queueMethod]();
|
|
358
|
-
const statFunction = this.options.preserveSymlinks ? this.fs.lstat : this.fs.stat;
|
|
359
|
-
statFunction(pathItem, (err, stats) => {
|
|
360
|
-
const item = { path: pathItem, stats };
|
|
361
|
-
if (err) {
|
|
362
|
-
return this.emit("error", err, item);
|
|
363
|
-
}
|
|
364
|
-
if (!stats.isDirectory() || this.rootDepth && pathItem.split(path2.sep).length - this.rootDepth >= this.options.depthLimit) {
|
|
365
|
-
return this.push(item);
|
|
366
|
-
}
|
|
367
|
-
this.fs.readdir(pathItem, (err2, pathItems) => {
|
|
368
|
-
if (err2) {
|
|
369
|
-
this.push(item);
|
|
370
|
-
return this.emit("error", err2, item);
|
|
371
|
-
}
|
|
372
|
-
pathItems = pathItems.map(function(part) {
|
|
373
|
-
return path2.join(pathItem, part);
|
|
374
|
-
});
|
|
375
|
-
if (this.options.filter) {
|
|
376
|
-
pathItems = pathItems.filter(this.options.filter);
|
|
377
|
-
}
|
|
378
|
-
if (this.options.pathSorter) {
|
|
379
|
-
pathItems.sort(this.options.pathSorter);
|
|
380
|
-
}
|
|
381
|
-
this.paths.push.apply(this.paths, pathItems);
|
|
382
|
-
this.push(item);
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
function walk(root, options) {
|
|
388
|
-
return new Walker(root, options);
|
|
389
|
-
}
|
|
390
|
-
module2.exports = walk;
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
|
|
394
312
|
// src/index.ts
|
|
395
313
|
var src_exports = {};
|
|
396
314
|
__export(src_exports, {
|
|
@@ -401,13 +319,12 @@ init_cjs_shims();
|
|
|
401
319
|
|
|
402
320
|
// src/lib.ts
|
|
403
321
|
init_cjs_shims();
|
|
404
|
-
var import_node_url = require("url");
|
|
405
322
|
var import_node_process = __toESM(require("process"), 1);
|
|
406
323
|
var import_pathe = __toESM(require("pathe"), 1);
|
|
407
324
|
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
408
325
|
var import_get_value2 = __toESM(require_get_value(), 1);
|
|
409
326
|
var import_set_value = __toESM(require_set_value(), 1);
|
|
410
|
-
var import_klaw = __toESM(
|
|
327
|
+
var import_klaw = __toESM(require("klaw"), 1);
|
|
411
328
|
|
|
412
329
|
// src/git.ts
|
|
413
330
|
init_cjs_shims();
|
|
@@ -433,12 +350,12 @@ var GitClient = class {
|
|
|
433
350
|
};
|
|
434
351
|
|
|
435
352
|
// src/lib.ts
|
|
436
|
-
var
|
|
437
|
-
var
|
|
438
|
-
var assetsDir = import_pathe.default.join(__dirname, "../assets");
|
|
353
|
+
var import_meta = {};
|
|
354
|
+
var assetsDir = import_pathe.default.join(import_meta.dirname, "../assets");
|
|
439
355
|
var cwd = import_node_process.default.cwd();
|
|
440
|
-
async function main(
|
|
441
|
-
const
|
|
356
|
+
async function main(opts) {
|
|
357
|
+
const { outDir = "" } = opts;
|
|
358
|
+
const absOutDir = import_pathe.default.isAbsolute(outDir) ? outDir : import_pathe.default.join(cwd, outDir);
|
|
442
359
|
const gitClient = new GitClient({
|
|
443
360
|
baseDir: cwd
|
|
444
361
|
});
|
|
@@ -467,6 +384,7 @@ async function main(outdir = "") {
|
|
|
467
384
|
} else if (relPath === ".changeset/config.json" && repoName && await import_fs_extra.default.exists(file.path)) {
|
|
468
385
|
const changesetJson = await import_fs_extra.default.readJson(file.path);
|
|
469
386
|
(0, import_set_value.default)(changesetJson, "changelog.1.repo", repoName);
|
|
387
|
+
await import_fs_extra.default.ensureDir(import_pathe.default.dirname(targetPath));
|
|
470
388
|
await import_fs_extra.default.writeJson(targetPath, changesetJson, {
|
|
471
389
|
spaces: 2
|
|
472
390
|
});
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"description": "my monorepo config copyer",
|
|
6
6
|
"author": "sonofmagic",
|
|
7
7
|
"license": "MIT",
|
|
@@ -24,8 +24,10 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"commander": "^12.1.0",
|
|
27
28
|
"fs-extra": "^11.2.0",
|
|
28
29
|
"git-url-parse": "^14.1.0",
|
|
30
|
+
"klaw": "^4.1.0",
|
|
29
31
|
"pathe": "^1.1.2",
|
|
30
32
|
"simple-git": "^3.25.0"
|
|
31
33
|
},
|