@promptscript/cli 1.4.5 → 1.4.7
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 +18 -11
- package/index.js +248 -21
- package/package.json +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -94,17 +94,22 @@ Run `prs compile` and get correctly formatted output for every AI tool your team
|
|
|
94
94
|
|
|
95
95
|
## Commands
|
|
96
96
|
|
|
97
|
-
| Command | Description
|
|
98
|
-
| :---------------------- |
|
|
99
|
-
| `prs init` | Initialize project with auto-detection
|
|
100
|
-
| `prs compile` | Compile to target AI tool formats
|
|
101
|
-
| `prs compile -w` | Watch mode - recompile on changes
|
|
102
|
-
| `prs compile --dry-run` | Preview changes without writing files
|
|
103
|
-
| `prs validate` | Validate `.prs` files with detailed errors
|
|
104
|
-
| `prs diff` | Show diff between source and compiled output
|
|
105
|
-
| `prs import` | Import existing AI instruction files to .prs
|
|
106
|
-
| `prs
|
|
107
|
-
| `prs
|
|
97
|
+
| Command | Description |
|
|
98
|
+
| :---------------------- | :-------------------------------------------- |
|
|
99
|
+
| `prs init` | Initialize project with auto-detection |
|
|
100
|
+
| `prs compile` | Compile to target AI tool formats |
|
|
101
|
+
| `prs compile -w` | Watch mode - recompile on changes |
|
|
102
|
+
| `prs compile --dry-run` | Preview changes without writing files |
|
|
103
|
+
| `prs validate` | Validate `.prs` files with detailed errors |
|
|
104
|
+
| `prs diff` | Show diff between source and compiled output |
|
|
105
|
+
| `prs import` | Import existing AI instruction files to .prs |
|
|
106
|
+
| `prs check` | Check configuration and dependencies health |
|
|
107
|
+
| `prs serve` | Start local development server for playground |
|
|
108
|
+
| `prs registry init` | Create a new PromptScript registry |
|
|
109
|
+
| `prs registry validate` | Validate registry structure and manifest |
|
|
110
|
+
| `prs registry publish` | Publish registry to remote |
|
|
111
|
+
| `prs pull` | Pull updates from registry |
|
|
112
|
+
| `prs update-check` | Check for newer CLI versions |
|
|
108
113
|
|
|
109
114
|
## Key Features
|
|
110
115
|
|
|
@@ -193,6 +198,8 @@ Options:
|
|
|
193
198
|
--dry-run Preview changes without writing files
|
|
194
199
|
--force Force overwrite existing files without prompts
|
|
195
200
|
--registry <path> Path or URL to registry
|
|
201
|
+
-c, --config <path> Path to custom config file
|
|
202
|
+
--cwd <dir> Working directory (project root)
|
|
196
203
|
--verbose Show detailed compilation progress
|
|
197
204
|
--debug Show debug information (includes verbose)
|
|
198
205
|
```
|
package/index.js
CHANGED
|
@@ -2637,9 +2637,10 @@ ${this.convention.rootWrapper.end}`;
|
|
|
2637
2637
|
}
|
|
2638
2638
|
/**
|
|
2639
2639
|
* Get the section separator based on convention.
|
|
2640
|
+
* Returns '\n\n' (double newline) for all conventions.
|
|
2640
2641
|
*/
|
|
2641
2642
|
getSectionSeparator() {
|
|
2642
|
-
return
|
|
2643
|
+
return "\n\n";
|
|
2643
2644
|
}
|
|
2644
2645
|
getListMarker() {
|
|
2645
2646
|
switch (this.convention.listStyle) {
|
|
@@ -3694,8 +3695,16 @@ var MarkdownInstructionFormatter = class extends BaseFormatter {
|
|
|
3694
3695
|
}
|
|
3695
3696
|
project(ast, renderer) {
|
|
3696
3697
|
const identity2 = this.findBlock(ast, "identity");
|
|
3697
|
-
|
|
3698
|
-
|
|
3698
|
+
let text = "";
|
|
3699
|
+
if (identity2) {
|
|
3700
|
+
text = this.extractText(identity2.content);
|
|
3701
|
+
} else {
|
|
3702
|
+
const context = this.findBlock(ast, "context");
|
|
3703
|
+
if (context?.content.type === "MixedContent" && context.content.text) {
|
|
3704
|
+
text = context.content.text.value.trim();
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
if (!text) return null;
|
|
3699
3708
|
const cleanText = text.split(/\n{2,}/).map(
|
|
3700
3709
|
(para) => para.split("\n").map((line) => line.trim()).filter((line) => line).join("\n")
|
|
3701
3710
|
).filter((para) => para).join("\n\n");
|
|
@@ -4723,7 +4732,7 @@ var GitHubFormatter = class extends BaseFormatter {
|
|
|
4723
4732
|
if (restrictions) sections.push(restrictions);
|
|
4724
4733
|
const diagrams = this.diagrams(ast, renderer);
|
|
4725
4734
|
if (diagrams) sections.push(diagrams);
|
|
4726
|
-
const knowledge = this.
|
|
4735
|
+
const knowledge = this.knowledgeContent(ast, renderer);
|
|
4727
4736
|
if (knowledge) sections.push(knowledge);
|
|
4728
4737
|
}
|
|
4729
4738
|
header(_ast) {
|
|
@@ -4731,13 +4740,41 @@ var GitHubFormatter = class extends BaseFormatter {
|
|
|
4731
4740
|
}
|
|
4732
4741
|
project(ast, renderer) {
|
|
4733
4742
|
const identity2 = this.findBlock(ast, "identity");
|
|
4734
|
-
|
|
4735
|
-
|
|
4743
|
+
let content = "";
|
|
4744
|
+
if (identity2) {
|
|
4745
|
+
content = this.extractText(identity2.content);
|
|
4746
|
+
} else {
|
|
4747
|
+
const context = this.findBlock(ast, "context");
|
|
4748
|
+
if (context?.content.type === "MixedContent" && context.content.text) {
|
|
4749
|
+
content = context.content.text.value.trim();
|
|
4750
|
+
}
|
|
4751
|
+
}
|
|
4752
|
+
if (!content) return null;
|
|
4736
4753
|
return renderer.renderSection("project", this.stripAllIndent(content));
|
|
4737
4754
|
}
|
|
4738
4755
|
techStack(ast, renderer) {
|
|
4739
4756
|
const context = this.findBlock(ast, "context");
|
|
4740
|
-
if (
|
|
4757
|
+
if (context) {
|
|
4758
|
+
const items = this.extractTechStackFromContext(context);
|
|
4759
|
+
if (items.length > 0) {
|
|
4760
|
+
const content = renderer.renderList(items);
|
|
4761
|
+
return renderer.renderSection("tech-stack", content);
|
|
4762
|
+
}
|
|
4763
|
+
}
|
|
4764
|
+
const standards = this.findBlock(ast, "standards");
|
|
4765
|
+
if (standards) {
|
|
4766
|
+
const items = this.extractTechStackFromStandards(standards);
|
|
4767
|
+
if (items.length > 0) {
|
|
4768
|
+
const content = renderer.renderList(items);
|
|
4769
|
+
return renderer.renderSection("tech-stack", content);
|
|
4770
|
+
}
|
|
4771
|
+
}
|
|
4772
|
+
return null;
|
|
4773
|
+
}
|
|
4774
|
+
/**
|
|
4775
|
+
* Extract tech stack items from @context block.
|
|
4776
|
+
*/
|
|
4777
|
+
extractTechStackFromContext(context) {
|
|
4741
4778
|
const props = this.getProps(context.content);
|
|
4742
4779
|
const items = [];
|
|
4743
4780
|
const languages = props["languages"];
|
|
@@ -4760,9 +4797,21 @@ var GitHubFormatter = class extends BaseFormatter {
|
|
|
4760
4797
|
);
|
|
4761
4798
|
}
|
|
4762
4799
|
}
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4800
|
+
return items;
|
|
4801
|
+
}
|
|
4802
|
+
/**
|
|
4803
|
+
* Extract tech stack items from @standards.code (languages, frameworks, testing).
|
|
4804
|
+
*/
|
|
4805
|
+
extractTechStackFromStandards(standards) {
|
|
4806
|
+
const code = this.getProp(standards.content, "code");
|
|
4807
|
+
if (!code || typeof code !== "object" || Array.isArray(code)) return [];
|
|
4808
|
+
const codeObj = code;
|
|
4809
|
+
const items = [];
|
|
4810
|
+
for (const key of ["languages", "frameworks", "testing"]) {
|
|
4811
|
+
const val = codeObj[key];
|
|
4812
|
+
if (val) items.push(...(Array.isArray(val) ? val : [val]).map(String));
|
|
4813
|
+
}
|
|
4814
|
+
return items;
|
|
4766
4815
|
}
|
|
4767
4816
|
architecture(ast, renderer) {
|
|
4768
4817
|
const context = this.findBlock(ast, "context");
|
|
@@ -4962,8 +5011,35 @@ ${this.stripAllIndent(content)}`
|
|
|
4962
5011
|
if (items.length === 0) return null;
|
|
4963
5012
|
return renderer.renderSection("diagrams", renderer.renderList(items));
|
|
4964
5013
|
}
|
|
4965
|
-
|
|
4966
|
-
|
|
5014
|
+
/**
|
|
5015
|
+
* Render remaining @knowledge content not already consumed by
|
|
5016
|
+
* commands() (## Development Commands) or postWork() (## Post-Work Verification).
|
|
5017
|
+
*/
|
|
5018
|
+
knowledgeContent(ast, _renderer) {
|
|
5019
|
+
const knowledge = this.findBlock(ast, "knowledge");
|
|
5020
|
+
if (!knowledge) return null;
|
|
5021
|
+
const text = this.extractText(knowledge.content);
|
|
5022
|
+
if (!text) return null;
|
|
5023
|
+
const consumedHeaders = ["## Development Commands", "## Post-Work Verification"];
|
|
5024
|
+
let remaining = text;
|
|
5025
|
+
for (const header of consumedHeaders) {
|
|
5026
|
+
const headerIndex = remaining.indexOf(header);
|
|
5027
|
+
if (headerIndex === -1) continue;
|
|
5028
|
+
const afterHeader = remaining.indexOf("\n", headerIndex);
|
|
5029
|
+
if (afterHeader === -1) {
|
|
5030
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
5031
|
+
continue;
|
|
5032
|
+
}
|
|
5033
|
+
const nextSection = remaining.indexOf("\n## ", afterHeader);
|
|
5034
|
+
if (nextSection === -1) {
|
|
5035
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
5036
|
+
} else {
|
|
5037
|
+
remaining = remaining.substring(0, headerIndex) + remaining.substring(nextSection + 1);
|
|
5038
|
+
}
|
|
5039
|
+
}
|
|
5040
|
+
remaining = remaining.trim();
|
|
5041
|
+
if (!remaining) return null;
|
|
5042
|
+
return this.stripAllIndent(remaining);
|
|
4967
5043
|
}
|
|
4968
5044
|
// Helper methods
|
|
4969
5045
|
formatTechItem(arr) {
|
|
@@ -5543,6 +5619,7 @@ var ClaudeFormatter = class extends BaseFormatter {
|
|
|
5543
5619
|
this.addSection(sections, this.postWork(ast, renderer));
|
|
5544
5620
|
this.addSection(sections, this.documentation(ast, renderer));
|
|
5545
5621
|
this.addSection(sections, this.diagrams(ast, renderer));
|
|
5622
|
+
this.addSection(sections, this.knowledgeContent(ast, renderer));
|
|
5546
5623
|
this.addSection(sections, this.donts(ast, renderer));
|
|
5547
5624
|
}
|
|
5548
5625
|
addSection(sections, content) {
|
|
@@ -5550,8 +5627,16 @@ var ClaudeFormatter = class extends BaseFormatter {
|
|
|
5550
5627
|
}
|
|
5551
5628
|
project(ast, renderer) {
|
|
5552
5629
|
const identity2 = this.findBlock(ast, "identity");
|
|
5553
|
-
|
|
5554
|
-
|
|
5630
|
+
let text = "";
|
|
5631
|
+
if (identity2) {
|
|
5632
|
+
text = this.extractText(identity2.content);
|
|
5633
|
+
} else {
|
|
5634
|
+
const context = this.findBlock(ast, "context");
|
|
5635
|
+
if (context?.content.type === "MixedContent" && context.content.text) {
|
|
5636
|
+
text = context.content.text.value.trim();
|
|
5637
|
+
}
|
|
5638
|
+
}
|
|
5639
|
+
if (!text) return null;
|
|
5555
5640
|
const cleanText = text.split(/\n{2,}/).map(
|
|
5556
5641
|
(para) => para.split("\n").map((line) => line.trim()).filter((line) => line).join("\n")
|
|
5557
5642
|
).filter((para) => para).join("\n\n");
|
|
@@ -5723,6 +5808,36 @@ var ClaudeFormatter = class extends BaseFormatter {
|
|
|
5723
5808
|
const content = renderer.renderList(items);
|
|
5724
5809
|
return renderer.renderSection("Diagrams", content) + "\n";
|
|
5725
5810
|
}
|
|
5811
|
+
/**
|
|
5812
|
+
* Render remaining @knowledge content not already consumed by
|
|
5813
|
+
* commands() (## Development Commands) or postWork() (## Post-Work Verification).
|
|
5814
|
+
*/
|
|
5815
|
+
knowledgeContent(ast, _renderer) {
|
|
5816
|
+
const knowledge = this.findBlock(ast, "knowledge");
|
|
5817
|
+
if (!knowledge) return null;
|
|
5818
|
+
const text = this.extractText(knowledge.content);
|
|
5819
|
+
if (!text) return null;
|
|
5820
|
+
const consumedHeaders = ["## Development Commands", "## Post-Work Verification"];
|
|
5821
|
+
let remaining = text;
|
|
5822
|
+
for (const header of consumedHeaders) {
|
|
5823
|
+
const headerIndex = remaining.indexOf(header);
|
|
5824
|
+
if (headerIndex === -1) continue;
|
|
5825
|
+
const afterHeader = remaining.indexOf("\n", headerIndex);
|
|
5826
|
+
if (afterHeader === -1) {
|
|
5827
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
5828
|
+
continue;
|
|
5829
|
+
}
|
|
5830
|
+
const nextSection = remaining.indexOf("\n## ", afterHeader);
|
|
5831
|
+
if (nextSection === -1) {
|
|
5832
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
5833
|
+
} else {
|
|
5834
|
+
remaining = remaining.substring(0, headerIndex) + remaining.substring(nextSection + 1);
|
|
5835
|
+
}
|
|
5836
|
+
}
|
|
5837
|
+
remaining = remaining.trim();
|
|
5838
|
+
if (!remaining) return null;
|
|
5839
|
+
return this.stripAllIndent(remaining) + "\n";
|
|
5840
|
+
}
|
|
5726
5841
|
donts(ast, renderer) {
|
|
5727
5842
|
const block = this.findBlock(ast, "restrictions");
|
|
5728
5843
|
if (!block) return null;
|
|
@@ -6060,6 +6175,8 @@ var CursorFormatter = class extends BaseFormatter {
|
|
|
6060
6175
|
if (documentation) sections.push(documentation);
|
|
6061
6176
|
const diagrams = this.diagrams(ast);
|
|
6062
6177
|
if (diagrams) sections.push(diagrams);
|
|
6178
|
+
const knowledge = this.knowledgeContent(ast);
|
|
6179
|
+
if (knowledge) sections.push(knowledge);
|
|
6063
6180
|
const never = this.never(ast);
|
|
6064
6181
|
if (never) sections.push(never);
|
|
6065
6182
|
}
|
|
@@ -6071,6 +6188,13 @@ var CursorFormatter = class extends BaseFormatter {
|
|
|
6071
6188
|
return fullText;
|
|
6072
6189
|
}
|
|
6073
6190
|
}
|
|
6191
|
+
if (!identity2) {
|
|
6192
|
+
const context = this.findBlock(ast, "context");
|
|
6193
|
+
if (context?.content.type === "MixedContent" && context.content.text) {
|
|
6194
|
+
const text = this.dedent(context.content.text.value.trim());
|
|
6195
|
+
if (text) return text;
|
|
6196
|
+
}
|
|
6197
|
+
}
|
|
6074
6198
|
const projectInfo = this.extractProjectInfo(ast);
|
|
6075
6199
|
const orgSuffix = projectInfo.org ? ` at ${projectInfo.org}` : "";
|
|
6076
6200
|
return `You are working on ${projectInfo.text}${orgSuffix}.`;
|
|
@@ -6377,6 +6501,32 @@ ${items.map((i) => "- " + i).join("\n")}`;
|
|
|
6377
6501
|
}
|
|
6378
6502
|
return items;
|
|
6379
6503
|
}
|
|
6504
|
+
knowledgeContent(ast) {
|
|
6505
|
+
const knowledge = this.findBlock(ast, "knowledge");
|
|
6506
|
+
if (!knowledge) return null;
|
|
6507
|
+
const text = this.extractText(knowledge.content);
|
|
6508
|
+
if (!text) return null;
|
|
6509
|
+
const consumedHeaders = ["## Development Commands", "## Post-Work Verification"];
|
|
6510
|
+
let remaining = text;
|
|
6511
|
+
for (const header of consumedHeaders) {
|
|
6512
|
+
const headerIndex = remaining.indexOf(header);
|
|
6513
|
+
if (headerIndex === -1) continue;
|
|
6514
|
+
const afterHeader = remaining.indexOf("\n", headerIndex);
|
|
6515
|
+
if (afterHeader === -1) {
|
|
6516
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
6517
|
+
continue;
|
|
6518
|
+
}
|
|
6519
|
+
const nextSection = remaining.indexOf("\n## ", afterHeader);
|
|
6520
|
+
if (nextSection === -1) {
|
|
6521
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
6522
|
+
} else {
|
|
6523
|
+
remaining = remaining.substring(0, headerIndex) + remaining.substring(nextSection + 1);
|
|
6524
|
+
}
|
|
6525
|
+
}
|
|
6526
|
+
remaining = remaining.trim();
|
|
6527
|
+
if (!remaining) return null;
|
|
6528
|
+
return this.stripAllIndent(remaining);
|
|
6529
|
+
}
|
|
6380
6530
|
never(ast) {
|
|
6381
6531
|
const block = this.findBlock(ast, "restrictions");
|
|
6382
6532
|
if (!block) return null;
|
|
@@ -6482,6 +6632,8 @@ var AntigravityFormatter = class extends BaseFormatter {
|
|
|
6482
6632
|
if (documentation) sections.push(documentation);
|
|
6483
6633
|
const diagrams = this.diagrams(ast, renderer);
|
|
6484
6634
|
if (diagrams) sections.push(diagrams);
|
|
6635
|
+
const knowledge = this.knowledgeContent(ast);
|
|
6636
|
+
if (knowledge) sections.push(knowledge);
|
|
6485
6637
|
const restrictions = this.restrictions(ast, renderer);
|
|
6486
6638
|
if (restrictions) sections.push(restrictions);
|
|
6487
6639
|
const content = sections.join("\n\n") + "\n";
|
|
@@ -6652,8 +6804,15 @@ var AntigravityFormatter = class extends BaseFormatter {
|
|
|
6652
6804
|
}
|
|
6653
6805
|
identity(ast, _renderer) {
|
|
6654
6806
|
const identity2 = this.findBlock(ast, "identity");
|
|
6655
|
-
|
|
6656
|
-
|
|
6807
|
+
let content = "";
|
|
6808
|
+
if (identity2) {
|
|
6809
|
+
content = this.extractText(identity2.content);
|
|
6810
|
+
} else {
|
|
6811
|
+
const context = this.findBlock(ast, "context");
|
|
6812
|
+
if (context?.content.type === "MixedContent" && context.content.text) {
|
|
6813
|
+
content = context.content.text.value.trim();
|
|
6814
|
+
}
|
|
6815
|
+
}
|
|
6657
6816
|
if (!content) return null;
|
|
6658
6817
|
return `## Project Identity
|
|
6659
6818
|
|
|
@@ -6664,7 +6823,29 @@ ${this.stripAllIndent(content)}`;
|
|
|
6664
6823
|
*/
|
|
6665
6824
|
techStack(ast, _renderer) {
|
|
6666
6825
|
const context = this.findBlock(ast, "context");
|
|
6667
|
-
if (
|
|
6826
|
+
if (context) {
|
|
6827
|
+
const items = this.extractTechStackFromContext(context);
|
|
6828
|
+
if (items.length > 0) {
|
|
6829
|
+
return `## Tech Stack
|
|
6830
|
+
|
|
6831
|
+
${items.join("\n")}`;
|
|
6832
|
+
}
|
|
6833
|
+
}
|
|
6834
|
+
const standards = this.findBlock(ast, "standards");
|
|
6835
|
+
if (standards) {
|
|
6836
|
+
const items = this.extractTechStackFromStandards(standards);
|
|
6837
|
+
if (items.length > 0) {
|
|
6838
|
+
return `## Tech Stack
|
|
6839
|
+
|
|
6840
|
+
${items.join(", ")}`;
|
|
6841
|
+
}
|
|
6842
|
+
}
|
|
6843
|
+
return null;
|
|
6844
|
+
}
|
|
6845
|
+
/**
|
|
6846
|
+
* Extract tech stack items from @context block.
|
|
6847
|
+
*/
|
|
6848
|
+
extractTechStackFromContext(context) {
|
|
6668
6849
|
const props = this.getProps(context.content);
|
|
6669
6850
|
const items = [];
|
|
6670
6851
|
const languages = props["languages"];
|
|
@@ -6694,10 +6875,21 @@ ${this.stripAllIndent(content)}`;
|
|
|
6694
6875
|
const arr = Array.isArray(frameworks) ? frameworks : [frameworks];
|
|
6695
6876
|
items.push(`**Frameworks:** ${arr.map((f) => this.valueToString(f)).join(", ")}`);
|
|
6696
6877
|
}
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6878
|
+
return items;
|
|
6879
|
+
}
|
|
6880
|
+
/**
|
|
6881
|
+
* Extract tech stack items from @standards.code (languages, frameworks, testing).
|
|
6882
|
+
*/
|
|
6883
|
+
extractTechStackFromStandards(standards) {
|
|
6884
|
+
const code = this.getProp(standards.content, "code");
|
|
6885
|
+
if (!code || typeof code !== "object" || Array.isArray(code)) return [];
|
|
6886
|
+
const codeObj = code;
|
|
6887
|
+
const items = [];
|
|
6888
|
+
for (const key of ["languages", "frameworks", "testing"]) {
|
|
6889
|
+
const val = codeObj[key];
|
|
6890
|
+
if (val) items.push(...(Array.isArray(val) ? val : [val]).map(String));
|
|
6891
|
+
}
|
|
6892
|
+
return items;
|
|
6701
6893
|
}
|
|
6702
6894
|
/**
|
|
6703
6895
|
* Extract architecture from @context block (same as GitHub/Cursor).
|
|
@@ -6941,6 +7133,32 @@ ${items.map((i) => "- " + i).join("\n")}`;
|
|
|
6941
7133
|
/**
|
|
6942
7134
|
* Extract restrictions from @restrictions block (same as GitHub/Cursor).
|
|
6943
7135
|
*/
|
|
7136
|
+
knowledgeContent(ast) {
|
|
7137
|
+
const knowledge = this.findBlock(ast, "knowledge");
|
|
7138
|
+
if (!knowledge) return null;
|
|
7139
|
+
const text = this.extractText(knowledge.content);
|
|
7140
|
+
if (!text) return null;
|
|
7141
|
+
const consumedHeaders = ["## Development Commands", "## Post-Work Verification"];
|
|
7142
|
+
let remaining = text;
|
|
7143
|
+
for (const header of consumedHeaders) {
|
|
7144
|
+
const headerIndex = remaining.indexOf(header);
|
|
7145
|
+
if (headerIndex === -1) continue;
|
|
7146
|
+
const afterHeader = remaining.indexOf("\n", headerIndex);
|
|
7147
|
+
if (afterHeader === -1) {
|
|
7148
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
7149
|
+
continue;
|
|
7150
|
+
}
|
|
7151
|
+
const nextSection = remaining.indexOf("\n## ", afterHeader);
|
|
7152
|
+
if (nextSection === -1) {
|
|
7153
|
+
remaining = remaining.substring(0, headerIndex).trimEnd();
|
|
7154
|
+
} else {
|
|
7155
|
+
remaining = remaining.substring(0, headerIndex) + remaining.substring(nextSection + 1);
|
|
7156
|
+
}
|
|
7157
|
+
}
|
|
7158
|
+
remaining = remaining.trim();
|
|
7159
|
+
if (!remaining) return null;
|
|
7160
|
+
return this.stripAllIndent(remaining);
|
|
7161
|
+
}
|
|
6944
7162
|
restrictions(ast, _renderer) {
|
|
6945
7163
|
const block = this.findBlock(ast, "restrictions");
|
|
6946
7164
|
if (!block) return null;
|
|
@@ -6960,6 +7178,14 @@ ${items.map((i) => "- " + i).join("\n")}`;
|
|
|
6960
7178
|
if (content.type === "TextContent") {
|
|
6961
7179
|
return content.value.trim().split("\n").filter((line) => line.trim()).map((line) => this.formatRestriction(line.trim()));
|
|
6962
7180
|
}
|
|
7181
|
+
if (content.type === "ObjectContent") {
|
|
7182
|
+
const itemsArray = this.getProp(content, "items");
|
|
7183
|
+
if (Array.isArray(itemsArray)) {
|
|
7184
|
+
return itemsArray.map(
|
|
7185
|
+
(item) => this.formatRestriction(this.valueToString(item))
|
|
7186
|
+
);
|
|
7187
|
+
}
|
|
7188
|
+
}
|
|
6963
7189
|
return [];
|
|
6964
7190
|
}
|
|
6965
7191
|
/**
|
|
@@ -27368,6 +27594,7 @@ export {
|
|
|
27368
27594
|
getCacheDir,
|
|
27369
27595
|
getCachePath,
|
|
27370
27596
|
getContext,
|
|
27597
|
+
importCommand,
|
|
27371
27598
|
initCommand,
|
|
27372
27599
|
isQuiet,
|
|
27373
27600
|
isVerbose,
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export { pullCommand } from './commands/pull.js';
|
|
|
14
14
|
export { diffCommand } from './commands/diff.js';
|
|
15
15
|
export { checkCommand } from './commands/check.js';
|
|
16
16
|
export { updateCheckCommand } from './commands/update-check.js';
|
|
17
|
+
export { importCommand } from './commands/import.js';
|
|
18
|
+
export type { ImportCommandOptions } from './commands/import.js';
|
|
17
19
|
export { loadConfig, findConfigFile, CONFIG_FILES } from './config/loader.js';
|
|
18
20
|
export { ConsoleOutput, createSpinner, LogLevel, setContext, getContext, isVerbose, isQuiet, } from './output/console.js';
|
|
19
21
|
export type { CLIContext } from './output/console.js';
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/cli/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EACL,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,OAAO,GACR,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,YAAY,EACV,WAAW,EACX,cAAc,EACd,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,YAAY,CAAC"}
|