create-astro 5.0.6 → 5.1.0-beta.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/create-astro.mjs +1 -1
- package/dist/actions/template.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +39 -2
- package/package.json +4 -5
package/create-astro.mjs
CHANGED
|
@@ -14,5 +14,6 @@ export declare function removeTemplateMarkerSections(content: string): string;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function processTemplateReadme(content: string, packageManager: string): string;
|
|
16
16
|
export declare function template(ctx: Pick<Context, 'template' | 'prompt' | 'yes' | 'dryRun' | 'exit' | 'tasks'>): Promise<void>;
|
|
17
|
+
export declare function generateAgentsMd(): string;
|
|
17
18
|
export declare function getTemplateTarget(tmpl: string, ref?: string): string;
|
|
18
19
|
export declare function isThirdPartyTemplate(tmpl: string): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { next } from './actions/next-steps.js';
|
|
|
6
6
|
import { projectName } from './actions/project-name.js';
|
|
7
7
|
import { template } from './actions/template.js';
|
|
8
8
|
import { verify } from './actions/verify.js';
|
|
9
|
-
export { processTemplateReadme, removeTemplateMarkerSections } from './actions/template.js';
|
|
9
|
+
export { generateAgentsMd, processTemplateReadme, removeTemplateMarkerSections, } from './actions/template.js';
|
|
10
10
|
export { setStdout } from './messages.js';
|
|
11
11
|
export declare function main(): Promise<void>;
|
|
12
12
|
export { dependencies, getContext, git, intro, next, projectName, template, verify };
|
package/dist/index.js
CHANGED
|
@@ -470,7 +470,7 @@ function printHelp({
|
|
|
470
470
|
if (headline) {
|
|
471
471
|
message.push(
|
|
472
472
|
linebreak(),
|
|
473
|
-
`${title(commandName)} ${color.green(`v${"5.0.
|
|
473
|
+
`${title(commandName)} ${color.green(`v${"5.1.0-beta.0"}`)} ${headline}`
|
|
474
474
|
);
|
|
475
475
|
}
|
|
476
476
|
if (usage) {
|
|
@@ -569,7 +569,7 @@ async function getContext(argv) {
|
|
|
569
569
|
packageManager,
|
|
570
570
|
"astro",
|
|
571
571
|
getPackageTag(packageSpecifier),
|
|
572
|
-
"
|
|
572
|
+
"7.0.0-beta.6"
|
|
573
573
|
),
|
|
574
574
|
skipHouston,
|
|
575
575
|
fancy,
|
|
@@ -688,6 +688,31 @@ var FILES_TO_UPDATE = {
|
|
|
688
688
|
return fs.promises.writeFile(file, JSON.stringify(packageJson, null, indent), "utf-8");
|
|
689
689
|
})
|
|
690
690
|
};
|
|
691
|
+
function generateAgentsMd() {
|
|
692
|
+
return `## Development
|
|
693
|
+
|
|
694
|
+
When starting the dev server, use background mode:
|
|
695
|
+
|
|
696
|
+
\`\`\`
|
|
697
|
+
astro dev --background
|
|
698
|
+
\`\`\`
|
|
699
|
+
|
|
700
|
+
Manage the background server with \`astro dev stop\`, \`astro dev status\`, and \`astro dev logs\`.
|
|
701
|
+
|
|
702
|
+
## Documentation
|
|
703
|
+
|
|
704
|
+
Full documentation: https://docs.astro.build
|
|
705
|
+
|
|
706
|
+
Consult these guides before working on related tasks:
|
|
707
|
+
|
|
708
|
+
- [Adding pages, dynamic routes, or middleware](https://docs.astro.build/en/guides/routing/)
|
|
709
|
+
- [Working with Astro components](https://docs.astro.build/en/basics/astro-components/)
|
|
710
|
+
- [Using React, Vue, Svelte, or other framework components](https://docs.astro.build/en/guides/framework-components/)
|
|
711
|
+
- [Adding or managing content](https://docs.astro.build/en/guides/content-collections/)
|
|
712
|
+
- [Adding styles or using Tailwind](https://docs.astro.build/en/guides/styling/)
|
|
713
|
+
- [Supporting multiple languages](https://docs.astro.build/en/guides/internationalization/)
|
|
714
|
+
`;
|
|
715
|
+
}
|
|
691
716
|
function getTemplateTarget(tmpl, ref = "latest") {
|
|
692
717
|
if (tmpl === "starlight" || tmpl.startsWith("starlight/")) {
|
|
693
718
|
const [, starter = "basics"] = tmpl.split("/");
|
|
@@ -743,6 +768,17 @@ async function copyTemplate(tmpl, ctx) {
|
|
|
743
768
|
}
|
|
744
769
|
throw new Error(`Unable to download template ${color2.reset(tmpl)}`);
|
|
745
770
|
}
|
|
771
|
+
const agentsPath = path.resolve(ctx.cwd, "AGENTS.md");
|
|
772
|
+
const claudePath = path.resolve(ctx.cwd, "CLAUDE.md");
|
|
773
|
+
fs.writeFileSync(agentsPath, generateAgentsMd());
|
|
774
|
+
try {
|
|
775
|
+
fs.symlinkSync("AGENTS.md", claudePath);
|
|
776
|
+
} catch {
|
|
777
|
+
try {
|
|
778
|
+
fs.linkSync(agentsPath, claudePath);
|
|
779
|
+
} catch {
|
|
780
|
+
}
|
|
781
|
+
}
|
|
746
782
|
const removeFiles = FILES_TO_REMOVE.map(async (file) => {
|
|
747
783
|
const fileLoc = path.resolve(path.join(ctx.cwd, file));
|
|
748
784
|
if (fs.existsSync(fileLoc)) {
|
|
@@ -1149,6 +1185,7 @@ async function main() {
|
|
|
1149
1185
|
}
|
|
1150
1186
|
export {
|
|
1151
1187
|
dependencies,
|
|
1188
|
+
generateAgentsMd,
|
|
1152
1189
|
getContext,
|
|
1153
1190
|
git,
|
|
1154
1191
|
intro,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-astro",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.1.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "withastro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"arg": "^5.0.2",
|
|
33
|
-
"@astrojs/internal-helpers": "0.
|
|
33
|
+
"@astrojs/internal-helpers": "0.10.0",
|
|
34
34
|
"astro-scripts": "0.0.14"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
@@ -40,10 +40,9 @@
|
|
|
40
40
|
"provenance": true
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
|
-
"build": "astro-scripts build \"src/index.ts\" --bundle && tsc",
|
|
43
|
+
"build": "astro-scripts build \"src/index.ts\" --bundle && tsc -b",
|
|
44
44
|
"build:ci": "astro-scripts build \"src/index.ts\" --bundle",
|
|
45
45
|
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
|
46
|
-
"test": "astro-scripts test \"test/**/*.test.ts\""
|
|
47
|
-
"typecheck:tests": "tsc --build tsconfig.test.json"
|
|
46
|
+
"test": "astro-scripts test \"test/**/*.test.ts\""
|
|
48
47
|
}
|
|
49
48
|
}
|