@rockclaver/sandcastle 0.8.0 → 0.8.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/README.md +2 -0
- package/dist/main.js +34 -18
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -705,6 +705,8 @@ npx @rockclaver/sandcastle init --profile js-ts
|
|
|
705
705
|
|
|
706
706
|
Profile names are de-duplicated while preserving first-occurrence order, and an unknown name fails fast with an error listing the valid profiles.
|
|
707
707
|
|
|
708
|
+
**Repository detection (advisory).** During init, Sandcastle does a shallow scan for stack signals — `package.json`/lockfiles (`js-ts`), `pubspec.yaml` (`flutter` or `dart`), and `go.mod` (`go`) — at the repo root **and** in any paths declared in `.gitmodules`, so signals living in a git submodule are still picked up. If your selected profiles don't match what was detected, init prints a warning and **continues anyway** — monorepos and custom layouts are valid, so detection never blocks scaffolding. It does not perform a full-tree walk, so signals nested in undeclared subdirectories won't be detected and may trigger an advisory mismatch warning.
|
|
709
|
+
|
|
708
710
|
**Generated guidance files.** Each selected profile scaffolds a guidance markdown file plus a metadata file under `.sandcastle/profiles/`:
|
|
709
711
|
|
|
710
712
|
```
|
package/dist/main.js
CHANGED
|
@@ -18478,27 +18478,43 @@ var readOptionalFile = (repoDir, file4) => Effect_exports.gen(function* () {
|
|
|
18478
18478
|
return yield* fs.readFileString(path2).pipe(Effect_exports.orElseSucceed(() => void 0));
|
|
18479
18479
|
});
|
|
18480
18480
|
var hasFlutterMarkers = (pubspec) => /^\s*sdk:\s*flutter\s*$/m.test(pubspec) || /^flutter:\s*$/m.test(pubspec);
|
|
18481
|
-
var
|
|
18482
|
-
const
|
|
18483
|
-
const
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
concurrency: "unbounded"
|
|
18487
|
-
}
|
|
18488
|
-
)).some(Boolean);
|
|
18489
|
-
if (hasJsSignal) {
|
|
18490
|
-
detected.push(getProfile("js-ts"));
|
|
18481
|
+
var parseSubmodulePaths = (gitmodules) => {
|
|
18482
|
+
const paths = [];
|
|
18483
|
+
for (const line4 of gitmodules.split("\n")) {
|
|
18484
|
+
const match6 = /^\s*path\s*=\s*(.+?)\s*$/.exec(line4);
|
|
18485
|
+
if (match6?.[1]) paths.push(match6[1]);
|
|
18491
18486
|
}
|
|
18492
|
-
|
|
18487
|
+
return paths;
|
|
18488
|
+
};
|
|
18489
|
+
var detectProfilesInDir = (dir) => Effect_exports.gen(function* () {
|
|
18490
|
+
const names = [];
|
|
18491
|
+
const hasJsSignal = (yield* hasFile(dir, "package.json")) || (yield* Effect_exports.all(
|
|
18492
|
+
LOCKFILES.map(([file4]) => hasFile(dir, file4)),
|
|
18493
|
+
{ concurrency: "unbounded" }
|
|
18494
|
+
)).some(Boolean);
|
|
18495
|
+
if (hasJsSignal) names.push("js-ts");
|
|
18496
|
+
const pubspec = yield* readOptionalFile(dir, "pubspec.yaml");
|
|
18493
18497
|
if (pubspec !== void 0) {
|
|
18494
|
-
|
|
18495
|
-
getProfile(hasFlutterMarkers(pubspec) ? "flutter" : "dart")
|
|
18496
|
-
);
|
|
18498
|
+
names.push(hasFlutterMarkers(pubspec) ? "flutter" : "dart");
|
|
18497
18499
|
}
|
|
18498
|
-
if (yield* hasFile(
|
|
18499
|
-
|
|
18500
|
+
if (yield* hasFile(dir, "go.mod")) names.push("go");
|
|
18501
|
+
return names;
|
|
18502
|
+
});
|
|
18503
|
+
var detectRepositoryProfiles = (repoDir) => Effect_exports.gen(function* () {
|
|
18504
|
+
const gitmodules = yield* readOptionalFile(repoDir, ".gitmodules");
|
|
18505
|
+
const submodulePaths = gitmodules === void 0 ? [] : parseSubmodulePaths(gitmodules);
|
|
18506
|
+
const searchDirs = [
|
|
18507
|
+
repoDir,
|
|
18508
|
+
...submodulePaths.map((p3) => join(repoDir, p3))
|
|
18509
|
+
];
|
|
18510
|
+
const found = /* @__PURE__ */ new Set();
|
|
18511
|
+
for (const dir of searchDirs) {
|
|
18512
|
+
for (const name of yield* detectProfilesInDir(dir)) {
|
|
18513
|
+
found.add(name);
|
|
18514
|
+
}
|
|
18500
18515
|
}
|
|
18501
|
-
|
|
18516
|
+
const profiles = listProfiles().filter((p3) => found.has(p3.name));
|
|
18517
|
+
return { profiles };
|
|
18502
18518
|
});
|
|
18503
18519
|
var getProfileMismatchWarning = (selectedProfiles, detection) => {
|
|
18504
18520
|
if (detection.profiles.length === 0) return void 0;
|
|
@@ -18909,7 +18925,7 @@ var scaffold = (repoDir, options3) => Effect_exports.gen(function* () {
|
|
|
18909
18925
|
yield* rewriteProfileReferences(configDir, selectedProfiles, mainFilename);
|
|
18910
18926
|
return { mainFilename };
|
|
18911
18927
|
});
|
|
18912
|
-
var VERSION = "0.8.
|
|
18928
|
+
var VERSION = "0.8.1" ;
|
|
18913
18929
|
|
|
18914
18930
|
// src/cli.ts
|
|
18915
18931
|
var imageNameOption = Options_exports.text("image-name").pipe(
|