@nextnode-solutions/nn 1.1.0 → 1.1.1
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/index.js +44 -39
- package/dist/nextnode.default.toml +51 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5033,12 +5033,12 @@ var require_isexe = __commonJS({
|
|
|
5033
5033
|
if (typeof Promise !== "function") {
|
|
5034
5034
|
throw new TypeError("callback not provided");
|
|
5035
5035
|
}
|
|
5036
|
-
return new Promise(function(
|
|
5036
|
+
return new Promise(function(resolve6, reject) {
|
|
5037
5037
|
isexe(path6, options || {}, function(er, is) {
|
|
5038
5038
|
if (er) {
|
|
5039
5039
|
reject(er);
|
|
5040
5040
|
} else {
|
|
5041
|
-
|
|
5041
|
+
resolve6(is);
|
|
5042
5042
|
}
|
|
5043
5043
|
});
|
|
5044
5044
|
});
|
|
@@ -5105,27 +5105,27 @@ var require_which = __commonJS({
|
|
|
5105
5105
|
opt = {};
|
|
5106
5106
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
5107
5107
|
const found = [];
|
|
5108
|
-
const step = (i3) => new Promise((
|
|
5108
|
+
const step = (i3) => new Promise((resolve6, reject) => {
|
|
5109
5109
|
if (i3 === pathEnv.length)
|
|
5110
|
-
return opt.all && found.length ?
|
|
5110
|
+
return opt.all && found.length ? resolve6(found) : reject(getNotFoundError(cmd));
|
|
5111
5111
|
const ppRaw = pathEnv[i3];
|
|
5112
5112
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
5113
5113
|
const pCmd = path6.join(pathPart, cmd);
|
|
5114
5114
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
5115
|
-
|
|
5115
|
+
resolve6(subStep(p, i3, 0));
|
|
5116
5116
|
});
|
|
5117
|
-
const subStep = (p, i3, ii) => new Promise((
|
|
5117
|
+
const subStep = (p, i3, ii) => new Promise((resolve6, reject) => {
|
|
5118
5118
|
if (ii === pathExt.length)
|
|
5119
|
-
return
|
|
5119
|
+
return resolve6(step(i3 + 1));
|
|
5120
5120
|
const ext = pathExt[ii];
|
|
5121
5121
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
5122
5122
|
if (!er && is) {
|
|
5123
5123
|
if (opt.all)
|
|
5124
5124
|
found.push(p + ext);
|
|
5125
5125
|
else
|
|
5126
|
-
return
|
|
5126
|
+
return resolve6(p + ext);
|
|
5127
5127
|
}
|
|
5128
|
-
return
|
|
5128
|
+
return resolve6(subStep(p, i3, ii + 1));
|
|
5129
5129
|
});
|
|
5130
5130
|
});
|
|
5131
5131
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -6220,8 +6220,8 @@ var init_deferred = __esm({
|
|
|
6220
6220
|
"use strict";
|
|
6221
6221
|
createDeferred = () => {
|
|
6222
6222
|
const methods = {};
|
|
6223
|
-
const promise = new Promise((
|
|
6224
|
-
Object.assign(methods, { resolve:
|
|
6223
|
+
const promise = new Promise((resolve6, reject) => {
|
|
6224
|
+
Object.assign(methods, { resolve: resolve6, reject });
|
|
6225
6225
|
});
|
|
6226
6226
|
return Object.assign(promise, methods);
|
|
6227
6227
|
};
|
|
@@ -11607,11 +11607,11 @@ var init_concurrent = __esm({
|
|
|
11607
11607
|
const promises = weakMap.get(stream);
|
|
11608
11608
|
const promise = createDeferred();
|
|
11609
11609
|
promises.push(promise);
|
|
11610
|
-
const
|
|
11611
|
-
return { resolve:
|
|
11610
|
+
const resolve6 = promise.resolve.bind(promise);
|
|
11611
|
+
return { resolve: resolve6, promises };
|
|
11612
11612
|
};
|
|
11613
|
-
waitForConcurrentStreams = async ({ resolve:
|
|
11614
|
-
|
|
11613
|
+
waitForConcurrentStreams = async ({ resolve: resolve6, promises }, subprocess) => {
|
|
11614
|
+
resolve6();
|
|
11615
11615
|
const [isSubprocessExit] = await Promise.race([
|
|
11616
11616
|
Promise.allSettled([true, subprocess]),
|
|
11617
11617
|
Promise.all([false, ...promises])
|
|
@@ -20609,11 +20609,11 @@ import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as rea
|
|
|
20609
20609
|
import { createServer } from "net";
|
|
20610
20610
|
import { join as join4 } from "path";
|
|
20611
20611
|
function isPortAvailable(port) {
|
|
20612
|
-
return new Promise((
|
|
20612
|
+
return new Promise((resolve6) => {
|
|
20613
20613
|
const server = createServer();
|
|
20614
|
-
server.once("error", () =>
|
|
20614
|
+
server.once("error", () => resolve6(false));
|
|
20615
20615
|
server.once("listening", () => {
|
|
20616
|
-
server.close(() =>
|
|
20616
|
+
server.close(() => resolve6(true));
|
|
20617
20617
|
});
|
|
20618
20618
|
server.listen(port, "127.0.0.1");
|
|
20619
20619
|
});
|
|
@@ -20740,18 +20740,18 @@ function isProcessRunning(pid) {
|
|
|
20740
20740
|
}
|
|
20741
20741
|
}
|
|
20742
20742
|
function gracefulKill(proc, timeoutMs = 5e3) {
|
|
20743
|
-
return new Promise((
|
|
20743
|
+
return new Promise((resolve6) => {
|
|
20744
20744
|
if (!proc.pid || proc.exitCode !== null) {
|
|
20745
|
-
|
|
20745
|
+
resolve6();
|
|
20746
20746
|
return;
|
|
20747
20747
|
}
|
|
20748
|
-
proc.once("exit", () =>
|
|
20748
|
+
proc.once("exit", () => resolve6());
|
|
20749
20749
|
proc.kill("SIGTERM");
|
|
20750
20750
|
setTimeout(() => {
|
|
20751
20751
|
if (proc.exitCode === null) {
|
|
20752
20752
|
proc.kill("SIGKILL");
|
|
20753
20753
|
}
|
|
20754
|
-
|
|
20754
|
+
resolve6();
|
|
20755
20755
|
}, timeoutMs);
|
|
20756
20756
|
});
|
|
20757
20757
|
}
|
|
@@ -20768,7 +20768,7 @@ async function waitForHealthy(checkFn, label, maxMs = 6e4) {
|
|
|
20768
20768
|
return false;
|
|
20769
20769
|
}
|
|
20770
20770
|
function sleep(ms) {
|
|
20771
|
-
return new Promise((
|
|
20771
|
+
return new Promise((resolve6) => setTimeout(resolve6, ms));
|
|
20772
20772
|
}
|
|
20773
20773
|
var init_process = __esm({
|
|
20774
20774
|
"src/lib/process.ts"() {
|
|
@@ -20795,21 +20795,26 @@ var init_services2 = __esm({
|
|
|
20795
20795
|
});
|
|
20796
20796
|
|
|
20797
20797
|
// src/lib/config.ts
|
|
20798
|
+
import { dirname as dirname2, resolve as resolve3 } from "path";
|
|
20799
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
20798
20800
|
function requireConfig() {
|
|
20799
20801
|
try {
|
|
20800
|
-
return loadConfig(process.cwd());
|
|
20801
|
-
} catch {
|
|
20802
|
+
return loadConfig(process.cwd(), void 0, DEFAULT_TOML_PATH);
|
|
20803
|
+
} catch (error) {
|
|
20802
20804
|
consola.error(
|
|
20803
|
-
|
|
20805
|
+
error instanceof Error ? error.message : "Failed to load nextnode.toml"
|
|
20804
20806
|
);
|
|
20805
20807
|
process.exit(1);
|
|
20806
20808
|
}
|
|
20807
20809
|
}
|
|
20810
|
+
var __dirname, DEFAULT_TOML_PATH;
|
|
20808
20811
|
var init_config2 = __esm({
|
|
20809
20812
|
"src/lib/config.ts"() {
|
|
20810
20813
|
"use strict";
|
|
20811
20814
|
init_dist2();
|
|
20812
20815
|
init_config();
|
|
20816
|
+
__dirname = dirname2(fileURLToPath4(import.meta.url));
|
|
20817
|
+
DEFAULT_TOML_PATH = resolve3(__dirname, "nextnode.default.toml");
|
|
20813
20818
|
}
|
|
20814
20819
|
});
|
|
20815
20820
|
|
|
@@ -21034,15 +21039,15 @@ __export(down_exports, {
|
|
|
21034
21039
|
import { existsSync as existsSync7 } from "fs";
|
|
21035
21040
|
import { join as join7 } from "path";
|
|
21036
21041
|
function promptConfirm() {
|
|
21037
|
-
return new Promise((
|
|
21042
|
+
return new Promise((resolve6) => {
|
|
21038
21043
|
if (!process.stdin.isTTY) {
|
|
21039
|
-
|
|
21044
|
+
resolve6(false);
|
|
21040
21045
|
return;
|
|
21041
21046
|
}
|
|
21042
21047
|
process.stdin.setEncoding("utf-8");
|
|
21043
21048
|
process.stdin.once("data", (data) => {
|
|
21044
21049
|
const answer = data.trim().toLowerCase();
|
|
21045
|
-
|
|
21050
|
+
resolve6(answer === "y" || answer === "yes");
|
|
21046
21051
|
});
|
|
21047
21052
|
process.stdin.resume();
|
|
21048
21053
|
});
|
|
@@ -21320,7 +21325,7 @@ __export(check_exports, {
|
|
|
21320
21325
|
default: () => check_default
|
|
21321
21326
|
});
|
|
21322
21327
|
import { existsSync as existsSync8, readFileSync as readFileSync10 } from "fs";
|
|
21323
|
-
import { resolve as
|
|
21328
|
+
import { resolve as resolve4 } from "path";
|
|
21324
21329
|
function detectRequiredVars(cwd) {
|
|
21325
21330
|
const requiredSet = /* @__PURE__ */ new Set();
|
|
21326
21331
|
const composePaths = [
|
|
@@ -21330,7 +21335,7 @@ function detectRequiredVars(cwd) {
|
|
|
21330
21335
|
"compose.yaml"
|
|
21331
21336
|
];
|
|
21332
21337
|
for (const composePath of composePaths) {
|
|
21333
|
-
const fullPath =
|
|
21338
|
+
const fullPath = resolve4(cwd, composePath);
|
|
21334
21339
|
if (existsSync8(fullPath)) {
|
|
21335
21340
|
const content = readFileSync10(fullPath, "utf-8");
|
|
21336
21341
|
const declarations = parseComposeEnv(content);
|
|
@@ -21426,7 +21431,7 @@ __export(init_exports2, {
|
|
|
21426
21431
|
default: () => init_default3
|
|
21427
21432
|
});
|
|
21428
21433
|
import { existsSync as existsSync9, readFileSync as readFileSync11, writeFileSync as writeFileSync7 } from "fs";
|
|
21429
|
-
import { resolve as
|
|
21434
|
+
import { resolve as resolve5 } from "path";
|
|
21430
21435
|
function initEnvFiles() {
|
|
21431
21436
|
const cwd = process.cwd();
|
|
21432
21437
|
const created = [];
|
|
@@ -21441,7 +21446,7 @@ function initEnvFiles() {
|
|
|
21441
21446
|
}
|
|
21442
21447
|
ensureGitignore2(cwd);
|
|
21443
21448
|
for (const { name, env: env2, label } of ENV_FILES) {
|
|
21444
|
-
const filePath =
|
|
21449
|
+
const filePath = resolve5(cwd, name);
|
|
21445
21450
|
if (existsSync9(filePath)) {
|
|
21446
21451
|
consola.info(`${name} already exists, skipping.`);
|
|
21447
21452
|
skipped.push(name);
|
|
@@ -21528,7 +21533,7 @@ function getPlaceholder(varName, env2, domain, _appName) {
|
|
|
21528
21533
|
}
|
|
21529
21534
|
}
|
|
21530
21535
|
function ensureGitignore2(cwd) {
|
|
21531
|
-
const gitignorePath =
|
|
21536
|
+
const gitignorePath = resolve5(cwd, ".gitignore");
|
|
21532
21537
|
const pattern = ".env.*";
|
|
21533
21538
|
if (!existsSync9(gitignorePath)) return;
|
|
21534
21539
|
const content = readFileSync11(gitignorePath, "utf-8");
|
|
@@ -22971,13 +22976,13 @@ var init_promise_polyfill = __esm({
|
|
|
22971
22976
|
// Available starting from Node 22
|
|
22972
22977
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
22973
22978
|
static withResolver() {
|
|
22974
|
-
let
|
|
22979
|
+
let resolve6;
|
|
22975
22980
|
let reject;
|
|
22976
22981
|
const promise = new Promise((res, rej) => {
|
|
22977
|
-
|
|
22982
|
+
resolve6 = res;
|
|
22978
22983
|
reject = rej;
|
|
22979
22984
|
});
|
|
22980
|
-
return { promise, resolve:
|
|
22985
|
+
return { promise, resolve: resolve6, reject };
|
|
22981
22986
|
}
|
|
22982
22987
|
};
|
|
22983
22988
|
}
|
|
@@ -23015,7 +23020,7 @@ function createPrompt(view) {
|
|
|
23015
23020
|
output
|
|
23016
23021
|
});
|
|
23017
23022
|
const screen = new ScreenManager(rl);
|
|
23018
|
-
const { promise, resolve:
|
|
23023
|
+
const { promise, resolve: resolve6, reject } = PromisePolyfill.withResolver();
|
|
23019
23024
|
const cancel = () => reject(new CancelPromptError());
|
|
23020
23025
|
if (signal) {
|
|
23021
23026
|
const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
|
|
@@ -23042,7 +23047,7 @@ function createPrompt(view) {
|
|
|
23042
23047
|
cycle(() => {
|
|
23043
23048
|
try {
|
|
23044
23049
|
const nextView = view(config, (value) => {
|
|
23045
|
-
setImmediate(() =>
|
|
23050
|
+
setImmediate(() => resolve6(value));
|
|
23046
23051
|
});
|
|
23047
23052
|
if (nextView === void 0) {
|
|
23048
23053
|
const callerFilename = callSites[1]?.getFileName();
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# nextnode.default.toml — canonical defaults for all nextnode.toml properties.
|
|
2
|
+
# Every configurable field must appear here with its default value.
|
|
3
|
+
# Project-specific nextnode.toml files override these at the field level.
|
|
4
|
+
#
|
|
5
|
+
# Required fields (no defaults — must be in project nextnode.toml):
|
|
6
|
+
# project.name
|
|
7
|
+
# project.type ("app" | "package")
|
|
8
|
+
|
|
9
|
+
# Set any script to false in your project's nextnode.toml to skip that step.
|
|
10
|
+
# Example: test = false
|
|
11
|
+
[scripts]
|
|
12
|
+
lint = "lint"
|
|
13
|
+
test = "test"
|
|
14
|
+
build = "build"
|
|
15
|
+
|
|
16
|
+
[server]
|
|
17
|
+
type = "cpx22"
|
|
18
|
+
location = "nbg1"
|
|
19
|
+
internal = false
|
|
20
|
+
|
|
21
|
+
[volume]
|
|
22
|
+
enabled = false
|
|
23
|
+
size = 20
|
|
24
|
+
|
|
25
|
+
[deploy]
|
|
26
|
+
port = 4321
|
|
27
|
+
zero_downtime = false
|
|
28
|
+
|
|
29
|
+
[health]
|
|
30
|
+
type = "http"
|
|
31
|
+
path = "/health"
|
|
32
|
+
interval = "30s"
|
|
33
|
+
timeout = "10s"
|
|
34
|
+
retries = 3
|
|
35
|
+
|
|
36
|
+
[sablier]
|
|
37
|
+
enabled = true
|
|
38
|
+
session_duration = "15m"
|
|
39
|
+
|
|
40
|
+
[environment.development]
|
|
41
|
+
enabled = true
|
|
42
|
+
pr_previews = true
|
|
43
|
+
cpu_limit = "0.25"
|
|
44
|
+
memory_limit = "256M"
|
|
45
|
+
|
|
46
|
+
[environment.production]
|
|
47
|
+
enabled = true
|
|
48
|
+
cpu_limit = "1.0"
|
|
49
|
+
memory_limit = "1G"
|
|
50
|
+
cpu_reservation = "0.25"
|
|
51
|
+
memory_reservation = "256M"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextnode-solutions/nn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"nn": "./dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsup",
|
|
11
|
+
"build": "tsup && cp ../../nextnode.default.toml dist/",
|
|
12
12
|
"dev": "tsup --watch",
|
|
13
|
-
"prepublishOnly": "tsup"
|
|
13
|
+
"prepublishOnly": "tsup && cp ../../nextnode.default.toml dist/"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@inquirer/prompts": "^8.2.1",
|