@jini-ai/devops 0.5.2 → 0.5.3
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/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type RequestListener } from 'node:http';
|
|
2
2
|
import { type AppFactoryPort, type ArtifactWriterPort, type AssetSourcePort } from './contracts.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/** Overlay exports in a caller-owned directory; only explicit clean removes unrelated files.
|
|
4
|
+
* No persisted ownership marker exists, so overlays also support exports from earlier versions.
|
|
5
|
+
* Paths and existing files still require regular, no-follow storage; filesystem errors propagate.
|
|
6
|
+
* The legacy nonemptyReason option remains accepted for source compatibility.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createNodeArtifactWriter(_required: Record<string, never>, _optional?: {
|
|
5
9
|
nonemptyReason?: (required: {
|
|
6
10
|
outputDir: string;
|
|
7
11
|
count: number;
|
|
@@ -3,7 +3,7 @@ import { constants } from 'node:fs';
|
|
|
3
3
|
import { lstat, mkdir, open, readdir, realpath, rm } from 'node:fs/promises';
|
|
4
4
|
import { createServer } from 'node:http';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
-
import {
|
|
6
|
+
import { ExportPathError } from './contracts.js';
|
|
7
7
|
import { safeRelativeOutputFile } from './transforms.js';
|
|
8
8
|
/** Require regular directories at every ancestor. Hosts must use canonical absolute storage paths.
|
|
9
9
|
* The storage hierarchy must be caller-owned; cross-process hostile ancestor swaps require host isolation.
|
|
@@ -34,16 +34,17 @@ async function ensureDirectory({ directory, label }, optional = {}) {
|
|
|
34
34
|
throw new ExportPathError(`${label} path must be a regular directory.`);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
38
|
-
|
|
37
|
+
/** Overlay exports in a caller-owned directory; only explicit clean removes unrelated files.
|
|
38
|
+
* No persisted ownership marker exists, so overlays also support exports from earlier versions.
|
|
39
|
+
* Paths and existing files still require regular, no-follow storage; filesystem errors propagate.
|
|
40
|
+
* The legacy nonemptyReason option remains accepted for source compatibility.
|
|
41
|
+
*/
|
|
42
|
+
export function createNodeArtifactWriter(_required, _optional = {}) {
|
|
39
43
|
return {
|
|
40
44
|
async prepare({ outputDir }, options = {}) {
|
|
41
45
|
await ensureDirectory({ directory: outputDir, label: 'Output' }, { create: true });
|
|
42
|
-
const entries = await readdir(outputDir);
|
|
43
|
-
if (entries.length && !options.clean)
|
|
44
|
-
throw new ExportOutputNotEmptyError(optional.nonemptyReason?.({ outputDir, count: entries.length }) ?? `export output directory '${outputDir}' is not empty (${entries.length} existing ${entries.length === 1 ? 'entry' : 'entries'}) — pass clean: true to remove its contents first, or select an empty/new directory`);
|
|
45
46
|
if (options.clean)
|
|
46
|
-
for (const entry of
|
|
47
|
+
for (const entry of await readdir(outputDir))
|
|
47
48
|
await rm(path.join(outputDir, entry), { recursive: true, force: true });
|
|
48
49
|
},
|
|
49
50
|
async write({ outputDir, outputFile, data }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/devops",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "DevOps capabilities for deployment, source control, and CI/CD, exposed through independent subpaths.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -124,9 +124,9 @@
|
|
|
124
124
|
"devDependencies": {
|
|
125
125
|
"@vitest/coverage-v8": "^2.1.9",
|
|
126
126
|
"undici": "^7.25.0",
|
|
127
|
-
"@jini-ai/
|
|
127
|
+
"@jini-ai/platform": "^0.5.2",
|
|
128
128
|
"@jini-ai/daemon": "0.5.4",
|
|
129
|
-
"@jini-ai/
|
|
129
|
+
"@jini-ai/core": "^0.4.2"
|
|
130
130
|
},
|
|
131
131
|
"dependencies": {
|
|
132
132
|
"@jini-ai/core": "^0.4.2"
|