@slicemachine/adapter-next 0.3.15-dev-next-release.0 → 0.3.15-dev-next-release.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,8 @@ const path = require("node:path");
5
5
  const node_url = require("node:url");
6
6
  const checkIsTypeScriptProject = require("../lib/checkIsTypeScriptProject.cjs");
7
7
  const index = require("../sliceTemplates/CallToAction/index.cjs");
8
- const initialTemplates = [index];
8
+ const index$1 = require("../sliceTemplates/AlternateGrid/index.cjs");
9
+ const initialTemplates = [index, index$1];
9
10
  const sliceTemplateLibraryRead = async ({ templateIDs }, { helpers, options }) => {
10
11
  const isTypeScriptProject = await checkIsTypeScriptProject.checkIsTypeScriptProject({
11
12
  helpers,
@@ -1 +1 @@
1
- {"version":3,"file":"sliceTemplateLibrary-read.cjs","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [CallToAction];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["CallToAction","checkIsTypeScriptProject","fileURLToPath","model"],"mappings":";;;;;;;AAYA,MAAM,mBAAmB,CAACA,KAAY;AAEzB,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAMC,kDAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACAC,SAAc,cAAA,IAAI,IAAI,KAAK,KAAK,MAAM,QAAQ,kNAAkB,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;;"}
1
+ {"version":3,"file":"sliceTemplateLibrary-read.cjs","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport * as AlternateGrid from \"../sliceTemplates/AlternateGrid\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [CallToAction, AlternateGrid];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["CallToAction","AlternateGrid","checkIsTypeScriptProject","fileURLToPath","model"],"mappings":";;;;;;;;AAcA,MAAM,mBAAmB,CAACA,OAAcC,OAAa;AAExC,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAMC,kDAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACAC,SAAc,cAAA,IAAI,IAAI,KAAK,KAAK,MAAM,QAAQ,kNAAkB,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;;"}
@@ -3,7 +3,8 @@ import path__default from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { checkIsTypeScriptProject } from "../lib/checkIsTypeScriptProject.js";
5
5
  import * as index from "../sliceTemplates/CallToAction/index.js";
6
- const initialTemplates = [index];
6
+ import * as index$1 from "../sliceTemplates/AlternateGrid/index.js";
7
+ const initialTemplates = [index, index$1];
7
8
  const sliceTemplateLibraryRead = async ({ templateIDs }, { helpers, options }) => {
8
9
  const isTypeScriptProject = await checkIsTypeScriptProject({
9
10
  helpers,
@@ -1 +1 @@
1
- {"version":3,"file":"sliceTemplateLibrary-read.js","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [CallToAction];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["CallToAction","path","model"],"mappings":";;;;;AAYA,MAAM,mBAAmB,CAACA,KAAY;AAEzB,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACA,cAAc,IAAI,IAAIC,cAAK,KAAK,MAAM,QAAQ,GAAG,YAAY,GAAG,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;"}
1
+ {"version":3,"file":"sliceTemplateLibrary-read.js","sources":["../../../src/hooks/sliceTemplateLibrary-read.ts"],"sourcesContent":["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { SharedSlice } from \"@prismicio/types-internal/lib/customtypes\";\nimport type { SliceTemplateLibraryReadHook } from \"@slicemachine/plugin-kit\";\n\nimport { checkIsTypeScriptProject } from \"../lib/checkIsTypeScriptProject\";\n\nimport * as CallToAction from \"../sliceTemplates/CallToAction\";\nimport * as AlternateGrid from \"../sliceTemplates/AlternateGrid\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst initialTemplates = [CallToAction, AlternateGrid];\n\nexport const sliceTemplateLibraryRead: SliceTemplateLibraryReadHook<\n\tPluginOptions\n> = async ({ templateIDs }, { helpers, options }) => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers,\n\t\toptions,\n\t});\n\tconst templates =\n\t\ttemplateIDs && templateIDs.length\n\t\t\t? initialTemplates.filter((t) => templateIDs?.includes(t.model.id))\n\t\t\t: initialTemplates;\n\n\tconst templatesPromises = templates.map(async (t) => {\n\t\tconst { mocks, model, createComponentContents, screenshotPaths } = t;\n\n\t\tconst screenshotEntries = Object.entries(screenshotPaths);\n\t\tconst screenshotPromises = screenshotEntries.map(([key, filePath]) => {\n\t\t\treturn fs\n\t\t\t\t.readFile(\n\t\t\t\t\tfileURLToPath(new URL(path.join(\"..\", filePath), import.meta.url)),\n\t\t\t\t)\n\t\t\t\t.then((data) => [key, data]);\n\t\t});\n\t\tconst readScreenshots = await Promise.all(screenshotPromises);\n\t\tconst screenshots = Object.fromEntries(readScreenshots);\n\n\t\treturn {\n\t\t\tmocks,\n\t\t\tmodel,\n\t\t\tcreateComponentContents: (model: SharedSlice) =>\n\t\t\t\tcreateComponentContents(model, isTypeScriptProject),\n\t\t\tscreenshots,\n\t\t};\n\t});\n\n\tconst resolvedTemplates = await Promise.all(templatesPromises);\n\n\treturn {\n\t\ttemplates: resolvedTemplates,\n\t};\n};\n"],"names":["CallToAction","AlternateGrid","path","model"],"mappings":";;;;;;AAcA,MAAM,mBAAmB,CAACA,OAAcC,OAAa;AAExC,MAAA,2BAET,OAAO,EAAE,YAAA,GAAe,EAAE,SAAS,cAAa;AAC7C,QAAA,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D;AAAA,IACA;AAAA,EAAA,CACA;AACD,QAAM,YACL,eAAe,YAAY,SACxB,iBAAiB,OAAO,CAAC,MAAM,2CAAa,SAAS,EAAE,MAAM,GAAG,IAChE;AAEJ,QAAM,oBAAoB,UAAU,IAAI,OAAO,MAAK;AACnD,UAAM,EAAE,OAAO,OAAO,yBAAyB,oBAAoB;AAE7D,UAAA,oBAAoB,OAAO,QAAQ,eAAe;AACxD,UAAM,qBAAqB,kBAAkB,IAAI,CAAC,CAAC,KAAK,QAAQ,MAAK;AAC7D,aAAA,GACL,SACA,cAAc,IAAI,IAAIC,cAAK,KAAK,MAAM,QAAQ,GAAG,YAAY,GAAG,CAAC,CAAC,EAElE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAAA,IAAA,CAC5B;AACD,UAAM,kBAAkB,MAAM,QAAQ,IAAI,kBAAkB;AACtD,UAAA,cAAc,OAAO,YAAY,eAAe;AAE/C,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,yBAAyB,CAACC,WACzB,wBAAwBA,QAAO,mBAAmB;AAAA,MACnD;AAAA,IAAA;AAAA,GAED;AAED,QAAM,oBAAoB,MAAM,QAAQ,IAAI,iBAAiB;AAEtD,SAAA;AAAA,IACN,WAAW;AAAA,EAAA;AAEb;"}