@savvy-web/silk-effects 1.1.0 → 1.3.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/changesets/services/config-inspector.js +24 -17
- package/index.d.ts +61 -40
- package/lint/cli/sections.js +3 -1
- package/lint/cli/templates/markdownlint.gen.js +9 -5
- package/lint/config/Preset.js +5 -5
- package/lint/config/createConfig.js +1 -1
- package/lint/handlers/Biome.js +1 -1
- package/lint/handlers/Markdown.js +1 -1
- package/lint/handlers/PackageJson.js +1 -1
- package/lint/handlers/PnpmWorkspace.js +1 -1
- package/lint/handlers/ShellScripts.js +1 -1
- package/lint/handlers/TypeScript.js +1 -1
- package/lint/handlers/Yaml.js +1 -1
- package/lint/index.js +2 -1
- package/lint/utils/Command.js +1 -1
- package/lint/utils/Filter.js +1 -1
- package/package.json +1 -1
- package/services/SilkPublishability.js +51 -18
- package/tsdoc-metadata.json +1 -1
|
@@ -249,10 +249,12 @@ function readRawPackageJson(fs, pkgDir) {
|
|
|
249
249
|
/**
|
|
250
250
|
* Build resolved scopes from the discovered workspace packages, keeping only
|
|
251
251
|
* those that are a release surface (declare publishConfig that yields at least
|
|
252
|
-
* one publish target). Used when `.changeset/config.json` declares no
|
|
253
|
-
* `packages` record
|
|
254
|
-
*
|
|
255
|
-
*
|
|
252
|
+
* one publish target). Used both when `.changeset/config.json` declares no
|
|
253
|
+
* explicit `packages` record AND to augment an explicit record with the
|
|
254
|
+
* remaining workspace packages it does not list (so the record annotates the
|
|
255
|
+
* listed packages without shrinking the release surface). The changeset
|
|
256
|
+
* `ignore` list is intentionally NOT consulted here — an ignored package still
|
|
257
|
+
* declares publishConfig and remains a valid changeset target.
|
|
256
258
|
*/
|
|
257
259
|
function buildFallbackScopes(fs, workspaces) {
|
|
258
260
|
return Effect.forEach(workspaces, (ws) => Effect.gen(function* () {
|
|
@@ -366,19 +368,24 @@ function makeShape(reader, discovery, fs) {
|
|
|
366
368
|
}));
|
|
367
369
|
const hasExplicitPackages = Object.keys(decodedOptions.packages ?? {}).length > 0;
|
|
368
370
|
let scopes;
|
|
369
|
-
if (hasExplicitPackages)
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
371
|
+
if (hasExplicitPackages) {
|
|
372
|
+
let explicitScopes;
|
|
373
|
+
try {
|
|
374
|
+
explicitScopes = buildResolvedScopes({
|
|
375
|
+
options: decodedOptions,
|
|
376
|
+
workspaces,
|
|
377
|
+
projectDir,
|
|
378
|
+
configPath
|
|
379
|
+
});
|
|
380
|
+
checkConflicts(explicitScopes, workspaces, projectDir, configPath);
|
|
381
|
+
} catch (e) {
|
|
382
|
+
if (e instanceof ConfigurationError) return yield* Effect.fail(e);
|
|
383
|
+
throw e;
|
|
384
|
+
}
|
|
385
|
+
const explicitNames = new Set(explicitScopes.map((s) => s.name));
|
|
386
|
+
const discoveredScopes = yield* buildFallbackScopes(fs, workspaces.filter((w) => !explicitNames.has(w.name)));
|
|
387
|
+
scopes = [...explicitScopes, ...discoveredScopes];
|
|
388
|
+
} else scopes = yield* buildFallbackScopes(fs, workspaces);
|
|
382
389
|
const inspected = {
|
|
383
390
|
configPath,
|
|
384
391
|
projectDir,
|
package/index.d.ts
CHANGED
|
@@ -4535,7 +4535,7 @@ interface TokenTypeMap {
|
|
|
4535
4535
|
chunkString: 'chunkString';
|
|
4536
4536
|
}
|
|
4537
4537
|
//#endregion
|
|
4538
|
-
//#region ../../node_modules/.pnpm/markdownlint@0.
|
|
4538
|
+
//#region ../../node_modules/.pnpm/markdownlint@0.41.0/node_modules/markdownlint/lib/markdownlint.d.mts
|
|
4539
4539
|
/**
|
|
4540
4540
|
* Function to implement rule logic.
|
|
4541
4541
|
*/
|
|
@@ -4601,13 +4601,13 @@ type ParserMicromark = {
|
|
|
4601
4601
|
tokens: MicromarkToken[];
|
|
4602
4602
|
};
|
|
4603
4603
|
/**
|
|
4604
|
-
* markdown-it token.
|
|
4604
|
+
* markdown-it base token.
|
|
4605
4605
|
*/
|
|
4606
|
-
type
|
|
4606
|
+
type MarkdownItBaseToken = {
|
|
4607
4607
|
/**
|
|
4608
4608
|
* HTML attributes.
|
|
4609
4609
|
*/
|
|
4610
|
-
attrs: string[][];
|
|
4610
|
+
attrs: string[][] | null;
|
|
4611
4611
|
/**
|
|
4612
4612
|
* Block-level token.
|
|
4613
4613
|
*/
|
|
@@ -4615,7 +4615,7 @@ type MarkdownItToken = {
|
|
|
4615
4615
|
/**
|
|
4616
4616
|
* Child nodes.
|
|
4617
4617
|
*/
|
|
4618
|
-
children:
|
|
4618
|
+
children: MarkdownItBaseToken[] | null;
|
|
4619
4619
|
/**
|
|
4620
4620
|
* Tag contents.
|
|
4621
4621
|
*/
|
|
@@ -4635,7 +4635,7 @@ type MarkdownItToken = {
|
|
|
4635
4635
|
/**
|
|
4636
4636
|
* Beginning/ending line numbers.
|
|
4637
4637
|
*/
|
|
4638
|
-
map: number[];
|
|
4638
|
+
map: number[] | null;
|
|
4639
4639
|
/**
|
|
4640
4640
|
* Markup text.
|
|
4641
4641
|
*/
|
|
@@ -4643,7 +4643,7 @@ type MarkdownItToken = {
|
|
|
4643
4643
|
/**
|
|
4644
4644
|
* Arbitrary data.
|
|
4645
4645
|
*/
|
|
4646
|
-
meta:
|
|
4646
|
+
meta: Object;
|
|
4647
4647
|
/**
|
|
4648
4648
|
* Level change.
|
|
4649
4649
|
*/
|
|
@@ -4656,6 +4656,15 @@ type MarkdownItToken = {
|
|
|
4656
4656
|
* Token type.
|
|
4657
4657
|
*/
|
|
4658
4658
|
type: string;
|
|
4659
|
+
};
|
|
4660
|
+
/**
|
|
4661
|
+
* markdown-it extended token.
|
|
4662
|
+
*/
|
|
4663
|
+
type MarkdownItExtendedToken = {
|
|
4664
|
+
/**
|
|
4665
|
+
* Child nodes.
|
|
4666
|
+
*/
|
|
4667
|
+
children: MarkdownItExtendedToken[] | null;
|
|
4659
4668
|
/**
|
|
4660
4669
|
* Line number (1-based).
|
|
4661
4670
|
*/
|
|
@@ -4665,6 +4674,10 @@ type MarkdownItToken = {
|
|
|
4665
4674
|
*/
|
|
4666
4675
|
line: string;
|
|
4667
4676
|
};
|
|
4677
|
+
/**
|
|
4678
|
+
* markdown-it token.
|
|
4679
|
+
*/
|
|
4680
|
+
type MarkdownItToken = MarkdownItBaseToken & MarkdownItExtendedToken;
|
|
4668
4681
|
type MicromarkTokenType = TokenType;
|
|
4669
4682
|
/**
|
|
4670
4683
|
* micromark token.
|
|
@@ -4718,23 +4731,23 @@ type RuleOnErrorInfo = {
|
|
|
4718
4731
|
/**
|
|
4719
4732
|
* Detail about the error.
|
|
4720
4733
|
*/
|
|
4721
|
-
detail?: string;
|
|
4734
|
+
detail?: string | undefined;
|
|
4722
4735
|
/**
|
|
4723
4736
|
* Context for the error.
|
|
4724
4737
|
*/
|
|
4725
|
-
context?: string;
|
|
4738
|
+
context?: string | undefined;
|
|
4726
4739
|
/**
|
|
4727
4740
|
* Link to more information.
|
|
4728
4741
|
*/
|
|
4729
|
-
information?: URL;
|
|
4742
|
+
information?: URL | undefined;
|
|
4730
4743
|
/**
|
|
4731
4744
|
* Column number (1-based) and length.
|
|
4732
4745
|
*/
|
|
4733
|
-
range?: number[];
|
|
4746
|
+
range?: number[] | undefined;
|
|
4734
4747
|
/**
|
|
4735
4748
|
* Fix information.
|
|
4736
4749
|
*/
|
|
4737
|
-
fixInfo?: RuleOnErrorFixInfo;
|
|
4750
|
+
fixInfo?: RuleOnErrorFixInfo | undefined;
|
|
4738
4751
|
};
|
|
4739
4752
|
/**
|
|
4740
4753
|
* Fix information for RuleOnErrorInfo.
|
|
@@ -4743,19 +4756,19 @@ type RuleOnErrorFixInfo = {
|
|
|
4743
4756
|
/**
|
|
4744
4757
|
* Line number (1-based).
|
|
4745
4758
|
*/
|
|
4746
|
-
lineNumber?: number;
|
|
4759
|
+
lineNumber?: number | undefined;
|
|
4747
4760
|
/**
|
|
4748
4761
|
* Column of the fix (1-based).
|
|
4749
4762
|
*/
|
|
4750
|
-
editColumn?: number;
|
|
4763
|
+
editColumn?: number | undefined;
|
|
4751
4764
|
/**
|
|
4752
4765
|
* Count of characters to delete.
|
|
4753
4766
|
*/
|
|
4754
|
-
deleteCount?: number;
|
|
4767
|
+
deleteCount?: number | undefined;
|
|
4755
4768
|
/**
|
|
4756
4769
|
* Text to insert (after deleting).
|
|
4757
4770
|
*/
|
|
4758
|
-
insertText?: string;
|
|
4771
|
+
insertText?: string | undefined;
|
|
4759
4772
|
};
|
|
4760
4773
|
/**
|
|
4761
4774
|
* Rule definition.
|
|
@@ -4772,7 +4785,7 @@ type Rule$2 = {
|
|
|
4772
4785
|
/**
|
|
4773
4786
|
* Link to more information.
|
|
4774
4787
|
*/
|
|
4775
|
-
information?: URL;
|
|
4788
|
+
information?: URL | undefined;
|
|
4776
4789
|
/**
|
|
4777
4790
|
* Rule tag(s).
|
|
4778
4791
|
*/
|
|
@@ -4784,7 +4797,7 @@ type Rule$2 = {
|
|
|
4784
4797
|
/**
|
|
4785
4798
|
* True if asynchronous.
|
|
4786
4799
|
*/
|
|
4787
|
-
asynchronous?: boolean;
|
|
4800
|
+
asynchronous?: boolean | undefined;
|
|
4788
4801
|
/**
|
|
4789
4802
|
* Rule implementation.
|
|
4790
4803
|
*/
|
|
@@ -4795,7 +4808,7 @@ type Rule$2 = {
|
|
|
4795
4808
|
*/
|
|
4796
4809
|
type RuleConfiguration = boolean | any;
|
|
4797
4810
|
//#endregion
|
|
4798
|
-
//#region ../../node_modules/.pnpm/markdownlint@0.
|
|
4811
|
+
//#region ../../node_modules/.pnpm/markdownlint@0.41.0/node_modules/markdownlint/lib/exports.d.mts
|
|
4799
4812
|
type Rule$1 = Rule$2;
|
|
4800
4813
|
//#endregion
|
|
4801
4814
|
//#region src/changesets/markdownlint/rules/content-structure.d.ts
|
|
@@ -6425,7 +6438,7 @@ declare abstract class Handler {
|
|
|
6425
6438
|
*
|
|
6426
6439
|
* @example
|
|
6427
6440
|
* ```typescript
|
|
6428
|
-
* import { Biome } from '@savvy-web/lint
|
|
6441
|
+
* import { Biome } from '@savvy-web/silk/lint';
|
|
6429
6442
|
*
|
|
6430
6443
|
* export default {
|
|
6431
6444
|
* // Auto-discovers biome command and config file
|
|
@@ -6530,7 +6543,7 @@ declare class Biome {
|
|
|
6530
6543
|
*
|
|
6531
6544
|
* @example
|
|
6532
6545
|
* ```typescript
|
|
6533
|
-
* import { Markdown } from '@savvy-web/lint
|
|
6546
|
+
* import { Markdown } from '@savvy-web/silk/lint';
|
|
6534
6547
|
*
|
|
6535
6548
|
* export default {
|
|
6536
6549
|
* // Auto-discovers command and config file
|
|
@@ -6607,7 +6620,7 @@ declare class Markdown {
|
|
|
6607
6620
|
*
|
|
6608
6621
|
* @example
|
|
6609
6622
|
* ```typescript
|
|
6610
|
-
* import { PackageJson } from '@savvy-web/lint
|
|
6623
|
+
* import { PackageJson } from '@savvy-web/silk/lint';
|
|
6611
6624
|
*
|
|
6612
6625
|
* export default {
|
|
6613
6626
|
* // Use defaults
|
|
@@ -6714,7 +6727,7 @@ interface PnpmWorkspaceContent {
|
|
|
6714
6727
|
*
|
|
6715
6728
|
* @example
|
|
6716
6729
|
* ```typescript
|
|
6717
|
-
* import { PnpmWorkspace } from '\@savvy-web/lint
|
|
6730
|
+
* import { PnpmWorkspace } from '\@savvy-web/silk/lint';
|
|
6718
6731
|
*
|
|
6719
6732
|
* export default {
|
|
6720
6733
|
* [PnpmWorkspace.glob]: PnpmWorkspace.create({
|
|
@@ -6788,7 +6801,7 @@ declare class PnpmWorkspace {
|
|
|
6788
6801
|
*
|
|
6789
6802
|
* @example
|
|
6790
6803
|
* ```typescript
|
|
6791
|
-
* import { ShellScripts } from '@savvy-web/lint
|
|
6804
|
+
* import { ShellScripts } from '@savvy-web/silk/lint';
|
|
6792
6805
|
*
|
|
6793
6806
|
* export default {
|
|
6794
6807
|
* [ShellScripts.glob]: ShellScripts.create({
|
|
@@ -6839,7 +6852,7 @@ type TypeScriptCompiler = "tsgo" | "tsc";
|
|
|
6839
6852
|
*
|
|
6840
6853
|
* @example
|
|
6841
6854
|
* ```typescript
|
|
6842
|
-
* import { TypeScript } from '\@savvy-web/lint
|
|
6855
|
+
* import { TypeScript } from '\@savvy-web/silk/lint';
|
|
6843
6856
|
*
|
|
6844
6857
|
* export default {
|
|
6845
6858
|
* // Auto-detects compiler and runs type checking
|
|
@@ -6931,7 +6944,7 @@ declare class TypeScript {
|
|
|
6931
6944
|
*
|
|
6932
6945
|
* @example
|
|
6933
6946
|
* ```typescript
|
|
6934
|
-
* import { Yaml } from '\@savvy-web/lint
|
|
6947
|
+
* import { Yaml } from '\@savvy-web/silk/lint';
|
|
6935
6948
|
*
|
|
6936
6949
|
* export default {
|
|
6937
6950
|
* [Yaml.glob]: Yaml.create({
|
|
@@ -7026,7 +7039,7 @@ declare class Yaml {
|
|
|
7026
7039
|
*
|
|
7027
7040
|
* @example
|
|
7028
7041
|
* ```typescript
|
|
7029
|
-
* import { createConfig } from '@savvy-web/lint
|
|
7042
|
+
* import { createConfig } from '@savvy-web/silk/lint';
|
|
7030
7043
|
*
|
|
7031
7044
|
* // Use all defaults
|
|
7032
7045
|
* export default createConfig();
|
|
@@ -7054,7 +7067,7 @@ type PresetExtendOptions = CreateConfigOptions;
|
|
|
7054
7067
|
*
|
|
7055
7068
|
* @example
|
|
7056
7069
|
* ```typescript
|
|
7057
|
-
* import { Preset } from '@savvy-web/lint
|
|
7070
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
7058
7071
|
*
|
|
7059
7072
|
* // Use a preset directly
|
|
7060
7073
|
* export default Preset.standard();
|
|
@@ -7081,7 +7094,7 @@ declare class Preset {
|
|
|
7081
7094
|
*
|
|
7082
7095
|
* @example
|
|
7083
7096
|
* ```typescript
|
|
7084
|
-
* import { Preset } from '@savvy-web/lint
|
|
7097
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
7085
7098
|
*
|
|
7086
7099
|
* export default Preset.minimal();
|
|
7087
7100
|
* ```
|
|
@@ -7103,7 +7116,7 @@ declare class Preset {
|
|
|
7103
7116
|
*
|
|
7104
7117
|
* @example
|
|
7105
7118
|
* ```typescript
|
|
7106
|
-
* import { Preset } from '@savvy-web/lint
|
|
7119
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
7107
7120
|
*
|
|
7108
7121
|
* export default Preset.standard({
|
|
7109
7122
|
* biome: { exclude: ['legacy/'] },
|
|
@@ -7128,7 +7141,7 @@ declare class Preset {
|
|
|
7128
7141
|
*
|
|
7129
7142
|
* @example
|
|
7130
7143
|
* ```typescript
|
|
7131
|
-
* import { Preset } from '@savvy-web/lint
|
|
7144
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
7132
7145
|
*
|
|
7133
7146
|
* export default Preset.silk({
|
|
7134
7147
|
* typescript: { skipTypecheck: true },
|
|
@@ -7145,7 +7158,7 @@ declare class Preset {
|
|
|
7145
7158
|
*
|
|
7146
7159
|
* @example
|
|
7147
7160
|
* ```typescript
|
|
7148
|
-
* import { Preset } from '@savvy-web/lint
|
|
7161
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
7149
7162
|
*
|
|
7150
7163
|
* const presetName = process.env.LINT_PRESET || 'standard';
|
|
7151
7164
|
* export default Preset.get(presetName);
|
|
@@ -7160,7 +7173,7 @@ declare class Preset {
|
|
|
7160
7173
|
*
|
|
7161
7174
|
* @example
|
|
7162
7175
|
* ```typescript
|
|
7163
|
-
* import { Command } from '@savvy-web/lint
|
|
7176
|
+
* import { Command } from '@savvy-web/silk/lint';
|
|
7164
7177
|
*
|
|
7165
7178
|
* if (Command.isAvailable('yq')) {
|
|
7166
7179
|
* // yq is installed globally
|
|
@@ -7347,7 +7360,7 @@ declare class Command$1 {
|
|
|
7347
7360
|
*
|
|
7348
7361
|
* @example
|
|
7349
7362
|
* ```typescript
|
|
7350
|
-
* import { Filter } from '@savvy-web/lint
|
|
7363
|
+
* import { Filter } from '@savvy-web/silk/lint';
|
|
7351
7364
|
*
|
|
7352
7365
|
* const handler = (filenames: readonly string[]) => {
|
|
7353
7366
|
* const filtered = Filter.exclude(filenames, ['dist/', '__fixtures__']);
|
|
@@ -7838,6 +7851,8 @@ declare const HUSKY_HOOK_PATH = ".husky/pre-commit";
|
|
|
7838
7851
|
declare const POST_CHECKOUT_HOOK_PATH = ".husky/post-checkout";
|
|
7839
7852
|
/** Path for the husky post-merge hook. */
|
|
7840
7853
|
declare const POST_MERGE_HOOK_PATH = ".husky/post-merge";
|
|
7854
|
+
/** Path for the husky post-commit hook. */
|
|
7855
|
+
declare const POST_COMMIT_HOOK_PATH = ".husky/post-commit";
|
|
7841
7856
|
/** Default path for the lint-staged config file. */
|
|
7842
7857
|
declare const DEFAULT_CONFIG_PATH = "lib/configs/lint-staged.config.ts";
|
|
7843
7858
|
/** Path for the markdownlint-cli2 config file. */
|
|
@@ -7876,9 +7891,11 @@ declare function generateManagedContent(configPath: string): string;
|
|
|
7876
7891
|
//#endregion
|
|
7877
7892
|
//#region src/lint/cli/templates/markdownlint.gen.d.ts
|
|
7878
7893
|
/**
|
|
7879
|
-
*
|
|
7894
|
+
* Markdownlint template data.
|
|
7880
7895
|
*
|
|
7881
|
-
*
|
|
7896
|
+
* Originally generated in the now-deprecated `@savvy-web/lint-staged` package;
|
|
7897
|
+
* the generator does not live in this repo, so this file is maintained by hand.
|
|
7898
|
+
* Edit the `MARKDOWNLINT_TEMPLATE` / `MARKDOWNLINT_CONFIG` objects directly.
|
|
7882
7899
|
*
|
|
7883
7900
|
* @internal
|
|
7884
7901
|
*/
|
|
@@ -7889,7 +7906,7 @@ declare const MARKDOWNLINT_TEMPLATE: {
|
|
|
7889
7906
|
readonly fix: true;
|
|
7890
7907
|
readonly gitignore: true;
|
|
7891
7908
|
readonly noBanner: true;
|
|
7892
|
-
readonly ignores: readonly ["**/node_modules", "**/.cache", "**/coverage", "**/.coverage", "**/dist", "**/CHANGELOG.md", "**/.claude/plans", "**/docs/superpowers"];
|
|
7909
|
+
readonly ignores: readonly ["**/node_modules", "**/.cache", "**/coverage", "**/.coverage", "**/dist", "**/CHANGELOG.md", "**/.claude/plans", "**/docs/superpowers", "**/__test__/**/fixtures/**", "**/__fixtures__/**"];
|
|
7893
7910
|
readonly customRules: readonly ["@savvy-web/silk/changesets/markdownlint"];
|
|
7894
7911
|
readonly config: {
|
|
7895
7912
|
readonly default: true;
|
|
@@ -7919,7 +7936,9 @@ declare const MARKDOWNLINT_TEMPLATE: {
|
|
|
7919
7936
|
readonly MD024: {
|
|
7920
7937
|
readonly siblings_only: true;
|
|
7921
7938
|
};
|
|
7922
|
-
readonly MD025:
|
|
7939
|
+
readonly MD025: {
|
|
7940
|
+
readonly front_matter_title: "";
|
|
7941
|
+
};
|
|
7923
7942
|
readonly MD026: true;
|
|
7924
7943
|
readonly MD027: true;
|
|
7925
7944
|
readonly MD028: true;
|
|
@@ -7997,7 +8016,9 @@ declare const MARKDOWNLINT_CONFIG: {
|
|
|
7997
8016
|
readonly MD024: {
|
|
7998
8017
|
readonly siblings_only: true;
|
|
7999
8018
|
};
|
|
8000
|
-
readonly MD025:
|
|
8019
|
+
readonly MD025: {
|
|
8020
|
+
readonly front_matter_title: "";
|
|
8021
|
+
};
|
|
8001
8022
|
readonly MD026: true;
|
|
8002
8023
|
readonly MD027: true;
|
|
8003
8024
|
readonly MD028: true;
|
|
@@ -8044,7 +8065,7 @@ declare const MARKDOWNLINT_CONFIG: {
|
|
|
8044
8065
|
readonly "changeset-dependency-table-format": false;
|
|
8045
8066
|
};
|
|
8046
8067
|
declare namespace index_d_exports$2 {
|
|
8047
|
-
export { BaseHandlerOptions, Biome, BiomeOptions, Command$1 as Command, CreateConfigOptions, DEFAULT_CONFIG_PATH, Filter, HUSKY_HOOK_PATH, Handler, LegacySavvyLintHygieneDef, LintStagedConfig, LintStagedEntry, LintStagedHandler, MARKDOWNLINT_CONFIG, MARKDOWNLINT_CONFIG_PATH, MARKDOWNLINT_SCHEMA, MARKDOWNLINT_TEMPLATE, Markdown, MarkdownOptions, POST_CHECKOUT_HOOK_PATH, POST_MERGE_HOOK_PATH, PackageJson, PackageJsonOptions, PackageManager, PnpmWorkspace, PnpmWorkspaceContent, PnpmWorkspaceOptions, Preset, PresetExtendOptions, PresetType, SavvyLintSectionDef, ShellScripts, ShellScriptsOptions, ToolSearchResult, TypeScript, TypeScriptCompiler, TypeScriptOptions, WorkspacePackageInfo, Yaml, YamlOptions, createConfig, generateManagedContent, getWorkspacePackagePaths, getWorkspacePackages, getWorkspaceRoot, isWorkspacePackagePath, resetWorkspaceCache, savvyLintBlock };
|
|
8068
|
+
export { BaseHandlerOptions, Biome, BiomeOptions, Command$1 as Command, CreateConfigOptions, DEFAULT_CONFIG_PATH, Filter, HUSKY_HOOK_PATH, Handler, LegacySavvyLintHygieneDef, LintStagedConfig, LintStagedEntry, LintStagedHandler, MARKDOWNLINT_CONFIG, MARKDOWNLINT_CONFIG_PATH, MARKDOWNLINT_SCHEMA, MARKDOWNLINT_TEMPLATE, Markdown, MarkdownOptions, POST_CHECKOUT_HOOK_PATH, POST_COMMIT_HOOK_PATH, POST_MERGE_HOOK_PATH, PackageJson, PackageJsonOptions, PackageManager, PnpmWorkspace, PnpmWorkspaceContent, PnpmWorkspaceOptions, Preset, PresetExtendOptions, PresetType, SavvyLintSectionDef, ShellScripts, ShellScriptsOptions, ToolSearchResult, TypeScript, TypeScriptCompiler, TypeScriptOptions, WorkspacePackageInfo, Yaml, YamlOptions, createConfig, generateManagedContent, getWorkspacePackagePaths, getWorkspacePackages, getWorkspaceRoot, isWorkspacePackagePath, resetWorkspaceCache, savvyLintBlock };
|
|
8048
8069
|
}
|
|
8049
8070
|
//#endregion
|
|
8050
8071
|
//#region src/schemas/BiomeConfig.d.ts
|
package/lint/cli/sections.js
CHANGED
|
@@ -13,6 +13,8 @@ const HUSKY_HOOK_PATH = ".husky/pre-commit";
|
|
|
13
13
|
const POST_CHECKOUT_HOOK_PATH = ".husky/post-checkout";
|
|
14
14
|
/** Path for the husky post-merge hook. */
|
|
15
15
|
const POST_MERGE_HOOK_PATH = ".husky/post-merge";
|
|
16
|
+
/** Path for the husky post-commit hook. */
|
|
17
|
+
const POST_COMMIT_HOOK_PATH = ".husky/post-commit";
|
|
16
18
|
/** Default path for the lint-staged config file. */
|
|
17
19
|
const DEFAULT_CONFIG_PATH = "lib/configs/lint-staged.config.ts";
|
|
18
20
|
/** Path for the markdownlint-cli2 config file. */
|
|
@@ -62,4 +64,4 @@ function generateManagedContent(configPath) {
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
//#endregion
|
|
65
|
-
export { DEFAULT_CONFIG_PATH, HUSKY_HOOK_PATH, LegacySavvyLintHygieneDef, MARKDOWNLINT_CONFIG_PATH, POST_CHECKOUT_HOOK_PATH, POST_MERGE_HOOK_PATH, SavvyLintSectionDef, generateManagedContent, savvyLintBlock };
|
|
67
|
+
export { DEFAULT_CONFIG_PATH, HUSKY_HOOK_PATH, LegacySavvyLintHygieneDef, MARKDOWNLINT_CONFIG_PATH, POST_CHECKOUT_HOOK_PATH, POST_COMMIT_HOOK_PATH, POST_MERGE_HOOK_PATH, SavvyLintSectionDef, generateManagedContent, savvyLintBlock };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
//#region src/lint/cli/templates/markdownlint.gen.ts
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Markdownlint template data.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Originally generated in the now-deprecated `@savvy-web/lint-staged` package;
|
|
6
|
+
* the generator does not live in this repo, so this file is maintained by hand.
|
|
7
|
+
* Edit the `MARKDOWNLINT_TEMPLATE` / `MARKDOWNLINT_CONFIG` objects directly.
|
|
6
8
|
*
|
|
7
9
|
* @internal
|
|
8
10
|
*/
|
|
@@ -21,7 +23,9 @@ const MARKDOWNLINT_TEMPLATE = {
|
|
|
21
23
|
"**/dist",
|
|
22
24
|
"**/CHANGELOG.md",
|
|
23
25
|
"**/.claude/plans",
|
|
24
|
-
"**/docs/superpowers"
|
|
26
|
+
"**/docs/superpowers",
|
|
27
|
+
"**/__test__/**/fixtures/**",
|
|
28
|
+
"**/__fixtures__/**"
|
|
25
29
|
],
|
|
26
30
|
customRules: ["@savvy-web/silk/changesets/markdownlint"],
|
|
27
31
|
config: {
|
|
@@ -50,7 +54,7 @@ const MARKDOWNLINT_TEMPLATE = {
|
|
|
50
54
|
MD022: true,
|
|
51
55
|
MD023: true,
|
|
52
56
|
MD024: { siblings_only: true },
|
|
53
|
-
MD025:
|
|
57
|
+
MD025: { front_matter_title: "" },
|
|
54
58
|
MD026: true,
|
|
55
59
|
MD027: true,
|
|
56
60
|
MD028: true,
|
|
@@ -129,7 +133,7 @@ const MARKDOWNLINT_CONFIG = {
|
|
|
129
133
|
MD022: true,
|
|
130
134
|
MD023: true,
|
|
131
135
|
MD024: { siblings_only: true },
|
|
132
|
-
MD025:
|
|
136
|
+
MD025: { front_matter_title: "" },
|
|
133
137
|
MD026: true,
|
|
134
138
|
MD027: true,
|
|
135
139
|
MD028: true,
|
package/lint/config/Preset.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createConfig } from "./createConfig.js";
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import { Preset } from '@savvy-web/lint
|
|
9
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
10
10
|
*
|
|
11
11
|
* // Use a preset directly
|
|
12
12
|
* export default Preset.standard();
|
|
@@ -33,7 +33,7 @@ var Preset = class Preset {
|
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```typescript
|
|
36
|
-
* import { Preset } from '@savvy-web/lint
|
|
36
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
37
37
|
*
|
|
38
38
|
* export default Preset.minimal();
|
|
39
39
|
* ```
|
|
@@ -67,7 +67,7 @@ var Preset = class Preset {
|
|
|
67
67
|
*
|
|
68
68
|
* @example
|
|
69
69
|
* ```typescript
|
|
70
|
-
* import { Preset } from '@savvy-web/lint
|
|
70
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
71
71
|
*
|
|
72
72
|
* export default Preset.standard({
|
|
73
73
|
* biome: { exclude: ['legacy/'] },
|
|
@@ -104,7 +104,7 @@ var Preset = class Preset {
|
|
|
104
104
|
*
|
|
105
105
|
* @example
|
|
106
106
|
* ```typescript
|
|
107
|
-
* import { Preset } from '@savvy-web/lint
|
|
107
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
108
108
|
*
|
|
109
109
|
* export default Preset.silk({
|
|
110
110
|
* typescript: { skipTypecheck: true },
|
|
@@ -133,7 +133,7 @@ var Preset = class Preset {
|
|
|
133
133
|
*
|
|
134
134
|
* @example
|
|
135
135
|
* ```typescript
|
|
136
|
-
* import { Preset } from '@savvy-web/lint
|
|
136
|
+
* import { Preset } from '@savvy-web/silk/lint';
|
|
137
137
|
*
|
|
138
138
|
* const presetName = process.env.LINT_PRESET || 'standard';
|
|
139
139
|
* export default Preset.get(presetName);
|
|
@@ -18,7 +18,7 @@ import { Yaml } from "../handlers/Yaml.js";
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```typescript
|
|
21
|
-
* import { createConfig } from '@savvy-web/lint
|
|
21
|
+
* import { createConfig } from '@savvy-web/silk/lint';
|
|
22
22
|
*
|
|
23
23
|
* // Use all defaults
|
|
24
24
|
* export default createConfig();
|
package/lint/handlers/Biome.js
CHANGED
|
@@ -31,7 +31,7 @@ const DEFAULT_STRINGIFY_OPTIONS = {
|
|
|
31
31
|
*
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* import { PnpmWorkspace } from '\@savvy-web/lint
|
|
34
|
+
* import { PnpmWorkspace } from '\@savvy-web/silk/lint';
|
|
35
35
|
*
|
|
36
36
|
* export default {
|
|
37
37
|
* [PnpmWorkspace.glob]: PnpmWorkspace.create({
|
|
@@ -12,7 +12,7 @@ import { Filter } from "../utils/Filter.js";
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
15
|
-
* import { ShellScripts } from '@savvy-web/lint
|
|
15
|
+
* import { ShellScripts } from '@savvy-web/silk/lint';
|
|
16
16
|
*
|
|
17
17
|
* export default {
|
|
18
18
|
* [ShellScripts.glob]: ShellScripts.create({
|
|
@@ -15,7 +15,7 @@ import { Filter } from "../utils/Filter.js";
|
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```typescript
|
|
18
|
-
* import { TypeScript } from '\@savvy-web/lint
|
|
18
|
+
* import { TypeScript } from '\@savvy-web/silk/lint';
|
|
19
19
|
*
|
|
20
20
|
* export default {
|
|
21
21
|
* // Auto-detects compiler and runs type checking
|
package/lint/handlers/Yaml.js
CHANGED
package/lint/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { TypeScript } from "./handlers/TypeScript.js";
|
|
|
12
12
|
import { Yaml } from "./handlers/Yaml.js";
|
|
13
13
|
import { createConfig } from "./config/createConfig.js";
|
|
14
14
|
import { Preset } from "./config/Preset.js";
|
|
15
|
-
import { DEFAULT_CONFIG_PATH, HUSKY_HOOK_PATH, LegacySavvyLintHygieneDef, MARKDOWNLINT_CONFIG_PATH, POST_CHECKOUT_HOOK_PATH, POST_MERGE_HOOK_PATH, SavvyLintSectionDef, generateManagedContent, savvyLintBlock } from "./cli/sections.js";
|
|
15
|
+
import { DEFAULT_CONFIG_PATH, HUSKY_HOOK_PATH, LegacySavvyLintHygieneDef, MARKDOWNLINT_CONFIG_PATH, POST_CHECKOUT_HOOK_PATH, POST_COMMIT_HOOK_PATH, POST_MERGE_HOOK_PATH, SavvyLintSectionDef, generateManagedContent, savvyLintBlock } from "./cli/sections.js";
|
|
16
16
|
import { MARKDOWNLINT_CONFIG, MARKDOWNLINT_SCHEMA, MARKDOWNLINT_TEMPLATE } from "./cli/templates/markdownlint.gen.js";
|
|
17
17
|
|
|
18
18
|
//#region src/lint/index.ts
|
|
@@ -30,6 +30,7 @@ var lint_exports = /* @__PURE__ */ __exportAll({
|
|
|
30
30
|
MARKDOWNLINT_TEMPLATE: () => MARKDOWNLINT_TEMPLATE,
|
|
31
31
|
Markdown: () => Markdown,
|
|
32
32
|
POST_CHECKOUT_HOOK_PATH: () => POST_CHECKOUT_HOOK_PATH,
|
|
33
|
+
POST_COMMIT_HOOK_PATH: () => POST_COMMIT_HOOK_PATH,
|
|
33
34
|
POST_MERGE_HOOK_PATH: () => POST_MERGE_HOOK_PATH,
|
|
34
35
|
PackageJson: () => PackageJson,
|
|
35
36
|
PnpmWorkspace: () => PnpmWorkspace,
|
package/lint/utils/Command.js
CHANGED
|
@@ -8,7 +8,7 @@ import { execSync } from "node:child_process";
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
|
-
* import { Command } from '@savvy-web/lint
|
|
11
|
+
* import { Command } from '@savvy-web/silk/lint';
|
|
12
12
|
*
|
|
13
13
|
* if (Command.isAvailable('yq')) {
|
|
14
14
|
* // yq is installed globally
|
package/lint/utils/Filter.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```typescript
|
|
7
|
-
* import { Filter } from '@savvy-web/lint
|
|
7
|
+
* import { Filter } from '@savvy-web/silk/lint';
|
|
8
8
|
*
|
|
9
9
|
* const handler = (filenames: readonly string[]) => {
|
|
10
10
|
* const filtered = Filter.exclude(filenames, ['dist/', '__fixtures__']);
|
package/package.json
CHANGED
|
@@ -16,6 +16,26 @@ const DEFAULT_REGISTRIES = {
|
|
|
16
16
|
github: "https://npm.pkg.github.com"
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
+
* Whether a registry endpoint participates in npm-style SLSA provenance.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* The npm public registry and GitHub Packages both accept provenance attestations through the
|
|
23
|
+
* Sigstore/OIDC trusted-publishing flow, so a {@link PublishTarget} bound to either is marked
|
|
24
|
+
* `provenance: true` by default — this is what gates the release action's attestation step. JSR
|
|
25
|
+
* and custom registries do not participate and resolve to `false`. Matching is endpoint-based
|
|
26
|
+
* (not target-key based) so a custom key pointed at one of these registries still opts in.
|
|
27
|
+
*/
|
|
28
|
+
const provenanceForRegistry = (registry) => {
|
|
29
|
+
const normalized = /^[a-z]+:\/\//i.test(registry) ? registry : `https://${registry}`;
|
|
30
|
+
let hostname;
|
|
31
|
+
try {
|
|
32
|
+
hostname = new URL(normalized).hostname.toLowerCase();
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return hostname === "registry.npmjs.org" || hostname === "npm.pkg.github.com";
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
19
39
|
* Silk publishability rules over `workspaces-effect`'s {@link PublishTarget}.
|
|
20
40
|
*
|
|
21
41
|
* @remarks
|
|
@@ -57,28 +77,41 @@ var SilkPublishability = class {
|
|
|
57
77
|
name: t.name,
|
|
58
78
|
registry: t.registry,
|
|
59
79
|
directory: dirByGroup.get(t.group) ?? `dist/prod/${t.group}/pkg`,
|
|
60
|
-
access
|
|
80
|
+
access,
|
|
81
|
+
provenance: provenanceForRegistry(t.registry)
|
|
61
82
|
}));
|
|
62
83
|
}
|
|
63
|
-
return Object.
|
|
84
|
+
return Object.entries(targets).map(([id, target]) => {
|
|
85
|
+
const registry = typeof target === "object" && target !== null && typeof target.registry === "string" ? target.registry : DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT;
|
|
86
|
+
return new PublishTarget({
|
|
87
|
+
name: pkgName,
|
|
88
|
+
registry,
|
|
89
|
+
directory: `dist/prod/${id}/pkg`,
|
|
90
|
+
access,
|
|
91
|
+
provenance: provenanceForRegistry(registry)
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (pc && (pc.access === "public" || pc.access === "restricted")) {
|
|
96
|
+
const registry = pc.registry ?? NPM_DEFAULT;
|
|
97
|
+
return [new PublishTarget({
|
|
98
|
+
name: pkgName,
|
|
99
|
+
registry,
|
|
100
|
+
directory: pc.directory ?? ".",
|
|
101
|
+
access: pc.access,
|
|
102
|
+
provenance: provenanceForRegistry(registry)
|
|
103
|
+
})];
|
|
104
|
+
}
|
|
105
|
+
if (raw.private !== true) {
|
|
106
|
+
const registry = pc?.registry ?? NPM_DEFAULT;
|
|
107
|
+
return [new PublishTarget({
|
|
64
108
|
name: pkgName,
|
|
65
|
-
registry
|
|
66
|
-
directory:
|
|
67
|
-
access
|
|
68
|
-
|
|
109
|
+
registry,
|
|
110
|
+
directory: pc?.directory ?? ".",
|
|
111
|
+
access: pc?.access ?? "public",
|
|
112
|
+
provenance: provenanceForRegistry(registry)
|
|
113
|
+
})];
|
|
69
114
|
}
|
|
70
|
-
if (pc && (pc.access === "public" || pc.access === "restricted")) return [new PublishTarget({
|
|
71
|
-
name: pkgName,
|
|
72
|
-
registry: pc.registry ?? NPM_DEFAULT,
|
|
73
|
-
directory: pc.directory ?? ".",
|
|
74
|
-
access: pc.access
|
|
75
|
-
})];
|
|
76
|
-
if (raw.private !== true) return [new PublishTarget({
|
|
77
|
-
name: pkgName,
|
|
78
|
-
registry: pc?.registry ?? NPM_DEFAULT,
|
|
79
|
-
directory: pc?.directory ?? ".",
|
|
80
|
-
access: pc?.access ?? "public"
|
|
81
|
-
})];
|
|
82
115
|
return [];
|
|
83
116
|
}
|
|
84
117
|
/**
|