@nextnode-solutions/nn 1.1.0 → 1.1.2
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 +74 -43
- 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])
|
|
@@ -19883,11 +19883,21 @@ $$;
|
|
|
19883
19883
|
const initDbSh = `#!/bin/bash
|
|
19884
19884
|
set -e
|
|
19885
19885
|
|
|
19886
|
-
#
|
|
19887
|
-
#
|
|
19886
|
+
# Init script for ${appName}
|
|
19887
|
+
# 1. Sets passwords for Supabase service roles
|
|
19888
|
+
# 2. Runs all SQL files in /docker-entrypoint-initdb.d/migrations/ in order
|
|
19888
19889
|
|
|
19890
|
+
ROLES_SQL="/etc/postgresql.schema.sql"
|
|
19889
19891
|
MIGRATIONS_DIR="/docker-entrypoint-initdb.d/migrations"
|
|
19890
19892
|
|
|
19893
|
+
# Set passwords for supabase_auth_admin and authenticator
|
|
19894
|
+
if [ -f "$ROLES_SQL" ]; then
|
|
19895
|
+
echo "[${appName}-init] Setting up Supabase role passwords"
|
|
19896
|
+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" \\
|
|
19897
|
+
-v POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \\
|
|
19898
|
+
-f "$ROLES_SQL"
|
|
19899
|
+
fi
|
|
19900
|
+
|
|
19891
19901
|
if [ ! -d "$MIGRATIONS_DIR" ]; then
|
|
19892
19902
|
echo "[${appName}-init] No migrations directory found, skipping"
|
|
19893
19903
|
exit 0
|
|
@@ -19895,7 +19905,7 @@ fi
|
|
|
19895
19905
|
|
|
19896
19906
|
for f in "$MIGRATIONS_DIR"/*.sql; do
|
|
19897
19907
|
if [ -f "$f" ]; then
|
|
19898
|
-
echo "[${appName}-init] Running migration: $(basename "$f")"
|
|
19908
|
+
echo "[${appName}-init] Running migration: $(basename \\"$f\\")"
|
|
19899
19909
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -f "$f"
|
|
19900
19910
|
fi
|
|
19901
19911
|
done
|
|
@@ -19973,7 +19983,7 @@ var init_services = __esm({
|
|
|
19973
19983
|
});
|
|
19974
19984
|
|
|
19975
19985
|
// src/lib/compose.ts
|
|
19976
|
-
import { mkdirSync, writeFileSync as writeFileSync2 } from "fs";
|
|
19986
|
+
import { mkdirSync, rmSync, statSync as statSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
19977
19987
|
import { join } from "path";
|
|
19978
19988
|
function generateLocalCompose(config, services, ports) {
|
|
19979
19989
|
const lines = ["services:"];
|
|
@@ -20227,6 +20237,14 @@ function writeLocalComposeFiles(projectDir, config, composeContent) {
|
|
|
20227
20237
|
const supabaseDir = join(nnDir, "supabase");
|
|
20228
20238
|
const initDir = join(supabaseDir, "init");
|
|
20229
20239
|
mkdirSync(initDir, { recursive: true });
|
|
20240
|
+
for (const name of [
|
|
20241
|
+
"kong.yml",
|
|
20242
|
+
"kong-entrypoint.sh",
|
|
20243
|
+
"roles.sql",
|
|
20244
|
+
"init-db.sh"
|
|
20245
|
+
]) {
|
|
20246
|
+
removeIfDirectory(join(supabaseDir, name));
|
|
20247
|
+
}
|
|
20230
20248
|
const kongConfig = generateKongConfig(config.services.supabase);
|
|
20231
20249
|
writeFileSync2(join(supabaseDir, "kong.yml"), kongConfig);
|
|
20232
20250
|
const initScripts = generateInitScripts(config.project.name);
|
|
@@ -20242,6 +20260,14 @@ function writeLocalComposeFiles(projectDir, config, composeContent) {
|
|
|
20242
20260
|
}
|
|
20243
20261
|
consola.info(`Generated compose files in ${nnDir}`);
|
|
20244
20262
|
}
|
|
20263
|
+
function removeIfDirectory(filePath) {
|
|
20264
|
+
try {
|
|
20265
|
+
if (statSync3(filePath).isDirectory()) {
|
|
20266
|
+
rmSync(filePath, { recursive: true });
|
|
20267
|
+
}
|
|
20268
|
+
} catch {
|
|
20269
|
+
}
|
|
20270
|
+
}
|
|
20245
20271
|
var init_compose = __esm({
|
|
20246
20272
|
"src/lib/compose.ts"() {
|
|
20247
20273
|
"use strict";
|
|
@@ -20609,11 +20635,11 @@ import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as rea
|
|
|
20609
20635
|
import { createServer } from "net";
|
|
20610
20636
|
import { join as join4 } from "path";
|
|
20611
20637
|
function isPortAvailable(port) {
|
|
20612
|
-
return new Promise((
|
|
20638
|
+
return new Promise((resolve6) => {
|
|
20613
20639
|
const server = createServer();
|
|
20614
|
-
server.once("error", () =>
|
|
20640
|
+
server.once("error", () => resolve6(false));
|
|
20615
20641
|
server.once("listening", () => {
|
|
20616
|
-
server.close(() =>
|
|
20642
|
+
server.close(() => resolve6(true));
|
|
20617
20643
|
});
|
|
20618
20644
|
server.listen(port, "127.0.0.1");
|
|
20619
20645
|
});
|
|
@@ -20740,18 +20766,18 @@ function isProcessRunning(pid) {
|
|
|
20740
20766
|
}
|
|
20741
20767
|
}
|
|
20742
20768
|
function gracefulKill(proc, timeoutMs = 5e3) {
|
|
20743
|
-
return new Promise((
|
|
20769
|
+
return new Promise((resolve6) => {
|
|
20744
20770
|
if (!proc.pid || proc.exitCode !== null) {
|
|
20745
|
-
|
|
20771
|
+
resolve6();
|
|
20746
20772
|
return;
|
|
20747
20773
|
}
|
|
20748
|
-
proc.once("exit", () =>
|
|
20774
|
+
proc.once("exit", () => resolve6());
|
|
20749
20775
|
proc.kill("SIGTERM");
|
|
20750
20776
|
setTimeout(() => {
|
|
20751
20777
|
if (proc.exitCode === null) {
|
|
20752
20778
|
proc.kill("SIGKILL");
|
|
20753
20779
|
}
|
|
20754
|
-
|
|
20780
|
+
resolve6();
|
|
20755
20781
|
}, timeoutMs);
|
|
20756
20782
|
});
|
|
20757
20783
|
}
|
|
@@ -20768,7 +20794,7 @@ async function waitForHealthy(checkFn, label, maxMs = 6e4) {
|
|
|
20768
20794
|
return false;
|
|
20769
20795
|
}
|
|
20770
20796
|
function sleep(ms) {
|
|
20771
|
-
return new Promise((
|
|
20797
|
+
return new Promise((resolve6) => setTimeout(resolve6, ms));
|
|
20772
20798
|
}
|
|
20773
20799
|
var init_process = __esm({
|
|
20774
20800
|
"src/lib/process.ts"() {
|
|
@@ -20795,21 +20821,26 @@ var init_services2 = __esm({
|
|
|
20795
20821
|
});
|
|
20796
20822
|
|
|
20797
20823
|
// src/lib/config.ts
|
|
20824
|
+
import { dirname as dirname2, resolve as resolve3 } from "path";
|
|
20825
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
20798
20826
|
function requireConfig() {
|
|
20799
20827
|
try {
|
|
20800
|
-
return loadConfig(process.cwd());
|
|
20801
|
-
} catch {
|
|
20828
|
+
return loadConfig(process.cwd(), void 0, DEFAULT_TOML_PATH);
|
|
20829
|
+
} catch (error) {
|
|
20802
20830
|
consola.error(
|
|
20803
|
-
|
|
20831
|
+
error instanceof Error ? error.message : "Failed to load nextnode.toml"
|
|
20804
20832
|
);
|
|
20805
20833
|
process.exit(1);
|
|
20806
20834
|
}
|
|
20807
20835
|
}
|
|
20836
|
+
var __dirname, DEFAULT_TOML_PATH;
|
|
20808
20837
|
var init_config2 = __esm({
|
|
20809
20838
|
"src/lib/config.ts"() {
|
|
20810
20839
|
"use strict";
|
|
20811
20840
|
init_dist2();
|
|
20812
20841
|
init_config();
|
|
20842
|
+
__dirname = dirname2(fileURLToPath4(import.meta.url));
|
|
20843
|
+
DEFAULT_TOML_PATH = resolve3(__dirname, "nextnode.default.toml");
|
|
20813
20844
|
}
|
|
20814
20845
|
});
|
|
20815
20846
|
|
|
@@ -21034,15 +21065,15 @@ __export(down_exports, {
|
|
|
21034
21065
|
import { existsSync as existsSync7 } from "fs";
|
|
21035
21066
|
import { join as join7 } from "path";
|
|
21036
21067
|
function promptConfirm() {
|
|
21037
|
-
return new Promise((
|
|
21068
|
+
return new Promise((resolve6) => {
|
|
21038
21069
|
if (!process.stdin.isTTY) {
|
|
21039
|
-
|
|
21070
|
+
resolve6(false);
|
|
21040
21071
|
return;
|
|
21041
21072
|
}
|
|
21042
21073
|
process.stdin.setEncoding("utf-8");
|
|
21043
21074
|
process.stdin.once("data", (data) => {
|
|
21044
21075
|
const answer = data.trim().toLowerCase();
|
|
21045
|
-
|
|
21076
|
+
resolve6(answer === "y" || answer === "yes");
|
|
21046
21077
|
});
|
|
21047
21078
|
process.stdin.resume();
|
|
21048
21079
|
});
|
|
@@ -21320,7 +21351,7 @@ __export(check_exports, {
|
|
|
21320
21351
|
default: () => check_default
|
|
21321
21352
|
});
|
|
21322
21353
|
import { existsSync as existsSync8, readFileSync as readFileSync10 } from "fs";
|
|
21323
|
-
import { resolve as
|
|
21354
|
+
import { resolve as resolve4 } from "path";
|
|
21324
21355
|
function detectRequiredVars(cwd) {
|
|
21325
21356
|
const requiredSet = /* @__PURE__ */ new Set();
|
|
21326
21357
|
const composePaths = [
|
|
@@ -21330,7 +21361,7 @@ function detectRequiredVars(cwd) {
|
|
|
21330
21361
|
"compose.yaml"
|
|
21331
21362
|
];
|
|
21332
21363
|
for (const composePath of composePaths) {
|
|
21333
|
-
const fullPath =
|
|
21364
|
+
const fullPath = resolve4(cwd, composePath);
|
|
21334
21365
|
if (existsSync8(fullPath)) {
|
|
21335
21366
|
const content = readFileSync10(fullPath, "utf-8");
|
|
21336
21367
|
const declarations = parseComposeEnv(content);
|
|
@@ -21426,7 +21457,7 @@ __export(init_exports2, {
|
|
|
21426
21457
|
default: () => init_default3
|
|
21427
21458
|
});
|
|
21428
21459
|
import { existsSync as existsSync9, readFileSync as readFileSync11, writeFileSync as writeFileSync7 } from "fs";
|
|
21429
|
-
import { resolve as
|
|
21460
|
+
import { resolve as resolve5 } from "path";
|
|
21430
21461
|
function initEnvFiles() {
|
|
21431
21462
|
const cwd = process.cwd();
|
|
21432
21463
|
const created = [];
|
|
@@ -21441,7 +21472,7 @@ function initEnvFiles() {
|
|
|
21441
21472
|
}
|
|
21442
21473
|
ensureGitignore2(cwd);
|
|
21443
21474
|
for (const { name, env: env2, label } of ENV_FILES) {
|
|
21444
|
-
const filePath =
|
|
21475
|
+
const filePath = resolve5(cwd, name);
|
|
21445
21476
|
if (existsSync9(filePath)) {
|
|
21446
21477
|
consola.info(`${name} already exists, skipping.`);
|
|
21447
21478
|
skipped.push(name);
|
|
@@ -21528,7 +21559,7 @@ function getPlaceholder(varName, env2, domain, _appName) {
|
|
|
21528
21559
|
}
|
|
21529
21560
|
}
|
|
21530
21561
|
function ensureGitignore2(cwd) {
|
|
21531
|
-
const gitignorePath =
|
|
21562
|
+
const gitignorePath = resolve5(cwd, ".gitignore");
|
|
21532
21563
|
const pattern = ".env.*";
|
|
21533
21564
|
if (!existsSync9(gitignorePath)) return;
|
|
21534
21565
|
const content = readFileSync11(gitignorePath, "utf-8");
|
|
@@ -22971,13 +23002,13 @@ var init_promise_polyfill = __esm({
|
|
|
22971
23002
|
// Available starting from Node 22
|
|
22972
23003
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
22973
23004
|
static withResolver() {
|
|
22974
|
-
let
|
|
23005
|
+
let resolve6;
|
|
22975
23006
|
let reject;
|
|
22976
23007
|
const promise = new Promise((res, rej) => {
|
|
22977
|
-
|
|
23008
|
+
resolve6 = res;
|
|
22978
23009
|
reject = rej;
|
|
22979
23010
|
});
|
|
22980
|
-
return { promise, resolve:
|
|
23011
|
+
return { promise, resolve: resolve6, reject };
|
|
22981
23012
|
}
|
|
22982
23013
|
};
|
|
22983
23014
|
}
|
|
@@ -23015,7 +23046,7 @@ function createPrompt(view) {
|
|
|
23015
23046
|
output
|
|
23016
23047
|
});
|
|
23017
23048
|
const screen = new ScreenManager(rl);
|
|
23018
|
-
const { promise, resolve:
|
|
23049
|
+
const { promise, resolve: resolve6, reject } = PromisePolyfill.withResolver();
|
|
23019
23050
|
const cancel = () => reject(new CancelPromptError());
|
|
23020
23051
|
if (signal) {
|
|
23021
23052
|
const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
|
|
@@ -23042,7 +23073,7 @@ function createPrompt(view) {
|
|
|
23042
23073
|
cycle(() => {
|
|
23043
23074
|
try {
|
|
23044
23075
|
const nextView = view(config, (value) => {
|
|
23045
|
-
setImmediate(() =>
|
|
23076
|
+
setImmediate(() => resolve6(value));
|
|
23046
23077
|
});
|
|
23047
23078
|
if (nextView === void 0) {
|
|
23048
23079
|
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.2",
|
|
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",
|