layero 0.1.4 → 0.1.5
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/package.json +4 -2
- package/scripts/postinstall.cjs +38 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "layero",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Layero CLI — publish a local site with one command.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
+
"scripts/postinstall.cjs",
|
|
15
16
|
"README.md"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"build": "tsc -p tsconfig.json",
|
|
19
20
|
"prepublishOnly": "npm run build",
|
|
20
|
-
"dev": "tsc -p tsconfig.json --watch"
|
|
21
|
+
"dev": "tsc -p tsconfig.json --watch",
|
|
22
|
+
"postinstall": "node scripts/postinstall.cjs || true"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
25
|
"chalk": "^5.3.0",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Print a quick-start banner after `npm install -g layero`.
|
|
3
|
+
// Stays silent in CI, in non-TTY (piped/automated installs), and when
|
|
4
|
+
// installed as a transitive dependency.
|
|
5
|
+
|
|
6
|
+
if (process.env.CI) return;
|
|
7
|
+
if (process.env.LAYERO_SKIP_POSTINSTALL) return;
|
|
8
|
+
if (!process.stdout.isTTY) return;
|
|
9
|
+
|
|
10
|
+
// Only print when the user installed `layero` directly (not as a sub-dep).
|
|
11
|
+
// npm sets npm_config_global=true for `npm install -g`; for local installs
|
|
12
|
+
// we check that this package is the install target via npm_package_name.
|
|
13
|
+
const isGlobal = process.env.npm_config_global === "true";
|
|
14
|
+
const isDirect = process.env.npm_package_name === "layero";
|
|
15
|
+
if (!isGlobal && !isDirect) return;
|
|
16
|
+
|
|
17
|
+
const c = process.stdout.hasColors && process.stdout.hasColors()
|
|
18
|
+
? {
|
|
19
|
+
reset: "\x1b[0m",
|
|
20
|
+
bold: "\x1b[1m",
|
|
21
|
+
dim: "\x1b[2m",
|
|
22
|
+
cyan: "\x1b[36m",
|
|
23
|
+
green: "\x1b[32m",
|
|
24
|
+
}
|
|
25
|
+
: { reset: "", bold: "", dim: "", cyan: "", green: "" };
|
|
26
|
+
|
|
27
|
+
const lines = [
|
|
28
|
+
"",
|
|
29
|
+
`${c.green}${c.bold}✨ Layero CLI installed${c.reset}`,
|
|
30
|
+
"",
|
|
31
|
+
` ${c.cyan}layero login${c.reset} ${c.dim}authenticate via browser${c.reset}`,
|
|
32
|
+
` ${c.cyan}cd your-site && layero deploy${c.reset} ${c.dim}publish current dir${c.reset}`,
|
|
33
|
+
` ${c.cyan}layero --help${c.reset} ${c.dim}all commands${c.reset}`,
|
|
34
|
+
"",
|
|
35
|
+
` ${c.dim}Docs: https://layero.ru${c.reset}`,
|
|
36
|
+
"",
|
|
37
|
+
];
|
|
38
|
+
process.stdout.write(lines.join("\n"));
|