create-astro 0.7.0 → 0.8.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/LICENSE +34 -0
- package/README.md +15 -0
- package/dist/config.js +17 -18
- package/dist/frameworks.js +11 -12
- package/dist/index.js +40 -26
- package/dist/logger.js +108 -0
- package/dist/templates.js +5 -15
- package/dist/types/config.d.ts +3 -2
- package/dist/types/frameworks.d.ts +10 -6
- package/dist/types/logger.d.ts +38 -0
- package/dist/types/templates.d.ts +2 -2
- package/package.json +20 -17
package/LICENSE
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Fred K. Schott
|
|
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.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
"""
|
|
25
|
+
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
|
|
26
|
+
|
|
27
|
+
Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors)
|
|
28
|
+
|
|
29
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
30
|
+
|
|
31
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
32
|
+
|
|
33
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
34
|
+
"""
|
package/README.md
CHANGED
|
@@ -43,4 +43,19 @@ May be provided in place of prompts
|
|
|
43
43
|
| `--template` | Specify the template name ([list][examples]) |
|
|
44
44
|
| `--commit` | Specify a specific Git commit or branch to use from this repo (by default, `main` branch of this repo will be used) |
|
|
45
45
|
|
|
46
|
+
### Debugging
|
|
47
|
+
|
|
48
|
+
To debug `create-astro`, you can use the `--verbose` flag which will log the output of degit and some more information about the command, this can be useful when you encounter an error and want to report it.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# npm 6.x
|
|
52
|
+
npm init astro my-astro-project --verbose
|
|
53
|
+
|
|
54
|
+
# npm 7+, extra double-dash is needed:
|
|
55
|
+
npm init astro my-astro-project -- --verbose
|
|
56
|
+
|
|
57
|
+
# yarn
|
|
58
|
+
yarn create astro my-astro-project --verbose
|
|
59
|
+
```
|
|
60
|
+
|
|
46
61
|
[examples]: https://github.com/withastro/astro/tree/main/examples
|
package/dist/config.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
const createConfig = ({
|
|
1
|
+
const createConfig = ({ integrations }) => {
|
|
2
|
+
if (integrations.length === 0) {
|
|
3
|
+
return `import { defineConfig } from 'astro/config';
|
|
4
|
+
// https://astro.build/config
|
|
5
|
+
export default defineConfig({});
|
|
6
|
+
`;
|
|
7
|
+
}
|
|
8
|
+
const rendererImports = integrations.map((r) => ` import ${r.id} from '${r.packageName}';`);
|
|
9
|
+
const rendererIntegrations = integrations.map((r) => ` ${r.id}(),`);
|
|
2
10
|
return [
|
|
3
|
-
`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
devOptions: {
|
|
13
|
-
// hostname: 'localhost', // The hostname to run the dev server on.
|
|
14
|
-
// port: 3000, // The port to run the dev server on.
|
|
15
|
-
},`,
|
|
16
|
-
` renderers: ${JSON.stringify(renderers, void 0, 2).split("\n").map((ln, i) => i !== 0 ? ` ${ln}` : ln).join("\n")},`,
|
|
17
|
-
`};
|
|
18
|
-
`
|
|
11
|
+
`import { defineConfig } from 'astro/config';`,
|
|
12
|
+
...rendererImports,
|
|
13
|
+
`// https://astro.build/config`,
|
|
14
|
+
`export default defineConfig({`,
|
|
15
|
+
` integrations: [`,
|
|
16
|
+
...rendererIntegrations,
|
|
17
|
+
` ]`,
|
|
18
|
+
`});`
|
|
19
19
|
].join("\n");
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
22
|
createConfig
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2NvbmZpZy50cyJdLAogICJtYXBwaW5ncyI6ICJBQUFPLE1BQU0sZUFBZSxDQUFDLEVBQUUsZ0JBQXlDO0FBQ3ZFLFNBQU87QUFBQSxJQUNOO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsSUFhQSxnQkFBZ0IsS0FBSyxVQUFVLFdBQVcsUUFBVyxHQUNuRCxNQUFNLE1BQ04sSUFBSSxDQUFDLElBQUksTUFBTyxNQUFNLElBQUksS0FBSyxPQUFPLElBQ3RDLEtBQUs7QUFBQSxJQUNQO0FBQUE7QUFBQSxJQUVDLEtBQUs7QUFBQTsiLAogICJuYW1lcyI6IFtdCn0K
|
package/dist/frameworks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const COUNTER_COMPONENTS = {
|
|
2
|
-
|
|
2
|
+
preact: {
|
|
3
3
|
filename: `src/components/PreactCounter.jsx`,
|
|
4
4
|
content: `import { useState } from 'preact/hooks';
|
|
5
5
|
|
|
@@ -18,7 +18,7 @@ export default function PreactCounter() {
|
|
|
18
18
|
}
|
|
19
19
|
`
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
react: {
|
|
22
22
|
filename: `src/components/ReactCounter.jsx`,
|
|
23
23
|
content: `import { useState } from 'react';
|
|
24
24
|
|
|
@@ -37,7 +37,7 @@ export default function ReactCounter() {
|
|
|
37
37
|
}
|
|
38
38
|
`
|
|
39
39
|
},
|
|
40
|
-
|
|
40
|
+
solid: {
|
|
41
41
|
filename: `src/components/SolidCounter.jsx`,
|
|
42
42
|
content: `import { createSignal } from "solid-js";
|
|
43
43
|
|
|
@@ -56,7 +56,7 @@ export default function SolidCounter() {
|
|
|
56
56
|
}
|
|
57
57
|
`
|
|
58
58
|
},
|
|
59
|
-
|
|
59
|
+
svelte: {
|
|
60
60
|
filename: `src/components/SvelteCounter.svelte`,
|
|
61
61
|
content: `<script>
|
|
62
62
|
let count = 0;
|
|
@@ -77,7 +77,7 @@ export default function SolidCounter() {
|
|
|
77
77
|
</div>
|
|
78
78
|
`
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
vue: {
|
|
81
81
|
filename: `src/components/VueCounter.vue`,
|
|
82
82
|
content: `<template>
|
|
83
83
|
<div id="vue" class="counter">
|
|
@@ -109,27 +109,26 @@ export default {
|
|
|
109
109
|
const FRAMEWORKS = [
|
|
110
110
|
{
|
|
111
111
|
title: "Preact",
|
|
112
|
-
value: "@astrojs/
|
|
112
|
+
value: { id: "preact", packageName: "@astrojs/preact" }
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
title: "React",
|
|
116
|
-
value: "@astrojs/
|
|
116
|
+
value: { id: "react", packageName: "@astrojs/react" }
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
title: "Solid",
|
|
120
|
-
value: "@astrojs/
|
|
119
|
+
title: "Solid.js",
|
|
120
|
+
value: { id: "solid", packageName: "@astrojs/solid-js" }
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
title: "Svelte",
|
|
124
|
-
value: "@astrojs/
|
|
124
|
+
value: { id: "svelte", packageName: "@astrojs/svelte" }
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
title: "Vue",
|
|
128
|
-
value: "@astrojs/
|
|
128
|
+
value: { id: "vue", packageName: "@astrojs/vue" }
|
|
129
129
|
}
|
|
130
130
|
];
|
|
131
131
|
export {
|
|
132
132
|
COUNTER_COMPONENTS,
|
|
133
133
|
FRAMEWORKS
|
|
134
134
|
};
|
|
135
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2ZyYW1ld29ya3MudHMiXSwKICAibWFwcGluZ3MiOiAiQUFBTyxNQUFNLHFCQUFxQjtBQUFBLEVBQ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BQ0MsT0FBTztBQUFBLElBQ1AsT0FBTztBQUFBO0FBQUEsRUFFUjtBQUFBLElBQ0MsT0FBTztBQUFBLElBQ1AsT0FBTztBQUFBO0FBQUEsRUFFUjtBQUFBLElBQ0MsT0FBTztBQUFBLElBQ1AsT0FBTztBQUFBO0FBQUEsRUFFUjtBQUFBLElBQ0MsT0FBTztBQUFBLElBQ1AsT0FBTztBQUFBO0FBQUE7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
package/dist/index.js
CHANGED
|
@@ -21,11 +21,13 @@ import fetch from "node-fetch";
|
|
|
21
21
|
import prompts from "prompts";
|
|
22
22
|
import degit from "degit";
|
|
23
23
|
import yargs from "yargs-parser";
|
|
24
|
+
import ora from "ora";
|
|
24
25
|
import { FRAMEWORKS, COUNTER_COMPONENTS } from "./frameworks.js";
|
|
25
26
|
import { TEMPLATES } from "./templates.js";
|
|
26
27
|
import { createConfig } from "./config.js";
|
|
28
|
+
import { logger, defaultLogLevel } from "./logger.js";
|
|
27
29
|
const cleanArgv = process.argv.filter((arg) => arg !== "--");
|
|
28
|
-
const args = yargs(cleanArgv
|
|
30
|
+
const args = yargs(cleanArgv);
|
|
29
31
|
prompts.override(args);
|
|
30
32
|
function mkdirp(dir) {
|
|
31
33
|
try {
|
|
@@ -39,12 +41,13 @@ function mkdirp(dir) {
|
|
|
39
41
|
const { version } = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
40
42
|
const POSTPROCESS_FILES = ["package.json", "astro.config.mjs", "CHANGELOG.md"];
|
|
41
43
|
async function main() {
|
|
44
|
+
logger.debug("Verbose logging turned on");
|
|
42
45
|
console.log(`
|
|
43
46
|
${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
|
|
44
47
|
console.log(`If you encounter a problem, visit ${cyan("https://github.com/withastro/astro/issues")} to search or file a new issue.
|
|
45
48
|
`);
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
let spinner = ora({ color: "green", text: "Prepare for liftoff." });
|
|
50
|
+
spinner.succeed();
|
|
48
51
|
const cwd = args["_"][2] || ".";
|
|
49
52
|
if (fs.existsSync(cwd)) {
|
|
50
53
|
if (fs.readdirSync(cwd).length > 0) {
|
|
@@ -78,45 +81,47 @@ ${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
|
|
|
78
81
|
const emitter = degit(`${templateTarget}${hash}`, {
|
|
79
82
|
cache: false,
|
|
80
83
|
force: true,
|
|
81
|
-
verbose: false
|
|
84
|
+
verbose: defaultLogLevel === "debug" ? true : false
|
|
85
|
+
});
|
|
86
|
+
logger.debug("Initialized degit with following config:", `${templateTarget}${hash}`, {
|
|
87
|
+
cache: false,
|
|
88
|
+
force: true,
|
|
89
|
+
verbose: defaultLogLevel === "debug" ? true : false
|
|
82
90
|
});
|
|
83
91
|
const selectedTemplate = TEMPLATES.find((template) => template.value === options.template);
|
|
84
|
-
let
|
|
85
|
-
if ((selectedTemplate == null ? void 0 : selectedTemplate.
|
|
92
|
+
let integrations = [];
|
|
93
|
+
if ((selectedTemplate == null ? void 0 : selectedTemplate.integrations) === true) {
|
|
86
94
|
const result = await prompts([
|
|
87
95
|
{
|
|
88
96
|
type: "multiselect",
|
|
89
|
-
name: "
|
|
97
|
+
name: "integrations",
|
|
90
98
|
message: "Which frameworks would you like to use?",
|
|
91
99
|
choices: FRAMEWORKS
|
|
92
100
|
}
|
|
93
101
|
]);
|
|
94
|
-
|
|
95
|
-
} else if ((selectedTemplate == null ? void 0 : selectedTemplate.renderers) && Array.isArray(selectedTemplate.renderers) && selectedTemplate.renderers.length) {
|
|
96
|
-
renderers = selectedTemplate.renderers;
|
|
97
|
-
const titles = renderers.map((renderer) => {
|
|
98
|
-
var _a;
|
|
99
|
-
return (_a = FRAMEWORKS.find((item) => item.value === renderer)) == null ? void 0 : _a.title;
|
|
100
|
-
}).join(", ");
|
|
101
|
-
console.log(`${green(`\u2714`)} ${bold(`Using template's default renderers`)} ${gray("\u203A")} ${titles}`);
|
|
102
|
+
integrations = result.integrations;
|
|
102
103
|
}
|
|
104
|
+
spinner = ora({ color: "green", text: "Copying project files..." }).start();
|
|
103
105
|
try {
|
|
104
|
-
|
|
106
|
+
emitter.on("info", (info) => {
|
|
107
|
+
logger.debug(info.message);
|
|
108
|
+
});
|
|
105
109
|
await emitter.clone(cwd);
|
|
106
110
|
} catch (err) {
|
|
111
|
+
logger.debug(err);
|
|
107
112
|
console.error(red(err.message));
|
|
108
113
|
if (err.message === "zlib: unexpected end of file") {
|
|
109
|
-
console.log(yellow("This seems to be a cache related problem. Remove the folder '~/.degit/github/
|
|
114
|
+
console.log(yellow("This seems to be a cache related problem. Remove the folder '~/.degit/github/withastro' to fix this error."));
|
|
110
115
|
console.log(yellow("For more information check out this issue: https://github.com/withastro/astro/issues/655"));
|
|
111
116
|
}
|
|
112
117
|
if (err.code === "MISSING_REF") {
|
|
113
118
|
console.log(yellow("This seems to be an issue with degit. Please check if you have 'git' installed on your system, and install it if you don't have (https://git-scm.com)."));
|
|
114
|
-
console.log(yellow("If you do have 'git' installed, please file a new issue here: https://github.com/withastro/astro/issues"));
|
|
119
|
+
console.log(yellow("If you do have 'git' installed, please run this command with the --verbose flag and file a new issue with the command output here: https://github.com/withastro/astro/issues"));
|
|
115
120
|
}
|
|
121
|
+
spinner.fail();
|
|
116
122
|
process.exit(1);
|
|
117
123
|
}
|
|
118
124
|
await Promise.all(POSTPROCESS_FILES.map(async (file) => {
|
|
119
|
-
var _a;
|
|
120
125
|
const fileLoc = path.resolve(path.join(cwd, file));
|
|
121
126
|
switch (file) {
|
|
122
127
|
case "CHANGELOG.md": {
|
|
@@ -126,17 +131,26 @@ ${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
|
|
|
126
131
|
break;
|
|
127
132
|
}
|
|
128
133
|
case "astro.config.mjs": {
|
|
129
|
-
if ((selectedTemplate == null ? void 0 : selectedTemplate.
|
|
134
|
+
if ((selectedTemplate == null ? void 0 : selectedTemplate.integrations) !== true) {
|
|
130
135
|
break;
|
|
131
136
|
}
|
|
132
|
-
await fs.promises.writeFile(fileLoc, createConfig({
|
|
137
|
+
await fs.promises.writeFile(fileLoc, createConfig({ integrations }));
|
|
133
138
|
break;
|
|
134
139
|
}
|
|
135
140
|
case "package.json": {
|
|
136
141
|
const packageJSON = JSON.parse(await fs.promises.readFile(fileLoc, "utf8"));
|
|
137
142
|
delete packageJSON.snowpack;
|
|
138
|
-
const
|
|
139
|
-
|
|
143
|
+
const integrationEntries = (await Promise.all(integrations.map((integration) => fetch(`https://registry.npmjs.org/${integration.packageName}/latest`).then((res) => res.json()).then((res) => {
|
|
144
|
+
let dependencies = [[res["name"], `^${res["version"]}`]];
|
|
145
|
+
if (res["peerDependencies"]) {
|
|
146
|
+
for (const peer in res["peerDependencies"]) {
|
|
147
|
+
dependencies.push([peer, res["peerDependencies"][peer]]);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return dependencies;
|
|
151
|
+
})))).flat(1);
|
|
152
|
+
packageJSON.devDependencies = __spreadValues(__spreadValues({}, packageJSON.devDependencies ?? {}), Object.fromEntries(integrationEntries));
|
|
153
|
+
packageJSON.devDependencies = Object.fromEntries(Object.entries(packageJSON.devDependencies).sort((a, b) => a[0].localeCompare(b[0])));
|
|
140
154
|
await fs.promises.writeFile(fileLoc, JSON.stringify(packageJSON, void 0, 2));
|
|
141
155
|
break;
|
|
142
156
|
}
|
|
@@ -145,8 +159,8 @@ ${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
|
|
|
145
159
|
if ((selectedTemplate == null ? void 0 : selectedTemplate.value) === "starter") {
|
|
146
160
|
let importStatements = [];
|
|
147
161
|
let components = [];
|
|
148
|
-
await Promise.all(
|
|
149
|
-
const component = COUNTER_COMPONENTS[
|
|
162
|
+
await Promise.all(integrations.map(async (integration) => {
|
|
163
|
+
const component = COUNTER_COMPONENTS[integration.id];
|
|
150
164
|
const componentName = path.basename(component.filename, path.extname(component.filename));
|
|
151
165
|
const absFileLoc = path.resolve(cwd, component.filename);
|
|
152
166
|
importStatements.push(`import ${componentName} from '${component.filename.replace(/^src/, "..")}';`);
|
|
@@ -162,6 +176,7 @@ ${bold("Welcome to Astro!")} ${gray(`(create-astro v${version})`)}`);
|
|
|
162
176
|
});
|
|
163
177
|
await fs.promises.writeFile(pageFileLoc, newContent);
|
|
164
178
|
}
|
|
179
|
+
spinner.succeed();
|
|
165
180
|
console.log(bold(green("\u2714") + " Done!"));
|
|
166
181
|
console.log("\nNext steps:");
|
|
167
182
|
let i = 1;
|
|
@@ -182,4 +197,3 @@ export {
|
|
|
182
197
|
main,
|
|
183
198
|
mkdirp
|
|
184
199
|
};
|
|
185
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIl0sCiAgIm1hcHBpbmdzIjogIjs7Ozs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTUEsTUFBTSxZQUFZLFFBQVEsS0FBSyxPQUFPLENBQUMsUUFBUSxRQUFRO0FBQ3ZELE1BQU0sT0FBTyxNQUFNLFdBQVcsRUFBRSxPQUFPLENBQUM7QUFDeEMsUUFBUSxTQUFTO0FBRVYsZ0JBQWdCLEtBQWE7QUFDbkMsTUFBSTtBQUNILE9BQUcsVUFBVSxLQUFLLEVBQUUsV0FBVztBQUFBLFdBQ3ZCLEdBQVA7QUFDRCxRQUFJLEVBQUUsU0FBUztBQUFVO0FBQ3pCLFVBQU07QUFBQTtBQUFBO0FBSVIsTUFBTSxFQUFFLFlBQVksS0FBSyxNQUFNLEdBQUcsYUFBYSxJQUFJLElBQUksbUJBQW1CLFlBQVksTUFBTTtBQUU1RixNQUFNLG9CQUFvQixDQUFDLGdCQUFnQixvQkFBb0I7QUFFL0Qsc0JBQTZCO0FBQzVCLFVBQVEsSUFBSTtBQUFBLEV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n0K
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { bold, blue, dim, red, yellow } from "kleur/colors";
|
|
2
|
+
import { Writable } from "stream";
|
|
3
|
+
import { format as utilFormat } from "util";
|
|
4
|
+
function getLoggerLocale() {
|
|
5
|
+
const defaultLocale = "en-US";
|
|
6
|
+
if (process.env.LANG) {
|
|
7
|
+
const extractedLocale = process.env.LANG.split(".")[0].replace(/_/g, "-");
|
|
8
|
+
if (extractedLocale.length < 2)
|
|
9
|
+
return defaultLocale;
|
|
10
|
+
else
|
|
11
|
+
return extractedLocale;
|
|
12
|
+
} else
|
|
13
|
+
return defaultLocale;
|
|
14
|
+
}
|
|
15
|
+
const dt = new Intl.DateTimeFormat(getLoggerLocale(), {
|
|
16
|
+
hour: "2-digit",
|
|
17
|
+
minute: "2-digit"
|
|
18
|
+
});
|
|
19
|
+
const defaultLogDestination = new Writable({
|
|
20
|
+
objectMode: true,
|
|
21
|
+
write(event, _, callback) {
|
|
22
|
+
let dest = process.stderr;
|
|
23
|
+
if (levels[event.level] < levels["error"])
|
|
24
|
+
dest = process.stdout;
|
|
25
|
+
dest.write(dim(dt.format(new Date()) + " "));
|
|
26
|
+
let type = event.type;
|
|
27
|
+
if (type) {
|
|
28
|
+
switch (event.level) {
|
|
29
|
+
case "info":
|
|
30
|
+
type = bold(blue(type));
|
|
31
|
+
break;
|
|
32
|
+
case "warn":
|
|
33
|
+
type = bold(yellow(type));
|
|
34
|
+
break;
|
|
35
|
+
case "error":
|
|
36
|
+
type = bold(red(type));
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
dest.write(`[${type}] `);
|
|
40
|
+
}
|
|
41
|
+
dest.write(utilFormat(...event.args));
|
|
42
|
+
dest.write("\n");
|
|
43
|
+
callback();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
let defaultLogLevel;
|
|
47
|
+
if (process.argv.includes("--verbose")) {
|
|
48
|
+
defaultLogLevel = "debug";
|
|
49
|
+
} else if (process.argv.includes("--silent")) {
|
|
50
|
+
defaultLogLevel = "silent";
|
|
51
|
+
} else {
|
|
52
|
+
defaultLogLevel = "info";
|
|
53
|
+
}
|
|
54
|
+
const defaultLogOptions = {
|
|
55
|
+
dest: defaultLogDestination,
|
|
56
|
+
level: defaultLogLevel
|
|
57
|
+
};
|
|
58
|
+
const levels = {
|
|
59
|
+
debug: 20,
|
|
60
|
+
info: 30,
|
|
61
|
+
warn: 40,
|
|
62
|
+
error: 50,
|
|
63
|
+
silent: 90
|
|
64
|
+
};
|
|
65
|
+
function log(opts = {}, level, type, ...args) {
|
|
66
|
+
const logLevel = opts.level ?? defaultLogOptions.level;
|
|
67
|
+
const dest = opts.dest ?? defaultLogOptions.dest;
|
|
68
|
+
const event = {
|
|
69
|
+
type,
|
|
70
|
+
level,
|
|
71
|
+
args,
|
|
72
|
+
message: ""
|
|
73
|
+
};
|
|
74
|
+
if (levels[logLevel] > levels[level]) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
dest.write(event);
|
|
78
|
+
}
|
|
79
|
+
function debug(opts, type, ...messages) {
|
|
80
|
+
return log(opts, "debug", type, ...messages);
|
|
81
|
+
}
|
|
82
|
+
function info(opts, type, ...messages) {
|
|
83
|
+
return log(opts, "info", type, ...messages);
|
|
84
|
+
}
|
|
85
|
+
function warn(opts, type, ...messages) {
|
|
86
|
+
return log(opts, "warn", type, ...messages);
|
|
87
|
+
}
|
|
88
|
+
function error(opts, type, ...messages) {
|
|
89
|
+
return log(opts, "error", type, ...messages);
|
|
90
|
+
}
|
|
91
|
+
const logger = {
|
|
92
|
+
debug: debug.bind(null, defaultLogOptions, "debug"),
|
|
93
|
+
info: info.bind(null, defaultLogOptions, "info"),
|
|
94
|
+
warn: warn.bind(null, defaultLogOptions, "warn"),
|
|
95
|
+
error: error.bind(null, defaultLogOptions, "error")
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
debug,
|
|
99
|
+
defaultLogDestination,
|
|
100
|
+
defaultLogLevel,
|
|
101
|
+
defaultLogOptions,
|
|
102
|
+
error,
|
|
103
|
+
info,
|
|
104
|
+
levels,
|
|
105
|
+
log,
|
|
106
|
+
logger,
|
|
107
|
+
warn
|
|
108
|
+
};
|
package/dist/templates.js
CHANGED
|
@@ -2,35 +2,25 @@ const TEMPLATES = [
|
|
|
2
2
|
{
|
|
3
3
|
title: "Starter Kit (Generic)",
|
|
4
4
|
value: "starter",
|
|
5
|
-
|
|
5
|
+
integrations: true
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
title: "Blog",
|
|
9
|
-
value: "blog"
|
|
10
|
-
renderers: ["@astrojs/renderer-preact"]
|
|
9
|
+
value: "blog"
|
|
11
10
|
},
|
|
12
11
|
{
|
|
13
12
|
title: "Documentation",
|
|
14
|
-
value: "docs"
|
|
15
|
-
renderers: ["@astrojs/renderer-preact"]
|
|
13
|
+
value: "docs"
|
|
16
14
|
},
|
|
17
15
|
{
|
|
18
16
|
title: "Portfolio",
|
|
19
|
-
value: "portfolio"
|
|
20
|
-
renderers: ["@astrojs/renderer-preact"]
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
title: "Portfolio Svelte",
|
|
24
|
-
value: "portfolio-svelte",
|
|
25
|
-
renderers: ["@astrojs/renderer-svelte"]
|
|
17
|
+
value: "portfolio"
|
|
26
18
|
},
|
|
27
19
|
{
|
|
28
20
|
title: "Minimal",
|
|
29
|
-
value: "minimal"
|
|
30
|
-
renderers: []
|
|
21
|
+
value: "minimal"
|
|
31
22
|
}
|
|
32
23
|
];
|
|
33
24
|
export {
|
|
34
25
|
TEMPLATES
|
|
35
26
|
};
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL3RlbXBsYXRlcy50cyJdLAogICJtYXBwaW5ncyI6ICJBQUFPLE1BQU0sWUFBWTtBQUFBLEVBQ3hCO0FBQUEsSUFDQyxPQUFPO0FBQUEsSUFDUCxPQUFPO0FBQUEsSUFDUCxXQUFXO0FBQUE7QUFBQSxFQUVaO0FBQUEsSUFDQyxPQUFPO0FBQUEsSUFDUCxPQUFPO0FBQUEsSUFDUCxXQUFXLENBQUM7QUFBQTtBQUFBLEVBRWI7QUFBQSxJQUNDLE9BQU87QUFBQSxJQUNQLE9BQU87QUFBQSxJQUNQLFdBQVcsQ0FBQztBQUFBO0FBQUEsRUFFYjtBQUFBLElBQ0MsT0FBTztBQUFBLElBQ1AsT0FBTztBQUFBLElBQ1AsV0FBVyxDQUFDO0FBQUE7QUFBQSxFQUViO0FBQUEsSUFDQyxPQUFPO0FBQUEsSUFDUCxPQUFPO0FBQUEsSUFDUCxXQUFXLENBQUM7QUFBQTtBQUFBLEVBRWI7QUFBQSxJQUNDLE9BQU87QUFBQSxJQUNQLE9BQU87QUFBQSxJQUNQLFdBQVc7QUFBQTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQo=
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
export declare const COUNTER_COMPONENTS: {
|
|
2
|
-
|
|
2
|
+
preact: {
|
|
3
3
|
filename: string;
|
|
4
4
|
content: string;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
react: {
|
|
7
7
|
filename: string;
|
|
8
8
|
content: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
solid: {
|
|
11
11
|
filename: string;
|
|
12
12
|
content: string;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
svelte: {
|
|
15
15
|
filename: string;
|
|
16
16
|
content: string;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
vue: {
|
|
19
19
|
filename: string;
|
|
20
20
|
content: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
export interface Integration {
|
|
24
|
+
id: string;
|
|
25
|
+
packageName: string;
|
|
26
|
+
}
|
|
23
27
|
export declare const FRAMEWORKS: {
|
|
24
28
|
title: string;
|
|
25
|
-
value:
|
|
29
|
+
value: Integration;
|
|
26
30
|
}[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Writable } from 'stream';
|
|
3
|
+
export declare const defaultLogDestination: Writable;
|
|
4
|
+
interface LogWritable<T> extends Writable {
|
|
5
|
+
write: (chunk: T) => boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
8
|
+
export declare type LoggerEvent = 'debug' | 'info' | 'warn' | 'error';
|
|
9
|
+
export declare let defaultLogLevel: LoggerLevel;
|
|
10
|
+
export interface LogOptions {
|
|
11
|
+
dest?: LogWritable<LogMessage>;
|
|
12
|
+
level?: LoggerLevel;
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultLogOptions: Required<LogOptions>;
|
|
15
|
+
export interface LogMessage {
|
|
16
|
+
type: string | null;
|
|
17
|
+
level: LoggerLevel;
|
|
18
|
+
message: string;
|
|
19
|
+
args: Array<any>;
|
|
20
|
+
}
|
|
21
|
+
export declare const levels: Record<LoggerLevel, number>;
|
|
22
|
+
/** Full logging API */
|
|
23
|
+
export declare function log(opts: LogOptions | undefined, level: LoggerLevel, type: string | null, ...args: Array<any>): void;
|
|
24
|
+
/** Emit a message only shown in debug mode */
|
|
25
|
+
export declare function debug(opts: LogOptions, type: string | null, ...messages: Array<any>): void;
|
|
26
|
+
/** Emit a general info message (be careful using this too much!) */
|
|
27
|
+
export declare function info(opts: LogOptions, type: string | null, ...messages: Array<any>): void;
|
|
28
|
+
/** Emit a warning a user should be aware of */
|
|
29
|
+
export declare function warn(opts: LogOptions, type: string | null, ...messages: Array<any>): void;
|
|
30
|
+
/** Emit a fatal error message the user should address. */
|
|
31
|
+
export declare function error(opts: LogOptions, type: string | null, ...messages: Array<any>): void;
|
|
32
|
+
export declare const logger: {
|
|
33
|
+
debug: (...args: any[]) => void;
|
|
34
|
+
info: (...args: any[]) => void;
|
|
35
|
+
warn: (...args: any[]) => void;
|
|
36
|
+
error: (...args: any[]) => void;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-astro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "withastro",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,30 +17,33 @@
|
|
|
17
17
|
"bin": {
|
|
18
18
|
"create-astro": "./create-astro.mjs"
|
|
19
19
|
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
|
22
|
-
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
|
23
|
-
"prepare": "yarn build",
|
|
24
|
-
"test": "rm -rf test/fixtures && mkdir test/fixtures && node --unhandled-rejections=strict test/create-astro.test.js"
|
|
25
|
-
},
|
|
26
20
|
"files": [
|
|
27
21
|
"dist",
|
|
28
22
|
"create-astro.js"
|
|
29
23
|
],
|
|
30
24
|
"dependencies": {
|
|
31
|
-
"@types/degit": "^2.8.
|
|
32
|
-
"@types/
|
|
33
|
-
"@types/prompts": "^2.0.12",
|
|
25
|
+
"@types/degit": "^2.8.3",
|
|
26
|
+
"@types/prompts": "^2.0.14",
|
|
34
27
|
"degit": "^2.8.4",
|
|
35
|
-
"kleur": "^4.1.
|
|
36
|
-
"node-fetch": "^3.
|
|
37
|
-
"
|
|
38
|
-
"
|
|
28
|
+
"kleur": "^4.1.4",
|
|
29
|
+
"node-fetch": "^3.2.3",
|
|
30
|
+
"ora": "^6.1.0",
|
|
31
|
+
"prompts": "^2.4.2",
|
|
32
|
+
"yargs-parser": "^21.0.1"
|
|
39
33
|
},
|
|
40
34
|
"devDependencies": {
|
|
41
|
-
"
|
|
35
|
+
"@types/yargs-parser": "^21.0.0",
|
|
36
|
+
"astro-scripts": "0.0.2",
|
|
37
|
+
"uvu": "^0.5.3"
|
|
42
38
|
},
|
|
43
39
|
"engines": {
|
|
44
40
|
"node": "^14.15.0 || >=16.0.0"
|
|
45
|
-
}
|
|
46
|
-
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
|
44
|
+
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
|
45
|
+
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
|
46
|
+
"test": "rm -rf test/fixtures && mkdir test/fixtures && node --unhandled-rejections=strict test/create-astro.test.js"
|
|
47
|
+
},
|
|
48
|
+
"readme": "# create-astro\n\n## Scaffolding for Astro projects\n\n**With NPM:**\n\n```bash\nnpm init astro\n```\n\n**With Yarn:**\n\n```bash\nyarn create astro\n```\n\n`create-astro` automatically runs in _interactive_ mode, but you can also specify your project name and template with command line arguments.\n\n```bash\n# npm 6.x\nnpm init astro my-astro-project --template starter\n\n# npm 7+, extra double-dash is needed:\nnpm init astro my-astro-project -- --template starter\n\n# yarn\nyarn create astro my-astro-project --template starter\n```\n[Check out the full list][examples] of example starter templates, available on GitHub.\n\nYou can also use any GitHub repo as a template:\n\n```bash\nnpm init astro my-astro-project -- --template cassidoo/shopify-react-astro\n```\n\n### CLI Flags\n\nMay be provided in place of prompts\n\n| Name | Description |\n|:-------------|:----------------------------------------------------|\n| `--template` | Specify the template name ([list][examples]) |\n| `--commit` | Specify a specific Git commit or branch to use from this repo (by default, `main` branch of this repo will be used) |\n\n### Debugging\n\nTo debug `create-astro`, you can use the `--verbose` flag which will log the output of degit and some more information about the command, this can be useful when you encounter an error and want to report it.\n\n```bash\n# npm 6.x\nnpm init astro my-astro-project --verbose\n\n# npm 7+, extra double-dash is needed:\nnpm init astro my-astro-project -- --verbose\n\n# yarn\nyarn create astro my-astro-project --verbose\n```\n\n[examples]: https://github.com/withastro/astro/tree/main/examples\n"
|
|
49
|
+
}
|