@warpgogol/repo-extract 1.2.9 → 1.2.10
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/dist/fs/transform.d.ts.map +1 -1
- package/dist/fs/transform.js +28 -7
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/fs/transform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/fs/transform.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAkEf;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CA0Df;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,MAAM,EAAE,CAAC,CAOnB;AA2BD,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CA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aced hardcoded org-specific values with config-driven options (stripScopes, preservePackages, rootPackageName, customConditions, onlyBuiltDependencies, packageManager, gitignoreMode).</item>
|
|
12
12
|
<item>RFC-0072: Parameterized buildRootPackageJson, generateRootFiles, generateCiWorkflow, fixStandalonePackageJson for pnpm/npm/yarn support.</item>
|
|
13
13
|
<item>Fix: Split generateCiWorkflow into ci + publish jobs — publish only on push to main, with registry-url for NODE_AUTH_TOKEN.</item>
|
|
14
|
+
<item>RFC-1081: Added gh release create step after npm publish with --generate-notes and || true for tag collision. Updated publish job permissions to contents: write.</item>
|
|
14
15
|
</CHANGE_SUMMARY>
|
|
15
16
|
*/
|
|
16
17
|
import { readFile, writeFile, rm, access, readdir } from "node:fs/promises";
|
|
@@ -52,7 +53,11 @@ export async function transformPackageJson(dest, relPath, config, logger) {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
for (const depField of [
|
|
56
|
+
for (const depField of [
|
|
57
|
+
"dependencies",
|
|
58
|
+
"devDependencies",
|
|
59
|
+
"peerDependencies",
|
|
60
|
+
]) {
|
|
56
61
|
if (pkg[depField]) {
|
|
57
62
|
for (const key of Object.keys(pkg[depField])) {
|
|
58
63
|
const shouldStrip = stripScopes.some((scope) => key.startsWith(scope));
|
|
@@ -331,7 +336,8 @@ export async function generateRootFiles(dest, root, config, packageDirs, appDirs
|
|
|
331
336
|
.map((e) => ` - ${e}`),
|
|
332
337
|
"",
|
|
333
338
|
];
|
|
334
|
-
if (config.onlyBuiltDependencies &&
|
|
339
|
+
if (config.onlyBuiltDependencies &&
|
|
340
|
+
config.onlyBuiltDependencies.length > 0) {
|
|
335
341
|
workspaceYamlLines.push("onlyBuiltDependencies:");
|
|
336
342
|
for (const dep of config.onlyBuiltDependencies) {
|
|
337
343
|
workspaceYamlLines.push(` - '${dep}'`);
|
|
@@ -370,7 +376,10 @@ export async function generateRootFiles(dest, root, config, packageDirs, appDirs
|
|
|
370
376
|
/* no tsconfig.json at this level — skip */
|
|
371
377
|
}
|
|
372
378
|
}
|
|
373
|
-
const references = [
|
|
379
|
+
const references = [
|
|
380
|
+
...packageDirs.map((d) => ({ path: `./${d}` })),
|
|
381
|
+
...appRefs,
|
|
382
|
+
];
|
|
374
383
|
const tsconfig = {
|
|
375
384
|
extends: "./tsconfig.base.json",
|
|
376
385
|
compileOnSave: false,
|
|
@@ -464,15 +473,23 @@ export function generateCiWorkflow(pm, ci) {
|
|
|
464
473
|
...buildSteps,
|
|
465
474
|
];
|
|
466
475
|
if (publish) {
|
|
467
|
-
lines.push("", " publish:", " needs: ci", " if: github.event_name == 'push'", " runs-on: ubuntu-latest", " timeout-minutes: 10", " permissions:", " contents:
|
|
476
|
+
lines.push("", " publish:", " needs: ci", " if: github.event_name == 'push'", " runs-on: ubuntu-latest", " timeout-minutes: 10", " permissions:", " contents: write", " id-token: write", " steps:", " - uses: actions/checkout@v5", ...pnpmSetup, " - uses: actions/setup-node@v5", " with:", ` node-version: ${nodeVersion}`, ` cache: ${cacheKey}`, " registry-url: https://registry.npmjs.org", ` - run: ${installCmd}`, ` - run: ${runPrefix} build`, " - run: npm publish --provenance --access public", " env:", " NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}", " - name: Create GitHub Release", " if: github.ref == 'refs/heads/main' && github.event_name == 'push'", " run: |", " VERSION=$(node -p \"require('./package.json').version\")", ' gh release create "v${VERSION}" \\', ' --title "v${VERSION}" \\', " --generate-notes \\", " --latest || true", " env:", " GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}");
|
|
468
477
|
}
|
|
469
478
|
if (ci?.deploy?.provider === "cloudflare-pages") {
|
|
470
479
|
const d = ci.deploy;
|
|
471
480
|
const envLines = [
|
|
472
|
-
" " +
|
|
481
|
+
" " +
|
|
482
|
+
d.apiTokenSecret +
|
|
483
|
+
": ${{ secrets." +
|
|
484
|
+
d.apiTokenSecret +
|
|
485
|
+
" }}",
|
|
473
486
|
];
|
|
474
487
|
if (d.accountIdSecret) {
|
|
475
|
-
envLines.push(" " +
|
|
488
|
+
envLines.push(" " +
|
|
489
|
+
d.accountIdSecret +
|
|
490
|
+
": ${{ secrets." +
|
|
491
|
+
d.accountIdSecret +
|
|
492
|
+
" }}");
|
|
476
493
|
}
|
|
477
494
|
lines.push("", " deploy:", " needs: ci", " if: github.event_name == 'push'", " runs-on: ubuntu-latest", " timeout-minutes: 15", " permissions:", " contents: read", " steps:", " - uses: actions/checkout@v5", ...pnpmSetup, " - uses: actions/setup-node@v5", " with:", ` node-version: ${nodeVersion}`, ` cache: ${cacheKey}`, ` - run: ${installCmd}`, ` - run: ${d.buildCommand}`, ` - run: npx wrangler deploy`, " working-directory: " + d.outputDir, " env:", ...envLines);
|
|
478
495
|
}
|
|
@@ -534,7 +551,11 @@ export async function fixStandalonePackageJson(dest, config, pm, root, logger) {
|
|
|
534
551
|
changed = true;
|
|
535
552
|
}
|
|
536
553
|
}
|
|
537
|
-
for (const depField of [
|
|
554
|
+
for (const depField of [
|
|
555
|
+
"dependencies",
|
|
556
|
+
"devDependencies",
|
|
557
|
+
"peerDependencies",
|
|
558
|
+
]) {
|
|
538
559
|
if (pkg[depField]) {
|
|
539
560
|
for (const key of Object.keys(pkg[depField])) {
|
|
540
561
|
if (depField === "peerDependencies") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warpgogol/repo-extract",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"description": "Extract apps and packages from a TurboRepo monorepo into standalone public repositories",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Andrii Syrokomskyi <andrii@syrokomskyi.com> (https://syrokomskyi.com)",
|