@blue-labs/repository-generator 4.1.1 → 5.0.0-rc.0
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 +6 -0
- package/dist/bin/blue-repo-generator.js +1 -1
- package/dist/bin/blue-repo-generator.mjs +1 -1
- package/dist/{generateRepository-B7eem2l_.mjs → generateRepository-BIy5RMGX.mjs} +370 -311
- package/dist/generateRepository-n6pGl-dC.js +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/core/ExpressionPreserver.d.ts +1 -1
- package/dist/lib/core/blueIds.d.ts +1 -1
- package/dist/lib/core/blueIds.d.ts.map +1 -1
- package/dist/lib/core/builtinRuntimeTypes.d.ts +2 -0
- package/dist/lib/core/builtinRuntimeTypes.d.ts.map +1 -0
- package/dist/lib/core/constants.d.ts +3 -1
- package/dist/lib/core/constants.d.ts.map +1 -1
- package/dist/lib/core/discovery.d.ts.map +1 -1
- package/dist/lib/core/internalTypes.d.ts +1 -1
- package/dist/lib/core/mergingProcessor.d.ts +1 -1
- package/dist/lib/core/repoDoc.d.ts.map +1 -1
- package/dist/lib/core/repositoryContent.d.ts +5 -0
- package/dist/lib/core/repositoryContent.d.ts.map +1 -0
- package/dist/lib/core/utils.d.ts +1 -1
- package/dist/lib/core/versions.d.ts.map +1 -1
- package/dist/lib/generateRepository.d.ts.map +1 -1
- package/dist/lib/types.d.ts +2 -2
- package/package.json +4 -4
- package/dist/generateRepository-DUT9zf8k.js +0 -1
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Generate (or check) a `BlueRepository.blue` file from a set of package folders containing `.blue` and `.dev.blue` definitions. It replaces inline type references with BlueIds, computes type-level and repo-level BlueIds, and enforces versioning/lifecycle rules.
|
|
4
4
|
|
|
5
|
+
## Blue JS 5 compatibility
|
|
6
|
+
|
|
7
|
+
Blue JS 5 expects BEX-compatible repository definitions and generated
|
|
8
|
+
repository type packages. Release consumers should use
|
|
9
|
+
`@blue-repository/types` 2.x with Blue JS 5 packages.
|
|
10
|
+
|
|
5
11
|
## Usage
|
|
6
12
|
|
|
7
13
|
### CLI
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const c=require("fs"),a=require("path"),f=require("../generateRepository-
|
|
2
|
+
"use strict";const c=require("fs"),a=require("path"),f=require("../generateRepository-n6pGl-dC.js");function u(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const l=u(c),i=u(a);function d(e){const o={repoRoot:process.cwd(),blueRepository:"BlueRepository.blue",verbose:!1,json:!1,failOnDiff:!0};for(let t=0;t<e.length;t++){const r=e[t];switch(r){case"--repo-root":o.repoRoot=e[++t];break;case"--blue-repository":o.blueRepository=e[++t];break;case"--mode":o.mode=e[++t];break;case"--verbose":o.verbose=!0;break;case"--json":o.json=!0;break;case"--allow-diff":o.failOnDiff=!1;break;default:throw new Error(`Unknown argument: ${r}`)}}if(!o.mode||o.mode!=="check"&&o.mode!=="write")throw new Error('Missing or invalid --mode (expected "check" or "write").');return o}function s(e,o){e&&console.log(JSON.stringify(o,null,2))}function p(){try{const e=d(process.argv.slice(2)),o=i.resolve(e.repoRoot),t=i.resolve(o,e.blueRepository),r=f.generateRepository({repoRoot:o,blueRepositoryPath:t,verbose:e.verbose}),n=r.existingYaml!==void 0&&r.existingYaml===r.yaml;if(e.mode==="check"){if(!r.existingYaml){if(s(e.json,{repoBlueId:r.currentRepoBlueId,changed:!0,reason:"BlueRepository.blue is missing."}),e.failOnDiff)throw new Error("BlueRepository.blue is missing. Run with --mode write to create it.");console.warn("BlueRepository.blue is missing. Run with --mode write.");return}if(!n){if(s(e.json,{repoBlueId:r.currentRepoBlueId,changed:!0,reason:"BlueRepository.blue is out of date."}),e.failOnDiff)throw new Error("BlueRepository.blue is out of date. Run with --mode write.");console.warn("BlueRepository.blue is out of date. Run with --mode write.");return}console.log("BlueRepository.blue is up to date."),s(e.json,{repoBlueId:r.currentRepoBlueId,changed:!1});return}if(!r.existingYaml||r.changed)l.mkdirSync(i.dirname(t),{recursive:!0}),l.writeFileSync(t,r.yaml,"utf8"),e.verbose&&console.info(`Wrote BlueRepository.blue with RepoBlueId ${r.currentRepoBlueId}`);else if(n)e.verbose&&console.info("No changes detected; BlueRepository.blue left untouched.");else throw new Error("RepoBlueId is unchanged but BlueRepository.blue differs. Please revert manual edits or regenerate from a clean state.");console.log(r.currentRepoBlueId),s(e.json,{repoBlueId:r.currentRepoBlueId,changed:r.changed||!n})}catch(e){const o=e instanceof Error?e.message:"Unknown error encountered.";console.error(o),process.exit(1)}}p();
|