@projitect/blueprint-markdown 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/dist/package.json +56 -0
- package/dist/src/index.d.ts +30 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +99 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +53 -3
- package/src/index.ts +131 -0
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kapil Easwar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@projitect/blueprint-markdown",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Composable AGENTS.md and README.md snippets (package manager, verification, commits, license, ...) for projitect.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/projitect/projitect.git",
|
|
8
|
+
"directory": "packages/blueprint-markdown"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/src/index.d.ts",
|
|
15
|
+
"import": "./dist/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"src",
|
|
21
|
+
"!**/*.tsbuildinfo"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc --build",
|
|
25
|
+
"build:clean": "tsc --build --clean",
|
|
26
|
+
"tc": "tsc --build"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@projitect/blueprint": "workspace:*",
|
|
30
|
+
"@projitect/core": "workspace:*",
|
|
31
|
+
"@projitect/test-kit": "workspace:*",
|
|
32
|
+
"effect": "4.0.0-rc.111",
|
|
33
|
+
"typescript": "5.9.3"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@projitect/blueprint": "workspace:*",
|
|
37
|
+
"@projitect/core": "workspace:*",
|
|
38
|
+
"effect": "4.0.0-rc.111"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22.12.0"
|
|
42
|
+
},
|
|
43
|
+
"projitect": {
|
|
44
|
+
"type": "blueprint-set",
|
|
45
|
+
"import": "import { markdownSnippets } from \"@projitect/blueprint-markdown\"",
|
|
46
|
+
"callTemplate": "markdownSnippets.{section}()",
|
|
47
|
+
"sections": [
|
|
48
|
+
"agentsPackageManager",
|
|
49
|
+
"agentsVerification",
|
|
50
|
+
"agentsCommits",
|
|
51
|
+
"agentsNoDestructiveShortcuts",
|
|
52
|
+
"readmeContributing",
|
|
53
|
+
"readmeLicense"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @projitect/blueprint-markdown
|
|
3
|
+
*
|
|
4
|
+
* Six composable Markdown snippets for `AGENTS.md` and `README.md`. Each function returns a
|
|
5
|
+
* region-mode blueprint that owns its named section between `<!-- pjt:markdown:<file>:<name> start -->`
|
|
6
|
+
* and `<!-- pjt:markdown:<file>:<name> end -->` markers — so several snippets coexist in one file,
|
|
7
|
+
* text outside the markers stays yours, and `pjt inspect` catches hand-edits inside them.
|
|
8
|
+
*
|
|
9
|
+
* Owner ids are stable across package versions: an upgrade changes a snippet's `version` and
|
|
10
|
+
* (usually) its content, never its id, so `pjt remodel` rewrites exactly the region that snippet
|
|
11
|
+
* owns. Every snippet takes optional `version` and `content` overrides for forks and tests.
|
|
12
|
+
*/
|
|
13
|
+
import type { Blueprint } from "@projitect/core";
|
|
14
|
+
/** Overrides accepted by every snippet. Both are optional. */
|
|
15
|
+
export interface SnippetOptions {
|
|
16
|
+
/** Recorded in `.pjt.lock`. Defaults to this package's version. */
|
|
17
|
+
readonly version?: string;
|
|
18
|
+
/** Replaces the snippet's default Markdown body. The owner id never changes. */
|
|
19
|
+
readonly content?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const markdownSnippets: {
|
|
22
|
+
readonly agentsPackageManager: (options?: SnippetOptions) => Blueprint.Blueprint;
|
|
23
|
+
readonly agentsVerification: (options?: SnippetOptions) => Blueprint.Blueprint;
|
|
24
|
+
readonly agentsCommits: (options?: SnippetOptions) => Blueprint.Blueprint;
|
|
25
|
+
readonly agentsNoDestructiveShortcuts: (options?: SnippetOptions) => Blueprint.Blueprint;
|
|
26
|
+
readonly readmeContributing: (options?: SnippetOptions) => Blueprint.Blueprint;
|
|
27
|
+
readonly readmeLicense: (options?: SnippetOptions) => Blueprint.Blueprint;
|
|
28
|
+
};
|
|
29
|
+
export type MarkdownSnippet = keyof typeof markdownSnippets;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAOhD,8DAA8D;AAC9D,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AA0DD,eAAO,MAAM,gBAAgB;8CACK,cAAc,KAAQ,SAAS,CAAC,SAAS;4CAO3C,cAAc,KAAQ,SAAS,CAAC,SAAS;uCAO9C,cAAc,KAAQ,SAAS,CAAC,SAAS;sDAO1B,cAAc,KAAQ,SAAS,CAAC,SAAS;4CAOnD,cAAc,KAAQ,SAAS,CAAC,SAAS;uCAO9C,cAAc,KAAQ,SAAS,CAAC,SAAS;CAO1D,CAAA;AAEV,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @projitect/blueprint-markdown
|
|
3
|
+
*
|
|
4
|
+
* Six composable Markdown snippets for `AGENTS.md` and `README.md`. Each function returns a
|
|
5
|
+
* region-mode blueprint that owns its named section between `<!-- pjt:markdown:<file>:<name> start -->`
|
|
6
|
+
* and `<!-- pjt:markdown:<file>:<name> end -->` markers — so several snippets coexist in one file,
|
|
7
|
+
* text outside the markers stays yours, and `pjt inspect` catches hand-edits inside them.
|
|
8
|
+
*
|
|
9
|
+
* Owner ids are stable across package versions: an upgrade changes a snippet's `version` and
|
|
10
|
+
* (usually) its content, never its id, so `pjt remodel` rewrites exactly the region that snippet
|
|
11
|
+
* owns. Every snippet takes optional `version` and `content` overrides for forks and tests.
|
|
12
|
+
*/
|
|
13
|
+
import { markdownSection } from "@projitect/blueprint";
|
|
14
|
+
import manifest from "../package.json" with { type: "json" };
|
|
15
|
+
// Read the version from the package manifest (emitted next to `dist/src`) so a release bump
|
|
16
|
+
// reaches `.pjt.lock` without a hand-edited constant. JSON import keeps this runtime-pure.
|
|
17
|
+
const PACKAGE_VERSION = manifest.version;
|
|
18
|
+
const FILES = {
|
|
19
|
+
agents: { path: "AGENTS.md", slug: "agents" },
|
|
20
|
+
readme: { path: "README.md", slug: "readme" },
|
|
21
|
+
};
|
|
22
|
+
const makeSnippet = (params) => {
|
|
23
|
+
const { file, name, defaultContent, options } = params;
|
|
24
|
+
return markdownSection({
|
|
25
|
+
id: `pjt:markdown:${file.slug}:${name}`,
|
|
26
|
+
version: options.version ?? PACKAGE_VERSION,
|
|
27
|
+
description: `${file.path} snippet: ${name}`,
|
|
28
|
+
path: file.path,
|
|
29
|
+
content: options.content ?? defaultContent,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const agentsPackageManager = `## Package manager
|
|
33
|
+
|
|
34
|
+
Use the package manager this project's lockfile names, and no other. Never mix package managers in
|
|
35
|
+
one checkout.
|
|
36
|
+
`;
|
|
37
|
+
const agentsVerification = `## Verification
|
|
38
|
+
|
|
39
|
+
Before claiming a task done, run the project's full check — typecheck, lint and tests — and read the
|
|
40
|
+
output. If a check fails, fix the cause; report anything you could not run.
|
|
41
|
+
`;
|
|
42
|
+
const agentsCommits = `## Commits
|
|
43
|
+
|
|
44
|
+
Write conventional commit subjects (\`feat:\`, \`fix:\`, \`docs:\`, ...). One concept per commit, and
|
|
45
|
+
run the full check before pushing.
|
|
46
|
+
`;
|
|
47
|
+
const agentsNoDestructiveShortcuts = `## No destructive shortcuts
|
|
48
|
+
|
|
49
|
+
When a check fails, fix the root cause. Do not skip or delete tests, silence type errors, or bypass
|
|
50
|
+
commit hooks to get a green result.
|
|
51
|
+
`;
|
|
52
|
+
const readmeContributing = `## Contributing
|
|
53
|
+
|
|
54
|
+
Issues and pull requests are welcome. Read \`AGENTS.md\` for the conventions this project follows
|
|
55
|
+
before you open one.
|
|
56
|
+
`;
|
|
57
|
+
const readmeLicense = `## License
|
|
58
|
+
|
|
59
|
+
See the \`LICENSE\` file in this repository for the license terms.
|
|
60
|
+
`;
|
|
61
|
+
export const markdownSnippets = {
|
|
62
|
+
agentsPackageManager: (options = {}) => makeSnippet({
|
|
63
|
+
file: FILES.agents,
|
|
64
|
+
name: "package-manager",
|
|
65
|
+
defaultContent: agentsPackageManager,
|
|
66
|
+
options,
|
|
67
|
+
}),
|
|
68
|
+
agentsVerification: (options = {}) => makeSnippet({
|
|
69
|
+
file: FILES.agents,
|
|
70
|
+
name: "verification",
|
|
71
|
+
defaultContent: agentsVerification,
|
|
72
|
+
options,
|
|
73
|
+
}),
|
|
74
|
+
agentsCommits: (options = {}) => makeSnippet({
|
|
75
|
+
file: FILES.agents,
|
|
76
|
+
name: "commits",
|
|
77
|
+
defaultContent: agentsCommits,
|
|
78
|
+
options,
|
|
79
|
+
}),
|
|
80
|
+
agentsNoDestructiveShortcuts: (options = {}) => makeSnippet({
|
|
81
|
+
file: FILES.agents,
|
|
82
|
+
name: "no-destructive-shortcuts",
|
|
83
|
+
defaultContent: agentsNoDestructiveShortcuts,
|
|
84
|
+
options,
|
|
85
|
+
}),
|
|
86
|
+
readmeContributing: (options = {}) => makeSnippet({
|
|
87
|
+
file: FILES.readme,
|
|
88
|
+
name: "contributing",
|
|
89
|
+
defaultContent: readmeContributing,
|
|
90
|
+
options,
|
|
91
|
+
}),
|
|
92
|
+
readmeLicense: (options = {}) => makeSnippet({
|
|
93
|
+
file: FILES.readme,
|
|
94
|
+
name: "license",
|
|
95
|
+
defaultContent: readmeLicense,
|
|
96
|
+
options,
|
|
97
|
+
}),
|
|
98
|
+
};
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3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Composable AGENTS.md and README.md snippets (package manager, verification, commits, license, ...) for projitect.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/projitect/projitect.git",
|
|
8
|
+
"directory": "packages/blueprint-markdown"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/src/index.d.ts",
|
|
15
|
+
"import": "./dist/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"src",
|
|
21
|
+
"!**/*.tsbuildinfo"
|
|
22
|
+
],
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"effect": "4.0.0-rc.111",
|
|
25
|
+
"typescript": "5.9.3",
|
|
26
|
+
"@projitect/blueprint": "1.0.1",
|
|
27
|
+
"@projitect/core": "1.0.1",
|
|
28
|
+
"@projitect/test-kit": "1.0.1"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"effect": "4.0.0-rc.111",
|
|
32
|
+
"@projitect/blueprint": "1.0.1",
|
|
33
|
+
"@projitect/core": "1.0.1"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22.12.0"
|
|
37
|
+
},
|
|
38
|
+
"projitect": {
|
|
39
|
+
"type": "blueprint-set",
|
|
40
|
+
"import": "import { markdownSnippets } from \"@projitect/blueprint-markdown\"",
|
|
41
|
+
"callTemplate": "markdownSnippets.{section}()",
|
|
42
|
+
"sections": [
|
|
43
|
+
"agentsPackageManager",
|
|
44
|
+
"agentsVerification",
|
|
45
|
+
"agentsCommits",
|
|
46
|
+
"agentsNoDestructiveShortcuts",
|
|
47
|
+
"readmeContributing",
|
|
48
|
+
"readmeLicense"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc --build",
|
|
53
|
+
"build:clean": "tsc --build --clean",
|
|
54
|
+
"tc": "tsc --build"
|
|
55
|
+
}
|
|
6
56
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @projitect/blueprint-markdown
|
|
3
|
+
*
|
|
4
|
+
* Six composable Markdown snippets for `AGENTS.md` and `README.md`. Each function returns a
|
|
5
|
+
* region-mode blueprint that owns its named section between `<!-- pjt:markdown:<file>:<name> start -->`
|
|
6
|
+
* and `<!-- pjt:markdown:<file>:<name> end -->` markers — so several snippets coexist in one file,
|
|
7
|
+
* text outside the markers stays yours, and `pjt inspect` catches hand-edits inside them.
|
|
8
|
+
*
|
|
9
|
+
* Owner ids are stable across package versions: an upgrade changes a snippet's `version` and
|
|
10
|
+
* (usually) its content, never its id, so `pjt remodel` rewrites exactly the region that snippet
|
|
11
|
+
* owns. Every snippet takes optional `version` and `content` overrides for forks and tests.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { markdownSection } from "@projitect/blueprint"
|
|
15
|
+
import type { Blueprint } from "@projitect/core"
|
|
16
|
+
import manifest from "../package.json" with { type: "json" }
|
|
17
|
+
|
|
18
|
+
// Read the version from the package manifest (emitted next to `dist/src`) so a release bump
|
|
19
|
+
// reaches `.pjt.lock` without a hand-edited constant. JSON import keeps this runtime-pure.
|
|
20
|
+
const PACKAGE_VERSION = manifest.version
|
|
21
|
+
|
|
22
|
+
/** Overrides accepted by every snippet. Both are optional. */
|
|
23
|
+
export interface SnippetOptions {
|
|
24
|
+
/** Recorded in `.pjt.lock`. Defaults to this package's version. */
|
|
25
|
+
readonly version?: string
|
|
26
|
+
/** Replaces the snippet's default Markdown body. The owner id never changes. */
|
|
27
|
+
readonly content?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const FILES = {
|
|
31
|
+
agents: { path: "AGENTS.md", slug: "agents" },
|
|
32
|
+
readme: { path: "README.md", slug: "readme" },
|
|
33
|
+
} as const
|
|
34
|
+
|
|
35
|
+
const makeSnippet = (params: {
|
|
36
|
+
readonly file: (typeof FILES)[keyof typeof FILES]
|
|
37
|
+
readonly name: string
|
|
38
|
+
readonly defaultContent: string
|
|
39
|
+
readonly options: SnippetOptions
|
|
40
|
+
}): Blueprint.Blueprint => {
|
|
41
|
+
const { file, name, defaultContent, options } = params
|
|
42
|
+
return markdownSection({
|
|
43
|
+
id: `pjt:markdown:${file.slug}:${name}`,
|
|
44
|
+
version: options.version ?? PACKAGE_VERSION,
|
|
45
|
+
description: `${file.path} snippet: ${name}`,
|
|
46
|
+
path: file.path,
|
|
47
|
+
content: options.content ?? defaultContent,
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const agentsPackageManager = `## Package manager
|
|
52
|
+
|
|
53
|
+
Use the package manager this project's lockfile names, and no other. Never mix package managers in
|
|
54
|
+
one checkout.
|
|
55
|
+
`
|
|
56
|
+
|
|
57
|
+
const agentsVerification = `## Verification
|
|
58
|
+
|
|
59
|
+
Before claiming a task done, run the project's full check — typecheck, lint and tests — and read the
|
|
60
|
+
output. If a check fails, fix the cause; report anything you could not run.
|
|
61
|
+
`
|
|
62
|
+
|
|
63
|
+
const agentsCommits = `## Commits
|
|
64
|
+
|
|
65
|
+
Write conventional commit subjects (\`feat:\`, \`fix:\`, \`docs:\`, ...). One concept per commit, and
|
|
66
|
+
run the full check before pushing.
|
|
67
|
+
`
|
|
68
|
+
|
|
69
|
+
const agentsNoDestructiveShortcuts = `## No destructive shortcuts
|
|
70
|
+
|
|
71
|
+
When a check fails, fix the root cause. Do not skip or delete tests, silence type errors, or bypass
|
|
72
|
+
commit hooks to get a green result.
|
|
73
|
+
`
|
|
74
|
+
|
|
75
|
+
const readmeContributing = `## Contributing
|
|
76
|
+
|
|
77
|
+
Issues and pull requests are welcome. Read \`AGENTS.md\` for the conventions this project follows
|
|
78
|
+
before you open one.
|
|
79
|
+
`
|
|
80
|
+
|
|
81
|
+
const readmeLicense = `## License
|
|
82
|
+
|
|
83
|
+
See the \`LICENSE\` file in this repository for the license terms.
|
|
84
|
+
`
|
|
85
|
+
|
|
86
|
+
export const markdownSnippets = {
|
|
87
|
+
agentsPackageManager: (options: SnippetOptions = {}): Blueprint.Blueprint =>
|
|
88
|
+
makeSnippet({
|
|
89
|
+
file: FILES.agents,
|
|
90
|
+
name: "package-manager",
|
|
91
|
+
defaultContent: agentsPackageManager,
|
|
92
|
+
options,
|
|
93
|
+
}),
|
|
94
|
+
agentsVerification: (options: SnippetOptions = {}): Blueprint.Blueprint =>
|
|
95
|
+
makeSnippet({
|
|
96
|
+
file: FILES.agents,
|
|
97
|
+
name: "verification",
|
|
98
|
+
defaultContent: agentsVerification,
|
|
99
|
+
options,
|
|
100
|
+
}),
|
|
101
|
+
agentsCommits: (options: SnippetOptions = {}): Blueprint.Blueprint =>
|
|
102
|
+
makeSnippet({
|
|
103
|
+
file: FILES.agents,
|
|
104
|
+
name: "commits",
|
|
105
|
+
defaultContent: agentsCommits,
|
|
106
|
+
options,
|
|
107
|
+
}),
|
|
108
|
+
agentsNoDestructiveShortcuts: (options: SnippetOptions = {}): Blueprint.Blueprint =>
|
|
109
|
+
makeSnippet({
|
|
110
|
+
file: FILES.agents,
|
|
111
|
+
name: "no-destructive-shortcuts",
|
|
112
|
+
defaultContent: agentsNoDestructiveShortcuts,
|
|
113
|
+
options,
|
|
114
|
+
}),
|
|
115
|
+
readmeContributing: (options: SnippetOptions = {}): Blueprint.Blueprint =>
|
|
116
|
+
makeSnippet({
|
|
117
|
+
file: FILES.readme,
|
|
118
|
+
name: "contributing",
|
|
119
|
+
defaultContent: readmeContributing,
|
|
120
|
+
options,
|
|
121
|
+
}),
|
|
122
|
+
readmeLicense: (options: SnippetOptions = {}): Blueprint.Blueprint =>
|
|
123
|
+
makeSnippet({
|
|
124
|
+
file: FILES.readme,
|
|
125
|
+
name: "license",
|
|
126
|
+
defaultContent: readmeLicense,
|
|
127
|
+
options,
|
|
128
|
+
}),
|
|
129
|
+
} as const
|
|
130
|
+
|
|
131
|
+
export type MarkdownSnippet = keyof typeof markdownSnippets
|
package/README.md
DELETED