diffdoc 0.6.1 → 0.6.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/commands/init.js +2 -3
- package/dist/commands/summarize.js +3 -4
- package/dist/schemas.js +4 -1
- package/dist/scripts/generate-schemas.js +2 -4
- package/dist/types/artifacts.js +3 -1
- package/package.json +1 -1
- package/schemas/{diffdocrc.schema.json → v2/diffdocrc.schema.json} +4 -1
- package/schemas/{manifest.schema.json → v2/manifest.schema.json} +1 -1
- package/schemas/{summary-asset.schema.json → v2/summary-asset.schema.json} +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -8,10 +8,9 @@ const promises_1 = __importDefault(require("node:fs/promises"));
|
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const promises_2 = require("node:readline/promises");
|
|
10
10
|
const node_process_1 = require("node:process");
|
|
11
|
-
const
|
|
12
|
-
const PKG_VERSION = require("../../package.json").version;
|
|
11
|
+
const schemas_1 = require("../schemas");
|
|
13
12
|
const DEFAULT_CONFIG = {
|
|
14
|
-
$schema: `${SCHEMA_BASE_URL}/
|
|
13
|
+
$schema: `${schemas_1.SCHEMA_BASE_URL}/diffdocrc.schema.json`,
|
|
15
14
|
baseDir: "./.diffdoc",
|
|
16
15
|
aiProvider: "local",
|
|
17
16
|
localLlmEndpoint: "http://localhost:11434/v1",
|
|
@@ -8,14 +8,13 @@ const promises_1 = __importDefault(require("node:fs/promises"));
|
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const ignore_1 = __importDefault(require("ignore"));
|
|
10
10
|
const artifacts_1 = require("../types/artifacts");
|
|
11
|
+
const schemas_1 = require("../schemas");
|
|
11
12
|
const git_1 = require("../utils/git");
|
|
12
13
|
const hashing_1 = require("../utils/hashing");
|
|
13
14
|
const llm_1 = require("../utils/llm");
|
|
14
15
|
const paths_1 = require("../utils/paths");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const MANIFEST_SCHEMA_URL = `${SCHEMA_BASE_URL}/v${PKG_VERSION}/schemas/manifest.schema.json`;
|
|
18
|
-
const SUMMARY_ASSET_SCHEMA_URL = `${SCHEMA_BASE_URL}/v${PKG_VERSION}/schemas/summary-asset.schema.json`;
|
|
16
|
+
const MANIFEST_SCHEMA_URL = `${schemas_1.SCHEMA_BASE_URL}/manifest.schema.json`;
|
|
17
|
+
const SUMMARY_ASSET_SCHEMA_URL = `${schemas_1.SCHEMA_BASE_URL}/summary-asset.schema.json`;
|
|
19
18
|
function normalizeRelativePath(filePath) {
|
|
20
19
|
return filePath.split(node_path_1.default.sep).join("/");
|
|
21
20
|
}
|
package/dist/schemas.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SummaryAssetSchema = exports.SummaryMetadataSchema = exports.RepoManifestSchema = exports.DiffdocConfigSchema = exports.SUMMARY_ASSET_SCHEMA_VERSION = exports.MANIFEST_SCHEMA_VERSION = void 0;
|
|
3
|
+
exports.SummaryAssetSchema = exports.SummaryMetadataSchema = exports.RepoManifestSchema = exports.DiffdocConfigSchema = exports.SCHEMA_BASE_URL = exports.SCHEMA_DIR_VERSION = exports.SUMMARY_ASSET_SCHEMA_VERSION = exports.MANIFEST_SCHEMA_VERSION = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
6
6
|
// Schema version constants
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
exports.MANIFEST_SCHEMA_VERSION = 2;
|
|
9
9
|
exports.SUMMARY_ASSET_SCHEMA_VERSION = 2;
|
|
10
|
+
exports.SCHEMA_DIR_VERSION = 2;
|
|
11
|
+
exports.SCHEMA_BASE_URL = `https://raw.githubusercontent.com/sullyTheDev/diffdoc/main/schemas/v${exports.SCHEMA_DIR_VERSION}`;
|
|
10
12
|
// ---------------------------------------------------------------------------
|
|
11
13
|
// Configuration schema (.diffdocrc)
|
|
12
14
|
// ---------------------------------------------------------------------------
|
|
13
15
|
exports.DiffdocConfigSchema = zod_1.z.object({
|
|
16
|
+
$schema: zod_1.z.string().optional(),
|
|
14
17
|
baseDir: zod_1.z.string().optional(),
|
|
15
18
|
aiProvider: zod_1.z.enum(["local", "cloud"]).optional(),
|
|
16
19
|
localLlmEndpoint: zod_1.z.string().optional(),
|
|
@@ -7,14 +7,12 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
7
7
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
8
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
9
9
|
const schemas_1 = require("../schemas");
|
|
10
|
-
const SCHEMA_BASE_URL = "https://raw.githubusercontent.com/sullyTheDev/diffdoc";
|
|
11
|
-
const VERSION = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.resolve(__dirname, "../../package.json"), "utf8")).version;
|
|
12
10
|
const schemas = [
|
|
13
11
|
{ name: "diffdocrc.schema.json", zodSchema: schemas_1.DiffdocConfigSchema },
|
|
14
12
|
{ name: "manifest.schema.json", zodSchema: schemas_1.RepoManifestSchema },
|
|
15
13
|
{ name: "summary-asset.schema.json", zodSchema: schemas_1.SummaryAssetSchema }
|
|
16
14
|
];
|
|
17
|
-
const outDir = node_path_1.default.resolve(__dirname,
|
|
15
|
+
const outDir = node_path_1.default.resolve(__dirname, `../../schemas/v${schemas_1.SCHEMA_DIR_VERSION}`);
|
|
18
16
|
node_fs_1.default.mkdirSync(outDir, { recursive: true });
|
|
19
17
|
for (const entry of schemas) {
|
|
20
18
|
const jsonSchema = (0, zod_to_json_schema_1.zodToJsonSchema)(entry.zodSchema, {
|
|
@@ -23,7 +21,7 @@ for (const entry of schemas) {
|
|
|
23
21
|
});
|
|
24
22
|
const schemaWithId = {
|
|
25
23
|
...jsonSchema,
|
|
26
|
-
$id: `${SCHEMA_BASE_URL}
|
|
24
|
+
$id: `${schemas_1.SCHEMA_BASE_URL}/${entry.name}`
|
|
27
25
|
};
|
|
28
26
|
const outPath = node_path_1.default.resolve(outDir, entry.name);
|
|
29
27
|
node_fs_1.default.writeFileSync(outPath, `${JSON.stringify(schemaWithId, null, 2)}\n`);
|
package/dist/types/artifacts.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// Re-export all schema definitions and types from the canonical source.
|
|
3
3
|
// This file exists for backwards-compatible import paths.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.DiffdocConfigSchema = exports.SummaryAssetSchema = exports.SummaryMetadataSchema = exports.RepoManifestSchema = exports.SUMMARY_ASSET_SCHEMA_VERSION = exports.MANIFEST_SCHEMA_VERSION = void 0;
|
|
5
|
+
exports.DiffdocConfigSchema = exports.SummaryAssetSchema = exports.SummaryMetadataSchema = exports.RepoManifestSchema = exports.SCHEMA_BASE_URL = exports.SCHEMA_DIR_VERSION = exports.SUMMARY_ASSET_SCHEMA_VERSION = exports.MANIFEST_SCHEMA_VERSION = void 0;
|
|
6
6
|
var schemas_1 = require("../schemas");
|
|
7
7
|
Object.defineProperty(exports, "MANIFEST_SCHEMA_VERSION", { enumerable: true, get: function () { return schemas_1.MANIFEST_SCHEMA_VERSION; } });
|
|
8
8
|
Object.defineProperty(exports, "SUMMARY_ASSET_SCHEMA_VERSION", { enumerable: true, get: function () { return schemas_1.SUMMARY_ASSET_SCHEMA_VERSION; } });
|
|
9
|
+
Object.defineProperty(exports, "SCHEMA_DIR_VERSION", { enumerable: true, get: function () { return schemas_1.SCHEMA_DIR_VERSION; } });
|
|
10
|
+
Object.defineProperty(exports, "SCHEMA_BASE_URL", { enumerable: true, get: function () { return schemas_1.SCHEMA_BASE_URL; } });
|
|
9
11
|
Object.defineProperty(exports, "RepoManifestSchema", { enumerable: true, get: function () { return schemas_1.RepoManifestSchema; } });
|
|
10
12
|
Object.defineProperty(exports, "SummaryMetadataSchema", { enumerable: true, get: function () { return schemas_1.SummaryMetadataSchema; } });
|
|
11
13
|
Object.defineProperty(exports, "SummaryAssetSchema", { enumerable: true, get: function () { return schemas_1.SummaryAssetSchema; } });
|
package/package.json
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
"diffdocrc": {
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
7
10
|
"baseDir": {
|
|
8
11
|
"type": "string"
|
|
9
12
|
},
|
|
@@ -100,5 +103,5 @@
|
|
|
100
103
|
}
|
|
101
104
|
},
|
|
102
105
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
103
|
-
"$id": "https://raw.githubusercontent.com/sullyTheDev/diffdoc/
|
|
106
|
+
"$id": "https://raw.githubusercontent.com/sullyTheDev/diffdoc/main/schemas/v2/diffdocrc.schema.json"
|
|
104
107
|
}
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
33
|
-
"$id": "https://raw.githubusercontent.com/sullyTheDev/diffdoc/
|
|
33
|
+
"$id": "https://raw.githubusercontent.com/sullyTheDev/diffdoc/main/schemas/v2/manifest.schema.json"
|
|
34
34
|
}
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
102
|
-
"$id": "https://raw.githubusercontent.com/sullyTheDev/diffdoc/
|
|
102
|
+
"$id": "https://raw.githubusercontent.com/sullyTheDev/diffdoc/main/schemas/v2/summary-asset.schema.json"
|
|
103
103
|
}
|