@slicemachine/adapter-nuxt 0.0.2-dev-plugins-m3.0
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/LICENSE +202 -0
- package/README.md +98 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +41 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js +41 -0
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
- package/dist/_node_modules/fetch-blob/file.cjs +61 -0
- package/dist/_node_modules/fetch-blob/file.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/file.js +61 -0
- package/dist/_node_modules/fetch-blob/file.js.map +1 -0
- package/dist/_node_modules/fetch-blob/index.cjs +223 -0
- package/dist/_node_modules/fetch-blob/index.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/index.js +223 -0
- package/dist/_node_modules/fetch-blob/index.js.map +1 -0
- package/dist/_node_modules/fetch-blob/streams.cjs +43 -0
- package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -0
- package/dist/_node_modules/fetch-blob/streams.js +42 -0
- package/dist/_node_modules/fetch-blob/streams.js.map +1 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs +116 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.js +116 -0
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -0
- package/dist/_node_modules/node-domexception/index.cjs +11 -0
- package/dist/_node_modules/node-domexception/index.cjs.map +1 -0
- package/dist/_node_modules/node-domexception/index.js +10 -0
- package/dist/_node_modules/node-domexception/index.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/body.cjs +262 -0
- package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/body.js +262 -0
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +10 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js +10 -0
- package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/base.cjs +17 -0
- package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/base.js +17 -0
- package/dist/_node_modules/node-fetch/src/errors/base.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +19 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +19 -0
- package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/headers.cjs +190 -0
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/headers.js +190 -0
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/index.cjs +292 -0
- package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/index.js +292 -0
- package/dist/_node_modules/node-fetch/src/index.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/request.cjs +206 -0
- package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/request.js +206 -0
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/response.cjs +122 -0
- package/dist/_node_modules/node-fetch/src/response.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/response.js +123 -0
- package/dist/_node_modules/node-fetch/src/response.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +12 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.js +12 -0
- package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +8 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +8 -0
- package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is.cjs +28 -0
- package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/is.js +28 -0
- package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +356 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +356 -0
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +149 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.js +149 -0
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +3822 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +3822 -0
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
- package/dist/_virtual/_commonjsHelpers.cjs +5 -0
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/_virtual/_commonjsHelpers.js +5 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/ponyfill.es2018.cjs +13 -0
- package/dist/_virtual/ponyfill.es2018.cjs.map +1 -0
- package/dist/_virtual/ponyfill.es2018.js +14 -0
- package/dist/_virtual/ponyfill.es2018.js.map +1 -0
- package/dist/constants.cjs +5 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -0
- package/dist/hooks/customType-asset-delete.cjs +31 -0
- package/dist/hooks/customType-asset-delete.cjs.map +1 -0
- package/dist/hooks/customType-asset-delete.d.ts +3 -0
- package/dist/hooks/customType-asset-delete.js +14 -0
- package/dist/hooks/customType-asset-delete.js.map +1 -0
- package/dist/hooks/customType-asset-read.cjs +34 -0
- package/dist/hooks/customType-asset-read.cjs.map +1 -0
- package/dist/hooks/customType-asset-read.d.ts +3 -0
- package/dist/hooks/customType-asset-read.js +17 -0
- package/dist/hooks/customType-asset-read.js.map +1 -0
- package/dist/hooks/customType-asset-update.cjs +34 -0
- package/dist/hooks/customType-asset-update.cjs.map +1 -0
- package/dist/hooks/customType-asset-update.d.ts +3 -0
- package/dist/hooks/customType-asset-update.js +16 -0
- package/dist/hooks/customType-asset-update.js.map +1 -0
- package/dist/hooks/customType-create.cjs +43 -0
- package/dist/hooks/customType-create.cjs.map +1 -0
- package/dist/hooks/customType-create.d.ts +3 -0
- package/dist/hooks/customType-create.js +25 -0
- package/dist/hooks/customType-create.js.map +1 -0
- package/dist/hooks/customType-delete.cjs +32 -0
- package/dist/hooks/customType-delete.cjs.map +1 -0
- package/dist/hooks/customType-delete.d.ts +3 -0
- package/dist/hooks/customType-delete.js +15 -0
- package/dist/hooks/customType-delete.js.map +1 -0
- package/dist/hooks/customType-read.cjs +31 -0
- package/dist/hooks/customType-read.cjs.map +1 -0
- package/dist/hooks/customType-read.d.ts +3 -0
- package/dist/hooks/customType-read.js +14 -0
- package/dist/hooks/customType-read.js.map +1 -0
- package/dist/hooks/customType-rename.cjs +6 -0
- package/dist/hooks/customType-rename.cjs.map +1 -0
- package/dist/hooks/customType-rename.d.ts +1 -0
- package/dist/hooks/customType-rename.js +6 -0
- package/dist/hooks/customType-rename.js.map +1 -0
- package/dist/hooks/customType-update.cjs +6 -0
- package/dist/hooks/customType-update.cjs.map +1 -0
- package/dist/hooks/customType-update.d.ts +1 -0
- package/dist/hooks/customType-update.js +6 -0
- package/dist/hooks/customType-update.js.map +1 -0
- package/dist/hooks/customTypeLibrary-read.cjs +53 -0
- package/dist/hooks/customTypeLibrary-read.cjs.map +1 -0
- package/dist/hooks/customTypeLibrary-read.d.ts +3 -0
- package/dist/hooks/customTypeLibrary-read.js +35 -0
- package/dist/hooks/customTypeLibrary-read.js.map +1 -0
- package/dist/hooks/project-init.cjs +112 -0
- package/dist/hooks/project-init.cjs.map +1 -0
- package/dist/hooks/project-init.d.ts +3 -0
- package/dist/hooks/project-init.js +94 -0
- package/dist/hooks/project-init.js.map +1 -0
- package/dist/hooks/slice-asset-delete.cjs +33 -0
- package/dist/hooks/slice-asset-delete.cjs.map +1 -0
- package/dist/hooks/slice-asset-delete.d.ts +3 -0
- package/dist/hooks/slice-asset-delete.js +16 -0
- package/dist/hooks/slice-asset-delete.js.map +1 -0
- package/dist/hooks/slice-asset-read.cjs +36 -0
- package/dist/hooks/slice-asset-read.cjs.map +1 -0
- package/dist/hooks/slice-asset-read.d.ts +3 -0
- package/dist/hooks/slice-asset-read.js +19 -0
- package/dist/hooks/slice-asset-read.js.map +1 -0
- package/dist/hooks/slice-asset-update.cjs +36 -0
- package/dist/hooks/slice-asset-update.cjs.map +1 -0
- package/dist/hooks/slice-asset-update.d.ts +3 -0
- package/dist/hooks/slice-asset-update.js +18 -0
- package/dist/hooks/slice-asset-update.js.map +1 -0
- package/dist/hooks/slice-create.cjs +77 -0
- package/dist/hooks/slice-create.cjs.map +1 -0
- package/dist/hooks/slice-create.d.ts +3 -0
- package/dist/hooks/slice-create.js +59 -0
- package/dist/hooks/slice-create.js.map +1 -0
- package/dist/hooks/slice-delete.cjs +41 -0
- package/dist/hooks/slice-delete.cjs.map +1 -0
- package/dist/hooks/slice-delete.d.ts +3 -0
- package/dist/hooks/slice-delete.js +24 -0
- package/dist/hooks/slice-delete.js.map +1 -0
- package/dist/hooks/slice-read.cjs +62 -0
- package/dist/hooks/slice-read.cjs.map +1 -0
- package/dist/hooks/slice-read.d.ts +3 -0
- package/dist/hooks/slice-read.js +44 -0
- package/dist/hooks/slice-read.js.map +1 -0
- package/dist/hooks/slice-rename.cjs +51 -0
- package/dist/hooks/slice-rename.cjs.map +1 -0
- package/dist/hooks/slice-rename.d.ts +3 -0
- package/dist/hooks/slice-rename.js +34 -0
- package/dist/hooks/slice-rename.js.map +1 -0
- package/dist/hooks/slice-update.cjs +14 -0
- package/dist/hooks/slice-update.cjs.map +1 -0
- package/dist/hooks/slice-update.d.ts +3 -0
- package/dist/hooks/slice-update.js +14 -0
- package/dist/hooks/slice-update.js.map +1 -0
- package/dist/hooks/sliceLibrary-read.cjs +52 -0
- package/dist/hooks/sliceLibrary-read.cjs.map +1 -0
- package/dist/hooks/sliceLibrary-read.d.ts +3 -0
- package/dist/hooks/sliceLibrary-read.js +34 -0
- package/dist/hooks/sliceLibrary-read.js.map +1 -0
- package/dist/hooks/sliceSimulator-setup-read.cjs +150 -0
- package/dist/hooks/sliceSimulator-setup-read.cjs.map +1 -0
- package/dist/hooks/sliceSimulator-setup-read.d.ts +3 -0
- package/dist/hooks/sliceSimulator-setup-read.js +150 -0
- package/dist/hooks/sliceSimulator-setup-read.js.map +1 -0
- package/dist/hooks/snippet-read.cjs +101 -0
- package/dist/hooks/snippet-read.cjs.map +1 -0
- package/dist/hooks/snippet-read.d.ts +3 -0
- package/dist/hooks/snippet-read.js +101 -0
- package/dist/hooks/snippet-read.js.map +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/buildCustomTypeAssetPath.cjs +29 -0
- package/dist/lib/buildCustomTypeAssetPath.cjs.map +1 -0
- package/dist/lib/buildCustomTypeAssetPath.d.ts +9 -0
- package/dist/lib/buildCustomTypeAssetPath.js +12 -0
- package/dist/lib/buildCustomTypeAssetPath.js.map +1 -0
- package/dist/lib/buildCustomTypeDirectoryPath.cjs +26 -0
- package/dist/lib/buildCustomTypeDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildCustomTypeDirectoryPath.d.ts +8 -0
- package/dist/lib/buildCustomTypeDirectoryPath.js +9 -0
- package/dist/lib/buildCustomTypeDirectoryPath.js.map +1 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs +7 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.d.ts +7 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.js +7 -0
- package/dist/lib/buildCustomTypeLibraryDirectoryPath.js.map +1 -0
- package/dist/lib/buildSliceAssetPath.cjs +34 -0
- package/dist/lib/buildSliceAssetPath.cjs.map +1 -0
- package/dist/lib/buildSliceAssetPath.d.ts +11 -0
- package/dist/lib/buildSliceAssetPath.js +17 -0
- package/dist/lib/buildSliceAssetPath.js.map +1 -0
- package/dist/lib/buildSliceDirectoryPath.cjs +30 -0
- package/dist/lib/buildSliceDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildSliceDirectoryPath.d.ts +10 -0
- package/dist/lib/buildSliceDirectoryPath.js +13 -0
- package/dist/lib/buildSliceDirectoryPath.js.map +1 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.cjs +7 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.cjs.map +1 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.d.ts +8 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.js +7 -0
- package/dist/lib/buildSliceLibraryDirectoryPath.js.map +1 -0
- package/dist/lib/checkIsTypeScriptProject.cjs +9 -0
- package/dist/lib/checkIsTypeScriptProject.cjs.map +1 -0
- package/dist/lib/checkIsTypeScriptProject.d.ts +8 -0
- package/dist/lib/checkIsTypeScriptProject.js +9 -0
- package/dist/lib/checkIsTypeScriptProject.js.map +1 -0
- package/dist/lib/checkPathExists.cjs +30 -0
- package/dist/lib/checkPathExists.cjs.map +1 -0
- package/dist/lib/checkPathExists.d.ts +2 -0
- package/dist/lib/checkPathExists.js +13 -0
- package/dist/lib/checkPathExists.js.map +1 -0
- package/dist/lib/isSharedSliceModel.cjs +7 -0
- package/dist/lib/isSharedSliceModel.cjs.map +1 -0
- package/dist/lib/isSharedSliceModel.d.ts +335 -0
- package/dist/lib/isSharedSliceModel.js +7 -0
- package/dist/lib/isSharedSliceModel.js.map +1 -0
- package/dist/lib/pascalCase.cjs +8 -0
- package/dist/lib/pascalCase.cjs.map +1 -0
- package/dist/lib/pascalCase.d.ts +8 -0
- package/dist/lib/pascalCase.js +8 -0
- package/dist/lib/pascalCase.js.map +1 -0
- package/dist/lib/readJSONFile.cjs +26 -0
- package/dist/lib/readJSONFile.cjs.map +1 -0
- package/dist/lib/readJSONFile.d.ts +1 -0
- package/dist/lib/readJSONFile.js +9 -0
- package/dist/lib/readJSONFile.js.map +1 -0
- package/dist/lib/rejectIfNecessary.cjs +10 -0
- package/dist/lib/rejectIfNecessary.cjs.map +1 -0
- package/dist/lib/rejectIfNecessary.d.ts +1 -0
- package/dist/lib/rejectIfNecessary.js +10 -0
- package/dist/lib/rejectIfNecessary.js.map +1 -0
- package/dist/lib/updateSliceModelFile.cjs +33 -0
- package/dist/lib/updateSliceModelFile.cjs.map +1 -0
- package/dist/lib/updateSliceModelFile.d.ts +9 -0
- package/dist/lib/updateSliceModelFile.js +15 -0
- package/dist/lib/updateSliceModelFile.js.map +1 -0
- package/dist/lib/upsertGlobalContentTypes.cjs +55 -0
- package/dist/lib/upsertGlobalContentTypes.cjs.map +1 -0
- package/dist/lib/upsertGlobalContentTypes.d.ts +12 -0
- package/dist/lib/upsertGlobalContentTypes.js +37 -0
- package/dist/lib/upsertGlobalContentTypes.js.map +1 -0
- package/dist/lib/upsertSliceLibraryIndexFile.cjs +83 -0
- package/dist/lib/upsertSliceLibraryIndexFile.cjs.map +1 -0
- package/dist/lib/upsertSliceLibraryIndexFile.d.ts +7 -0
- package/dist/lib/upsertSliceLibraryIndexFile.js +65 -0
- package/dist/lib/upsertSliceLibraryIndexFile.js.map +1 -0
- package/dist/packages/adapter-nuxt/package.json.cjs +5 -0
- package/dist/packages/adapter-nuxt/package.json.cjs.map +1 -0
- package/dist/packages/adapter-nuxt/package.json.js +5 -0
- package/dist/packages/adapter-nuxt/package.json.js.map +1 -0
- package/dist/plugin.cjs +59 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.js +59 -0
- package/dist/plugin.js.map +1 -0
- package/dist/simulator/SliceSimulator.cjs +79 -0
- package/dist/simulator/SliceSimulator.cjs.map +1 -0
- package/dist/simulator/SliceSimulator.d.ts +34 -0
- package/dist/simulator/SliceSimulator.js +79 -0
- package/dist/simulator/SliceSimulator.js.map +1 -0
- package/dist/simulator/index.d.ts +2 -0
- package/dist/simulator.cjs +5 -0
- package/dist/simulator.cjs.map +1 -0
- package/dist/simulator.js +5 -0
- package/dist/simulator.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/package.json +107 -0
- package/src/constants.ts +5 -0
- package/src/hooks/customType-asset-delete.ts +18 -0
- package/src/hooks/customType-asset-read.ts +22 -0
- package/src/hooks/customType-asset-update.ts +20 -0
- package/src/hooks/customType-create.ts +45 -0
- package/src/hooks/customType-delete.ts +21 -0
- package/src/hooks/customType-read.ts +24 -0
- package/src/hooks/customType-rename.ts +3 -0
- package/src/hooks/customType-update.ts +3 -0
- package/src/hooks/customTypeLibrary-read.ts +53 -0
- package/src/hooks/project-init.ts +163 -0
- package/src/hooks/slice-asset-delete.ts +21 -0
- package/src/hooks/slice-asset-read.ts +25 -0
- package/src/hooks/slice-asset-update.ts +23 -0
- package/src/hooks/slice-create.ts +115 -0
- package/src/hooks/slice-delete.ts +41 -0
- package/src/hooks/slice-read.ts +69 -0
- package/src/hooks/slice-rename.ts +46 -0
- package/src/hooks/slice-update.ts +19 -0
- package/src/hooks/sliceLibrary-read.ts +48 -0
- package/src/hooks/sliceSimulator-setup-read.ts +209 -0
- package/src/hooks/snippet-read.ts +145 -0
- package/src/index.ts +4 -0
- package/src/lib/buildCustomTypeAssetPath.ts +24 -0
- package/src/lib/buildCustomTypeDirectoryPath.ts +20 -0
- package/src/lib/buildCustomTypeLibraryDirectoryPath.ts +13 -0
- package/src/lib/buildSliceAssetPath.ts +32 -0
- package/src/lib/buildSliceDirectoryPath.ts +26 -0
- package/src/lib/buildSliceLibraryDirectoryPath.ts +14 -0
- package/src/lib/checkIsTypeScriptProject.ts +17 -0
- package/src/lib/checkPathExists.ts +12 -0
- package/src/lib/isSharedSliceModel.ts +14 -0
- package/src/lib/pascalCase.ts +12 -0
- package/src/lib/readJSONFile.ts +7 -0
- package/src/lib/rejectIfNecessary.ts +16 -0
- package/src/lib/updateSliceModelFile.ts +33 -0
- package/src/lib/upsertGlobalContentTypes.ts +62 -0
- package/src/lib/upsertSliceLibraryIndexFile.ts +90 -0
- package/src/plugin.ts +63 -0
- package/src/simulator/SliceSimulator.ts +157 -0
- package/src/simulator/index.ts +2 -0
- package/src/types.ts +5 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { buildCustomTypeLibraryDirectoryPath } from "../lib/buildCustomTypeLibraryDirectoryPath.js";
|
|
4
|
+
import { readJSONFile } from "../lib/readJSONFile.js";
|
|
5
|
+
const isCustomTypeModel = (input) => {
|
|
6
|
+
return typeof input === "object" && input !== null && "json" in input;
|
|
7
|
+
};
|
|
8
|
+
const customTypeLibraryRead = async (_data, { helpers }) => {
|
|
9
|
+
const dirPath = buildCustomTypeLibraryDirectoryPath({ helpers });
|
|
10
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
11
|
+
const childDirs = await fs.readdir(dirPath);
|
|
12
|
+
const ids = [];
|
|
13
|
+
await Promise.all(childDirs.map(async (childDir) => {
|
|
14
|
+
const childDirContents = await fs.readdir(path.join(dirPath, childDir), {
|
|
15
|
+
withFileTypes: true
|
|
16
|
+
});
|
|
17
|
+
const isCustomTypeDir = childDirContents.some((entry) => {
|
|
18
|
+
return entry.isFile() && entry.name === "index.json";
|
|
19
|
+
});
|
|
20
|
+
if (isCustomTypeDir) {
|
|
21
|
+
const modelPath = path.join(dirPath, childDir, "index.json");
|
|
22
|
+
const modelContents = await readJSONFile(modelPath);
|
|
23
|
+
if (isCustomTypeModel(modelContents)) {
|
|
24
|
+
ids.push(modelContents.id);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
return {
|
|
29
|
+
ids: ids.sort()
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
customTypeLibraryRead
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=customTypeLibrary-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customTypeLibrary-read.js","sources":["../../../src/hooks/customTypeLibrary-read.ts"],"sourcesContent":["import type { CustomTypeLibraryReadHook } from \"@slicemachine/plugin-kit\";\nimport type { CustomType } from \"@prismicio/types-internal/lib/customtypes\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeLibraryDirectoryPath } from \"../lib/buildCustomTypeLibraryDirectoryPath\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst isCustomTypeModel = (\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tinput: any,\n): input is CustomType => {\n\treturn typeof input === \"object\" && input !== null && \"json\" in input;\n};\n\nexport const customTypeLibraryRead: CustomTypeLibraryReadHook<\n\tPluginOptions\n> = async (_data, { helpers }) => {\n\tconst dirPath = buildCustomTypeLibraryDirectoryPath({ helpers });\n\n\t// Ensure the directory exists.\n\tawait fs.mkdir(dirPath, { recursive: true });\n\n\tconst childDirs = await fs.readdir(dirPath);\n\n\tconst ids: string[] = [];\n\tawait Promise.all(\n\t\tchildDirs.map(async (childDir) => {\n\t\t\tconst childDirContents = await fs.readdir(path.join(dirPath, childDir), {\n\t\t\t\twithFileTypes: true,\n\t\t\t});\n\t\t\tconst isCustomTypeDir = childDirContents.some((entry) => {\n\t\t\t\treturn entry.isFile() && entry.name === \"index.json\";\n\t\t\t});\n\n\t\t\tif (isCustomTypeDir) {\n\t\t\t\tconst modelPath = path.join(dirPath, childDir, \"index.json\");\n\n\t\t\t\tconst modelContents = await readJSONFile(modelPath);\n\n\t\t\t\tif (isCustomTypeModel(modelContents)) {\n\t\t\t\t\tids.push(modelContents.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t);\n\n\treturn {\n\t\tids: ids.sort(),\n\t};\n};\n"],"names":[],"mappings":";;;;AAUA,MAAM,oBAAoB,CAEzB,UACwB;AACxB,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;AAEO,MAAM,wBAET,OAAO,OAAO,EAAE,cAAa;AAChC,QAAM,UAAU,oCAAoC,EAAE,QAAS,CAAA;AAG/D,QAAM,GAAG,MAAM,SAAS,EAAE,WAAW,MAAM;AAE3C,QAAM,YAAY,MAAM,GAAG,QAAQ,OAAO;AAE1C,QAAM,MAAgB,CAAA;AACtB,QAAM,QAAQ,IACb,UAAU,IAAI,OAAO,aAAY;AAC1B,UAAA,mBAAmB,MAAM,GAAG,QAAQ,KAAK,KAAK,SAAS,QAAQ,GAAG;AAAA,MACvE,eAAe;AAAA,IAAA,CACf;AACD,UAAM,kBAAkB,iBAAiB,KAAK,CAAC,UAAS;AACvD,aAAO,MAAM,OAAA,KAAY,MAAM,SAAS;AAAA,IAAA,CACxC;AAED,QAAI,iBAAiB;AACpB,YAAM,YAAY,KAAK,KAAK,SAAS,UAAU,YAAY;AAErD,YAAA,gBAAgB,MAAM,aAAa,SAAS;AAE9C,UAAA,kBAAkB,aAAa,GAAG;AACjC,YAAA,KAAK,cAAc,EAAE;AAAA,MACzB;AAAA,IACD;AAAA,EACD,CAAA,CAAC;AAGI,SAAA;AAAA,IACN,KAAK,IAAI,KAAM;AAAA,EAAA;AAEjB;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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 commonTags = require("common-tags");
|
|
6
|
+
const magicast = require("magicast");
|
|
7
|
+
const checkPathExists = require("../lib/checkPathExists.cjs");
|
|
8
|
+
const rejectIfNecessary = require("../lib/rejectIfNecessary.cjs");
|
|
9
|
+
const checkIsTypeScriptProject = require("../lib/checkIsTypeScriptProject.cjs");
|
|
10
|
+
function _interopNamespaceDefault(e) {
|
|
11
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
if (k !== "default") {
|
|
15
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: () => e[k]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
27
|
+
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
28
|
+
var __freeze = Object.freeze;
|
|
29
|
+
var __defProp = Object.defineProperty;
|
|
30
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
31
|
+
var _a;
|
|
32
|
+
const NUXT_PRISMIC = "@nuxtjs/prismic";
|
|
33
|
+
const installDependencies = async ({ installDependencies: installDependencies2 }) => {
|
|
34
|
+
try {
|
|
35
|
+
await installDependencies2({
|
|
36
|
+
dependencies: {
|
|
37
|
+
[NUXT_PRISMIC]: "^3.0.0"
|
|
38
|
+
},
|
|
39
|
+
dev: true
|
|
40
|
+
});
|
|
41
|
+
} catch (error) {
|
|
42
|
+
await installDependencies2({
|
|
43
|
+
dependencies: {
|
|
44
|
+
[NUXT_PRISMIC]: "rc"
|
|
45
|
+
},
|
|
46
|
+
dev: true
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const configurePrismicModule = async ({ helpers, project }) => {
|
|
51
|
+
let nuxtConfigPath = helpers.joinPathFromRoot("nuxt.config.js");
|
|
52
|
+
if (!await checkPathExists.checkPathExists(nuxtConfigPath)) {
|
|
53
|
+
nuxtConfigPath = helpers.joinPathFromRoot("nuxt.config.ts");
|
|
54
|
+
if (!await checkPathExists.checkPathExists(nuxtConfigPath)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const mod = await magicast.loadFile(nuxtConfigPath);
|
|
59
|
+
const config = mod.exports.default.$type === "function-call" ? mod.exports.default.$args[0] : mod.exports.default;
|
|
60
|
+
let hasInlinedConfiguration = false;
|
|
61
|
+
const hasPrismicModuleRegistered = (config.modules || []).find((registration) => {
|
|
62
|
+
if (typeof registration === "string") {
|
|
63
|
+
return registration === NUXT_PRISMIC;
|
|
64
|
+
} else if (Array.isArray(registration)) {
|
|
65
|
+
hasInlinedConfiguration = !!registration[1];
|
|
66
|
+
return registration[0] === NUXT_PRISMIC;
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
});
|
|
70
|
+
if (!hasPrismicModuleRegistered) {
|
|
71
|
+
config.modules || (config.modules = []);
|
|
72
|
+
config.modules.push(NUXT_PRISMIC);
|
|
73
|
+
}
|
|
74
|
+
const endpoint = project.config.repositoryName;
|
|
75
|
+
if (!hasInlinedConfiguration) {
|
|
76
|
+
config.prismic || (config.prismic = {});
|
|
77
|
+
config.prismic.endpoint = endpoint;
|
|
78
|
+
}
|
|
79
|
+
await magicast.writeFile(mod, nuxtConfigPath);
|
|
80
|
+
};
|
|
81
|
+
const createSliceSimulatorPage = async ({ helpers, options }) => {
|
|
82
|
+
const isTypeScriptProject = await checkIsTypeScriptProject.checkIsTypeScriptProject({
|
|
83
|
+
helpers,
|
|
84
|
+
options
|
|
85
|
+
});
|
|
86
|
+
const srcPagesDirectoryExists = await checkPathExists.checkPathExists(helpers.joinPathFromRoot("src/pages"));
|
|
87
|
+
const filePath = helpers.joinPathFromRoot(srcPagesDirectoryExists ? "src/pages" : "pages", "slice-simulator.vue");
|
|
88
|
+
if (await checkPathExists.checkPathExists(filePath)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
await fs__namespace.mkdir(path__namespace.dirname(filePath), { recursive: true });
|
|
92
|
+
const scriptAttributes = ["setup"];
|
|
93
|
+
if (isTypeScriptProject) {
|
|
94
|
+
scriptAttributes.push('lang="ts"');
|
|
95
|
+
}
|
|
96
|
+
let contents = commonTags.stripIndent(_a || (_a = __template(['\n <template>\n <SliceSimulator #default="{ slices }">\n <SliceZone :slices="slices" :components="components" />\n </SliceSimulator>\n </template>\n\n <script ', '>\n import { SliceSimulator } from "@slicemachine/adapter-nuxt/simulator";\n import { components } from "~/slices";\n <\/script>\n '])), scriptAttributes.join(" "));
|
|
97
|
+
if (options.format) {
|
|
98
|
+
contents = await helpers.format(contents, filePath, {
|
|
99
|
+
prettier: { parser: "vue" }
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
await fs__namespace.writeFile(filePath, contents);
|
|
103
|
+
};
|
|
104
|
+
const projectInit = async ({ installDependencies: _installDependencies }, context) => {
|
|
105
|
+
rejectIfNecessary.rejectIfNecessary(await Promise.allSettled([
|
|
106
|
+
await installDependencies({ installDependencies: _installDependencies }),
|
|
107
|
+
await configurePrismicModule(context),
|
|
108
|
+
await createSliceSimulatorPage(context)
|
|
109
|
+
]));
|
|
110
|
+
};
|
|
111
|
+
exports.projectInit = projectInit;
|
|
112
|
+
//# sourceMappingURL=project-init.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-init.cjs","sources":["../../../src/hooks/project-init.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport type {\n\tProjectInitHook,\n\tProjectInitHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\nimport { loadFile, writeFile, type ASTNode } from \"magicast\";\n\nimport { checkPathExists } from \"../lib/checkPathExists\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst NUXT_PRISMIC = \"@nuxtjs/prismic\";\n\ntype InstallDependenciesArgs = {\n\tinstallDependencies: ProjectInitHookData[\"installDependencies\"];\n};\n\nconst installDependencies = async ({\n\tinstallDependencies,\n}: InstallDependenciesArgs) => {\n\ttry {\n\t\tawait installDependencies({\n\t\t\tdependencies: {\n\t\t\t\t[NUXT_PRISMIC]: \"^3.0.0\",\n\t\t\t},\n\t\t\tdev: true,\n\t\t});\n\t} catch (error) {\n\t\t// TODO: Remove when latest is published and documented\n\t\t// Fallback to RC if latest is still not available\n\t\tawait installDependencies({\n\t\t\tdependencies: {\n\t\t\t\t[NUXT_PRISMIC]: \"rc\",\n\t\t\t},\n\t\t\tdev: true,\n\t\t});\n\t}\n};\n\ntype ConfigurePrismicModuleArgs = SliceMachineContext<PluginOptions>;\n\nconst configurePrismicModule = async ({\n\thelpers,\n\tproject,\n}: ConfigurePrismicModuleArgs) => {\n\tlet nuxtConfigPath = helpers.joinPathFromRoot(\"nuxt.config.js\");\n\n\tif (!(await checkPathExists(nuxtConfigPath))) {\n\t\tnuxtConfigPath = helpers.joinPathFromRoot(\"nuxt.config.ts\");\n\n\t\t// nuxt.config.* not found\n\t\tif (!(await checkPathExists(nuxtConfigPath))) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst mod = await loadFile(nuxtConfigPath);\n\tconst config =\n\t\tmod.exports.default.$type === \"function-call\"\n\t\t\t? mod.exports.default.$args[0]\n\t\t\t: mod.exports.default;\n\n\t// Register Prismic module\n\tlet hasInlinedConfiguration = false;\n\tconst hasPrismicModuleRegistered = (config.modules || []).find(\n\t\t(registration: string | [string, unknown]) => {\n\t\t\tif (typeof registration === \"string\") {\n\t\t\t\treturn registration === NUXT_PRISMIC;\n\t\t\t} else if (Array.isArray(registration)) {\n\t\t\t\thasInlinedConfiguration = !!registration[1];\n\n\t\t\t\treturn registration[0] === NUXT_PRISMIC;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\t);\n\n\tif (!hasPrismicModuleRegistered) {\n\t\tconfig.modules ||= [];\n\t\tconfig.modules.push(NUXT_PRISMIC);\n\t}\n\n\t// Append Prismic module configuration\n\tconst endpoint = project.config.repositoryName;\n\tif (!hasInlinedConfiguration) {\n\t\tconfig.prismic ||= {};\n\t\tconfig.prismic.endpoint = endpoint;\n\t}\n\n\tawait writeFile(mod as unknown as ASTNode, nuxtConfigPath);\n};\n\ntype CreateSliceSimulatorPageArgs = SliceMachineContext<PluginOptions>;\n\nconst createSliceSimulatorPage = async ({\n\thelpers,\n\toptions,\n}: CreateSliceSimulatorPageArgs) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\n\tconst srcPagesDirectoryExists = await checkPathExists(\n\t\thelpers.joinPathFromRoot(\"src/pages\"),\n\t);\n\n\tconst filePath = helpers.joinPathFromRoot(\n\t\tsrcPagesDirectoryExists ? \"src/pages\" : \"pages\",\n\t\t\"slice-simulator.vue\",\n\t);\n\n\tif (await checkPathExists(filePath)) {\n\t\treturn;\n\t}\n\n\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\n\tconst scriptAttributes = [\"setup\"];\n\tif (isTypeScriptProject) {\n\t\tscriptAttributes.push('lang=\"ts\"');\n\t}\n\n\tlet contents = stripIndent`\n\t\t<template>\n\t\t\t<SliceSimulator #default=\"{ slices }\">\n\t\t\t\t<SliceZone :slices=\"slices\" :components=\"components\" />\n\t\t\t</SliceSimulator>\n\t\t</template>\n\n\t\t<script ${scriptAttributes.join(\" \")}>\n\t\timport { SliceSimulator } from \"@slicemachine/adapter-nuxt/simulator\";\n\t\timport { components } from \"~/slices\";\n\t\t</script>\n\t`;\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath, {\n\t\t\tprettier: { parser: \"vue\" },\n\t\t});\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n\nexport const projectInit: ProjectInitHook<PluginOptions> = async (\n\t{ installDependencies: _installDependencies },\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tawait installDependencies({ installDependencies: _installDependencies }),\n\t\t\tawait configurePrismicModule(context),\n\t\t\tawait createSliceSimulatorPage(context),\n\t\t]),\n\t);\n};\n"],"names":["installDependencies","checkPathExists","loadFile","writeFile","checkIsTypeScriptProject","fs","path","stripIndent","rejectIfNecessary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AAgBA,MAAM,eAAe;AAMrB,MAAM,sBAAsB,OAAO,EAClC,qBAAAA,2BAC6B;AACzB,MAAA;AACH,UAAMA,qBAAoB;AAAA,MACzB,cAAc;AAAA,QACb,CAAC,YAAY,GAAG;AAAA,MAChB;AAAA,MACD,KAAK;AAAA,IAAA,CACL;AAAA,WACO;AAGR,UAAMA,qBAAoB;AAAA,MACzB,cAAc;AAAA,QACb,CAAC,YAAY,GAAG;AAAA,MAChB;AAAA,MACD,KAAK;AAAA,IAAA,CACL;AAAA,EACD;AACF;AAIA,MAAM,yBAAyB,OAAO,EACrC,SACA,cACgC;AAC5B,MAAA,iBAAiB,QAAQ,iBAAiB,gBAAgB;AAE9D,MAAI,CAAE,MAAMC,gCAAgB,cAAc,GAAI;AAC5B,qBAAA,QAAQ,iBAAiB,gBAAgB;AAG1D,QAAI,CAAE,MAAMA,gCAAgB,cAAc,GAAI;AAC7C;AAAA,IACA;AAAA,EACD;AAEK,QAAA,MAAM,MAAMC,kBAAS,cAAc;AACzC,QAAM,SACL,IAAI,QAAQ,QAAQ,UAAU,kBAC3B,IAAI,QAAQ,QAAQ,MAAM,CAAC,IAC3B,IAAI,QAAQ;AAGhB,MAAI,0BAA0B;AAC9B,QAAM,8BAA8B,OAAO,WAAW,CAAA,GAAI,KACzD,CAAC,iBAA4C;AACxC,QAAA,OAAO,iBAAiB,UAAU;AACrC,aAAO,iBAAiB;AAAA,IACd,WAAA,MAAM,QAAQ,YAAY,GAAG;AACb,gCAAA,CAAC,CAAC,aAAa,CAAC;AAEnC,aAAA,aAAa,CAAC,MAAM;AAAA,IAC3B;AAEM,WAAA;AAAA,EAAA,CACP;AAGF,MAAI,CAAC,4BAA4B;AAChC,WAAO,YAAP,OAAO,UAAY;AACZ,WAAA,QAAQ,KAAK,YAAY;AAAA,EAChC;AAGK,QAAA,WAAW,QAAQ,OAAO;AAChC,MAAI,CAAC,yBAAyB;AAC7B,WAAO,YAAP,OAAO,UAAY;AACnB,WAAO,QAAQ,WAAW;AAAA,EAC1B;AAEK,QAAAC,SAAA,UAAU,KAA2B,cAAc;AAC1D;AAIA,MAAM,2BAA2B,OAAO,EACvC,SACA,cACkC;AAC5B,QAAA,sBAAsB,MAAMC,kDAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AAED,QAAM,0BAA0B,MAAMH,gBAAA,gBACrC,QAAQ,iBAAiB,WAAW,CAAC;AAGtC,QAAM,WAAW,QAAQ,iBACxB,0BAA0B,cAAc,SACxC,qBAAqB;AAGlB,MAAA,MAAMA,gBAAAA,gBAAgB,QAAQ,GAAG;AACpC;AAAA,EACA;AAEK,QAAAI,cAAG,MAAMC,gBAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAA,CAAM;AAEpD,QAAA,mBAAmB,CAAC,OAAO;AACjC,MAAI,qBAAqB;AACxB,qBAAiB,KAAK,WAAW;AAAA,EACjC;AAED,MAAI,WAAWC,WAAW,YAAA,OAAA,KAAA,WAAA,CAAA,6KAOW,wIAA1B,CAAA,IAAA,iBAAiB,KAAK,GAAG,CAAA;AAMpC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,UAAU;AAAA,MACnD,UAAU,EAAE,QAAQ,MAAO;AAAA,IAAA,CAC3B;AAAA,EACD;AAEK,QAAAF,cAAG,UAAU,UAAU,QAAQ;AACtC;AAEO,MAAM,cAA8C,OAC1D,EAAE,qBAAqB,qBAAA,GACvB,YACG;AAEFG,sCAAA,MAAM,QAAQ,WAAW;AAAA,IACxB,MAAM,oBAAoB,EAAE,qBAAqB,sBAAsB;AAAA,IACvE,MAAM,uBAAuB,OAAO;AAAA,IACpC,MAAM,yBAAyB,OAAO;AAAA,EACtC,CAAA,CAAC;AAEJ;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { stripIndent } from "common-tags";
|
|
4
|
+
import { loadFile, writeFile } from "magicast";
|
|
5
|
+
import { checkPathExists } from "../lib/checkPathExists.js";
|
|
6
|
+
import { rejectIfNecessary } from "../lib/rejectIfNecessary.js";
|
|
7
|
+
import { checkIsTypeScriptProject } from "../lib/checkIsTypeScriptProject.js";
|
|
8
|
+
var __freeze = Object.freeze;
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
11
|
+
var _a;
|
|
12
|
+
const NUXT_PRISMIC = "@nuxtjs/prismic";
|
|
13
|
+
const installDependencies = async ({ installDependencies: installDependencies2 }) => {
|
|
14
|
+
try {
|
|
15
|
+
await installDependencies2({
|
|
16
|
+
dependencies: {
|
|
17
|
+
[NUXT_PRISMIC]: "^3.0.0"
|
|
18
|
+
},
|
|
19
|
+
dev: true
|
|
20
|
+
});
|
|
21
|
+
} catch (error) {
|
|
22
|
+
await installDependencies2({
|
|
23
|
+
dependencies: {
|
|
24
|
+
[NUXT_PRISMIC]: "rc"
|
|
25
|
+
},
|
|
26
|
+
dev: true
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const configurePrismicModule = async ({ helpers, project }) => {
|
|
31
|
+
let nuxtConfigPath = helpers.joinPathFromRoot("nuxt.config.js");
|
|
32
|
+
if (!await checkPathExists(nuxtConfigPath)) {
|
|
33
|
+
nuxtConfigPath = helpers.joinPathFromRoot("nuxt.config.ts");
|
|
34
|
+
if (!await checkPathExists(nuxtConfigPath)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const mod = await loadFile(nuxtConfigPath);
|
|
39
|
+
const config = mod.exports.default.$type === "function-call" ? mod.exports.default.$args[0] : mod.exports.default;
|
|
40
|
+
let hasInlinedConfiguration = false;
|
|
41
|
+
const hasPrismicModuleRegistered = (config.modules || []).find((registration) => {
|
|
42
|
+
if (typeof registration === "string") {
|
|
43
|
+
return registration === NUXT_PRISMIC;
|
|
44
|
+
} else if (Array.isArray(registration)) {
|
|
45
|
+
hasInlinedConfiguration = !!registration[1];
|
|
46
|
+
return registration[0] === NUXT_PRISMIC;
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
});
|
|
50
|
+
if (!hasPrismicModuleRegistered) {
|
|
51
|
+
config.modules || (config.modules = []);
|
|
52
|
+
config.modules.push(NUXT_PRISMIC);
|
|
53
|
+
}
|
|
54
|
+
const endpoint = project.config.repositoryName;
|
|
55
|
+
if (!hasInlinedConfiguration) {
|
|
56
|
+
config.prismic || (config.prismic = {});
|
|
57
|
+
config.prismic.endpoint = endpoint;
|
|
58
|
+
}
|
|
59
|
+
await writeFile(mod, nuxtConfigPath);
|
|
60
|
+
};
|
|
61
|
+
const createSliceSimulatorPage = async ({ helpers, options }) => {
|
|
62
|
+
const isTypeScriptProject = await checkIsTypeScriptProject({
|
|
63
|
+
helpers,
|
|
64
|
+
options
|
|
65
|
+
});
|
|
66
|
+
const srcPagesDirectoryExists = await checkPathExists(helpers.joinPathFromRoot("src/pages"));
|
|
67
|
+
const filePath = helpers.joinPathFromRoot(srcPagesDirectoryExists ? "src/pages" : "pages", "slice-simulator.vue");
|
|
68
|
+
if (await checkPathExists(filePath)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
72
|
+
const scriptAttributes = ["setup"];
|
|
73
|
+
if (isTypeScriptProject) {
|
|
74
|
+
scriptAttributes.push('lang="ts"');
|
|
75
|
+
}
|
|
76
|
+
let contents = stripIndent(_a || (_a = __template(['\n <template>\n <SliceSimulator #default="{ slices }">\n <SliceZone :slices="slices" :components="components" />\n </SliceSimulator>\n </template>\n\n <script ', '>\n import { SliceSimulator } from "@slicemachine/adapter-nuxt/simulator";\n import { components } from "~/slices";\n <\/script>\n '])), scriptAttributes.join(" "));
|
|
77
|
+
if (options.format) {
|
|
78
|
+
contents = await helpers.format(contents, filePath, {
|
|
79
|
+
prettier: { parser: "vue" }
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
await fs.writeFile(filePath, contents);
|
|
83
|
+
};
|
|
84
|
+
const projectInit = async ({ installDependencies: _installDependencies }, context) => {
|
|
85
|
+
rejectIfNecessary(await Promise.allSettled([
|
|
86
|
+
await installDependencies({ installDependencies: _installDependencies }),
|
|
87
|
+
await configurePrismicModule(context),
|
|
88
|
+
await createSliceSimulatorPage(context)
|
|
89
|
+
]));
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
projectInit
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=project-init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-init.js","sources":["../../../src/hooks/project-init.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport type {\n\tProjectInitHook,\n\tProjectInitHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\nimport { loadFile, writeFile, type ASTNode } from \"magicast\";\n\nimport { checkPathExists } from \"../lib/checkPathExists\";\nimport { rejectIfNecessary } from \"../lib/rejectIfNecessary\";\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst NUXT_PRISMIC = \"@nuxtjs/prismic\";\n\ntype InstallDependenciesArgs = {\n\tinstallDependencies: ProjectInitHookData[\"installDependencies\"];\n};\n\nconst installDependencies = async ({\n\tinstallDependencies,\n}: InstallDependenciesArgs) => {\n\ttry {\n\t\tawait installDependencies({\n\t\t\tdependencies: {\n\t\t\t\t[NUXT_PRISMIC]: \"^3.0.0\",\n\t\t\t},\n\t\t\tdev: true,\n\t\t});\n\t} catch (error) {\n\t\t// TODO: Remove when latest is published and documented\n\t\t// Fallback to RC if latest is still not available\n\t\tawait installDependencies({\n\t\t\tdependencies: {\n\t\t\t\t[NUXT_PRISMIC]: \"rc\",\n\t\t\t},\n\t\t\tdev: true,\n\t\t});\n\t}\n};\n\ntype ConfigurePrismicModuleArgs = SliceMachineContext<PluginOptions>;\n\nconst configurePrismicModule = async ({\n\thelpers,\n\tproject,\n}: ConfigurePrismicModuleArgs) => {\n\tlet nuxtConfigPath = helpers.joinPathFromRoot(\"nuxt.config.js\");\n\n\tif (!(await checkPathExists(nuxtConfigPath))) {\n\t\tnuxtConfigPath = helpers.joinPathFromRoot(\"nuxt.config.ts\");\n\n\t\t// nuxt.config.* not found\n\t\tif (!(await checkPathExists(nuxtConfigPath))) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst mod = await loadFile(nuxtConfigPath);\n\tconst config =\n\t\tmod.exports.default.$type === \"function-call\"\n\t\t\t? mod.exports.default.$args[0]\n\t\t\t: mod.exports.default;\n\n\t// Register Prismic module\n\tlet hasInlinedConfiguration = false;\n\tconst hasPrismicModuleRegistered = (config.modules || []).find(\n\t\t(registration: string | [string, unknown]) => {\n\t\t\tif (typeof registration === \"string\") {\n\t\t\t\treturn registration === NUXT_PRISMIC;\n\t\t\t} else if (Array.isArray(registration)) {\n\t\t\t\thasInlinedConfiguration = !!registration[1];\n\n\t\t\t\treturn registration[0] === NUXT_PRISMIC;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\t);\n\n\tif (!hasPrismicModuleRegistered) {\n\t\tconfig.modules ||= [];\n\t\tconfig.modules.push(NUXT_PRISMIC);\n\t}\n\n\t// Append Prismic module configuration\n\tconst endpoint = project.config.repositoryName;\n\tif (!hasInlinedConfiguration) {\n\t\tconfig.prismic ||= {};\n\t\tconfig.prismic.endpoint = endpoint;\n\t}\n\n\tawait writeFile(mod as unknown as ASTNode, nuxtConfigPath);\n};\n\ntype CreateSliceSimulatorPageArgs = SliceMachineContext<PluginOptions>;\n\nconst createSliceSimulatorPage = async ({\n\thelpers,\n\toptions,\n}: CreateSliceSimulatorPageArgs) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\n\tconst srcPagesDirectoryExists = await checkPathExists(\n\t\thelpers.joinPathFromRoot(\"src/pages\"),\n\t);\n\n\tconst filePath = helpers.joinPathFromRoot(\n\t\tsrcPagesDirectoryExists ? \"src/pages\" : \"pages\",\n\t\t\"slice-simulator.vue\",\n\t);\n\n\tif (await checkPathExists(filePath)) {\n\t\treturn;\n\t}\n\n\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\n\tconst scriptAttributes = [\"setup\"];\n\tif (isTypeScriptProject) {\n\t\tscriptAttributes.push('lang=\"ts\"');\n\t}\n\n\tlet contents = stripIndent`\n\t\t<template>\n\t\t\t<SliceSimulator #default=\"{ slices }\">\n\t\t\t\t<SliceZone :slices=\"slices\" :components=\"components\" />\n\t\t\t</SliceSimulator>\n\t\t</template>\n\n\t\t<script ${scriptAttributes.join(\" \")}>\n\t\timport { SliceSimulator } from \"@slicemachine/adapter-nuxt/simulator\";\n\t\timport { components } from \"~/slices\";\n\t\t</script>\n\t`;\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath, {\n\t\t\tprettier: { parser: \"vue\" },\n\t\t});\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n\nexport const projectInit: ProjectInitHook<PluginOptions> = async (\n\t{ installDependencies: _installDependencies },\n\tcontext,\n) => {\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tawait installDependencies({ installDependencies: _installDependencies }),\n\t\t\tawait configurePrismicModule(context),\n\t\t\tawait createSliceSimulatorPage(context),\n\t\t]),\n\t);\n};\n"],"names":["installDependencies"],"mappings":";;;;;;;;;;AAAA,IAAA;AAgBA,MAAM,eAAe;AAMrB,MAAM,sBAAsB,OAAO,EAClC,qBAAAA,2BAC6B;AACzB,MAAA;AACH,UAAMA,qBAAoB;AAAA,MACzB,cAAc;AAAA,QACb,CAAC,YAAY,GAAG;AAAA,MAChB;AAAA,MACD,KAAK;AAAA,IAAA,CACL;AAAA,WACO;AAGR,UAAMA,qBAAoB;AAAA,MACzB,cAAc;AAAA,QACb,CAAC,YAAY,GAAG;AAAA,MAChB;AAAA,MACD,KAAK;AAAA,IAAA,CACL;AAAA,EACD;AACF;AAIA,MAAM,yBAAyB,OAAO,EACrC,SACA,cACgC;AAC5B,MAAA,iBAAiB,QAAQ,iBAAiB,gBAAgB;AAE9D,MAAI,CAAE,MAAM,gBAAgB,cAAc,GAAI;AAC5B,qBAAA,QAAQ,iBAAiB,gBAAgB;AAG1D,QAAI,CAAE,MAAM,gBAAgB,cAAc,GAAI;AAC7C;AAAA,IACA;AAAA,EACD;AAEK,QAAA,MAAM,MAAM,SAAS,cAAc;AACzC,QAAM,SACL,IAAI,QAAQ,QAAQ,UAAU,kBAC3B,IAAI,QAAQ,QAAQ,MAAM,CAAC,IAC3B,IAAI,QAAQ;AAGhB,MAAI,0BAA0B;AAC9B,QAAM,8BAA8B,OAAO,WAAW,CAAA,GAAI,KACzD,CAAC,iBAA4C;AACxC,QAAA,OAAO,iBAAiB,UAAU;AACrC,aAAO,iBAAiB;AAAA,IACd,WAAA,MAAM,QAAQ,YAAY,GAAG;AACb,gCAAA,CAAC,CAAC,aAAa,CAAC;AAEnC,aAAA,aAAa,CAAC,MAAM;AAAA,IAC3B;AAEM,WAAA;AAAA,EAAA,CACP;AAGF,MAAI,CAAC,4BAA4B;AAChC,WAAO,YAAP,OAAO,UAAY;AACZ,WAAA,QAAQ,KAAK,YAAY;AAAA,EAChC;AAGK,QAAA,WAAW,QAAQ,OAAO;AAChC,MAAI,CAAC,yBAAyB;AAC7B,WAAO,YAAP,OAAO,UAAY;AACnB,WAAO,QAAQ,WAAW;AAAA,EAC1B;AAEK,QAAA,UAAU,KAA2B,cAAc;AAC1D;AAIA,MAAM,2BAA2B,OAAO,EACvC,SACA,cACkC;AAC5B,QAAA,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AAED,QAAM,0BAA0B,MAAM,gBACrC,QAAQ,iBAAiB,WAAW,CAAC;AAGtC,QAAM,WAAW,QAAQ,iBACxB,0BAA0B,cAAc,SACxC,qBAAqB;AAGlB,MAAA,MAAM,gBAAgB,QAAQ,GAAG;AACpC;AAAA,EACA;AAEK,QAAA,GAAG,MAAM,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAA,CAAM;AAEpD,QAAA,mBAAmB,CAAC,OAAO;AACjC,MAAI,qBAAqB;AACxB,qBAAiB,KAAK,WAAW;AAAA,EACjC;AAED,MAAI,WAAW,YAAW,OAAA,KAAA,WAAA,CAAA,6KAOW,wIAA1B,CAAA,IAAA,iBAAiB,KAAK,GAAG,CAAA;AAMpC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,UAAU;AAAA,MACnD,UAAU,EAAE,QAAQ,MAAO;AAAA,IAAA,CAC3B;AAAA,EACD;AAEK,QAAA,GAAG,UAAU,UAAU,QAAQ;AACtC;AAEO,MAAM,cAA8C,OAC1D,EAAE,qBAAqB,qBAAA,GACvB,YACG;AAEF,oBAAA,MAAM,QAAQ,WAAW;AAAA,IACxB,MAAM,oBAAoB,EAAE,qBAAqB,sBAAsB;AAAA,IACvE,MAAM,uBAAuB,OAAO;AAAA,IACpC,MAAM,yBAAyB,OAAO;AAAA,EACtC,CAAA,CAAC;AAEJ;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fs = require("node:fs/promises");
|
|
4
|
+
const buildSliceAssetPath = require("../lib/buildSliceAssetPath.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 fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
22
|
+
const sliceAssetDelete = async (data, context) => {
|
|
23
|
+
const filePath = await buildSliceAssetPath.buildSliceAssetPath({
|
|
24
|
+
libraryID: data.libraryID,
|
|
25
|
+
sliceID: data.sliceID,
|
|
26
|
+
assetID: data.assetID,
|
|
27
|
+
helpers: context.helpers,
|
|
28
|
+
actions: context.actions
|
|
29
|
+
});
|
|
30
|
+
await fs__namespace.rm(filePath);
|
|
31
|
+
};
|
|
32
|
+
exports.sliceAssetDelete = sliceAssetDelete;
|
|
33
|
+
//# sourceMappingURL=slice-asset-delete.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-asset-delete.cjs","sources":["../../../src/hooks/slice-asset-delete.ts"],"sourcesContent":["import type { SliceAssetDeleteHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildSliceAssetPath } from \"../lib/buildSliceAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceAssetDelete: SliceAssetDeleteHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst filePath = await buildSliceAssetPath({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.sliceID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t\tactions: context.actions,\n\t});\n\n\tawait fs.rm(filePath);\n};\n"],"names":["buildSliceAssetPath","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOa,MAAA,mBAAwD,OACpE,MACA,YACG;AACG,QAAA,WAAW,MAAMA,wCAAoB;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAAC,cAAG,GAAG,QAAQ;AACrB;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import { buildSliceAssetPath } from "../lib/buildSliceAssetPath.js";
|
|
3
|
+
const sliceAssetDelete = async (data, context) => {
|
|
4
|
+
const filePath = await buildSliceAssetPath({
|
|
5
|
+
libraryID: data.libraryID,
|
|
6
|
+
sliceID: data.sliceID,
|
|
7
|
+
assetID: data.assetID,
|
|
8
|
+
helpers: context.helpers,
|
|
9
|
+
actions: context.actions
|
|
10
|
+
});
|
|
11
|
+
await fs.rm(filePath);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
sliceAssetDelete
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=slice-asset-delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-asset-delete.js","sources":["../../../src/hooks/slice-asset-delete.ts"],"sourcesContent":["import type { SliceAssetDeleteHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildSliceAssetPath } from \"../lib/buildSliceAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceAssetDelete: SliceAssetDeleteHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst filePath = await buildSliceAssetPath({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.sliceID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t\tactions: context.actions,\n\t});\n\n\tawait fs.rm(filePath);\n};\n"],"names":[],"mappings":";;AAOa,MAAA,mBAAwD,OACpE,MACA,YACG;AACG,QAAA,WAAW,MAAM,oBAAoB;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAA,GAAG,GAAG,QAAQ;AACrB;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fs = require("node:fs/promises");
|
|
4
|
+
const buildSliceAssetPath = require("../lib/buildSliceAssetPath.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 fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
22
|
+
const sliceAssetRead = async (data, context) => {
|
|
23
|
+
const filePath = await buildSliceAssetPath.buildSliceAssetPath({
|
|
24
|
+
libraryID: data.libraryID,
|
|
25
|
+
sliceID: data.sliceID,
|
|
26
|
+
assetID: data.assetID,
|
|
27
|
+
helpers: context.helpers,
|
|
28
|
+
actions: context.actions
|
|
29
|
+
});
|
|
30
|
+
const assetData = await fs__namespace.readFile(filePath);
|
|
31
|
+
return {
|
|
32
|
+
data: assetData
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
exports.sliceAssetRead = sliceAssetRead;
|
|
36
|
+
//# sourceMappingURL=slice-asset-read.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-asset-read.cjs","sources":["../../../src/hooks/slice-asset-read.ts"],"sourcesContent":["import type { SliceAssetReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildSliceAssetPath } from \"../lib/buildSliceAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceAssetRead: SliceAssetReadHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst filePath = await buildSliceAssetPath({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.sliceID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t\tactions: context.actions,\n\t});\n\n\tconst assetData = await fs.readFile(filePath);\n\n\treturn {\n\t\tdata: assetData,\n\t};\n};\n"],"names":["buildSliceAssetPath","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOa,MAAA,iBAAoD,OAChE,MACA,YACG;AACG,QAAA,WAAW,MAAMA,wCAAoB;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAM,YAAY,MAAMC,cAAG,SAAS,QAAQ;AAErC,SAAA;AAAA,IACN,MAAM;AAAA,EAAA;AAER;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import { buildSliceAssetPath } from "../lib/buildSliceAssetPath.js";
|
|
3
|
+
const sliceAssetRead = async (data, context) => {
|
|
4
|
+
const filePath = await buildSliceAssetPath({
|
|
5
|
+
libraryID: data.libraryID,
|
|
6
|
+
sliceID: data.sliceID,
|
|
7
|
+
assetID: data.assetID,
|
|
8
|
+
helpers: context.helpers,
|
|
9
|
+
actions: context.actions
|
|
10
|
+
});
|
|
11
|
+
const assetData = await fs.readFile(filePath);
|
|
12
|
+
return {
|
|
13
|
+
data: assetData
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
sliceAssetRead
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=slice-asset-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-asset-read.js","sources":["../../../src/hooks/slice-asset-read.ts"],"sourcesContent":["import type { SliceAssetReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildSliceAssetPath } from \"../lib/buildSliceAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceAssetRead: SliceAssetReadHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst filePath = await buildSliceAssetPath({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.sliceID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t\tactions: context.actions,\n\t});\n\n\tconst assetData = await fs.readFile(filePath);\n\n\treturn {\n\t\tdata: assetData,\n\t};\n};\n"],"names":[],"mappings":";;AAOa,MAAA,iBAAoD,OAChE,MACA,YACG;AACG,QAAA,WAAW,MAAM,oBAAoB;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAM,YAAY,MAAM,GAAG,SAAS,QAAQ;AAErC,SAAA;AAAA,IACN,MAAM;AAAA,EAAA;AAER;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 buildSliceAssetPath = require("../lib/buildSliceAssetPath.cjs");
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
+
if (e) {
|
|
9
|
+
for (const k in e) {
|
|
10
|
+
if (k !== "default") {
|
|
11
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: () => e[k]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
23
|
+
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
24
|
+
const sliceAssetUpdate = async (data, context) => {
|
|
25
|
+
const filePath = await buildSliceAssetPath.buildSliceAssetPath({
|
|
26
|
+
libraryID: data.libraryID,
|
|
27
|
+
sliceID: data.sliceID,
|
|
28
|
+
assetID: data.asset.id,
|
|
29
|
+
helpers: context.helpers,
|
|
30
|
+
actions: context.actions
|
|
31
|
+
});
|
|
32
|
+
await fs__namespace.mkdir(path__namespace.dirname(filePath), { recursive: true });
|
|
33
|
+
await fs__namespace.writeFile(filePath, data.asset.data);
|
|
34
|
+
};
|
|
35
|
+
exports.sliceAssetUpdate = sliceAssetUpdate;
|
|
36
|
+
//# sourceMappingURL=slice-asset-update.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-asset-update.cjs","sources":["../../../src/hooks/slice-asset-update.ts"],"sourcesContent":["import type { SliceAssetUpdateHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildSliceAssetPath } from \"../lib/buildSliceAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceAssetUpdate: SliceAssetUpdateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst filePath = await buildSliceAssetPath({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.sliceID,\n\t\tassetID: data.asset.id,\n\t\thelpers: context.helpers,\n\t\tactions: context.actions,\n\t});\n\n\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\tawait fs.writeFile(filePath, data.asset.data);\n};\n"],"names":["buildSliceAssetPath","fs","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQa,MAAA,mBAAwD,OACpE,MACA,YACG;AACG,QAAA,WAAW,MAAMA,wCAAoB;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,IACd,SAAS,KAAK,MAAM;AAAA,IACpB,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAAC,cAAG,MAAMC,gBAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAA,CAAM;AAC1D,QAAMD,cAAG,UAAU,UAAU,KAAK,MAAM,IAAI;AAC7C;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as fs from "node:fs/promises";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { buildSliceAssetPath } from "../lib/buildSliceAssetPath.js";
|
|
4
|
+
const sliceAssetUpdate = async (data, context) => {
|
|
5
|
+
const filePath = await buildSliceAssetPath({
|
|
6
|
+
libraryID: data.libraryID,
|
|
7
|
+
sliceID: data.sliceID,
|
|
8
|
+
assetID: data.asset.id,
|
|
9
|
+
helpers: context.helpers,
|
|
10
|
+
actions: context.actions
|
|
11
|
+
});
|
|
12
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
13
|
+
await fs.writeFile(filePath, data.asset.data);
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
sliceAssetUpdate
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=slice-asset-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-asset-update.js","sources":["../../../src/hooks/slice-asset-update.ts"],"sourcesContent":["import type { SliceAssetUpdateHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildSliceAssetPath } from \"../lib/buildSliceAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const sliceAssetUpdate: SliceAssetUpdateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst filePath = await buildSliceAssetPath({\n\t\tlibraryID: data.libraryID,\n\t\tsliceID: data.sliceID,\n\t\tassetID: data.asset.id,\n\t\thelpers: context.helpers,\n\t\tactions: context.actions,\n\t});\n\n\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\tawait fs.writeFile(filePath, data.asset.data);\n};\n"],"names":[],"mappings":";;;AAQa,MAAA,mBAAwD,OACpE,MACA,YACG;AACG,QAAA,WAAW,MAAM,oBAAoB;AAAA,IAC1C,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,IACd,SAAS,KAAK,MAAM;AAAA,IACpB,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAA,GAAG,MAAM,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAA,CAAM;AAC1D,QAAM,GAAG,UAAU,UAAU,KAAK,MAAM,IAAI;AAC7C;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const commonTags = require("common-tags");
|
|
4
|
+
const fs = require("node:fs/promises");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const buildSliceDirectoryPath = require("../lib/buildSliceDirectoryPath.cjs");
|
|
7
|
+
const rejectIfNecessary = require("../lib/rejectIfNecessary.cjs");
|
|
8
|
+
const updateSliceModelFile = require("../lib/updateSliceModelFile.cjs");
|
|
9
|
+
const upsertGlobalContentTypes = require("../lib/upsertGlobalContentTypes.cjs");
|
|
10
|
+
const upsertSliceLibraryIndexFile = require("../lib/upsertSliceLibraryIndexFile.cjs");
|
|
11
|
+
const checkIsTypeScriptProject = require("../lib/checkIsTypeScriptProject.cjs");
|
|
12
|
+
const pascalCase = require("../lib/pascalCase.cjs");
|
|
13
|
+
function _interopNamespaceDefault(e) {
|
|
14
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
15
|
+
if (e) {
|
|
16
|
+
for (const k in e) {
|
|
17
|
+
if (k !== "default") {
|
|
18
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: () => e[k]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
30
|
+
const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
|
|
31
|
+
var __freeze = Object.freeze;
|
|
32
|
+
var __defProp = Object.defineProperty;
|
|
33
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const createComponentFile = async ({ dir, data, helpers, options }) => {
|
|
36
|
+
const filePath = path__namespace.join(dir, "index.vue");
|
|
37
|
+
const model = data.model;
|
|
38
|
+
const pascalName = pascalCase.pascalCase(model.name);
|
|
39
|
+
let contents;
|
|
40
|
+
const isTypeScriptProject = await checkIsTypeScriptProject.checkIsTypeScriptProject({
|
|
41
|
+
helpers,
|
|
42
|
+
options
|
|
43
|
+
});
|
|
44
|
+
if (isTypeScriptProject) {
|
|
45
|
+
contents = commonTags.stripIndent(_a || (_a = __template(['\n <template>\n <section\n :data-slice-type="slice.slice_type"\n :data-slice-variation="slice.variation"\n >\n Placeholder component for ', ' (variation: {{ slice.variation }}) Slices\n </section>\n </template>\n\n <script setup lang="ts">\n import { Content } from "@prismicio/client";\n\n // The array passed to `getSliceComponentProps` is purely optional.\n // Consider it as a visual hint for you when templating your slice.\n defineProps(getSliceComponentProps<Content.', 'Slice>(\n ["slice", "index", "slices", "context"]\n ));\n <\/script>\n '], ['\n <template>\n <section\n :data-slice-type="slice.slice_type"\n :data-slice-variation="slice.variation"\n >\n Placeholder component for ', ' (variation: {{ slice.variation }}) Slices\n </section>\n </template>\n\n <script setup lang="ts">\n import { Content } from "@prismicio/client";\n\n // The array passed to \\`getSliceComponentProps\\` is purely optional.\n // Consider it as a visual hint for you when templating your slice.\n defineProps(getSliceComponentProps<Content.', 'Slice>(\n ["slice", "index", "slices", "context"]\n ));\n <\/script>\n '])), model.id, pascalName);
|
|
46
|
+
} else {
|
|
47
|
+
contents = commonTags.stripIndent(_b || (_b = __template(['\n <template>\n <section\n :data-slice-type="slice.slice_type"\n :data-slice-variation="slice.variation"\n >\n Placeholder component for {{ model.id }} (variation: {{ slice.variation }}) Slices\n </section>\n </template>\n\n <script setup>\n // The array passed to `getSliceComponentProps` is purely optional.\n // Consider it as a visual hint for you when templating your slice.\n defineProps(getSliceComponentProps(["slice", "index", "slices", "context"]));\n <\/script>\n '], ['\n <template>\n <section\n :data-slice-type="slice.slice_type"\n :data-slice-variation="slice.variation"\n >\n Placeholder component for {{ model.id }} (variation: {{ slice.variation }}) Slices\n </section>\n </template>\n\n <script setup>\n // The array passed to \\`getSliceComponentProps\\` is purely optional.\n // Consider it as a visual hint for you when templating your slice.\n defineProps(getSliceComponentProps(["slice", "index", "slices", "context"]));\n <\/script>\n '])));
|
|
48
|
+
}
|
|
49
|
+
if (options.format) {
|
|
50
|
+
contents = await helpers.format(contents, filePath, {
|
|
51
|
+
prettier: { parser: "vue" }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
await fs__namespace.writeFile(filePath, contents);
|
|
55
|
+
};
|
|
56
|
+
const sliceCreate = async (data, context) => {
|
|
57
|
+
const dir = buildSliceDirectoryPath.buildSliceDirectoryPath({
|
|
58
|
+
libraryID: data.libraryID,
|
|
59
|
+
model: data.model,
|
|
60
|
+
helpers: context.helpers
|
|
61
|
+
});
|
|
62
|
+
await fs__namespace.mkdir(dir, { recursive: true });
|
|
63
|
+
rejectIfNecessary.rejectIfNecessary(await Promise.allSettled([
|
|
64
|
+
updateSliceModelFile.updateSliceModelFile({
|
|
65
|
+
libraryID: data.libraryID,
|
|
66
|
+
model: data.model,
|
|
67
|
+
...context
|
|
68
|
+
}),
|
|
69
|
+
createComponentFile({ dir, data, ...context })
|
|
70
|
+
]));
|
|
71
|
+
rejectIfNecessary.rejectIfNecessary(await Promise.allSettled([
|
|
72
|
+
upsertGlobalContentTypes.upsertGlobalContentTypes(context),
|
|
73
|
+
upsertSliceLibraryIndexFile.upsertSliceLibraryIndexFile({ libraryID: data.libraryID, ...context })
|
|
74
|
+
]));
|
|
75
|
+
};
|
|
76
|
+
exports.sliceCreate = sliceCreate;
|
|
77
|
+
//# sourceMappingURL=slice-create.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice-create.cjs","sources":["../../../src/hooks/slice-create.ts"],"sourcesContent":["import type {\n\tSliceCreateHook,\n\tSliceCreateHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\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\";\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\nimport { pascalCase } from \"../lib/pascalCase\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype Args = {\n\tdir: string;\n\tdata: SliceCreateHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst createComponentFile = async ({ dir, data, helpers, options }: Args) => {\n\tconst filePath = path.join(dir, \"index.vue\");\n\tconst model = data.model;\n\tconst pascalName = pascalCase(model.name);\n\n\tlet contents: string;\n\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\n\tif (isTypeScriptProject) {\n\t\tcontents = stripIndent`\n\t\t\t<template>\n\t\t\t\t<section\n\t\t\t\t\t:data-slice-type=\"slice.slice_type\"\n\t\t\t\t\t:data-slice-variation=\"slice.variation\"\n\t\t\t\t>\n\t\t\t\t\tPlaceholder component for ${model.id} (variation: {{ slice.variation }}) Slices\n\t\t\t\t</section>\n\t\t\t</template>\n\n\t\t\t<script setup lang=\"ts\">\n\t\t\timport { Content } from \"@prismicio/client\";\n\n\t\t\t// The array passed to \\`getSliceComponentProps\\` is purely optional.\n\t\t\t// Consider it as a visual hint for you when templating your slice.\n\t\t\tdefineProps(getSliceComponentProps<Content.${pascalName}Slice>(\n\t\t\t\t[\"slice\", \"index\", \"slices\", \"context\"]\n\t\t\t));\n\t\t\t</script>\n\t\t`;\n\t} else {\n\t\tcontents = stripIndent`\n\t\t\t<template>\n\t\t\t\t<section\n\t\t\t\t\t:data-slice-type=\"slice.slice_type\"\n\t\t\t\t\t:data-slice-variation=\"slice.variation\"\n\t\t\t\t>\n\t\t\t\t\tPlaceholder component for {{ model.id }} (variation: {{ slice.variation }}) Slices\n\t\t\t\t</section>\n\t\t\t</template>\n\n\t\t\t<script setup>\n\t\t\t// The array passed to \\`getSliceComponentProps\\` is purely optional.\n\t\t\t// Consider it as a visual hint for you when templating your slice.\n\t\t\tdefineProps(getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]));\n\t\t\t</script>\n\t\t`;\n\t}\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath, {\n\t\t\tprettier: { parser: \"vue\" },\n\t\t});\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n\nexport const sliceCreate: SliceCreateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst dir = buildSliceDirectoryPath({\n\t\tlibraryID: data.libraryID,\n\t\tmodel: data.model,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.mkdir(dir, { recursive: true });\n\n\trejectIfNecessary(\n\t\tawait Promise.allSettled([\n\t\t\tupdateSliceModelFile({\n\t\t\t\tlibraryID: data.libraryID,\n\t\t\t\tmodel: data.model,\n\t\t\t\t...context,\n\t\t\t}),\n\t\t\tcreateComponentFile({ dir, data, ...context }),\n\t\t]),\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":["path","pascalCase","checkIsTypeScriptProject","stripIndent","fs","buildSliceDirectoryPath","rejectIfNecessary","updateSliceModelFile","upsertGlobalContentTypes","upsertSliceLibraryIndexFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAA,IAAA;AAmBA,MAAM,sBAAsB,OAAO,EAAE,KAAK,MAAM,SAAS,cAAmB;AAC3E,QAAM,WAAWA,gBAAK,KAAK,KAAK,WAAW;AAC3C,QAAM,QAAQ,KAAK;AACb,QAAA,aAAaC,WAAAA,WAAW,MAAM,IAAI;AAEpC,MAAA;AAEE,QAAA,sBAAsB,MAAMC,kDAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AAED,MAAI,qBAAqB;AACb,eAAAC,WAAA,YAAA,OAAA,KAAW,6KAMiB,gWASiB,iFAAA,GAflC,kKAMiB,oWASiB,iFAAA,CAAA,IATzB,MAAM,IASS,UAAA;AAAA,EAAA,OAKxC;AACN,eAAWA,WAAW,YAAA,OAAA,KAAA,WAAA,CAAA,igBAAA,GAAA,CAAA,qgBAAA,CAAA,EAAA;AAAA,EAgBtB;AAED,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,UAAU;AAAA,MACnD,UAAU,EAAE,QAAQ,MAAO;AAAA,IAAA,CAC3B;AAAA,EACD;AAEK,QAAAC,cAAG,UAAU,UAAU,QAAQ;AACtC;AAEa,MAAA,cAA8C,OAC1D,MACA,YACG;AACH,QAAM,MAAMC,wBAAAA,wBAAwB;AAAA,IACnC,WAAW,KAAK;AAAA,IAChB,OAAO,KAAK;AAAA,IACZ,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAMD,cAAG,MAAM,KAAK,EAAE,WAAW,MAAM;AAGtCE,sCAAA,MAAM,QAAQ,WAAW;AAAA,IACxBC,0CAAqB;AAAA,MACpB,WAAW,KAAK;AAAA,MAChB,OAAO,KAAK;AAAA,MACZ,GAAG;AAAA,IAAA,CACH;AAAA,IACD,oBAAoB,EAAE,KAAK,MAAM,GAAG,SAAS;AAAA,EAC7C,CAAA,CAAC;AAIFD,sCAAA,MAAM,QAAQ,WAAW;AAAA,IACxBE,yBAAAA,yBAAyB,OAAO;AAAA,IAChCC,wDAA4B,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS;AAAA,EACrE,CAAA,CAAC;AAEJ;;"}
|