@askrjs/cli 0.0.7 → 0.0.9
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/dist/add.js +10 -1
- package/dist/create.js +1 -1
- package/dist/{discovery-Djq8TxJu.js → discovery-BX-lnFRK.js} +1 -2
- package/dist/generate.js +278 -20
- package/dist/{planner-ZAX9SFjY.js → planner-BDfYDKnI.js} +112 -31
- package/dist/registry-BVliEbUv.js +95 -0
- package/dist/skills/askr-ssr-ssg/SKILL.md +1 -1
- package/dist/{skills-B7CbWur9.js → skills-C2KzfTl9.js} +0 -1
- package/dist/skills.js +1 -1
- package/dist/{range-YUs9eimn.js → specification-BSlq_n9A.js} +50 -4
- package/dist/ssg.d.ts +0 -1
- package/dist/ssg.js +4 -5
- package/dist/templates/full-stack/src/server/app.ts +34 -16
- package/dist/templates/full-stack/src/server/dependencies.ts +7 -2
- package/dist/templates/spa/README.md +2 -2
- package/dist/templates/spa/src/main.tsx +2 -3
- package/dist/templates/spa/src/pages/_routes.tsx +2 -2
- package/dist/update.js +2 -2
- package/package.json +6 -2
- package/dist/registry-D2APi6x0.js +0 -228
- package/dist/specification-DXnDOC-0.js +0 -49
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import semver from "semver";
|
|
2
|
-
//#region src/update/specification.ts
|
|
3
|
-
const WINDOWS_PATH = /^[A-Za-z]:[\\/]/;
|
|
4
|
-
const HOSTED_GIT = /^(?:bitbucket|gist|github|gitlab):/i;
|
|
5
|
-
const GIT_URL = /^(?:git(?:\+[^:]+)?:|git@|ssh:)/i;
|
|
6
|
-
const GIT_SHORTHAND = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:#.*)?$/;
|
|
7
|
-
const REGISTRY_TAG = /^[A-Za-z][A-Za-z0-9._-]*$/;
|
|
8
|
-
const SCOPED_PATH = /^@[^/]+\/[^/]+$/;
|
|
9
|
-
function parseDependencySpecification(specification) {
|
|
10
|
-
const rawSpec = specification.trim();
|
|
11
|
-
if (!rawSpec) return {
|
|
12
|
-
type: "unsupported",
|
|
13
|
-
rawSpec
|
|
14
|
-
};
|
|
15
|
-
if (/^npm:/i.test(rawSpec)) return {
|
|
16
|
-
type: "alias",
|
|
17
|
-
rawSpec
|
|
18
|
-
};
|
|
19
|
-
if (/^(?:file|link|workspace):/i.test(rawSpec) || rawSpec.startsWith("./") || rawSpec.startsWith("../") || rawSpec.startsWith("/") || rawSpec.startsWith("~/") || /\.(?:tar\.gz|tgz)$/i.test(rawSpec) || WINDOWS_PATH.test(rawSpec) || /^[A-Za-z]:/.test(rawSpec) || SCOPED_PATH.test(rawSpec)) return {
|
|
20
|
-
type: "file",
|
|
21
|
-
rawSpec
|
|
22
|
-
};
|
|
23
|
-
if (HOSTED_GIT.test(rawSpec) || GIT_URL.test(rawSpec) || GIT_SHORTHAND.test(rawSpec)) return {
|
|
24
|
-
type: "git",
|
|
25
|
-
rawSpec
|
|
26
|
-
};
|
|
27
|
-
if (/^https?:/i.test(rawSpec) || /^[a-z][a-z0-9+.-]*:\/\//i.test(rawSpec)) return {
|
|
28
|
-
type: "remote",
|
|
29
|
-
rawSpec
|
|
30
|
-
};
|
|
31
|
-
if (semver.valid(rawSpec)) return {
|
|
32
|
-
type: "version",
|
|
33
|
-
rawSpec
|
|
34
|
-
};
|
|
35
|
-
if (semver.validRange(rawSpec)) return {
|
|
36
|
-
type: "range",
|
|
37
|
-
rawSpec
|
|
38
|
-
};
|
|
39
|
-
if (REGISTRY_TAG.test(rawSpec)) return {
|
|
40
|
-
type: "tag",
|
|
41
|
-
rawSpec
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
type: "unsupported",
|
|
45
|
-
rawSpec
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
export { parseDependencySpecification as t };
|