create-astro 5.0.5 → 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 +43 -11
- package/package.json +5 -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,
|
|
@@ -682,17 +682,37 @@ var FILES_TO_REMOVE = ["CHANGELOG.md", ".codesandbox"];
|
|
|
682
682
|
var FILES_TO_UPDATE = {
|
|
683
683
|
"package.json": (file, overrides) => fs.promises.readFile(file, "utf-8").then((value) => {
|
|
684
684
|
const indent = /(^\s+)/m.exec(value)?.[1] ?? " ";
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
null,
|
|
690
|
-
indent
|
|
691
|
-
),
|
|
692
|
-
"utf-8"
|
|
693
|
-
);
|
|
685
|
+
const packageJson = JSON.parse(value);
|
|
686
|
+
packageJson.name = overrides.name;
|
|
687
|
+
delete packageJson.private;
|
|
688
|
+
return fs.promises.writeFile(file, JSON.stringify(packageJson, null, indent), "utf-8");
|
|
694
689
|
})
|
|
695
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
|
+
}
|
|
696
716
|
function getTemplateTarget(tmpl, ref = "latest") {
|
|
697
717
|
if (tmpl === "starlight" || tmpl.startsWith("starlight/")) {
|
|
698
718
|
const [, starter = "basics"] = tmpl.split("/");
|
|
@@ -748,6 +768,17 @@ async function copyTemplate(tmpl, ctx) {
|
|
|
748
768
|
}
|
|
749
769
|
throw new Error(`Unable to download template ${color2.reset(tmpl)}`);
|
|
750
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
|
+
}
|
|
751
782
|
const removeFiles = FILES_TO_REMOVE.map(async (file) => {
|
|
752
783
|
const fileLoc = path.resolve(path.join(ctx.cwd, file));
|
|
753
784
|
if (fs.existsSync(fileLoc)) {
|
|
@@ -1154,6 +1185,7 @@ async function main() {
|
|
|
1154
1185
|
}
|
|
1155
1186
|
export {
|
|
1156
1187
|
dependencies,
|
|
1188
|
+
generateAgentsMd,
|
|
1157
1189
|
getContext,
|
|
1158
1190
|
git,
|
|
1159
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,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"arg": "^5.0.2",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"@astrojs/internal-helpers": "0.10.0",
|
|
34
|
+
"astro-scripts": "0.0.14"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=22.12.0"
|
|
@@ -40,9 +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.
|
|
46
|
+
"test": "astro-scripts test \"test/**/*.test.ts\""
|
|
47
47
|
}
|
|
48
48
|
}
|