flisk-import 0.16.0 → 0.17.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/dist/flisk.js +12 -1
- package/package.json +1 -1
package/dist/flisk.js
CHANGED
|
@@ -50,6 +50,17 @@ export function findProjectRoot(start) {
|
|
|
50
50
|
dir = parent;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* A project name Flisk accepts (flisk#1519): lowercase letters, digits, - and _, starting with a letter or digit.
|
|
55
|
+
* "Lychee" becomes "lychee", "My App" becomes "my-app".
|
|
56
|
+
*/
|
|
57
|
+
export function projectNameFor(projectRoot) {
|
|
58
|
+
const name = basename(projectRoot)
|
|
59
|
+
.toLowerCase()
|
|
60
|
+
.replace(/[^a-z0-9_-]+/g, "-")
|
|
61
|
+
.replace(/^[-_]+|-+$/g, "");
|
|
62
|
+
return name || "project";
|
|
63
|
+
}
|
|
53
64
|
/**
|
|
54
65
|
* The minimal `.flisk/project.json` an import writes when the repo is not a Flisk project yet: the given stacks in
|
|
55
66
|
* Pre-Alpha, no optional infrastructure, and discovery of every `services/<stack>/<name>` folder. A copy of the minimum
|
|
@@ -58,7 +69,7 @@ export function findProjectRoot(start) {
|
|
|
58
69
|
export function defaultProjectConfig(projectRoot, preAlpha) {
|
|
59
70
|
return {
|
|
60
71
|
version: "1.0",
|
|
61
|
-
project: { name:
|
|
72
|
+
project: { name: projectNameFor(projectRoot), version: "1.0.0" },
|
|
62
73
|
phases: {
|
|
63
74
|
pre_alpha: { name: "Pre-Alpha", ...preAlpha },
|
|
64
75
|
alpha: { name: "Alpha", description: "", enabledStacks: [] },
|