@tenonhq/dovetail-core 0.0.128 → 0.0.130
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/bootstrap.js +11 -1
- package/dist/envArg.js +159 -4
- package/dist/tests/bootstrapEnvWalkUp.test.js +162 -0
- package/dist/tests/envArg.test.js +13 -1
- package/dist/tests/envWalkUp.test.js +209 -0
- package/package.json +2 -2
- package/release-manifest.json +224 -197
- package/skills/dove-setup-project.md +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -47,7 +47,17 @@ async function init() {
|
|
|
47
47
|
// the override must be set before loadEnvPath runs inside loadConfigs.
|
|
48
48
|
const envArg = (0, envArg_1.parseEnvArg)(process.argv.slice(2));
|
|
49
49
|
if (envArg) {
|
|
50
|
-
ConfigManager.setEnvPathOverride((0, envArg_1.resolveEnvArgPath)(envArg
|
|
50
|
+
ConfigManager.setEnvPathOverride((0, envArg_1.resolveEnvArgPath)(envArg, undefined, {
|
|
51
|
+
onParentMatch: function (foundPath) {
|
|
52
|
+
// stderr, never stdout (stdout carries --json / format json output).
|
|
53
|
+
// The path only — never anything from the file. Same notice as dove-sn.
|
|
54
|
+
process.stderr.write("dove: --env " +
|
|
55
|
+
envArg +
|
|
56
|
+
": using " +
|
|
57
|
+
foundPath +
|
|
58
|
+
" (found in a parent directory)\n");
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
51
61
|
}
|
|
52
62
|
let configLoaded = false;
|
|
53
63
|
try {
|
package/dist/envArg.js
CHANGED
|
@@ -3,9 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ENV_WALK_UP_MAX_LEVELS = void 0;
|
|
6
7
|
exports.parseEnvArg = parseEnvArg;
|
|
7
8
|
exports.resolveEnvArgPath = resolveEnvArgPath;
|
|
9
|
+
exports.findEnvFileUpward = findEnvFileUpward;
|
|
8
10
|
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const os_1 = __importDefault(require("os"));
|
|
9
12
|
const path_1 = __importDefault(require("path"));
|
|
10
13
|
/**
|
|
11
14
|
* Per-invocation .env selection for the `dove` CLI.
|
|
@@ -31,6 +34,11 @@ const path_1 = __importDefault(require("path"));
|
|
|
31
34
|
var ENV_FLAGS = ["--env", "--env-file", "--envFile", "-e"];
|
|
32
35
|
// Prefix a bare instance name is expanded with (`prod` → `.env.prod`).
|
|
33
36
|
var BARE_NAME_PREFIX = ".env.";
|
|
37
|
+
/**
|
|
38
|
+
* How many parent directories a bare instance name's file is looked for in,
|
|
39
|
+
* above the cwd. Mirrored in packages/servicenow/src/loadEnv.ts.
|
|
40
|
+
*/
|
|
41
|
+
exports.ENV_WALK_UP_MAX_LEVELS = 8;
|
|
34
42
|
/**
|
|
35
43
|
* @description Extracts the env-file selector from a raw argv slice. Supports
|
|
36
44
|
* both `--env <value>` and `--env=<value>` (and the `-e` / `--env-file`
|
|
@@ -75,14 +83,20 @@ function parseEnvArg(argv) {
|
|
|
75
83
|
* `workshop.env`) is an explicit filename in cwd, used as-is even when
|
|
76
84
|
* it does not exist yet — `dove login --env` may be about to create it.
|
|
77
85
|
* 4. Anything else is a bare instance name: `prod` → `<cwd>/.env.prod`.
|
|
78
|
-
*
|
|
79
|
-
*
|
|
86
|
+
* When that file does not exist, the parent directories are searched
|
|
87
|
+
* (findEnvFileUpward) and the nearest existing `.env.prod` wins, so a
|
|
88
|
+
* nested git worktree can use the per-instance file of the checkout it
|
|
89
|
+
* lives in. Nothing found → `<cwd>/.env.prod`, as before.
|
|
90
|
+
* Only rule 4 walks up; paths and explicit filenames never do. Existence is
|
|
91
|
+
* checked with stat only — no file is read here. A missing file keeps dove's
|
|
92
|
+
* historical behavior (nothing is loaded from it).
|
|
80
93
|
* @param {string} rawPath - The value returned by parseEnvArg.
|
|
81
94
|
* @param {string} [cwd] - Base directory for relative paths and bare names (defaults to process.cwd()).
|
|
95
|
+
* @param {EnvWalkUpOptions} [options] - Home-directory bound and a callback for a parent-directory match.
|
|
82
96
|
* @returns {string} An absolute path to the requested .env file.
|
|
83
97
|
* @throws {Error} When rawPath is not a non-empty string.
|
|
84
98
|
*/
|
|
85
|
-
function resolveEnvArgPath(rawPath, cwd) {
|
|
99
|
+
function resolveEnvArgPath(rawPath, cwd, options) {
|
|
86
100
|
if (typeof rawPath !== "string" || rawPath.trim().length === 0) {
|
|
87
101
|
throw new Error("--env must be a non-empty env-file name or path.");
|
|
88
102
|
}
|
|
@@ -98,7 +112,148 @@ function resolveEnvArgPath(rawPath, cwd) {
|
|
|
98
112
|
if (value.indexOf(".") !== -1) {
|
|
99
113
|
return literal;
|
|
100
114
|
}
|
|
101
|
-
|
|
115
|
+
var fileName = BARE_NAME_PREFIX + value;
|
|
116
|
+
var inCwd = path_1.default.resolve(base, fileName);
|
|
117
|
+
if (isExistingFile(inCwd)) {
|
|
118
|
+
return inCwd;
|
|
119
|
+
}
|
|
120
|
+
var opts = options || {};
|
|
121
|
+
var found = findEnvFileUpward({
|
|
122
|
+
fileName: fileName,
|
|
123
|
+
startDir: base,
|
|
124
|
+
homeDir: opts.homeDir,
|
|
125
|
+
ownerUid: opts.ownerUid,
|
|
126
|
+
});
|
|
127
|
+
if (found === null) {
|
|
128
|
+
return inCwd;
|
|
129
|
+
}
|
|
130
|
+
if (typeof opts.onParentMatch === "function") {
|
|
131
|
+
try {
|
|
132
|
+
opts.onParentMatch(found);
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
// A logging callback must never change which file is selected.
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return found;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @description Looks for `fileName` in the parent directories of `startDir`
|
|
142
|
+
* (not in `startDir` itself) and returns the nearest one that exists as a
|
|
143
|
+
* regular file owned by the current user. Bounds: at most `maxLevels` parents
|
|
144
|
+
* (default ENV_WALK_UP_MAX_LEVELS); never the home directory or anything above
|
|
145
|
+
* it; never the filesystem root. A file owned by someone else (e.g. planted in
|
|
146
|
+
* a shared or world-writable ancestor such as /tmp when the cwd is outside the
|
|
147
|
+
* home directory) is skipped, never selected. Uses stat only and never reads a
|
|
148
|
+
* file. Never throws: bad input or no match returns null.
|
|
149
|
+
* Keep behaviorally identical to findEnvFileUpward in
|
|
150
|
+
* packages/servicenow/src/loadEnv.ts — packages/servicenow/tests/envWalkUpParity.test.ts
|
|
151
|
+
* runs both.
|
|
152
|
+
* @param {{fileName: string, startDir: string, homeDir?: string, maxLevels?: number, ownerUid?: number}} args
|
|
153
|
+
* @returns {string|null} The absolute path of the nearest match, or null.
|
|
154
|
+
*/
|
|
155
|
+
function findEnvFileUpward(args) {
|
|
156
|
+
if (!args ||
|
|
157
|
+
typeof args.fileName !== "string" ||
|
|
158
|
+
typeof args.startDir !== "string") {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
var fileName = args.fileName;
|
|
162
|
+
if (fileName.length === 0 ||
|
|
163
|
+
/[\\/]/.test(fileName) ||
|
|
164
|
+
fileName === "." ||
|
|
165
|
+
fileName === "..") {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
if (args.startDir.length === 0) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
var maxLevels = typeof args.maxLevels === "number" &&
|
|
172
|
+
isFinite(args.maxLevels) &&
|
|
173
|
+
args.maxLevels >= 0
|
|
174
|
+
? Math.floor(args.maxLevels)
|
|
175
|
+
: exports.ENV_WALK_UP_MAX_LEVELS;
|
|
176
|
+
var home = typeof args.homeDir === "string" ? args.homeDir : safeHomeDir();
|
|
177
|
+
var homeResolved = home.length > 0 ? path_1.default.resolve(home) : "";
|
|
178
|
+
var ownerUid = typeof args.ownerUid === "number" && isFinite(args.ownerUid)
|
|
179
|
+
? args.ownerUid
|
|
180
|
+
: currentUid();
|
|
181
|
+
var dir = path_1.default.resolve(args.startDir);
|
|
182
|
+
for (var level = 0; level < maxLevels; level++) {
|
|
183
|
+
var parent = path_1.default.dirname(dir);
|
|
184
|
+
if (parent === dir) {
|
|
185
|
+
break; // already at the root
|
|
186
|
+
}
|
|
187
|
+
dir = parent;
|
|
188
|
+
if (path_1.default.dirname(dir) === dir) {
|
|
189
|
+
break; // never the filesystem root
|
|
190
|
+
}
|
|
191
|
+
if (homeResolved.length > 0 &&
|
|
192
|
+
isSameOrAncestor({ dir: dir, of: homeResolved })) {
|
|
193
|
+
break; // never the home directory or above it
|
|
194
|
+
}
|
|
195
|
+
var candidate = path_1.default.join(dir, fileName);
|
|
196
|
+
if (isOwnedFile({ candidate: candidate, ownerUid: ownerUid })) {
|
|
197
|
+
return candidate;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @description True when the path is a regular file owned by `ownerUid`
|
|
204
|
+
* (any owner when `ownerUid` is negative). Stat only. Never throws.
|
|
205
|
+
* @param {{candidate: string, ownerUid: number}} args
|
|
206
|
+
* @returns {boolean}
|
|
207
|
+
*/
|
|
208
|
+
function isOwnedFile(args) {
|
|
209
|
+
try {
|
|
210
|
+
var stat = fs_1.default.statSync(args.candidate);
|
|
211
|
+
if (!stat.isFile()) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
return args.ownerUid < 0 || stat.uid === args.ownerUid;
|
|
215
|
+
}
|
|
216
|
+
catch (e) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* @description process.getuid(), or -1 where it does not exist (Windows),
|
|
222
|
+
* which disables the ownership check. Never throws.
|
|
223
|
+
* @returns {number}
|
|
224
|
+
*/
|
|
225
|
+
function currentUid() {
|
|
226
|
+
try {
|
|
227
|
+
return typeof process.getuid === "function" ? process.getuid() : -1;
|
|
228
|
+
}
|
|
229
|
+
catch (e) {
|
|
230
|
+
return -1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* @description True when `dir` is `of` itself or one of its ancestors.
|
|
235
|
+
* @param {{dir: string, of: string}} args - Both absolute.
|
|
236
|
+
* @returns {boolean}
|
|
237
|
+
*/
|
|
238
|
+
function isSameOrAncestor(args) {
|
|
239
|
+
var rel = path_1.default.relative(args.dir, args.of);
|
|
240
|
+
if (rel === "") {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
return rel.indexOf("..") !== 0 && !path_1.default.isAbsolute(rel);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @description os.homedir(), or "" when it cannot be determined. Never throws.
|
|
247
|
+
* @returns {string}
|
|
248
|
+
*/
|
|
249
|
+
function safeHomeDir() {
|
|
250
|
+
try {
|
|
251
|
+
var home = os_1.default.homedir();
|
|
252
|
+
return typeof home === "string" ? home : "";
|
|
253
|
+
}
|
|
254
|
+
catch (e) {
|
|
255
|
+
return "";
|
|
256
|
+
}
|
|
102
257
|
}
|
|
103
258
|
/**
|
|
104
259
|
* @description True when the path exists and is a regular file. Never throws.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Tests that `dove`'s init() wires the bare-name walk-up end to end: a
|
|
3
|
+
// `--env <name>` with no file in cwd selects the parent directory's file,
|
|
4
|
+
// loads it, and prints only the chosen path to stderr (never stdout, never
|
|
5
|
+
// anything from the file). Every file here is a fake, created in a temp
|
|
6
|
+
// directory at runtime.
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
// --- Mock setup (must be before imports) ---
|
|
45
|
+
//
|
|
46
|
+
// init() boots the CLI parser, which under Jest would see jest's argv; stub it
|
|
47
|
+
// (same as cred.test.ts). Config loading is stubbed to a pass-through so the
|
|
48
|
+
// test is about the --env override, not dove.config.js discovery.
|
|
49
|
+
jest.mock("../commander", () => ({ initCommands: jest.fn() }));
|
|
50
|
+
jest.mock("../config", () => {
|
|
51
|
+
var actual = jest.requireActual("../config");
|
|
52
|
+
var override;
|
|
53
|
+
return Object.assign({}, actual, {
|
|
54
|
+
setEnvPathOverride: jest.fn(function (p) {
|
|
55
|
+
override = p;
|
|
56
|
+
}),
|
|
57
|
+
loadConfigs: jest.fn(function () {
|
|
58
|
+
return Promise.resolve();
|
|
59
|
+
}),
|
|
60
|
+
getEnvPath: jest.fn(function () {
|
|
61
|
+
if (override === undefined)
|
|
62
|
+
throw new Error("no override");
|
|
63
|
+
return override;
|
|
64
|
+
}),
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
// --- Imports (after mocks) ---
|
|
68
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
69
|
+
const fs_1 = __importDefault(require("fs"));
|
|
70
|
+
const os_1 = __importDefault(require("os"));
|
|
71
|
+
const path_1 = __importDefault(require("path"));
|
|
72
|
+
const bootstrap_1 = require("../bootstrap");
|
|
73
|
+
const ConfigManager = __importStar(require("../config"));
|
|
74
|
+
var ENV_PREFIX = ".env.";
|
|
75
|
+
var FAKE_CONTENT = "SN_INSTANCE=fakebootwalkup\nSN_USER=fakeuser\nSN_PASSWORD=fakepass-not-real\n";
|
|
76
|
+
describe("init() — --env bare name found in a parent directory", function () {
|
|
77
|
+
var root;
|
|
78
|
+
var savedCwd;
|
|
79
|
+
var savedArgv;
|
|
80
|
+
var savedKeys = ["SN_INSTANCE", "SN_USER", "SN_PASSWORD"];
|
|
81
|
+
var savedEnv = {};
|
|
82
|
+
beforeEach(function () {
|
|
83
|
+
root = fs_1.default.realpathSync(fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "dove-boot-walkup-")));
|
|
84
|
+
savedCwd = process.cwd();
|
|
85
|
+
savedArgv = process.argv;
|
|
86
|
+
savedKeys.forEach(function (k) {
|
|
87
|
+
savedEnv[k] = process.env[k];
|
|
88
|
+
delete process.env[k];
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
afterEach(function () {
|
|
92
|
+
process.chdir(savedCwd);
|
|
93
|
+
process.argv = savedArgv;
|
|
94
|
+
savedKeys.forEach(function (k) {
|
|
95
|
+
if (savedEnv[k] === undefined)
|
|
96
|
+
delete process.env[k];
|
|
97
|
+
else
|
|
98
|
+
process.env[k] = savedEnv[k];
|
|
99
|
+
});
|
|
100
|
+
fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
101
|
+
});
|
|
102
|
+
it("selects and loads the parent file and logs only its path to stderr", async function () {
|
|
103
|
+
// A random name, so the walk above the temp root can never hit a stray file.
|
|
104
|
+
var name = "bootwalkup" + crypto_1.default.randomBytes(6).toString("hex");
|
|
105
|
+
var nested = path_1.default.join(root, "wt", "pkg");
|
|
106
|
+
fs_1.default.mkdirSync(nested, { recursive: true });
|
|
107
|
+
var target = path_1.default.join(root, ENV_PREFIX + name);
|
|
108
|
+
fs_1.default.writeFileSync(target, FAKE_CONTENT);
|
|
109
|
+
process.chdir(nested);
|
|
110
|
+
process.argv = ["node", "dove", "status", "--env", name];
|
|
111
|
+
var errOut = [];
|
|
112
|
+
var stdOut = [];
|
|
113
|
+
var errSpy = jest
|
|
114
|
+
.spyOn(process.stderr, "write")
|
|
115
|
+
.mockImplementation(function (chunk) {
|
|
116
|
+
errOut.push(String(chunk));
|
|
117
|
+
return true;
|
|
118
|
+
});
|
|
119
|
+
var outSpy = jest
|
|
120
|
+
.spyOn(process.stdout, "write")
|
|
121
|
+
.mockImplementation(function (chunk) {
|
|
122
|
+
stdOut.push(String(chunk));
|
|
123
|
+
return true;
|
|
124
|
+
});
|
|
125
|
+
try {
|
|
126
|
+
await (0, bootstrap_1.init)();
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
errSpy.mockRestore();
|
|
130
|
+
outSpy.mockRestore();
|
|
131
|
+
}
|
|
132
|
+
expect(ConfigManager.setEnvPathOverride).toHaveBeenCalledWith(target);
|
|
133
|
+
expect(process.env.SN_INSTANCE).toBe("fakebootwalkup");
|
|
134
|
+
var err = errOut.join("");
|
|
135
|
+
expect(err).toContain("dove: --env " + name + ": using " + target);
|
|
136
|
+
expect(err).toContain("found in a parent directory");
|
|
137
|
+
expect(err).not.toContain("fakepass-not-real");
|
|
138
|
+
expect(stdOut.join("")).not.toContain(target);
|
|
139
|
+
});
|
|
140
|
+
it("prints nothing when the file is in cwd", async function () {
|
|
141
|
+
var name = "bootwalkup" + crypto_1.default.randomBytes(6).toString("hex");
|
|
142
|
+
var target = path_1.default.join(root, ENV_PREFIX + name);
|
|
143
|
+
fs_1.default.writeFileSync(target, FAKE_CONTENT);
|
|
144
|
+
process.chdir(root);
|
|
145
|
+
process.argv = ["node", "dove", "status", "--env", name];
|
|
146
|
+
var errOut = [];
|
|
147
|
+
var errSpy = jest
|
|
148
|
+
.spyOn(process.stderr, "write")
|
|
149
|
+
.mockImplementation(function (chunk) {
|
|
150
|
+
errOut.push(String(chunk));
|
|
151
|
+
return true;
|
|
152
|
+
});
|
|
153
|
+
try {
|
|
154
|
+
await (0, bootstrap_1.init)();
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
errSpy.mockRestore();
|
|
158
|
+
}
|
|
159
|
+
expect(ConfigManager.setEnvPathOverride).toHaveBeenLastCalledWith(target);
|
|
160
|
+
expect(errOut.join("")).not.toContain("found in a parent directory");
|
|
161
|
+
});
|
|
162
|
+
});
|
|
@@ -7,6 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
10
11
|
const fs_1 = __importDefault(require("fs"));
|
|
11
12
|
const os_1 = __importDefault(require("os"));
|
|
12
13
|
const path_1 = __importDefault(require("path"));
|
|
@@ -116,7 +117,18 @@ describe("resolveEnvArgPath", function () {
|
|
|
116
117
|
expect((0, envArg_1.resolveEnvArgPath)(raw, tmpDir)).toBe(path_1.default.join(tmpDir, ENV_PREFIX + "demo8"));
|
|
117
118
|
});
|
|
118
119
|
it("defaults to process.cwd() when no cwd is given", function () {
|
|
119
|
-
|
|
120
|
+
// Hermetic: run from a temp dir with a random name, so a bare name can't
|
|
121
|
+
// walk up to a real per-instance file above the checkout.
|
|
122
|
+
var savedCwd = process.cwd();
|
|
123
|
+
var name = "cwddefault" + crypto_1.default.randomBytes(6).toString("hex");
|
|
124
|
+
var dir = fs_1.default.realpathSync(tmpDir);
|
|
125
|
+
process.chdir(dir);
|
|
126
|
+
try {
|
|
127
|
+
expect((0, envArg_1.resolveEnvArgPath)(name)).toBe(path_1.default.join(dir, ENV_PREFIX + name));
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
process.chdir(savedCwd);
|
|
131
|
+
}
|
|
120
132
|
});
|
|
121
133
|
it("throws on an empty or non-string selector", function () {
|
|
122
134
|
expect(function () {
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Tests for the parent-directory lookup of a bare `--env <name>` (envArg.ts):
|
|
3
|
+
// resolveEnvArgPath walks up from the cwd for `<prefix><name>` when the cwd
|
|
4
|
+
// has none, bounded by the home directory, the filesystem root and
|
|
5
|
+
// ENV_WALK_UP_MAX_LEVELS. Paths and dotted filenames never walk up.
|
|
6
|
+
// Every file here is a fake, created in a temp directory at runtime.
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const os_1 = __importDefault(require("os"));
|
|
13
|
+
const path_1 = __importDefault(require("path"));
|
|
14
|
+
const envArg_1 = require("../envArg");
|
|
15
|
+
// The conventional per-instance env-file prefix (`loft` → `<prefix>loft`).
|
|
16
|
+
var ENV_PREFIX = ".env.";
|
|
17
|
+
var NAME = "loft";
|
|
18
|
+
var FILE = ENV_PREFIX + NAME;
|
|
19
|
+
describe("resolveEnvArgPath — bare name walks up to a parent directory", function () {
|
|
20
|
+
var root;
|
|
21
|
+
var home;
|
|
22
|
+
var cwd;
|
|
23
|
+
beforeEach(function () {
|
|
24
|
+
root = fs_1.default.realpathSync(fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "dove-walkup-")));
|
|
25
|
+
// root/home/a/b/c/d — cwd is d, the fake home directory is root/home.
|
|
26
|
+
home = path_1.default.join(root, "home");
|
|
27
|
+
cwd = path_1.default.join(home, "a", "b", "c", "d");
|
|
28
|
+
fs_1.default.mkdirSync(cwd, { recursive: true });
|
|
29
|
+
});
|
|
30
|
+
afterEach(function () {
|
|
31
|
+
fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
32
|
+
});
|
|
33
|
+
function touch(dir, name) {
|
|
34
|
+
var p = path_1.default.join(dir, name || FILE);
|
|
35
|
+
fs_1.default.writeFileSync(p, "SN_INSTANCE=fake\n");
|
|
36
|
+
return p;
|
|
37
|
+
}
|
|
38
|
+
it("uses the file in cwd when it is there (no walk-up)", function () {
|
|
39
|
+
var inCwd = touch(cwd);
|
|
40
|
+
touch(path_1.default.join(home, "a"));
|
|
41
|
+
var calls = [];
|
|
42
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, {
|
|
43
|
+
homeDir: home,
|
|
44
|
+
onParentMatch: function (p) {
|
|
45
|
+
calls.push(p);
|
|
46
|
+
},
|
|
47
|
+
})).toBe(inCwd);
|
|
48
|
+
expect(calls).toEqual([]);
|
|
49
|
+
});
|
|
50
|
+
it("finds the file one level up and reports it", function () {
|
|
51
|
+
var up1 = touch(path_1.default.join(home, "a", "b", "c"));
|
|
52
|
+
var calls = [];
|
|
53
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, {
|
|
54
|
+
homeDir: home,
|
|
55
|
+
onParentMatch: function (p) {
|
|
56
|
+
calls.push(p);
|
|
57
|
+
},
|
|
58
|
+
})).toBe(up1);
|
|
59
|
+
expect(calls).toEqual([up1]);
|
|
60
|
+
});
|
|
61
|
+
it("finds the file three levels up", function () {
|
|
62
|
+
var up3 = touch(path_1.default.join(home, "a"));
|
|
63
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home })).toBe(up3);
|
|
64
|
+
});
|
|
65
|
+
it("takes the nearest match when several parents have one", function () {
|
|
66
|
+
var near = touch(path_1.default.join(home, "a", "b"));
|
|
67
|
+
touch(path_1.default.join(home, "a"));
|
|
68
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home })).toBe(near);
|
|
69
|
+
});
|
|
70
|
+
it("returns the cwd path (historical behavior) when no parent has the file", function () {
|
|
71
|
+
var calls = [];
|
|
72
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, {
|
|
73
|
+
homeDir: home,
|
|
74
|
+
onParentMatch: function (p) {
|
|
75
|
+
calls.push(p);
|
|
76
|
+
},
|
|
77
|
+
})).toBe(path_1.default.join(cwd, FILE));
|
|
78
|
+
expect(calls).toEqual([]);
|
|
79
|
+
});
|
|
80
|
+
it("never uses the home directory itself", function () {
|
|
81
|
+
touch(home);
|
|
82
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home })).toBe(path_1.default.join(cwd, FILE));
|
|
83
|
+
});
|
|
84
|
+
it("never uses a directory above the home directory", function () {
|
|
85
|
+
touch(root);
|
|
86
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home })).toBe(path_1.default.join(cwd, FILE));
|
|
87
|
+
});
|
|
88
|
+
it("skips a parent entry with that name that is a directory, not a file", function () {
|
|
89
|
+
fs_1.default.mkdirSync(path_1.default.join(home, "a", "b", FILE));
|
|
90
|
+
var up3 = touch(path_1.default.join(home, "a"));
|
|
91
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home })).toBe(up3);
|
|
92
|
+
});
|
|
93
|
+
it("does not walk up for a dotted filename", function () {
|
|
94
|
+
touch(path_1.default.join(home, "a"), "loft.env");
|
|
95
|
+
touch(path_1.default.join(home, "a"), FILE);
|
|
96
|
+
expect((0, envArg_1.resolveEnvArgPath)("loft.env", cwd, { homeDir: home })).toBe(path_1.default.join(cwd, "loft.env"));
|
|
97
|
+
expect((0, envArg_1.resolveEnvArgPath)(FILE, cwd, { homeDir: home })).toBe(path_1.default.join(cwd, FILE));
|
|
98
|
+
});
|
|
99
|
+
it("does not walk up for a path value", function () {
|
|
100
|
+
touch(path_1.default.join(home, "a"));
|
|
101
|
+
expect((0, envArg_1.resolveEnvArgPath)(path_1.default.join("envs", NAME), cwd, { homeDir: home })).toBe(path_1.default.join(cwd, "envs", NAME));
|
|
102
|
+
});
|
|
103
|
+
it("checks existence with stat only — never opens or reads a file", function () {
|
|
104
|
+
var up3 = touch(path_1.default.join(home, "a"));
|
|
105
|
+
var readSpy = jest.spyOn(fs_1.default, "readFileSync");
|
|
106
|
+
var openSpy = jest.spyOn(fs_1.default, "openSync");
|
|
107
|
+
try {
|
|
108
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home })).toBe(up3);
|
|
109
|
+
expect((0, envArg_1.resolveEnvArgPath)("missing", cwd, { homeDir: home })).toBe(path_1.default.join(cwd, ENV_PREFIX + "missing"));
|
|
110
|
+
expect(readSpy).not.toHaveBeenCalled();
|
|
111
|
+
expect(openSpy).not.toHaveBeenCalled();
|
|
112
|
+
}
|
|
113
|
+
finally {
|
|
114
|
+
readSpy.mockRestore();
|
|
115
|
+
openSpy.mockRestore();
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
it("skips a parent file owned by another user (e.g. planted in /tmp)", function () {
|
|
119
|
+
touch(path_1.default.join(home, "a"));
|
|
120
|
+
var otherUid = (typeof process.getuid === "function" ? process.getuid() : 0) + 4242;
|
|
121
|
+
var calls = [];
|
|
122
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, {
|
|
123
|
+
homeDir: home,
|
|
124
|
+
ownerUid: otherUid,
|
|
125
|
+
onParentMatch: function (p) {
|
|
126
|
+
calls.push(p);
|
|
127
|
+
},
|
|
128
|
+
})).toBe(path_1.default.join(cwd, FILE));
|
|
129
|
+
expect(calls).toEqual([]);
|
|
130
|
+
});
|
|
131
|
+
it("accepts a parent file owned by the current user, and any owner when ownerUid < 0", function () {
|
|
132
|
+
var up3 = touch(path_1.default.join(home, "a"));
|
|
133
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home })).toBe(up3);
|
|
134
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, { homeDir: home, ownerUid: -1 })).toBe(up3);
|
|
135
|
+
});
|
|
136
|
+
it("keeps the selection when the callback throws", function () {
|
|
137
|
+
var up1 = touch(path_1.default.join(home, "a", "b", "c"));
|
|
138
|
+
expect((0, envArg_1.resolveEnvArgPath)(NAME, cwd, {
|
|
139
|
+
homeDir: home,
|
|
140
|
+
onParentMatch: function () {
|
|
141
|
+
throw new Error("logger down");
|
|
142
|
+
},
|
|
143
|
+
})).toBe(up1);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
describe("findEnvFileUpward", function () {
|
|
147
|
+
var root;
|
|
148
|
+
beforeEach(function () {
|
|
149
|
+
root = fs_1.default.realpathSync(fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), "dove-walkup-depth-")));
|
|
150
|
+
});
|
|
151
|
+
afterEach(function () {
|
|
152
|
+
fs_1.default.rmSync(root, { recursive: true, force: true });
|
|
153
|
+
});
|
|
154
|
+
// root/l0/l1/.../l<depth-1>; returns the deepest directory and every level.
|
|
155
|
+
function chain(depth) {
|
|
156
|
+
var levels = [];
|
|
157
|
+
var dir = root;
|
|
158
|
+
for (var i = 0; i < depth; i++) {
|
|
159
|
+
dir = path_1.default.join(dir, "l" + i);
|
|
160
|
+
levels.push(dir);
|
|
161
|
+
}
|
|
162
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
163
|
+
return { deepest: dir, levels: levels };
|
|
164
|
+
}
|
|
165
|
+
it("defaults to " + envArg_1.ENV_WALK_UP_MAX_LEVELS + " parent levels", function () {
|
|
166
|
+
expect(envArg_1.ENV_WALK_UP_MAX_LEVELS).toBe(8);
|
|
167
|
+
});
|
|
168
|
+
it("finds a file exactly ENV_WALK_UP_MAX_LEVELS levels up", function () {
|
|
169
|
+
var c = chain(envArg_1.ENV_WALK_UP_MAX_LEVELS + 2);
|
|
170
|
+
// levels[last] is the start; ENV_WALK_UP_MAX_LEVELS up from it:
|
|
171
|
+
var target = c.levels[c.levels.length - 1 - envArg_1.ENV_WALK_UP_MAX_LEVELS];
|
|
172
|
+
fs_1.default.writeFileSync(path_1.default.join(target, FILE), "x");
|
|
173
|
+
expect((0, envArg_1.findEnvFileUpward)({ fileName: FILE, startDir: c.deepest, homeDir: "" })).toBe(path_1.default.join(target, FILE));
|
|
174
|
+
});
|
|
175
|
+
it("stops after ENV_WALK_UP_MAX_LEVELS levels", function () {
|
|
176
|
+
var c = chain(envArg_1.ENV_WALK_UP_MAX_LEVELS + 3);
|
|
177
|
+
var tooFar = c.levels[c.levels.length - 2 - envArg_1.ENV_WALK_UP_MAX_LEVELS];
|
|
178
|
+
fs_1.default.writeFileSync(path_1.default.join(tooFar, FILE), "x");
|
|
179
|
+
expect((0, envArg_1.findEnvFileUpward)({ fileName: FILE, startDir: c.deepest, homeDir: "" })).toBeNull();
|
|
180
|
+
});
|
|
181
|
+
it("honors a smaller maxLevels", function () {
|
|
182
|
+
var c = chain(5);
|
|
183
|
+
fs_1.default.writeFileSync(path_1.default.join(c.levels[1], FILE), "x"); // 3 levels up from l4
|
|
184
|
+
expect((0, envArg_1.findEnvFileUpward)({
|
|
185
|
+
fileName: FILE,
|
|
186
|
+
startDir: c.deepest,
|
|
187
|
+
homeDir: "",
|
|
188
|
+
maxLevels: 2,
|
|
189
|
+
})).toBeNull();
|
|
190
|
+
expect((0, envArg_1.findEnvFileUpward)({
|
|
191
|
+
fileName: FILE,
|
|
192
|
+
startDir: c.deepest,
|
|
193
|
+
homeDir: "",
|
|
194
|
+
maxLevels: 3,
|
|
195
|
+
})).toBe(path_1.default.join(c.levels[1], FILE));
|
|
196
|
+
});
|
|
197
|
+
it("never looks in startDir itself", function () {
|
|
198
|
+
var c = chain(2);
|
|
199
|
+
fs_1.default.writeFileSync(path_1.default.join(c.deepest, FILE), "x");
|
|
200
|
+
expect((0, envArg_1.findEnvFileUpward)({ fileName: FILE, startDir: c.deepest, homeDir: "" })).toBeNull();
|
|
201
|
+
});
|
|
202
|
+
it("returns null for bad input instead of throwing", function () {
|
|
203
|
+
expect((0, envArg_1.findEnvFileUpward)({ fileName: "", startDir: root })).toBeNull();
|
|
204
|
+
expect((0, envArg_1.findEnvFileUpward)({ fileName: path_1.default.join("a", FILE), startDir: root })).toBeNull();
|
|
205
|
+
expect((0, envArg_1.findEnvFileUpward)({ fileName: "..", startDir: root })).toBeNull();
|
|
206
|
+
expect((0, envArg_1.findEnvFileUpward)({ fileName: FILE, startDir: "" })).toBeNull();
|
|
207
|
+
expect((0, envArg_1.findEnvFileUpward)(null)).toBeNull();
|
|
208
|
+
});
|
|
209
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenonhq/dovetail-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.130",
|
|
4
4
|
"description": "Next-gen file syncer",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"typescript": "^5.2.2"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tenonhq/dovetail-clickup": "~0.0.
|
|
41
|
+
"@tenonhq/dovetail-clickup": "~0.0.15",
|
|
42
42
|
"@tenonhq/dovetail-schema": "~0.0.15",
|
|
43
43
|
"axios": "^1.20.0",
|
|
44
44
|
"axios-cookiejar-support": "^4.0.7",
|
package/release-manifest.json
CHANGED
|
@@ -1,7 +1,230 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "dovetail-manifest/v1",
|
|
3
|
-
"generated_at": "2026-10-
|
|
3
|
+
"generated_at": "2026-10-19T20:13:35.615Z",
|
|
4
4
|
"events": [
|
|
5
|
+
{
|
|
6
|
+
"$schema": "dovetail-release-event/v1",
|
|
7
|
+
"event_id": "dovetail-clickup@0.0.15",
|
|
8
|
+
"package": "@tenonhq/dovetail-clickup",
|
|
9
|
+
"version": "0.0.15",
|
|
10
|
+
"prev_version": "0.0.14",
|
|
11
|
+
"published_at": "2026-10-19T20:13:35.597Z",
|
|
12
|
+
"git": {
|
|
13
|
+
"sha": "27e794da15a284012f747cd45bfed9e9c0c742ad",
|
|
14
|
+
"tag": "dovetail-clickup@0.0.15"
|
|
15
|
+
},
|
|
16
|
+
"semver_bump": "patch",
|
|
17
|
+
"commits": [
|
|
18
|
+
{
|
|
19
|
+
"sha": "27e794da1",
|
|
20
|
+
"subject": "feat(clickup,mcp): ClickUp Goals + Key Results (#335)",
|
|
21
|
+
"pr": 335
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"sha": "b46e30a86",
|
|
25
|
+
"subject": "chore(release): publish 7 packages [skip ci]"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"exports_delta": null,
|
|
29
|
+
"narrative": null
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"$schema": "dovetail-release-event/v1",
|
|
33
|
+
"event_id": "dovetail-core@0.0.129",
|
|
34
|
+
"package": "@tenonhq/dovetail-core",
|
|
35
|
+
"version": "0.0.129",
|
|
36
|
+
"prev_version": "0.0.128",
|
|
37
|
+
"published_at": "2026-10-19T20:13:35.597Z",
|
|
38
|
+
"git": {
|
|
39
|
+
"sha": "27e794da15a284012f747cd45bfed9e9c0c742ad",
|
|
40
|
+
"tag": "dovetail-core@0.0.129"
|
|
41
|
+
},
|
|
42
|
+
"semver_bump": "patch",
|
|
43
|
+
"commits": [
|
|
44
|
+
{
|
|
45
|
+
"sha": "58bb537f2",
|
|
46
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"sha": "a32a76e4c",
|
|
50
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"sha": "7020c0e49",
|
|
54
|
+
"subject": "chore(release): @tenonhq/dovetail-core@0.0.128 [skip ci]"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"exports_delta": null,
|
|
58
|
+
"narrative": null
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"$schema": "dovetail-release-event/v1",
|
|
62
|
+
"event_id": "dovetail-mcp@0.0.55",
|
|
63
|
+
"package": "@tenonhq/dovetail-mcp",
|
|
64
|
+
"version": "0.0.55",
|
|
65
|
+
"prev_version": "0.0.54",
|
|
66
|
+
"published_at": "2026-10-19T20:13:35.597Z",
|
|
67
|
+
"git": {
|
|
68
|
+
"sha": "27e794da15a284012f747cd45bfed9e9c0c742ad",
|
|
69
|
+
"tag": "dovetail-mcp@0.0.55"
|
|
70
|
+
},
|
|
71
|
+
"semver_bump": "patch",
|
|
72
|
+
"commits": [
|
|
73
|
+
{
|
|
74
|
+
"sha": "27e794da1",
|
|
75
|
+
"subject": "feat(clickup,mcp): ClickUp Goals + Key Results (#335)",
|
|
76
|
+
"pr": 335
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"sha": "58bb537f2",
|
|
80
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"exports_delta": null,
|
|
84
|
+
"narrative": null
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"$schema": "dovetail-release-event/v1",
|
|
88
|
+
"event_id": "dovetail-servicenow@0.0.56",
|
|
89
|
+
"package": "@tenonhq/dovetail-servicenow",
|
|
90
|
+
"version": "0.0.56",
|
|
91
|
+
"prev_version": "0.0.55",
|
|
92
|
+
"published_at": "2026-10-15T22:33:13.670Z",
|
|
93
|
+
"git": {
|
|
94
|
+
"sha": "01c04e34711ddd97ee37a470b6449b36b9862af0",
|
|
95
|
+
"tag": "dovetail-servicenow@0.0.56"
|
|
96
|
+
},
|
|
97
|
+
"semver_bump": "patch",
|
|
98
|
+
"commits": [
|
|
99
|
+
{
|
|
100
|
+
"sha": "01c04e347",
|
|
101
|
+
"subject": "feat(servicenow): accept conditions, domain_id and domain_path column types (#333)",
|
|
102
|
+
"pr": 333
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"sha": "a32a76e4c",
|
|
106
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"exports_delta": null,
|
|
110
|
+
"narrative": null
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"$schema": "dovetail-release-event/v1",
|
|
114
|
+
"event_id": "dovetail-mcp@0.0.54",
|
|
115
|
+
"package": "@tenonhq/dovetail-mcp",
|
|
116
|
+
"version": "0.0.54",
|
|
117
|
+
"prev_version": "0.0.53",
|
|
118
|
+
"published_at": "2026-10-15T22:33:13.670Z",
|
|
119
|
+
"git": {
|
|
120
|
+
"sha": "01c04e34711ddd97ee37a470b6449b36b9862af0",
|
|
121
|
+
"tag": "dovetail-mcp@0.0.54"
|
|
122
|
+
},
|
|
123
|
+
"semver_bump": "patch",
|
|
124
|
+
"commits": [
|
|
125
|
+
{
|
|
126
|
+
"sha": "a32a76e4c",
|
|
127
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"exports_delta": null,
|
|
131
|
+
"narrative": null
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"$schema": "dovetail-release-event/v1",
|
|
135
|
+
"event_id": "dovetail-servicenow@0.0.55",
|
|
136
|
+
"package": "@tenonhq/dovetail-servicenow",
|
|
137
|
+
"version": "0.0.55",
|
|
138
|
+
"prev_version": "0.0.54",
|
|
139
|
+
"published_at": "2026-10-11T19:49:07.347Z",
|
|
140
|
+
"git": {
|
|
141
|
+
"sha": "b0fbd1f2401757a624316c3b3a4d8a9fc35f6e92",
|
|
142
|
+
"tag": "dovetail-servicenow@0.0.55"
|
|
143
|
+
},
|
|
144
|
+
"semver_bump": "patch",
|
|
145
|
+
"commits": [
|
|
146
|
+
{
|
|
147
|
+
"sha": "b0fbd1f24",
|
|
148
|
+
"subject": "feat(servicenow): --domain session-domain selection for dove-sn record writes (#332)",
|
|
149
|
+
"pr": 332
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"sha": "6bfedbdec",
|
|
153
|
+
"subject": "fix: server ops accept a scope sys_id; refuse ambiguous scope names (#330)",
|
|
154
|
+
"pr": 330
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"sha": "7bd8dfc04",
|
|
158
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"sha": "3fb9300cf",
|
|
162
|
+
"subject": "chore(release): publish 3 packages [skip ci]"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"exports_delta": null,
|
|
166
|
+
"narrative": null
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"$schema": "dovetail-release-event/v1",
|
|
170
|
+
"event_id": "dovetail-mcp@0.0.53",
|
|
171
|
+
"package": "@tenonhq/dovetail-mcp",
|
|
172
|
+
"version": "0.0.53",
|
|
173
|
+
"prev_version": "0.0.52",
|
|
174
|
+
"published_at": "2026-10-11T19:49:07.347Z",
|
|
175
|
+
"git": {
|
|
176
|
+
"sha": "b0fbd1f2401757a624316c3b3a4d8a9fc35f6e92",
|
|
177
|
+
"tag": "dovetail-mcp@0.0.53"
|
|
178
|
+
},
|
|
179
|
+
"semver_bump": "patch",
|
|
180
|
+
"commits": [
|
|
181
|
+
{
|
|
182
|
+
"sha": "7bd8dfc04",
|
|
183
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"sha": "3fb9300cf",
|
|
187
|
+
"subject": "chore(release): publish 3 packages [skip ci]"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"exports_delta": null,
|
|
191
|
+
"narrative": null
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"$schema": "dovetail-release-event/v1",
|
|
195
|
+
"event_id": "dovetail-core@0.0.128",
|
|
196
|
+
"package": "@tenonhq/dovetail-core",
|
|
197
|
+
"version": "0.0.128",
|
|
198
|
+
"prev_version": "0.0.127",
|
|
199
|
+
"published_at": "2026-10-09T16:29:50.775Z",
|
|
200
|
+
"git": {
|
|
201
|
+
"sha": "d5e3d77b0dd4aac1d732c3311eb8050f238d3691",
|
|
202
|
+
"tag": "dovetail-core@0.0.128"
|
|
203
|
+
},
|
|
204
|
+
"semver_bump": "patch",
|
|
205
|
+
"commits": [
|
|
206
|
+
{
|
|
207
|
+
"sha": "d5e3d77b0",
|
|
208
|
+
"subject": "fix: getScopeId counts matches by iterating; unblock the failed #330 publish (#331)",
|
|
209
|
+
"pr": 331
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"sha": "6bfedbdec",
|
|
213
|
+
"subject": "fix: server ops accept a scope sys_id; refuse ambiguous scope names (#330)",
|
|
214
|
+
"pr": 330
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"sha": "7bd8dfc04",
|
|
218
|
+
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"sha": "3fb9300cf",
|
|
222
|
+
"subject": "chore(release): publish 3 packages [skip ci]"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"exports_delta": null,
|
|
226
|
+
"narrative": null
|
|
227
|
+
},
|
|
5
228
|
{
|
|
6
229
|
"$schema": "dovetail-release-event/v1",
|
|
7
230
|
"event_id": "dovetail-servicenow@0.0.54",
|
|
@@ -1151,202 +1374,6 @@
|
|
|
1151
1374
|
],
|
|
1152
1375
|
"exports_delta": null,
|
|
1153
1376
|
"narrative": null
|
|
1154
|
-
},
|
|
1155
|
-
{
|
|
1156
|
-
"$schema": "dovetail-release-event/v1",
|
|
1157
|
-
"event_id": "dovetail-servicenow@0.0.45",
|
|
1158
|
-
"package": "@tenonhq/dovetail-servicenow",
|
|
1159
|
-
"version": "0.0.45",
|
|
1160
|
-
"prev_version": "0.0.44",
|
|
1161
|
-
"published_at": "2026-09-30T21:15:07.753Z",
|
|
1162
|
-
"git": {
|
|
1163
|
-
"sha": "5ed116898825fdbe390d5f9e806ae797d34150ae",
|
|
1164
|
-
"tag": "dovetail-servicenow@0.0.45"
|
|
1165
|
-
},
|
|
1166
|
-
"semver_bump": "patch",
|
|
1167
|
-
"commits": [
|
|
1168
|
-
{
|
|
1169
|
-
"sha": "5ed116898",
|
|
1170
|
-
"subject": "fix(servicenow): clone-action copies output mappings and IO labels (#284)",
|
|
1171
|
-
"pr": 284
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
"sha": "2fd584e31",
|
|
1175
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1176
|
-
}
|
|
1177
|
-
],
|
|
1178
|
-
"exports_delta": null,
|
|
1179
|
-
"narrative": null
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
"$schema": "dovetail-release-event/v1",
|
|
1183
|
-
"event_id": "dovetail-mcp@0.0.42",
|
|
1184
|
-
"package": "@tenonhq/dovetail-mcp",
|
|
1185
|
-
"version": "0.0.42",
|
|
1186
|
-
"prev_version": "0.0.41",
|
|
1187
|
-
"published_at": "2026-09-30T21:15:07.753Z",
|
|
1188
|
-
"git": {
|
|
1189
|
-
"sha": "5ed116898825fdbe390d5f9e806ae797d34150ae",
|
|
1190
|
-
"tag": "dovetail-mcp@0.0.42"
|
|
1191
|
-
},
|
|
1192
|
-
"semver_bump": "patch",
|
|
1193
|
-
"commits": [
|
|
1194
|
-
{
|
|
1195
|
-
"sha": "2fd584e31",
|
|
1196
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1197
|
-
}
|
|
1198
|
-
],
|
|
1199
|
-
"exports_delta": null,
|
|
1200
|
-
"narrative": null
|
|
1201
|
-
},
|
|
1202
|
-
{
|
|
1203
|
-
"$schema": "dovetail-release-event/v1",
|
|
1204
|
-
"event_id": "dovetail-servicenow@0.0.44",
|
|
1205
|
-
"package": "@tenonhq/dovetail-servicenow",
|
|
1206
|
-
"version": "0.0.44",
|
|
1207
|
-
"prev_version": "0.0.43",
|
|
1208
|
-
"published_at": "2026-09-30T19:56:06.848Z",
|
|
1209
|
-
"git": {
|
|
1210
|
-
"sha": "bbbafb8580e6ef3a37bf0db41c0257b46eb2c7fd",
|
|
1211
|
-
"tag": "dovetail-servicenow@0.0.44"
|
|
1212
|
-
},
|
|
1213
|
-
"semver_bump": "patch",
|
|
1214
|
-
"commits": [
|
|
1215
|
-
{
|
|
1216
|
-
"sha": "bbbafb858",
|
|
1217
|
-
"subject": "fix(servicenow): define-action verify ignores server-defaulted maxLength (#283)",
|
|
1218
|
-
"pr": 283
|
|
1219
|
-
},
|
|
1220
|
-
{
|
|
1221
|
-
"sha": "80c775d5f",
|
|
1222
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1223
|
-
}
|
|
1224
|
-
],
|
|
1225
|
-
"exports_delta": null,
|
|
1226
|
-
"narrative": null
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
"$schema": "dovetail-release-event/v1",
|
|
1230
|
-
"event_id": "dovetail-mcp@0.0.41",
|
|
1231
|
-
"package": "@tenonhq/dovetail-mcp",
|
|
1232
|
-
"version": "0.0.41",
|
|
1233
|
-
"prev_version": "0.0.40",
|
|
1234
|
-
"published_at": "2026-09-30T19:56:06.848Z",
|
|
1235
|
-
"git": {
|
|
1236
|
-
"sha": "bbbafb8580e6ef3a37bf0db41c0257b46eb2c7fd",
|
|
1237
|
-
"tag": "dovetail-mcp@0.0.41"
|
|
1238
|
-
},
|
|
1239
|
-
"semver_bump": "patch",
|
|
1240
|
-
"commits": [
|
|
1241
|
-
{
|
|
1242
|
-
"sha": "80c775d5f",
|
|
1243
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1244
|
-
}
|
|
1245
|
-
],
|
|
1246
|
-
"exports_delta": null,
|
|
1247
|
-
"narrative": null
|
|
1248
|
-
},
|
|
1249
|
-
{
|
|
1250
|
-
"$schema": "dovetail-release-event/v1",
|
|
1251
|
-
"event_id": "dovetail-servicenow@0.0.43",
|
|
1252
|
-
"package": "@tenonhq/dovetail-servicenow",
|
|
1253
|
-
"version": "0.0.43",
|
|
1254
|
-
"prev_version": "0.0.42",
|
|
1255
|
-
"published_at": "2026-09-30T19:46:32.033Z",
|
|
1256
|
-
"git": {
|
|
1257
|
-
"sha": "f74ad656a75e8fecc5ba1d1ee8df75a9aefee91a",
|
|
1258
|
-
"tag": "dovetail-servicenow@0.0.43"
|
|
1259
|
-
},
|
|
1260
|
-
"semver_bump": "patch",
|
|
1261
|
-
"commits": [
|
|
1262
|
-
{
|
|
1263
|
-
"sha": "f74ad656a",
|
|
1264
|
-
"subject": "feat(servicenow): dove-sn define-action / action_define (#282)",
|
|
1265
|
-
"pr": 282
|
|
1266
|
-
},
|
|
1267
|
-
{
|
|
1268
|
-
"sha": "b402cc04f",
|
|
1269
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1270
|
-
}
|
|
1271
|
-
],
|
|
1272
|
-
"exports_delta": null,
|
|
1273
|
-
"narrative": null
|
|
1274
|
-
},
|
|
1275
|
-
{
|
|
1276
|
-
"$schema": "dovetail-release-event/v1",
|
|
1277
|
-
"event_id": "dovetail-mcp@0.0.40",
|
|
1278
|
-
"package": "@tenonhq/dovetail-mcp",
|
|
1279
|
-
"version": "0.0.40",
|
|
1280
|
-
"prev_version": "0.0.39",
|
|
1281
|
-
"published_at": "2026-09-30T19:46:32.033Z",
|
|
1282
|
-
"git": {
|
|
1283
|
-
"sha": "f74ad656a75e8fecc5ba1d1ee8df75a9aefee91a",
|
|
1284
|
-
"tag": "dovetail-mcp@0.0.40"
|
|
1285
|
-
},
|
|
1286
|
-
"semver_bump": "patch",
|
|
1287
|
-
"commits": [
|
|
1288
|
-
{
|
|
1289
|
-
"sha": "b402cc04f",
|
|
1290
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1291
|
-
}
|
|
1292
|
-
],
|
|
1293
|
-
"exports_delta": null,
|
|
1294
|
-
"narrative": null
|
|
1295
|
-
},
|
|
1296
|
-
{
|
|
1297
|
-
"$schema": "dovetail-release-event/v1",
|
|
1298
|
-
"event_id": "dovetail-servicenow@0.0.42",
|
|
1299
|
-
"package": "@tenonhq/dovetail-servicenow",
|
|
1300
|
-
"version": "0.0.42",
|
|
1301
|
-
"prev_version": "0.0.41",
|
|
1302
|
-
"published_at": "2026-09-30T19:26:41.221Z",
|
|
1303
|
-
"git": {
|
|
1304
|
-
"sha": "9006005a00c4ba9b4017fa5e5eb864f015985725",
|
|
1305
|
-
"tag": "dovetail-servicenow@0.0.42"
|
|
1306
|
-
},
|
|
1307
|
-
"semver_bump": "patch",
|
|
1308
|
-
"commits": [
|
|
1309
|
-
{
|
|
1310
|
-
"sha": "9006005a0",
|
|
1311
|
-
"subject": "fix(servicenow): clone-action remaps steps by step_id (#281)",
|
|
1312
|
-
"pr": 281
|
|
1313
|
-
},
|
|
1314
|
-
{
|
|
1315
|
-
"sha": "9e552389f",
|
|
1316
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1317
|
-
},
|
|
1318
|
-
{
|
|
1319
|
-
"sha": "a97389552",
|
|
1320
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1321
|
-
}
|
|
1322
|
-
],
|
|
1323
|
-
"exports_delta": null,
|
|
1324
|
-
"narrative": null
|
|
1325
|
-
},
|
|
1326
|
-
{
|
|
1327
|
-
"$schema": "dovetail-release-event/v1",
|
|
1328
|
-
"event_id": "dovetail-mcp@0.0.39",
|
|
1329
|
-
"package": "@tenonhq/dovetail-mcp",
|
|
1330
|
-
"version": "0.0.39",
|
|
1331
|
-
"prev_version": "0.0.38",
|
|
1332
|
-
"published_at": "2026-09-30T19:26:41.221Z",
|
|
1333
|
-
"git": {
|
|
1334
|
-
"sha": "9006005a00c4ba9b4017fa5e5eb864f015985725",
|
|
1335
|
-
"tag": "dovetail-mcp@0.0.39"
|
|
1336
|
-
},
|
|
1337
|
-
"semver_bump": "patch",
|
|
1338
|
-
"commits": [
|
|
1339
|
-
{
|
|
1340
|
-
"sha": "9e552389f",
|
|
1341
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1342
|
-
},
|
|
1343
|
-
{
|
|
1344
|
-
"sha": "a97389552",
|
|
1345
|
-
"subject": "chore(release): publish 2 packages [skip ci]"
|
|
1346
|
-
}
|
|
1347
|
-
],
|
|
1348
|
-
"exports_delta": null,
|
|
1349
|
-
"narrative": null
|
|
1350
1377
|
}
|
|
1351
1378
|
]
|
|
1352
1379
|
}
|
|
@@ -56,7 +56,7 @@ SN_INSTANCE=your-instance.service-now.com
|
|
|
56
56
|
- Instance should NOT have `https://` prefix or trailing slash
|
|
57
57
|
- Optional: `DASHBOARD_PORT=3456`
|
|
58
58
|
- **Never commit `.env` to git**
|
|
59
|
-
- **Multiple instances?** Keep one file per instance (`.env.dev`, `.env.prod`) and pass `--env <name|path>` (alias `-e`) on any command: `npx dove push --env prod` (bare name → `.env.prod` in the cwd) or `npx dove push --env .env.prod`. `dove login --env prod` writes credentials to that file too. Git-ignore the whole pattern (`.env*`).
|
|
59
|
+
- **Multiple instances?** Keep one file per instance (`.env.dev`, `.env.prod`) and pass `--env <name|path>` (alias `-e`) on any command: `npx dove push --env prod` (bare name → `.env.prod` in the cwd, else the nearest one in a parent directory, up to 8 levels and never the home directory — so it works from a nested worktree) or `npx dove push --env .env.prod`. `dove login --env prod` writes credentials to that file too. Git-ignore the whole pattern (`.env*`).
|
|
60
60
|
|
|
61
61
|
#### Set up `.gitignore`
|
|
62
62
|
```
|