@slicemachine/adapter-nuxt 0.3.10 → 0.3.11-dev-next-release.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/hooks/project-init.cjs +26 -29
- package/dist/hooks/project-init.cjs.map +1 -1
- package/dist/hooks/project-init.js +26 -28
- package/dist/hooks/project-init.js.map +1 -1
- package/dist/hooks/slice-create.cjs +28 -46
- package/dist/hooks/slice-create.cjs.map +1 -1
- package/dist/hooks/slice-create.js +28 -28
- package/dist/hooks/slice-create.js.map +1 -1
- package/dist/lib/checkHasSrcDirectory.cjs +5 -2
- package/dist/lib/checkHasSrcDirectory.cjs.map +1 -1
- package/dist/lib/checkHasSrcDirectory.js +5 -2
- package/dist/lib/checkHasSrcDirectory.js.map +1 -1
- package/dist/lib/checkIsTypeScriptProject.cjs +2 -3
- package/dist/lib/checkIsTypeScriptProject.cjs.map +1 -1
- package/dist/lib/checkIsTypeScriptProject.js +2 -3
- package/dist/lib/checkIsTypeScriptProject.js.map +1 -1
- package/dist/lib/getJSFileExtension.cjs +12 -0
- package/dist/lib/getJSFileExtension.cjs.map +1 -0
- package/dist/lib/getJSFileExtension.d.ts +5 -0
- package/dist/lib/getJSFileExtension.js +12 -0
- package/dist/lib/getJSFileExtension.js.map +1 -0
- package/dist/lib/upsertSliceLibraryIndexFile.cjs +30 -22
- package/dist/lib/upsertSliceLibraryIndexFile.cjs.map +1 -1
- package/dist/lib/upsertSliceLibraryIndexFile.js +30 -21
- package/dist/lib/upsertSliceLibraryIndexFile.js.map +1 -1
- package/dist/plugin.cjs +178 -36
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +178 -36
- package/dist/plugin.js.map +1 -1
- package/dist/types.d.ts +22 -0
- package/package.json +4 -6
- package/src/hooks/project-init.ts +32 -36
- package/src/hooks/slice-create.ts +39 -34
- package/src/lib/checkHasSrcDirectory.ts +5 -2
- package/src/lib/checkIsTypeScriptProject.ts +5 -4
- package/src/lib/getJSFileExtension.ts +22 -0
- package/src/lib/upsertSliceLibraryIndexFile.ts +55 -36
- package/src/plugin.ts +247 -37
- package/src/types.ts +25 -0
- package/dist/hooks/customType-asset-delete.cjs +0 -31
- package/dist/hooks/customType-asset-delete.cjs.map +0 -1
- package/dist/hooks/customType-asset-delete.d.ts +0 -3
- package/dist/hooks/customType-asset-delete.js +0 -14
- package/dist/hooks/customType-asset-delete.js.map +0 -1
- package/dist/hooks/customType-asset-read.cjs +0 -34
- package/dist/hooks/customType-asset-read.cjs.map +0 -1
- package/dist/hooks/customType-asset-read.d.ts +0 -3
- package/dist/hooks/customType-asset-read.js +0 -17
- package/dist/hooks/customType-asset-read.js.map +0 -1
- package/dist/hooks/customType-asset-update.cjs +0 -34
- package/dist/hooks/customType-asset-update.cjs.map +0 -1
- package/dist/hooks/customType-asset-update.d.ts +0 -3
- package/dist/hooks/customType-asset-update.js +0 -16
- package/dist/hooks/customType-asset-update.js.map +0 -1
- package/dist/hooks/customType-create.cjs +0 -43
- package/dist/hooks/customType-create.cjs.map +0 -1
- package/dist/hooks/customType-create.d.ts +0 -3
- package/dist/hooks/customType-create.js +0 -25
- package/dist/hooks/customType-create.js.map +0 -1
- package/dist/hooks/customType-delete.cjs +0 -32
- package/dist/hooks/customType-delete.cjs.map +0 -1
- package/dist/hooks/customType-delete.d.ts +0 -3
- package/dist/hooks/customType-delete.js +0 -15
- package/dist/hooks/customType-delete.js.map +0 -1
- package/dist/hooks/customType-read.cjs +0 -31
- package/dist/hooks/customType-read.cjs.map +0 -1
- package/dist/hooks/customType-read.d.ts +0 -3
- package/dist/hooks/customType-read.js +0 -14
- package/dist/hooks/customType-read.js.map +0 -1
- package/dist/hooks/customType-rename.cjs +0 -6
- package/dist/hooks/customType-rename.cjs.map +0 -1
- package/dist/hooks/customType-rename.d.ts +0 -1
- package/dist/hooks/customType-rename.js +0 -6
- package/dist/hooks/customType-rename.js.map +0 -1
- package/dist/hooks/customType-update.cjs +0 -6
- package/dist/hooks/customType-update.cjs.map +0 -1
- package/dist/hooks/customType-update.d.ts +0 -1
- package/dist/hooks/customType-update.js +0 -6
- package/dist/hooks/customType-update.js.map +0 -1
- package/dist/hooks/customTypeLibrary-read.cjs +0 -55
- package/dist/hooks/customTypeLibrary-read.cjs.map +0 -1
- package/dist/hooks/customTypeLibrary-read.d.ts +0 -3
- package/dist/hooks/customTypeLibrary-read.js +0 -37
- package/dist/hooks/customTypeLibrary-read.js.map +0 -1
- package/dist/hooks/slice-asset-delete.cjs +0 -33
- package/dist/hooks/slice-asset-delete.cjs.map +0 -1
- package/dist/hooks/slice-asset-delete.d.ts +0 -3
- package/dist/hooks/slice-asset-delete.js +0 -16
- package/dist/hooks/slice-asset-delete.js.map +0 -1
- package/dist/hooks/slice-asset-read.cjs +0 -36
- package/dist/hooks/slice-asset-read.cjs.map +0 -1
- package/dist/hooks/slice-asset-read.d.ts +0 -3
- package/dist/hooks/slice-asset-read.js +0 -19
- package/dist/hooks/slice-asset-read.js.map +0 -1
- package/dist/hooks/slice-asset-update.cjs +0 -36
- package/dist/hooks/slice-asset-update.cjs.map +0 -1
- package/dist/hooks/slice-asset-update.d.ts +0 -3
- package/dist/hooks/slice-asset-update.js +0 -18
- package/dist/hooks/slice-asset-update.js.map +0 -1
- package/dist/hooks/slice-delete.cjs +0 -41
- package/dist/hooks/slice-delete.cjs.map +0 -1
- package/dist/hooks/slice-delete.d.ts +0 -3
- package/dist/hooks/slice-delete.js +0 -24
- package/dist/hooks/slice-delete.js.map +0 -1
- package/dist/hooks/slice-read.cjs +0 -62
- package/dist/hooks/slice-read.cjs.map +0 -1
- package/dist/hooks/slice-read.d.ts +0 -3
- package/dist/hooks/slice-read.js +0 -44
- package/dist/hooks/slice-read.js.map +0 -1
- package/dist/hooks/slice-rename.cjs +0 -51
- package/dist/hooks/slice-rename.cjs.map +0 -1
- package/dist/hooks/slice-rename.d.ts +0 -3
- package/dist/hooks/slice-rename.js +0 -34
- package/dist/hooks/slice-rename.js.map +0 -1
- package/dist/hooks/slice-update.cjs +0 -14
- package/dist/hooks/slice-update.cjs.map +0 -1
- package/dist/hooks/slice-update.d.ts +0 -3
- package/dist/hooks/slice-update.js +0 -14
- package/dist/hooks/slice-update.js.map +0 -1
- package/dist/hooks/sliceLibrary-read.cjs +0 -52
- package/dist/hooks/sliceLibrary-read.cjs.map +0 -1
- package/dist/hooks/sliceLibrary-read.d.ts +0 -3
- package/dist/hooks/sliceLibrary-read.js +0 -34
- package/dist/hooks/sliceLibrary-read.js.map +0 -1
- package/dist/lib/buildCustomTypeAssetPath.cjs +0 -29
- package/dist/lib/buildCustomTypeAssetPath.cjs.map +0 -1
- package/dist/lib/buildCustomTypeAssetPath.d.ts +0 -9
- package/dist/lib/buildCustomTypeAssetPath.js +0 -12
- package/dist/lib/buildCustomTypeAssetPath.js.map +0 -1
- package/dist/lib/buildCustomTypeDirectoryPath.cjs +0 -26
- package/dist/lib/buildCustomTypeDirectoryPath.cjs.map +0 -1
- package/dist/lib/buildCustomTypeDirectoryPath.d.ts +0 -8
- package/dist/lib/buildCustomTypeDirectoryPath.js +0 -9
- package/dist/lib/buildCustomTypeDirectoryPath.js.map +0 -1
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs +0 -7
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs.map +0 -1
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.d.ts +0 -7
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.js +0 -7
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.js.map +0 -1
- package/dist/lib/buildSliceAssetPath.cjs +0 -34
- package/dist/lib/buildSliceAssetPath.cjs.map +0 -1
- package/dist/lib/buildSliceAssetPath.d.ts +0 -11
- package/dist/lib/buildSliceAssetPath.js +0 -17
- package/dist/lib/buildSliceAssetPath.js.map +0 -1
- package/dist/lib/buildSliceDirectoryPath.cjs +0 -30
- package/dist/lib/buildSliceDirectoryPath.cjs.map +0 -1
- package/dist/lib/buildSliceDirectoryPath.d.ts +0 -10
- package/dist/lib/buildSliceDirectoryPath.js +0 -13
- package/dist/lib/buildSliceDirectoryPath.js.map +0 -1
- package/dist/lib/buildSliceLibraryDirectoryPath.cjs +0 -7
- package/dist/lib/buildSliceLibraryDirectoryPath.cjs.map +0 -1
- package/dist/lib/buildSliceLibraryDirectoryPath.d.ts +0 -8
- package/dist/lib/buildSliceLibraryDirectoryPath.js +0 -7
- package/dist/lib/buildSliceLibraryDirectoryPath.js.map +0 -1
- package/dist/lib/checkPathExists.cjs +0 -30
- package/dist/lib/checkPathExists.cjs.map +0 -1
- package/dist/lib/checkPathExists.d.ts +0 -2
- package/dist/lib/checkPathExists.js +0 -13
- package/dist/lib/checkPathExists.js.map +0 -1
- package/dist/lib/isSharedSliceModel.cjs +0 -7
- package/dist/lib/isSharedSliceModel.cjs.map +0 -1
- package/dist/lib/isSharedSliceModel.d.ts +0 -335
- package/dist/lib/isSharedSliceModel.js +0 -7
- package/dist/lib/isSharedSliceModel.js.map +0 -1
- package/dist/lib/readJSONFile.cjs +0 -26
- package/dist/lib/readJSONFile.cjs.map +0 -1
- package/dist/lib/readJSONFile.d.ts +0 -1
- package/dist/lib/readJSONFile.js +0 -9
- package/dist/lib/readJSONFile.js.map +0 -1
- package/dist/lib/updateSliceModelFile.cjs +0 -33
- package/dist/lib/updateSliceModelFile.cjs.map +0 -1
- package/dist/lib/updateSliceModelFile.d.ts +0 -9
- package/dist/lib/updateSliceModelFile.js +0 -15
- package/dist/lib/updateSliceModelFile.js.map +0 -1
- package/dist/lib/upsertGlobalContentTypes.cjs +0 -56
- package/dist/lib/upsertGlobalContentTypes.cjs.map +0 -1
- package/dist/lib/upsertGlobalContentTypes.d.ts +0 -12
- package/dist/lib/upsertGlobalContentTypes.js +0 -38
- package/dist/lib/upsertGlobalContentTypes.js.map +0 -1
- package/src/hooks/customType-asset-delete.ts +0 -18
- package/src/hooks/customType-asset-read.ts +0 -22
- package/src/hooks/customType-asset-update.ts +0 -20
- package/src/hooks/customType-create.ts +0 -45
- package/src/hooks/customType-delete.ts +0 -21
- package/src/hooks/customType-read.ts +0 -24
- package/src/hooks/customType-rename.ts +0 -3
- package/src/hooks/customType-update.ts +0 -3
- package/src/hooks/customTypeLibrary-read.ts +0 -58
- package/src/hooks/slice-asset-delete.ts +0 -21
- package/src/hooks/slice-asset-read.ts +0 -25
- package/src/hooks/slice-asset-update.ts +0 -23
- package/src/hooks/slice-delete.ts +0 -41
- package/src/hooks/slice-read.ts +0 -69
- package/src/hooks/slice-rename.ts +0 -46
- package/src/hooks/slice-update.ts +0 -19
- package/src/hooks/sliceLibrary-read.ts +0 -48
- package/src/lib/buildCustomTypeAssetPath.ts +0 -24
- package/src/lib/buildCustomTypeDirectoryPath.ts +0 -20
- package/src/lib/buildCustomTypeLibraryDirectoryPath.ts +0 -13
- package/src/lib/buildSliceAssetPath.ts +0 -32
- package/src/lib/buildSliceDirectoryPath.ts +0 -26
- package/src/lib/buildSliceLibraryDirectoryPath.ts +0 -14
- package/src/lib/checkPathExists.ts +0 -12
- package/src/lib/isSharedSliceModel.ts +0 -14
- package/src/lib/readJSONFile.ts +0 -7
- package/src/lib/updateSliceModelFile.ts +0 -33
- package/src/lib/upsertGlobalContentTypes.ts +0 -61
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fs = require("node:fs/promises");
|
|
4
|
-
const buildSliceDirectoryPath = require("../lib/buildSliceDirectoryPath.cjs");
|
|
5
|
-
const rejectIfNecessary = require("../lib/rejectIfNecessary.cjs");
|
|
6
|
-
const upsertGlobalContentTypes = require("../lib/upsertGlobalContentTypes.cjs");
|
|
7
|
-
const upsertSliceLibraryIndexFile = require("../lib/upsertSliceLibraryIndexFile.cjs");
|
|
8
|
-
function _interopNamespaceDefault(e) {
|
|
9
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
-
if (e) {
|
|
11
|
-
for (const k in e) {
|
|
12
|
-
if (k !== "default") {
|
|
13
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: () => e[k]
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
25
|
-
const deleteSliceDir = async ({ data, helpers }) => {
|
|
26
|
-
const dir = buildSliceDirectoryPath.buildSliceDirectoryPath({
|
|
27
|
-
libraryID: data.libraryID,
|
|
28
|
-
model: data.model,
|
|
29
|
-
helpers
|
|
30
|
-
});
|
|
31
|
-
await fs__namespace.rm(dir, { recursive: true });
|
|
32
|
-
};
|
|
33
|
-
const sliceDelete = async (data, context) => {
|
|
34
|
-
await deleteSliceDir({ data, ...context });
|
|
35
|
-
rejectIfNecessary.rejectIfNecessary(await Promise.allSettled([
|
|
36
|
-
upsertGlobalContentTypes.upsertGlobalContentTypes(context),
|
|
37
|
-
upsertSliceLibraryIndexFile.upsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context })
|
|
38
|
-
]));
|
|
39
|
-
};
|
|
40
|
-
exports.sliceDelete = sliceDelete;
|
|
41
|
-
//# sourceMappingURL=slice-delete.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-delete.cjs","sources":["../../../src/hooks/slice-delete.ts"],"sourcesContent":["import type {\n\tSliceDeleteHook,\n\tSliceDeleteHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildSliceDirectoryPath } from \"../lib/buildSliceDirectoryPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype Args = {\n\tdata: SliceDeleteHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst deleteSliceDir = async ({ data, helpers }: Args) => {\n\tconst dir = buildSliceDirectoryPath({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\thelpers,\n\t});\n\n\tawait fs.rm(dir, { recursive: true });\n};\n\nexport const sliceDelete: SliceDeleteHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tawait deleteSliceDir({ data, ...context });\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertGlobalContentTypes(context),\n\t\t\tupsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context }),\n\t\t]),\n\t);\n};\n"],"names":["buildSliceDirectoryPath","fs","rejectIfNecessary","upsertGlobalContentTypes","upsertSliceLibraryIndexFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,iBAAiB,OAAO,EAAE,MAAM,cAAmB;AACxD,QAAM,MAAMA,wBAAAA,wBAAwB;AAAA,IACnC,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ;AAAA,EAAA,CACA;AAED,QAAMC,cAAG,GAAG,KAAK,EAAE,WAAW,MAAM;AACrC;AAEa,MAAA,cAA8C,OAC1D,MACA,YACG;AACH,QAAM,eAAe,EAAE,MAAM,GAAG,QAAS,CAAA;AAGxCC,sCAAA,MAAM,QAAQ,WAAW;AAAA,IACxBC,yBAAAA,yBAAyB,OAAO;AAAA,IAChCC,wDAA4B,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS;AAAA,EACrE,CAAA,CAAC;AAEJ;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import { buildSliceDirectoryPath } from "../lib/buildSliceDirectoryPath.js";
|
|
3
|
-
import { rejectIfNecessary } from "../lib/rejectIfNecessary.js";
|
|
4
|
-
import { upsertGlobalContentTypes } from "../lib/upsertGlobalContentTypes.js";
|
|
5
|
-
import { upsertSliceLibraryIndexFile } from "../lib/upsertSliceLibraryIndexFile.js";
|
|
6
|
-
const deleteSliceDir = async ({ data, helpers }) => {
|
|
7
|
-
const dir = buildSliceDirectoryPath({
|
|
8
|
-
libraryID: data.libraryID,
|
|
9
|
-
model: data.model,
|
|
10
|
-
helpers
|
|
11
|
-
});
|
|
12
|
-
await fs.rm(dir, { recursive: true });
|
|
13
|
-
};
|
|
14
|
-
const sliceDelete = async (data, context) => {
|
|
15
|
-
await deleteSliceDir({ data, ...context });
|
|
16
|
-
rejectIfNecessary(await Promise.allSettled([
|
|
17
|
-
upsertGlobalContentTypes(context),
|
|
18
|
-
upsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context })
|
|
19
|
-
]));
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
sliceDelete
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=slice-delete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-delete.js","sources":["../../../src/hooks/slice-delete.ts"],"sourcesContent":["import type {\n\tSliceDeleteHook,\n\tSliceDeleteHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildSliceDirectoryPath } from \"../lib/buildSliceDirectoryPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype Args = {\n\tdata: SliceDeleteHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst deleteSliceDir = async ({ data, helpers }: Args) => {\n\tconst dir = buildSliceDirectoryPath({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\thelpers,\n\t});\n\n\tawait fs.rm(dir, { recursive: true });\n};\n\nexport const sliceDelete: SliceDeleteHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tawait deleteSliceDir({ data, ...context });\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertGlobalContentTypes(context),\n\t\t\tupsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context }),\n\t\t]),\n\t);\n};\n"],"names":[],"mappings":";;;;;AAkBA,MAAM,iBAAiB,OAAO,EAAE,MAAM,cAAmB;AACxD,QAAM,MAAM,wBAAwB;AAAA,IACnC,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ;AAAA,EAAA,CACA;AAED,QAAM,GAAG,GAAG,KAAK,EAAE,WAAW,MAAM;AACrC;AAEa,MAAA,cAA8C,OAC1D,MACA,YACG;AACH,QAAM,eAAe,EAAE,MAAM,GAAG,QAAS,CAAA;AAGxC,oBAAA,MAAM,QAAQ,WAAW;AAAA,IACxB,yBAAyB,OAAO;AAAA,IAChC,4BAA4B,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS;AAAA,EACrE,CAAA,CAAC;AAEJ;"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fs = require("node:fs/promises");
|
|
4
|
-
const path = require("node:path");
|
|
5
|
-
const buildSliceLibraryDirectoryPath = require("../lib/buildSliceLibraryDirectoryPath.cjs");
|
|
6
|
-
const isSharedSliceModel = require("../lib/isSharedSliceModel.cjs");
|
|
7
|
-
const readJSONFile = require("../lib/readJSONFile.cjs");
|
|
8
|
-
function _interopNamespaceDefault(e) {
|
|
9
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
-
if (e) {
|
|
11
|
-
for (const k in e) {
|
|
12
|
-
if (k !== "default") {
|
|
13
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: () => e[k]
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
25
|
-
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
26
|
-
const sliceRead = async (data, { helpers }) => {
|
|
27
|
-
const libraryDir = buildSliceLibraryDirectoryPath.buildSliceLibraryDirectoryPath({
|
|
28
|
-
libraryID: data.libraryID,
|
|
29
|
-
helpers
|
|
30
|
-
});
|
|
31
|
-
await fs__namespace.mkdir(libraryDir, { recursive: true });
|
|
32
|
-
const childDirs = await fs__namespace.readdir(libraryDir, { withFileTypes: true });
|
|
33
|
-
const modelReadErrors = [];
|
|
34
|
-
const [model] = (await Promise.all(childDirs.map(async (childDir) => {
|
|
35
|
-
if (childDir.isDirectory()) {
|
|
36
|
-
const modelPath = path__namespace.join(libraryDir, childDir.name, "model.json");
|
|
37
|
-
try {
|
|
38
|
-
const modelContents = await readJSONFile.readJSONFile(modelPath);
|
|
39
|
-
if (isSharedSliceModel.isSharedSliceModel(modelContents) && modelContents.id === data.sliceID) {
|
|
40
|
-
return modelContents;
|
|
41
|
-
}
|
|
42
|
-
} catch (error) {
|
|
43
|
-
modelReadErrors.push(modelPath);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}))).filter((model2) => Boolean(model2));
|
|
47
|
-
if (model) {
|
|
48
|
-
return {
|
|
49
|
-
model
|
|
50
|
-
};
|
|
51
|
-
} else {
|
|
52
|
-
if (modelReadErrors.length) {
|
|
53
|
-
throw new Error(`Did not find a Slice model with ID "${data.sliceID}" in the "${data.libraryID}" Slice Library.
|
|
54
|
-
|
|
55
|
-
Those Slice models could not be read:
|
|
56
|
-
- ${modelReadErrors.join("\n - ")}`);
|
|
57
|
-
}
|
|
58
|
-
throw new Error(`Did not find a Slice model with ID "${data.sliceID}" in the "${data.libraryID}" Slice Library.`);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.sliceRead = sliceRead;
|
|
62
|
-
//# sourceMappingURL=slice-read.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-read.cjs","sources":["../../../src/hooks/slice-read.ts"],"sourcesContent":["import type { SliceReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildSliceLibraryDirectoryPath } from \"../lib/buildSliceLibraryDirectoryPath\";\nimport { isSharedSliceModel } from \"../lib/isSharedSliceModel\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceRead: SliceReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst libraryDir = buildSliceLibraryDirectoryPath({\n\t\tlibraryID: data.libraryID,\n\t\thelpers,\n\t});\n\n\t// Ensure the directory exists.\n\tawait fs.mkdir(libraryDir, { recursive: true });\n\n\tconst childDirs = await fs.readdir(libraryDir, { withFileTypes: true });\n\n\tconst modelReadErrors: string[] = [];\n\n\t// Find the first matching model.\n\tconst [model] = (\n\t\tawait Promise.all(\n\t\t\tchildDirs.map(async (childDir) => {\n\t\t\t\tif (childDir.isDirectory()) {\n\t\t\t\t\tconst modelPath = path.join(libraryDir, childDir.name, \"model.json\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst modelContents = await readJSONFile(modelPath);\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisSharedSliceModel(modelContents) &&\n\t\t\t\t\t\t\tmodelContents.id === data.sliceID\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn modelContents;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tmodelReadErrors.push(modelPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\t).filter((model): model is NonNullable<typeof model> => Boolean(model));\n\n\tif (model) {\n\t\treturn {\n\t\t\tmodel,\n\t\t};\n\t} else {\n\t\tif (modelReadErrors.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Did not find a Slice model with ID \"${data.sliceID}\" in the \"${\n\t\t\t\t\tdata.libraryID\n\t\t\t\t}\" Slice Library.\\n\\nThose Slice models could not be read:\\n - ${modelReadErrors.join(\n\t\t\t\t\t\"\\n - \",\n\t\t\t\t)}`,\n\t\t\t);\n\t\t}\n\n\t\tthrow new Error(\n\t\t\t`Did not find a Slice model with ID \"${data.sliceID}\" in the \"${data.libraryID}\" Slice Library.`,\n\t\t);\n\t}\n};\n"],"names":["buildSliceLibraryDirectoryPath","fs","path","readJSONFile","isSharedSliceModel","model"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,YAA0C,OACtD,MACA,EAAE,cACC;AACH,QAAM,aAAaA,+BAAAA,+BAA+B;AAAA,IACjD,WAAW,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAGD,QAAMC,cAAG,MAAM,YAAY,EAAE,WAAW,MAAM;AAExC,QAAA,YAAY,MAAMA,cAAG,QAAQ,YAAY,EAAE,eAAe,MAAM;AAEtE,QAAM,kBAA4B,CAAA;AAG5B,QAAA,CAAC,KAAK,KACX,MAAM,QAAQ,IACb,UAAU,IAAI,OAAO,aAAY;AAC5B,QAAA,SAAS,eAAe;AAC3B,YAAM,YAAYC,gBAAK,KAAK,YAAY,SAAS,MAAM,YAAY;AAC/D,UAAA;AACG,cAAA,gBAAgB,MAAMC,0BAAa,SAAS;AAElD,YACCC,mBAAAA,mBAAmB,aAAa,KAChC,cAAc,OAAO,KAAK,SACzB;AACM,iBAAA;AAAA,QACP;AAAA,eACO;AACR,wBAAgB,KAAK,SAAS;AAAA,MAC9B;AAAA,IACD;AAAA,EAAA,CACD,CAAC,GAEF,OAAO,CAACC,WAA8C,QAAQA,MAAK,CAAC;AAEtE,MAAI,OAAO;AACH,WAAA;AAAA,MACN;AAAA,IAAA;AAAA,SAEK;AACN,QAAI,gBAAgB,QAAQ;AAC3B,YAAM,IAAI,MACT,uCAAuC,KAAK,oBAC3C,KAAK;AAAA;AAAA;AAAA,MAC4D,gBAAgB,KACjF,QAAQ,GACN;AAAA,IAEJ;AAED,UAAM,IAAI,MACT,uCAAuC,KAAK,oBAAoB,KAAK,2BAA2B;AAAA,EAEjG;AACF;;"}
|
package/dist/hooks/slice-read.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { buildSliceLibraryDirectoryPath } from "../lib/buildSliceLibraryDirectoryPath.js";
|
|
4
|
-
import { isSharedSliceModel } from "../lib/isSharedSliceModel.js";
|
|
5
|
-
import { readJSONFile } from "../lib/readJSONFile.js";
|
|
6
|
-
const sliceRead = async (data, { helpers }) => {
|
|
7
|
-
const libraryDir = buildSliceLibraryDirectoryPath({
|
|
8
|
-
libraryID: data.libraryID,
|
|
9
|
-
helpers
|
|
10
|
-
});
|
|
11
|
-
await fs.mkdir(libraryDir, { recursive: true });
|
|
12
|
-
const childDirs = await fs.readdir(libraryDir, { withFileTypes: true });
|
|
13
|
-
const modelReadErrors = [];
|
|
14
|
-
const [model] = (await Promise.all(childDirs.map(async (childDir) => {
|
|
15
|
-
if (childDir.isDirectory()) {
|
|
16
|
-
const modelPath = path.join(libraryDir, childDir.name, "model.json");
|
|
17
|
-
try {
|
|
18
|
-
const modelContents = await readJSONFile(modelPath);
|
|
19
|
-
if (isSharedSliceModel(modelContents) && modelContents.id === data.sliceID) {
|
|
20
|
-
return modelContents;
|
|
21
|
-
}
|
|
22
|
-
} catch (error) {
|
|
23
|
-
modelReadErrors.push(modelPath);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}))).filter((model2) => Boolean(model2));
|
|
27
|
-
if (model) {
|
|
28
|
-
return {
|
|
29
|
-
model
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
if (modelReadErrors.length) {
|
|
33
|
-
throw new Error(`Did not find a Slice model with ID "${data.sliceID}" in the "${data.libraryID}" Slice Library.
|
|
34
|
-
|
|
35
|
-
Those Slice models could not be read:
|
|
36
|
-
- ${modelReadErrors.join("\n - ")}`);
|
|
37
|
-
}
|
|
38
|
-
throw new Error(`Did not find a Slice model with ID "${data.sliceID}" in the "${data.libraryID}" Slice Library.`);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
sliceRead
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=slice-read.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-read.js","sources":["../../../src/hooks/slice-read.ts"],"sourcesContent":["import type { SliceReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildSliceLibraryDirectoryPath } from \"../lib/buildSliceLibraryDirectoryPath\";\nimport { isSharedSliceModel } from \"../lib/isSharedSliceModel\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceRead: SliceReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst libraryDir = buildSliceLibraryDirectoryPath({\n\t\tlibraryID: data.libraryID,\n\t\thelpers,\n\t});\n\n\t// Ensure the directory exists.\n\tawait fs.mkdir(libraryDir, { recursive: true });\n\n\tconst childDirs = await fs.readdir(libraryDir, { withFileTypes: true });\n\n\tconst modelReadErrors: string[] = [];\n\n\t// Find the first matching model.\n\tconst [model] = (\n\t\tawait Promise.all(\n\t\t\tchildDirs.map(async (childDir) => {\n\t\t\t\tif (childDir.isDirectory()) {\n\t\t\t\t\tconst modelPath = path.join(libraryDir, childDir.name, \"model.json\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst modelContents = await readJSONFile(modelPath);\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisSharedSliceModel(modelContents) &&\n\t\t\t\t\t\t\tmodelContents.id === data.sliceID\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn modelContents;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tmodelReadErrors.push(modelPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\t).filter((model): model is NonNullable<typeof model> => Boolean(model));\n\n\tif (model) {\n\t\treturn {\n\t\t\tmodel,\n\t\t};\n\t} else {\n\t\tif (modelReadErrors.length) {\n\t\t\tthrow new Error(\n\t\t\t\t`Did not find a Slice model with ID \"${data.sliceID}\" in the \"${\n\t\t\t\t\tdata.libraryID\n\t\t\t\t}\" Slice Library.\\n\\nThose Slice models could not be read:\\n - ${modelReadErrors.join(\n\t\t\t\t\t\"\\n - \",\n\t\t\t\t)}`,\n\t\t\t);\n\t\t}\n\n\t\tthrow new Error(\n\t\t\t`Did not find a Slice model with ID \"${data.sliceID}\" in the \"${data.libraryID}\" Slice Library.`,\n\t\t);\n\t}\n};\n"],"names":["model"],"mappings":";;;;;AAUO,MAAM,YAA0C,OACtD,MACA,EAAE,cACC;AACH,QAAM,aAAa,+BAA+B;AAAA,IACjD,WAAW,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAGD,QAAM,GAAG,MAAM,YAAY,EAAE,WAAW,MAAM;AAExC,QAAA,YAAY,MAAM,GAAG,QAAQ,YAAY,EAAE,eAAe,MAAM;AAEtE,QAAM,kBAA4B,CAAA;AAG5B,QAAA,CAAC,KAAK,KACX,MAAM,QAAQ,IACb,UAAU,IAAI,OAAO,aAAY;AAC5B,QAAA,SAAS,eAAe;AAC3B,YAAM,YAAY,KAAK,KAAK,YAAY,SAAS,MAAM,YAAY;AAC/D,UAAA;AACG,cAAA,gBAAgB,MAAM,aAAa,SAAS;AAElD,YACC,mBAAmB,aAAa,KAChC,cAAc,OAAO,KAAK,SACzB;AACM,iBAAA;AAAA,QACP;AAAA,eACO;AACR,wBAAgB,KAAK,SAAS;AAAA,MAC9B;AAAA,IACD;AAAA,EAAA,CACD,CAAC,GAEF,OAAO,CAACA,WAA8C,QAAQA,MAAK,CAAC;AAEtE,MAAI,OAAO;AACH,WAAA;AAAA,MACN;AAAA,IAAA;AAAA,SAEK;AACN,QAAI,gBAAgB,QAAQ;AAC3B,YAAM,IAAI,MACT,uCAAuC,KAAK,oBAC3C,KAAK;AAAA;AAAA;AAAA,MAC4D,gBAAgB,KACjF,QAAQ,GACN;AAAA,IAEJ;AAED,UAAM,IAAI,MACT,uCAAuC,KAAK,oBAAoB,KAAK,2BAA2B;AAAA,EAEjG;AACF;"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fse = require("fs-extra");
|
|
4
|
-
const buildSliceDirectoryPath = require("../lib/buildSliceDirectoryPath.cjs");
|
|
5
|
-
const rejectIfNecessary = require("../lib/rejectIfNecessary.cjs");
|
|
6
|
-
const updateSliceModelFile = require("../lib/updateSliceModelFile.cjs");
|
|
7
|
-
const upsertGlobalContentTypes = require("../lib/upsertGlobalContentTypes.cjs");
|
|
8
|
-
const upsertSliceLibraryIndexFile = require("../lib/upsertSliceLibraryIndexFile.cjs");
|
|
9
|
-
function _interopNamespaceDefault(e) {
|
|
10
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
11
|
-
if (e) {
|
|
12
|
-
for (const k in e) {
|
|
13
|
-
if (k !== "default") {
|
|
14
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: () => e[k]
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
n.default = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
const fse__namespace = /* @__PURE__ */ _interopNamespaceDefault(fse);
|
|
26
|
-
const sliceRename = async (data, context) => {
|
|
27
|
-
const { model: currentModel } = await context.actions.readSliceModel({
|
|
28
|
-
libraryID: data.libraryID,
|
|
29
|
-
sliceID: data.model.id
|
|
30
|
-
});
|
|
31
|
-
await fse__namespace.move(buildSliceDirectoryPath.buildSliceDirectoryPath({
|
|
32
|
-
libraryID: data.libraryID,
|
|
33
|
-
model: currentModel,
|
|
34
|
-
helpers: context.helpers
|
|
35
|
-
}), buildSliceDirectoryPath.buildSliceDirectoryPath({
|
|
36
|
-
libraryID: data.libraryID,
|
|
37
|
-
model: data.model,
|
|
38
|
-
helpers: context.helpers
|
|
39
|
-
}));
|
|
40
|
-
await updateSliceModelFile.updateSliceModelFile({
|
|
41
|
-
libraryID: data.libraryID,
|
|
42
|
-
model: data.model,
|
|
43
|
-
...context
|
|
44
|
-
});
|
|
45
|
-
rejectIfNecessary.rejectIfNecessary(await Promise.allSettled([
|
|
46
|
-
upsertGlobalContentTypes.upsertGlobalContentTypes(context),
|
|
47
|
-
upsertSliceLibraryIndexFile.upsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context })
|
|
48
|
-
]));
|
|
49
|
-
};
|
|
50
|
-
exports.sliceRename = sliceRename;
|
|
51
|
-
//# sourceMappingURL=slice-rename.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-rename.cjs","sources":["../../../src/hooks/slice-rename.ts"],"sourcesContent":["import type { SliceRenameHook } from \"@slicemachine/plugin-kit\";\nimport * as fse from \"fs-extra\";\n\nimport { buildSliceDirectoryPath } from \"../lib/buildSliceDirectoryPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { updateSliceModelFile } from \"../lib/updateSliceModelFile\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceRename: SliceRenameHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst { model: currentModel } = await context.actions.readSliceModel({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.model.id,\n\t});\n\n\tawait fse.move(\n\t\tbuildSliceDirectoryPath({\n\t\t\tlibraryID: data.libraryID,\n\t\t\tmodel: currentModel,\n\t\t\thelpers: context.helpers,\n\t\t}),\n\t\tbuildSliceDirectoryPath({\n\t\t\tlibraryID: data.libraryID,\n\t\t\tmodel: data.model,\n\t\t\thelpers: context.helpers,\n\t\t}),\n\t);\n\n\tawait updateSliceModelFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\t...context,\n\t});\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertGlobalContentTypes(context),\n\t\t\tupsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context }),\n\t\t]),\n\t);\n};\n"],"names":["fse","buildSliceDirectoryPath","updateSliceModelFile","rejectIfNecessary","upsertGlobalContentTypes","upsertSliceLibraryIndexFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWa,MAAA,cAA8C,OAC1D,MACA,YACG;AACH,QAAM,EAAE,OAAO,aAAA,IAAiB,MAAM,QAAQ,QAAQ,eAAe;AAAA,IACpE,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK,MAAM;AAAA,EAAA,CACpB;AAEK,QAAAA,eAAI,KACTC,gDAAwB;AAAA,IACvB,WAAW,KAAK;AAAA,IAChB,OAAO;AAAA,IACP,SAAS,QAAQ;AAAA,EACjB,CAAA,GACDA,wBAAAA,wBAAwB;AAAA,IACvB,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,SAAS,QAAQ;AAAA,EACjB,CAAA,CAAC;AAGH,QAAMC,0CAAqB;AAAA,IAC1B,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,GAAG;AAAA,EAAA,CACH;AAGAC,sCAAA,MAAM,QAAQ,WAAW;AAAA,IACxBC,yBAAAA,yBAAyB,OAAO;AAAA,IAChCC,wDAA4B,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS;AAAA,EACrE,CAAA,CAAC;AAEJ;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as fse from "fs-extra";
|
|
2
|
-
import { buildSliceDirectoryPath } from "../lib/buildSliceDirectoryPath.js";
|
|
3
|
-
import { rejectIfNecessary } from "../lib/rejectIfNecessary.js";
|
|
4
|
-
import { updateSliceModelFile } from "../lib/updateSliceModelFile.js";
|
|
5
|
-
import { upsertGlobalContentTypes } from "../lib/upsertGlobalContentTypes.js";
|
|
6
|
-
import { upsertSliceLibraryIndexFile } from "../lib/upsertSliceLibraryIndexFile.js";
|
|
7
|
-
const sliceRename = async (data, context) => {
|
|
8
|
-
const { model: currentModel } = await context.actions.readSliceModel({
|
|
9
|
-
libraryID: data.libraryID,
|
|
10
|
-
sliceID: data.model.id
|
|
11
|
-
});
|
|
12
|
-
await fse.move(buildSliceDirectoryPath({
|
|
13
|
-
libraryID: data.libraryID,
|
|
14
|
-
model: currentModel,
|
|
15
|
-
helpers: context.helpers
|
|
16
|
-
}), buildSliceDirectoryPath({
|
|
17
|
-
libraryID: data.libraryID,
|
|
18
|
-
model: data.model,
|
|
19
|
-
helpers: context.helpers
|
|
20
|
-
}));
|
|
21
|
-
await updateSliceModelFile({
|
|
22
|
-
libraryID: data.libraryID,
|
|
23
|
-
model: data.model,
|
|
24
|
-
...context
|
|
25
|
-
});
|
|
26
|
-
rejectIfNecessary(await Promise.allSettled([
|
|
27
|
-
upsertGlobalContentTypes(context),
|
|
28
|
-
upsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context })
|
|
29
|
-
]));
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
sliceRename
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=slice-rename.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-rename.js","sources":["../../../src/hooks/slice-rename.ts"],"sourcesContent":["import type { SliceRenameHook } from \"@slicemachine/plugin-kit\";\nimport * as fse from \"fs-extra\";\n\nimport { buildSliceDirectoryPath } from \"../lib/buildSliceDirectoryPath\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { updateSliceModelFile } from \"../lib/updateSliceModelFile\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\nimport { upsertSliceLibraryIndexFile } from \"../lib/upsertSliceLibraryIndexFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceRename: SliceRenameHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst { model: currentModel } = await context.actions.readSliceModel({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.model.id,\n\t});\n\n\tawait fse.move(\n\t\tbuildSliceDirectoryPath({\n\t\t\tlibraryID: data.libraryID,\n\t\t\tmodel: currentModel,\n\t\t\thelpers: context.helpers,\n\t\t}),\n\t\tbuildSliceDirectoryPath({\n\t\t\tlibraryID: data.libraryID,\n\t\t\tmodel: data.model,\n\t\t\thelpers: context.helpers,\n\t\t}),\n\t);\n\n\tawait updateSliceModelFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\t...context,\n\t});\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupsertGlobalContentTypes(context),\n\t\t\tupsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context }),\n\t\t]),\n\t);\n};\n"],"names":[],"mappings":";;;;;;AAWa,MAAA,cAA8C,OAC1D,MACA,YACG;AACH,QAAM,EAAE,OAAO,aAAA,IAAiB,MAAM,QAAQ,QAAQ,eAAe;AAAA,IACpE,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK,MAAM;AAAA,EAAA,CACpB;AAEK,QAAA,IAAI,KACT,wBAAwB;AAAA,IACvB,WAAW,KAAK;AAAA,IAChB,OAAO;AAAA,IACP,SAAS,QAAQ;AAAA,EACjB,CAAA,GACD,wBAAwB;AAAA,IACvB,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,SAAS,QAAQ;AAAA,EACjB,CAAA,CAAC;AAGH,QAAM,qBAAqB;AAAA,IAC1B,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,GAAG;AAAA,EAAA,CACH;AAGA,oBAAA,MAAM,QAAQ,WAAW;AAAA,IACxB,yBAAyB,OAAO;AAAA,IAChC,4BAA4B,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS;AAAA,EACrE,CAAA,CAAC;AAEJ;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const updateSliceModelFile = require("../lib/updateSliceModelFile.cjs");
|
|
4
|
-
const upsertGlobalContentTypes = require("../lib/upsertGlobalContentTypes.cjs");
|
|
5
|
-
const sliceUpdate = async (data, context) => {
|
|
6
|
-
await updateSliceModelFile.updateSliceModelFile({
|
|
7
|
-
libraryID: data.libraryID,
|
|
8
|
-
model: data.model,
|
|
9
|
-
...context
|
|
10
|
-
});
|
|
11
|
-
await upsertGlobalContentTypes.upsertGlobalContentTypes(context);
|
|
12
|
-
};
|
|
13
|
-
exports.sliceUpdate = sliceUpdate;
|
|
14
|
-
//# sourceMappingURL=slice-update.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-update.cjs","sources":["../../../src/hooks/slice-update.ts"],"sourcesContent":["import type { SliceUpdateHook } from \"@slicemachine/plugin-kit\";\n\nimport { updateSliceModelFile } from \"../lib/updateSliceModelFile\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceUpdate: SliceUpdateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tawait updateSliceModelFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\t...context,\n\t});\n\n\tawait upsertGlobalContentTypes(context);\n};\n"],"names":["updateSliceModelFile","upsertGlobalContentTypes"],"mappings":";;;;AAOa,MAAA,cAA8C,OAC1D,MACA,YACG;AACH,QAAMA,0CAAqB;AAAA,IAC1B,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,GAAG;AAAA,EAAA,CACH;AAED,QAAMC,yBAAAA,yBAAyB,OAAO;AACvC;;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { updateSliceModelFile } from "../lib/updateSliceModelFile.js";
|
|
2
|
-
import { upsertGlobalContentTypes } from "../lib/upsertGlobalContentTypes.js";
|
|
3
|
-
const sliceUpdate = async (data, context) => {
|
|
4
|
-
await updateSliceModelFile({
|
|
5
|
-
libraryID: data.libraryID,
|
|
6
|
-
model: data.model,
|
|
7
|
-
...context
|
|
8
|
-
});
|
|
9
|
-
await upsertGlobalContentTypes(context);
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
sliceUpdate
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=slice-update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slice-update.js","sources":["../../../src/hooks/slice-update.ts"],"sourcesContent":["import type { SliceUpdateHook } from \"@slicemachine/plugin-kit\";\n\nimport { updateSliceModelFile } from \"../lib/updateSliceModelFile\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceUpdate: SliceUpdateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tawait updateSliceModelFile({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\t...context,\n\t});\n\n\tawait upsertGlobalContentTypes(context);\n};\n"],"names":[],"mappings":";;AAOa,MAAA,cAA8C,OAC1D,MACA,YACG;AACH,QAAM,qBAAqB;AAAA,IAC1B,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,GAAG;AAAA,EAAA,CACH;AAED,QAAM,yBAAyB,OAAO;AACvC;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const fs = require("node:fs/promises");
|
|
4
|
-
const path = require("node:path");
|
|
5
|
-
const buildSliceLibraryDirectoryPath = require("../lib/buildSliceLibraryDirectoryPath.cjs");
|
|
6
|
-
const isSharedSliceModel = require("../lib/isSharedSliceModel.cjs");
|
|
7
|
-
const readJSONFile = require("../lib/readJSONFile.cjs");
|
|
8
|
-
function _interopNamespaceDefault(e) {
|
|
9
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
10
|
-
if (e) {
|
|
11
|
-
for (const k in e) {
|
|
12
|
-
if (k !== "default") {
|
|
13
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: () => e[k]
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
25
|
-
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
26
|
-
const sliceLibraryRead = async (data, { helpers }) => {
|
|
27
|
-
const dir = buildSliceLibraryDirectoryPath.buildSliceLibraryDirectoryPath({
|
|
28
|
-
libraryID: data.libraryID,
|
|
29
|
-
helpers
|
|
30
|
-
});
|
|
31
|
-
await fs__namespace.mkdir(dir, { recursive: true });
|
|
32
|
-
const childDirs = await fs__namespace.readdir(dir, { withFileTypes: true });
|
|
33
|
-
const sliceIDs = [];
|
|
34
|
-
await Promise.all(childDirs.map(async (childDir) => {
|
|
35
|
-
if (childDir.isDirectory()) {
|
|
36
|
-
const modelPath = path__namespace.join(dir, childDir.name, "model.json");
|
|
37
|
-
try {
|
|
38
|
-
const modelContents = await readJSONFile.readJSONFile(modelPath);
|
|
39
|
-
if (isSharedSliceModel.isSharedSliceModel(modelContents)) {
|
|
40
|
-
sliceIDs.push(modelContents.id);
|
|
41
|
-
}
|
|
42
|
-
} catch {
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
return {
|
|
47
|
-
id: data.libraryID,
|
|
48
|
-
sliceIDs: sliceIDs.sort()
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
exports.sliceLibraryRead = sliceLibraryRead;
|
|
52
|
-
//# sourceMappingURL=sliceLibrary-read.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sliceLibrary-read.cjs","sources":["../../../src/hooks/sliceLibrary-read.ts"],"sourcesContent":["import type { SliceLibraryReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildSliceLibraryDirectoryPath } from \"../lib/buildSliceLibraryDirectoryPath\";\nimport { isSharedSliceModel } from \"../lib/isSharedSliceModel\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceLibraryRead: SliceLibraryReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst dir = buildSliceLibraryDirectoryPath({\n\t\tlibraryID: data.libraryID,\n\t\thelpers,\n\t});\n\n\t// Ensure the directory exists.\n\tawait fs.mkdir(dir, { recursive: true });\n\n\tconst childDirs = await fs.readdir(dir, { withFileTypes: true });\n\n\tconst sliceIDs: string[] = [];\n\tawait Promise.all(\n\t\tchildDirs.map(async (childDir) => {\n\t\t\tif (childDir.isDirectory()) {\n\t\t\t\tconst modelPath = path.join(dir, childDir.name, \"model.json\");\n\n\t\t\t\ttry {\n\t\t\t\t\tconst modelContents = await readJSONFile(modelPath);\n\n\t\t\t\t\tif (isSharedSliceModel(modelContents)) {\n\t\t\t\t\t\tsliceIDs.push(modelContents.id);\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t);\n\n\treturn {\n\t\tid: data.libraryID,\n\t\tsliceIDs: sliceIDs.sort(),\n\t};\n};\n"],"names":["buildSliceLibraryDirectoryPath","fs","path","readJSONFile","isSharedSliceModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,mBAAwD,OACpE,MACA,EAAE,cACC;AACH,QAAM,MAAMA,+BAAAA,+BAA+B;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAGD,QAAMC,cAAG,MAAM,KAAK,EAAE,WAAW,MAAM;AAEjC,QAAA,YAAY,MAAMA,cAAG,QAAQ,KAAK,EAAE,eAAe,MAAM;AAE/D,QAAM,WAAqB,CAAA;AAC3B,QAAM,QAAQ,IACb,UAAU,IAAI,OAAO,aAAY;AAC5B,QAAA,SAAS,eAAe;AAC3B,YAAM,YAAYC,gBAAK,KAAK,KAAK,SAAS,MAAM,YAAY;AAExD,UAAA;AACG,cAAA,gBAAgB,MAAMC,0BAAa,SAAS;AAE9C,YAAAC,mBAAAA,mBAAmB,aAAa,GAAG;AAC7B,mBAAA,KAAK,cAAc,EAAE;AAAA,QAC9B;AAAA,MAAA,QACA;AAAA,MAED;AAAA,IACD;AAAA,EACD,CAAA,CAAC;AAGI,SAAA;AAAA,IACN,IAAI,KAAK;AAAA,IACT,UAAU,SAAS,KAAM;AAAA,EAAA;AAE3B;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { buildSliceLibraryDirectoryPath } from "../lib/buildSliceLibraryDirectoryPath.js";
|
|
4
|
-
import { isSharedSliceModel } from "../lib/isSharedSliceModel.js";
|
|
5
|
-
import { readJSONFile } from "../lib/readJSONFile.js";
|
|
6
|
-
const sliceLibraryRead = async (data, { helpers }) => {
|
|
7
|
-
const dir = buildSliceLibraryDirectoryPath({
|
|
8
|
-
libraryID: data.libraryID,
|
|
9
|
-
helpers
|
|
10
|
-
});
|
|
11
|
-
await fs.mkdir(dir, { recursive: true });
|
|
12
|
-
const childDirs = await fs.readdir(dir, { withFileTypes: true });
|
|
13
|
-
const sliceIDs = [];
|
|
14
|
-
await Promise.all(childDirs.map(async (childDir) => {
|
|
15
|
-
if (childDir.isDirectory()) {
|
|
16
|
-
const modelPath = path.join(dir, childDir.name, "model.json");
|
|
17
|
-
try {
|
|
18
|
-
const modelContents = await readJSONFile(modelPath);
|
|
19
|
-
if (isSharedSliceModel(modelContents)) {
|
|
20
|
-
sliceIDs.push(modelContents.id);
|
|
21
|
-
}
|
|
22
|
-
} catch {
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}));
|
|
26
|
-
return {
|
|
27
|
-
id: data.libraryID,
|
|
28
|
-
sliceIDs: sliceIDs.sort()
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
sliceLibraryRead
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=sliceLibrary-read.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sliceLibrary-read.js","sources":["../../../src/hooks/sliceLibrary-read.ts"],"sourcesContent":["import type { SliceLibraryReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildSliceLibraryDirectoryPath } from \"../lib/buildSliceLibraryDirectoryPath\";\nimport { isSharedSliceModel } from \"../lib/isSharedSliceModel\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceLibraryRead: SliceLibraryReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst dir = buildSliceLibraryDirectoryPath({\n\t\tlibraryID: data.libraryID,\n\t\thelpers,\n\t});\n\n\t// Ensure the directory exists.\n\tawait fs.mkdir(dir, { recursive: true });\n\n\tconst childDirs = await fs.readdir(dir, { withFileTypes: true });\n\n\tconst sliceIDs: string[] = [];\n\tawait Promise.all(\n\t\tchildDirs.map(async (childDir) => {\n\t\t\tif (childDir.isDirectory()) {\n\t\t\t\tconst modelPath = path.join(dir, childDir.name, \"model.json\");\n\n\t\t\t\ttry {\n\t\t\t\t\tconst modelContents = await readJSONFile(modelPath);\n\n\t\t\t\t\tif (isSharedSliceModel(modelContents)) {\n\t\t\t\t\t\tsliceIDs.push(modelContents.id);\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// noop\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t);\n\n\treturn {\n\t\tid: data.libraryID,\n\t\tsliceIDs: sliceIDs.sort(),\n\t};\n};\n"],"names":[],"mappings":";;;;;AAUO,MAAM,mBAAwD,OACpE,MACA,EAAE,cACC;AACH,QAAM,MAAM,+BAA+B;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAGD,QAAM,GAAG,MAAM,KAAK,EAAE,WAAW,MAAM;AAEjC,QAAA,YAAY,MAAM,GAAG,QAAQ,KAAK,EAAE,eAAe,MAAM;AAE/D,QAAM,WAAqB,CAAA;AAC3B,QAAM,QAAQ,IACb,UAAU,IAAI,OAAO,aAAY;AAC5B,QAAA,SAAS,eAAe;AAC3B,YAAM,YAAY,KAAK,KAAK,KAAK,SAAS,MAAM,YAAY;AAExD,UAAA;AACG,cAAA,gBAAgB,MAAM,aAAa,SAAS;AAE9C,YAAA,mBAAmB,aAAa,GAAG;AAC7B,mBAAA,KAAK,cAAc,EAAE;AAAA,QAC9B;AAAA,MAAA,QACA;AAAA,MAED;AAAA,IACD;AAAA,EACD,CAAA,CAAC;AAGI,SAAA;AAAA,IACN,IAAI,KAAK;AAAA,IACT,UAAU,SAAS,KAAM;AAAA,EAAA;AAE3B;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const path = require("node:path");
|
|
4
|
-
const buildCustomTypeDirectoryPath = require("./buildCustomTypeDirectoryPath.cjs");
|
|
5
|
-
function _interopNamespaceDefault(e) {
|
|
6
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
-
if (e) {
|
|
8
|
-
for (const k in e) {
|
|
9
|
-
if (k !== "default") {
|
|
10
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: () => e[k]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
n.default = e;
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
22
|
-
const buildCustomTypeAssetPath = (args) => {
|
|
23
|
-
return path__namespace.join(buildCustomTypeDirectoryPath.buildCustomTypeDirectoryPath({
|
|
24
|
-
customTypeID: args.customTypeID,
|
|
25
|
-
helpers: args.helpers
|
|
26
|
-
}), args.assetID);
|
|
27
|
-
};
|
|
28
|
-
exports.buildCustomTypeAssetPath = buildCustomTypeAssetPath;
|
|
29
|
-
//# sourceMappingURL=buildCustomTypeAssetPath.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeAssetPath.cjs","sources":["../../../src/lib/buildCustomTypeAssetPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildCustomTypeDirectoryPath } from \"./buildCustomTypeDirectoryPath\";\n\ntype BuildCustomTypeAssetPathArgs = {\n\tcustomTypeID: string;\n\tassetID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeAssetPath = (\n\targs: BuildCustomTypeAssetPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildCustomTypeDirectoryPath({\n\t\t\tcustomTypeID: args.customTypeID,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\targs.assetID,\n\t);\n};\n"],"names":["path","buildCustomTypeDirectoryPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaa,MAAA,2BAA2B,CACvC,SACW;AACJ,SAAAA,gBAAK,KACXC,0DAA6B;AAAA,IAC5B,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK;AAAA,EAAA,CACd,GACD,KAAK,OAAO;AAEd;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SliceMachineContext } from "@slicemachine/plugin-kit";
|
|
2
|
-
import { PluginOptions } from "../types";
|
|
3
|
-
type BuildCustomTypeAssetPathArgs = {
|
|
4
|
-
customTypeID: string;
|
|
5
|
-
assetID: string;
|
|
6
|
-
helpers: SliceMachineContext<PluginOptions>["helpers"];
|
|
7
|
-
};
|
|
8
|
-
export declare const buildCustomTypeAssetPath: (args: BuildCustomTypeAssetPathArgs) => string;
|
|
9
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
import { buildCustomTypeDirectoryPath } from "./buildCustomTypeDirectoryPath.js";
|
|
3
|
-
const buildCustomTypeAssetPath = (args) => {
|
|
4
|
-
return path.join(buildCustomTypeDirectoryPath({
|
|
5
|
-
customTypeID: args.customTypeID,
|
|
6
|
-
helpers: args.helpers
|
|
7
|
-
}), args.assetID);
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
buildCustomTypeAssetPath
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=buildCustomTypeAssetPath.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeAssetPath.js","sources":["../../../src/lib/buildCustomTypeAssetPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildCustomTypeDirectoryPath } from \"./buildCustomTypeDirectoryPath\";\n\ntype BuildCustomTypeAssetPathArgs = {\n\tcustomTypeID: string;\n\tassetID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeAssetPath = (\n\targs: BuildCustomTypeAssetPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildCustomTypeDirectoryPath({\n\t\t\tcustomTypeID: args.customTypeID,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\targs.assetID,\n\t);\n};\n"],"names":[],"mappings":";;AAaa,MAAA,2BAA2B,CACvC,SACW;AACJ,SAAA,KAAK,KACX,6BAA6B;AAAA,IAC5B,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK;AAAA,EAAA,CACd,GACD,KAAK,OAAO;AAEd;"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const path = require("node:path");
|
|
4
|
-
const buildCustomTypeLibraryDirectoryPath = require("./buildCustomTypeLibraryDirectoryPath.cjs");
|
|
5
|
-
function _interopNamespaceDefault(e) {
|
|
6
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
-
if (e) {
|
|
8
|
-
for (const k in e) {
|
|
9
|
-
if (k !== "default") {
|
|
10
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: () => e[k]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
n.default = e;
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
22
|
-
const buildCustomTypeDirectoryPath = (args) => {
|
|
23
|
-
return path__namespace.join(buildCustomTypeLibraryDirectoryPath.buildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }), args.customTypeID);
|
|
24
|
-
};
|
|
25
|
-
exports.buildCustomTypeDirectoryPath = buildCustomTypeDirectoryPath;
|
|
26
|
-
//# sourceMappingURL=buildCustomTypeDirectoryPath.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeDirectoryPath.cjs","sources":["../../../src/lib/buildCustomTypeDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildCustomTypeLibraryDirectoryPath } from \"./buildCustomTypeLibraryDirectoryPath\";\n\ntype BuildCustomTypeDirectoryPathArgs = {\n\tcustomTypeID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeDirectoryPath = (\n\targs: BuildCustomTypeDirectoryPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }),\n\t\targs.customTypeID,\n\t);\n};\n"],"names":["path","buildCustomTypeLibraryDirectoryPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYa,MAAA,+BAA+B,CAC3C,SACW;AACJ,SAAAA,gBAAK,KACXC,oCAAA,oCAAoC,EAAE,SAAS,KAAK,SAAS,GAC7D,KAAK,YAAY;AAEnB;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SliceMachineContext } from "@slicemachine/plugin-kit";
|
|
2
|
-
import { PluginOptions } from "../types";
|
|
3
|
-
type BuildCustomTypeDirectoryPathArgs = {
|
|
4
|
-
customTypeID: string;
|
|
5
|
-
helpers: SliceMachineContext<PluginOptions>["helpers"];
|
|
6
|
-
};
|
|
7
|
-
export declare const buildCustomTypeDirectoryPath: (args: BuildCustomTypeDirectoryPathArgs) => string;
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
import { buildCustomTypeLibraryDirectoryPath } from "./buildCustomTypeLibraryDirectoryPath.js";
|
|
3
|
-
const buildCustomTypeDirectoryPath = (args) => {
|
|
4
|
-
return path.join(buildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }), args.customTypeID);
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
buildCustomTypeDirectoryPath
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=buildCustomTypeDirectoryPath.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeDirectoryPath.js","sources":["../../../src/lib/buildCustomTypeDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildCustomTypeLibraryDirectoryPath } from \"./buildCustomTypeLibraryDirectoryPath\";\n\ntype BuildCustomTypeDirectoryPathArgs = {\n\tcustomTypeID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeDirectoryPath = (\n\targs: BuildCustomTypeDirectoryPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }),\n\t\targs.customTypeID,\n\t);\n};\n"],"names":[],"mappings":";;AAYa,MAAA,+BAA+B,CAC3C,SACW;AACJ,SAAA,KAAK,KACX,oCAAoC,EAAE,SAAS,KAAK,SAAS,GAC7D,KAAK,YAAY;AAEnB;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const buildCustomTypeLibraryDirectoryPath = (args) => {
|
|
4
|
-
return args.helpers.joinPathFromRoot("customtypes");
|
|
5
|
-
};
|
|
6
|
-
exports.buildCustomTypeLibraryDirectoryPath = buildCustomTypeLibraryDirectoryPath;
|
|
7
|
-
//# sourceMappingURL=buildCustomTypeLibraryDirectoryPath.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildCustomTypeLibraryDirectoryPath.cjs","sources":["../../../src/lib/buildCustomTypeLibraryDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\ntype BuildCustomTypeLibraryDirectoryPathArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeLibraryDirectoryPath = (\n\targs: BuildCustomTypeLibraryDirectoryPathArgs,\n): string => {\n\treturn args.helpers.joinPathFromRoot(\"customtypes\");\n};\n"],"names":[],"mappings":";;AAQa,MAAA,sCAAsC,CAClD,SACW;AACJ,SAAA,KAAK,QAAQ,iBAAiB,aAAa;AACnD;;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SliceMachineContext } from "@slicemachine/plugin-kit";
|
|
2
|
-
import { PluginOptions } from "../types";
|
|
3
|
-
type BuildCustomTypeLibraryDirectoryPathArgs = {
|
|
4
|
-
helpers: SliceMachineContext<PluginOptions>["helpers"];
|
|
5
|
-
};
|
|
6
|
-
export declare const buildCustomTypeLibraryDirectoryPath: (args: BuildCustomTypeLibraryDirectoryPathArgs) => string;
|
|
7
|
-
export {};
|