@slicemachine/init 2.10.37-beta.2 → 2.10.37
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/lib/framework.cjs +1 -1
- package/dist/lib/framework.cjs.map +1 -1
- package/dist/lib/framework.js +1 -1
- package/dist/lib/framework.js.map +1 -1
- package/dist/packages/init/package.json.cjs +2 -5
- package/dist/packages/init/package.json.cjs.map +1 -1
- package/dist/packages/init/package.json.js +2 -5
- package/dist/packages/init/package.json.js.map +1 -1
- package/package.json +4 -5
- package/src/lib/framework.ts +1 -1
package/dist/lib/framework.cjs
CHANGED
|
@@ -37,7 +37,7 @@ const FRAMEWORKS = {
|
|
|
37
37
|
prismicDocumentation: "https://prismic.dev/init/nuxt",
|
|
38
38
|
adapterName: "@slicemachine/adapter-nuxt",
|
|
39
39
|
compatibility: {
|
|
40
|
-
nuxt: "^3.0.0 || ^4.0.0
|
|
40
|
+
nuxt: "^3.0.0 || ^4.0.0"
|
|
41
41
|
},
|
|
42
42
|
devDependencies: {
|
|
43
43
|
...DEFAULT_DEV_DEPENDENCIES,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.cjs","sources":["../../../src/lib/framework.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { FrameworkWroomTelemetryID } from \"@slicemachine/manager\";\n\nimport { version as pkgVersion } from \"../../package.json\";\n\nexport type Framework = {\n\t/**\n\t * Framework's human readable name.\n\t */\n\tname: string;\n\n\t/**\n\t * Framework 's id sent to Segment from Slice Machine\n\t */\n\tsliceMachineTelemetryID:\n\t\t| \"next\"\n\t\t| \"nuxt-2\"\n\t\t| \"nuxt\"\n\t\t| \"sveltekit-1\"\n\t\t| \"sveltekit-2\"\n\t\t| \"universal\";\n\n\t/**\n\t * Framework's id sent to Segment from wroom.\n\t */\n\twroomTelemetryID: FrameworkWroomTelemetryID;\n\n\t/**\n\t * A link to the Prismic documentation for the framework\n\t */\n\tprismicDocumentation: string;\n\n\t/**\n\t * Package name of the adapter responsible for this framework\n\t */\n\tadapterName: string;\n\n\t/**\n\t * A package name/semver range map defining framework compatibility\n\t * requirements.\n\t *\n\t * Project should match all entries to be considered compatible.\n\t */\n\tcompatibility: Record<string, string>;\n\n\t/**\n\t * A package name/semver range map defining development dependencies to be\n\t * installed. Typically Slice Machine and the framework's adapter.\n\t *\n\t * @remarks\n\t * Dependencies required to work with the framework (e.g. `@prismicio/next`\n\t * for Next.js) should not be defined here. Those are to be defined by the\n\t * adapter.\n\t */\n\tdevDependencies: Record<string, string>;\n};\n\nconst prereleaseComponents = semver.prerelease(pkgVersion);\nlet npmDistributionTag;\nif (\n\tprereleaseComponents !== null &&\n\tprereleaseComponents.length >= 2 &&\n\tprocess.env.NODE_ENV !== \"test\"\n) {\n\tconst prereleaseIdentifier = prereleaseComponents.slice(0, -1).join(\".\");\n\tnpmDistributionTag = prereleaseIdentifier;\n} else {\n\tnpmDistributionTag = \"latest\";\n}\n\nconst DEFAULT_DEV_DEPENDENCIES: Record<string, string> = {\n\t\"slice-machine-ui\": npmDistributionTag,\n};\n\n/**\n * Frameworks we support, orders shouldn't matter much but is respected (the\n * higher it is the more priority it has in case multiple matches)\n */\nexport const FRAMEWORKS: Record<string, Framework> = {\n\t\"nuxt-2\": {\n\t\tname: \"Nuxt 2\",\n\t\tsliceMachineTelemetryID: \"nuxt-2\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt-2\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt2\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^2.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-nuxt2\": npmDistributionTag,\n\t\t},\n\t},\n\tnuxt: {\n\t\tname: \"Nuxt\",\n\t\tsliceMachineTelemetryID: \"nuxt\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^3.0.0 || ^4.0.0
|
|
1
|
+
{"version":3,"file":"framework.cjs","sources":["../../../src/lib/framework.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { FrameworkWroomTelemetryID } from \"@slicemachine/manager\";\n\nimport { version as pkgVersion } from \"../../package.json\";\n\nexport type Framework = {\n\t/**\n\t * Framework's human readable name.\n\t */\n\tname: string;\n\n\t/**\n\t * Framework 's id sent to Segment from Slice Machine\n\t */\n\tsliceMachineTelemetryID:\n\t\t| \"next\"\n\t\t| \"nuxt-2\"\n\t\t| \"nuxt\"\n\t\t| \"sveltekit-1\"\n\t\t| \"sveltekit-2\"\n\t\t| \"universal\";\n\n\t/**\n\t * Framework's id sent to Segment from wroom.\n\t */\n\twroomTelemetryID: FrameworkWroomTelemetryID;\n\n\t/**\n\t * A link to the Prismic documentation for the framework\n\t */\n\tprismicDocumentation: string;\n\n\t/**\n\t * Package name of the adapter responsible for this framework\n\t */\n\tadapterName: string;\n\n\t/**\n\t * A package name/semver range map defining framework compatibility\n\t * requirements.\n\t *\n\t * Project should match all entries to be considered compatible.\n\t */\n\tcompatibility: Record<string, string>;\n\n\t/**\n\t * A package name/semver range map defining development dependencies to be\n\t * installed. Typically Slice Machine and the framework's adapter.\n\t *\n\t * @remarks\n\t * Dependencies required to work with the framework (e.g. `@prismicio/next`\n\t * for Next.js) should not be defined here. Those are to be defined by the\n\t * adapter.\n\t */\n\tdevDependencies: Record<string, string>;\n};\n\nconst prereleaseComponents = semver.prerelease(pkgVersion);\nlet npmDistributionTag;\nif (\n\tprereleaseComponents !== null &&\n\tprereleaseComponents.length >= 2 &&\n\tprocess.env.NODE_ENV !== \"test\"\n) {\n\tconst prereleaseIdentifier = prereleaseComponents.slice(0, -1).join(\".\");\n\tnpmDistributionTag = prereleaseIdentifier;\n} else {\n\tnpmDistributionTag = \"latest\";\n}\n\nconst DEFAULT_DEV_DEPENDENCIES: Record<string, string> = {\n\t\"slice-machine-ui\": npmDistributionTag,\n};\n\n/**\n * Frameworks we support, orders shouldn't matter much but is respected (the\n * higher it is the more priority it has in case multiple matches)\n */\nexport const FRAMEWORKS: Record<string, Framework> = {\n\t\"nuxt-2\": {\n\t\tname: \"Nuxt 2\",\n\t\tsliceMachineTelemetryID: \"nuxt-2\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt-2\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt2\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^2.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-nuxt2\": npmDistributionTag,\n\t\t},\n\t},\n\tnuxt: {\n\t\tname: \"Nuxt\",\n\t\tsliceMachineTelemetryID: \"nuxt\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^3.0.0 || ^4.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-nuxt\": npmDistributionTag,\n\t\t},\n\t},\n\tnext: {\n\t\tname: \"Next.js\",\n\t\tsliceMachineTelemetryID: \"next\",\n\t\twroomTelemetryID: \"next\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/next\",\n\t\tadapterName: \"@slicemachine/adapter-next\",\n\t\tcompatibility: {\n\t\t\tnext: \"^11 || ^12 || ^13 || ^14 || ^15.0.0-rc.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-next\": npmDistributionTag,\n\t\t},\n\t},\n\t\"sveltekit-1\": {\n\t\tname: \"SvelteKit\",\n\t\tsliceMachineTelemetryID: \"sveltekit-1\",\n\t\twroomTelemetryID: \"sveltekit\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/sveltekit-1\",\n\t\tadapterName: \"@slicemachine/adapter-sveltekit\",\n\t\tcompatibility: {\n\t\t\t\"@sveltejs/kit\": \"^1.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-sveltekit\": npmDistributionTag,\n\t\t},\n\t},\n\t\"sveltekit-2\": {\n\t\tname: \"SvelteKit\",\n\t\tsliceMachineTelemetryID: \"sveltekit-2\",\n\t\twroomTelemetryID: \"sveltekit\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/sveltekit-2\",\n\t\tadapterName: \"@slicemachine/adapter-sveltekit\",\n\t\tcompatibility: {\n\t\t\t\"@sveltejs/kit\": \"^2.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-sveltekit\": npmDistributionTag,\n\t\t},\n\t},\n} as const;\n\n/**\n * Universal package used when framework is not supported.\n */\nexport const UNIVERSAL: Framework = {\n\tname: \"universal (no framework)\",\n\tsliceMachineTelemetryID: \"universal\",\n\twroomTelemetryID: \"other\",\n\tprismicDocumentation: \"https://prismic.dev/init/universal\",\n\tadapterName: \"@slicemachine/adapter-universal\",\n\tcompatibility: {},\n\tdevDependencies: {\n\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\"@slicemachine/adapter-universal\": npmDistributionTag,\n\t},\n};\n\nexport const detectFramework = async (cwd: string): Promise<Framework> => {\n\tconst path = join(cwd, \"package.json\");\n\n\tlet allDependencies: Record<string, string>;\n\ttry {\n\t\tconst pkg = JSON.parse(await readFile(path, \"utf-8\"));\n\n\t\tallDependencies = {\n\t\t\t...pkg.dependencies,\n\t\t\t...pkg.devDependencies,\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to read project's \\`package.json\\` at \\`${path}\\``,\n\t\t\t{ cause: error },\n\t\t);\n\t}\n\n\treturn (\n\t\tObject.values(FRAMEWORKS).find((framework) => {\n\t\t\treturn Object.entries(framework.compatibility).every(([pkg, range]) => {\n\t\t\t\tif (pkg in allDependencies) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Determine lowest version possibly in use\n\t\t\t\t\t\tconst minimumVersion = semver.minVersion(allDependencies[pkg]);\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\treturn semver.satisfies(minimumVersion!, range);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// We assume unconventional tags, `latest`, `beta`, `dev` matches the framework\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}) || UNIVERSAL\n\t);\n};\n"],"names":["pkgVersion","path","join","readFile"],"mappings":";;;;;;AA4DA,MAAM,uBAAuB,OAAO,WAAWA,SAAAA,OAAU;AACzD,IAAI;AACJ,IACC,yBAAyB,QACzB,qBAAqB,UAAU,KAC/B,QAAQ,IAAI,aAAa,QACxB;AACD,QAAM,uBAAuB,qBAAqB,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;AAClD,uBAAA;AACtB,OAAO;AACe,uBAAA;AACtB;AAEA,MAAM,2BAAmD;AAAA,EACxD,oBAAoB;;AAOd,MAAM,aAAwC;AAAA,EACpD,UAAU;AAAA,IACT,MAAM;AAAA,IACN,yBAAyB;AAAA,IACzB,kBAAkB;AAAA,IAClB,sBAAsB;AAAA,IACtB,aAAa;AAAA,IACb,eAAe;AAAA,MACd,MAAM;AAAA,IACN;AAAA,IACD,iBAAiB;AAAA,MAChB,GAAG;AAAA,MACH,+BAA+B;A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,SAAOC,KAAAA,KAAK,KAAK,cAAc;AAEjC,MAAA;AACA,MAAA;AACH,UAAM,MAAM,KAAK,MAAM,MAAMC,GAAAA,SAASF,QAAM,OAAO,CAAC;AAElC,sBAAA;AAAA,MACjB,GAAG,IAAI;AAAA,MACP,GAAG,IAAI;AAAA,IAAA;AAAA,WAEA,OAAO;AACT,UAAA,IAAI,MACT,kDAAkDA,MAAI,MACtD,EAAE,OAAO,OAAO;AAAA,EAElB;AAEA,SACC,OAAO,OAAO,UAAU,EAAE,KAAK,CAAC,cAAa;AACrC,WAAA,OAAO,QAAQ,UAAU,aAAa,EAAE,MAAM,CAAC,CAAC,KAAK,KAAK,MAAK;AACrE,UAAI,OAAO,iBAAiB;AACvB,YAAA;AAEH,gBAAM,iBAAiB,OAAO,WAAW,gBAAgB,GAAG,CAAC;AAGtD,iBAAA,OAAO,UAAU,gBAAiB,KAAK;AAAA,iBACtC,OAAO;AAER,iBAAA;AAAA,QACR;AAAA,MACD;AAEO,aAAA;AAAA,IAAA,CACP;AAAA,EACD,CAAA,KAAK;AAER;;;;"}
|
package/dist/lib/framework.js
CHANGED
|
@@ -35,7 +35,7 @@ const FRAMEWORKS = {
|
|
|
35
35
|
prismicDocumentation: "https://prismic.dev/init/nuxt",
|
|
36
36
|
adapterName: "@slicemachine/adapter-nuxt",
|
|
37
37
|
compatibility: {
|
|
38
|
-
nuxt: "^3.0.0 || ^4.0.0
|
|
38
|
+
nuxt: "^3.0.0 || ^4.0.0"
|
|
39
39
|
},
|
|
40
40
|
devDependencies: {
|
|
41
41
|
...DEFAULT_DEV_DEPENDENCIES,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.js","sources":["../../../src/lib/framework.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { FrameworkWroomTelemetryID } from \"@slicemachine/manager\";\n\nimport { version as pkgVersion } from \"../../package.json\";\n\nexport type Framework = {\n\t/**\n\t * Framework's human readable name.\n\t */\n\tname: string;\n\n\t/**\n\t * Framework 's id sent to Segment from Slice Machine\n\t */\n\tsliceMachineTelemetryID:\n\t\t| \"next\"\n\t\t| \"nuxt-2\"\n\t\t| \"nuxt\"\n\t\t| \"sveltekit-1\"\n\t\t| \"sveltekit-2\"\n\t\t| \"universal\";\n\n\t/**\n\t * Framework's id sent to Segment from wroom.\n\t */\n\twroomTelemetryID: FrameworkWroomTelemetryID;\n\n\t/**\n\t * A link to the Prismic documentation for the framework\n\t */\n\tprismicDocumentation: string;\n\n\t/**\n\t * Package name of the adapter responsible for this framework\n\t */\n\tadapterName: string;\n\n\t/**\n\t * A package name/semver range map defining framework compatibility\n\t * requirements.\n\t *\n\t * Project should match all entries to be considered compatible.\n\t */\n\tcompatibility: Record<string, string>;\n\n\t/**\n\t * A package name/semver range map defining development dependencies to be\n\t * installed. Typically Slice Machine and the framework's adapter.\n\t *\n\t * @remarks\n\t * Dependencies required to work with the framework (e.g. `@prismicio/next`\n\t * for Next.js) should not be defined here. Those are to be defined by the\n\t * adapter.\n\t */\n\tdevDependencies: Record<string, string>;\n};\n\nconst prereleaseComponents = semver.prerelease(pkgVersion);\nlet npmDistributionTag;\nif (\n\tprereleaseComponents !== null &&\n\tprereleaseComponents.length >= 2 &&\n\tprocess.env.NODE_ENV !== \"test\"\n) {\n\tconst prereleaseIdentifier = prereleaseComponents.slice(0, -1).join(\".\");\n\tnpmDistributionTag = prereleaseIdentifier;\n} else {\n\tnpmDistributionTag = \"latest\";\n}\n\nconst DEFAULT_DEV_DEPENDENCIES: Record<string, string> = {\n\t\"slice-machine-ui\": npmDistributionTag,\n};\n\n/**\n * Frameworks we support, orders shouldn't matter much but is respected (the\n * higher it is the more priority it has in case multiple matches)\n */\nexport const FRAMEWORKS: Record<string, Framework> = {\n\t\"nuxt-2\": {\n\t\tname: \"Nuxt 2\",\n\t\tsliceMachineTelemetryID: \"nuxt-2\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt-2\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt2\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^2.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-nuxt2\": npmDistributionTag,\n\t\t},\n\t},\n\tnuxt: {\n\t\tname: \"Nuxt\",\n\t\tsliceMachineTelemetryID: \"nuxt\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^3.0.0 || ^4.0.0
|
|
1
|
+
{"version":3,"file":"framework.js","sources":["../../../src/lib/framework.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport semver from \"semver\";\n\nimport { FrameworkWroomTelemetryID } from \"@slicemachine/manager\";\n\nimport { version as pkgVersion } from \"../../package.json\";\n\nexport type Framework = {\n\t/**\n\t * Framework's human readable name.\n\t */\n\tname: string;\n\n\t/**\n\t * Framework 's id sent to Segment from Slice Machine\n\t */\n\tsliceMachineTelemetryID:\n\t\t| \"next\"\n\t\t| \"nuxt-2\"\n\t\t| \"nuxt\"\n\t\t| \"sveltekit-1\"\n\t\t| \"sveltekit-2\"\n\t\t| \"universal\";\n\n\t/**\n\t * Framework's id sent to Segment from wroom.\n\t */\n\twroomTelemetryID: FrameworkWroomTelemetryID;\n\n\t/**\n\t * A link to the Prismic documentation for the framework\n\t */\n\tprismicDocumentation: string;\n\n\t/**\n\t * Package name of the adapter responsible for this framework\n\t */\n\tadapterName: string;\n\n\t/**\n\t * A package name/semver range map defining framework compatibility\n\t * requirements.\n\t *\n\t * Project should match all entries to be considered compatible.\n\t */\n\tcompatibility: Record<string, string>;\n\n\t/**\n\t * A package name/semver range map defining development dependencies to be\n\t * installed. Typically Slice Machine and the framework's adapter.\n\t *\n\t * @remarks\n\t * Dependencies required to work with the framework (e.g. `@prismicio/next`\n\t * for Next.js) should not be defined here. Those are to be defined by the\n\t * adapter.\n\t */\n\tdevDependencies: Record<string, string>;\n};\n\nconst prereleaseComponents = semver.prerelease(pkgVersion);\nlet npmDistributionTag;\nif (\n\tprereleaseComponents !== null &&\n\tprereleaseComponents.length >= 2 &&\n\tprocess.env.NODE_ENV !== \"test\"\n) {\n\tconst prereleaseIdentifier = prereleaseComponents.slice(0, -1).join(\".\");\n\tnpmDistributionTag = prereleaseIdentifier;\n} else {\n\tnpmDistributionTag = \"latest\";\n}\n\nconst DEFAULT_DEV_DEPENDENCIES: Record<string, string> = {\n\t\"slice-machine-ui\": npmDistributionTag,\n};\n\n/**\n * Frameworks we support, orders shouldn't matter much but is respected (the\n * higher it is the more priority it has in case multiple matches)\n */\nexport const FRAMEWORKS: Record<string, Framework> = {\n\t\"nuxt-2\": {\n\t\tname: \"Nuxt 2\",\n\t\tsliceMachineTelemetryID: \"nuxt-2\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt-2\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt2\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^2.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-nuxt2\": npmDistributionTag,\n\t\t},\n\t},\n\tnuxt: {\n\t\tname: \"Nuxt\",\n\t\tsliceMachineTelemetryID: \"nuxt\",\n\t\twroomTelemetryID: \"nuxt\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/nuxt\",\n\t\tadapterName: \"@slicemachine/adapter-nuxt\",\n\t\tcompatibility: {\n\t\t\tnuxt: \"^3.0.0 || ^4.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-nuxt\": npmDistributionTag,\n\t\t},\n\t},\n\tnext: {\n\t\tname: \"Next.js\",\n\t\tsliceMachineTelemetryID: \"next\",\n\t\twroomTelemetryID: \"next\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/next\",\n\t\tadapterName: \"@slicemachine/adapter-next\",\n\t\tcompatibility: {\n\t\t\tnext: \"^11 || ^12 || ^13 || ^14 || ^15.0.0-rc.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-next\": npmDistributionTag,\n\t\t},\n\t},\n\t\"sveltekit-1\": {\n\t\tname: \"SvelteKit\",\n\t\tsliceMachineTelemetryID: \"sveltekit-1\",\n\t\twroomTelemetryID: \"sveltekit\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/sveltekit-1\",\n\t\tadapterName: \"@slicemachine/adapter-sveltekit\",\n\t\tcompatibility: {\n\t\t\t\"@sveltejs/kit\": \"^1.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-sveltekit\": npmDistributionTag,\n\t\t},\n\t},\n\t\"sveltekit-2\": {\n\t\tname: \"SvelteKit\",\n\t\tsliceMachineTelemetryID: \"sveltekit-2\",\n\t\twroomTelemetryID: \"sveltekit\",\n\t\tprismicDocumentation: \"https://prismic.dev/init/sveltekit-2\",\n\t\tadapterName: \"@slicemachine/adapter-sveltekit\",\n\t\tcompatibility: {\n\t\t\t\"@sveltejs/kit\": \"^2.0.0\",\n\t\t},\n\t\tdevDependencies: {\n\t\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\t\"@slicemachine/adapter-sveltekit\": npmDistributionTag,\n\t\t},\n\t},\n} as const;\n\n/**\n * Universal package used when framework is not supported.\n */\nexport const UNIVERSAL: Framework = {\n\tname: \"universal (no framework)\",\n\tsliceMachineTelemetryID: \"universal\",\n\twroomTelemetryID: \"other\",\n\tprismicDocumentation: \"https://prismic.dev/init/universal\",\n\tadapterName: \"@slicemachine/adapter-universal\",\n\tcompatibility: {},\n\tdevDependencies: {\n\t\t...DEFAULT_DEV_DEPENDENCIES,\n\t\t\"@slicemachine/adapter-universal\": npmDistributionTag,\n\t},\n};\n\nexport const detectFramework = async (cwd: string): Promise<Framework> => {\n\tconst path = join(cwd, \"package.json\");\n\n\tlet allDependencies: Record<string, string>;\n\ttry {\n\t\tconst pkg = JSON.parse(await readFile(path, \"utf-8\"));\n\n\t\tallDependencies = {\n\t\t\t...pkg.dependencies,\n\t\t\t...pkg.devDependencies,\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to read project's \\`package.json\\` at \\`${path}\\``,\n\t\t\t{ cause: error },\n\t\t);\n\t}\n\n\treturn (\n\t\tObject.values(FRAMEWORKS).find((framework) => {\n\t\t\treturn Object.entries(framework.compatibility).every(([pkg, range]) => {\n\t\t\t\tif (pkg in allDependencies) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Determine lowest version possibly in use\n\t\t\t\t\t\tconst minimumVersion = semver.minVersion(allDependencies[pkg]);\n\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\treturn semver.satisfies(minimumVersion!, range);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t// We assume unconventional tags, `latest`, `beta`, `dev` matches the framework\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t});\n\t\t}) || UNIVERSAL\n\t);\n};\n"],"names":["pkgVersion"],"mappings":";;;;AA4DA,MAAM,uBAAuB,OAAO,WAAWA,OAAU;AACzD,IAAI;AACJ,IACC,yBAAyB,QACzB,qBAAqB,UAAU,KAC/B,QAAQ,IAAI,aAAa,QACxB;AACD,QAAM,uBAAuB,qBAAqB,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;AAClD,uBAAA;AACtB,OAAO;AACe,uBAAA;AACtB;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AA,IACnC;AAAA,EACD;;AAMK,MAAM,YAAuB;AAAA,EACnC,MAAM;AAAA,EACN,yBAAyB;AAAA,EACzB,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,aAAa;AAAA,EACb,eAAe,CAAE;AAAA,EACjB,iBAAiB;AAAA,IAChB,GAAG;AAAA,IACH,mCAAmC;AAAA,EACnC;;AAGW,MAAA,kBAAkB,OAAO,QAAmC;AAClE,QAAA,OAAO,KAAK,KAAK,cAAc;AAEjC,MAAA;AACA,MAAA;AACH,UAAM,MAAM,KAAK,MAAM,MAAM,SAAS,MAAM,OAAO,CAAC;AAElC,sBAAA;AAAA,MACjB,GAAG,IAAI;AAAA,MACP,GAAG,IAAI;AAAA,IAAA;AAAA,WAEA,OAAO;AACT,UAAA,IAAI,MACT,kDAAkD,IAAI,MACtD,EAAE,OAAO,OAAO;AAAA,EAElB;AAEA,SACC,OAAO,OAAO,UAAU,EAAE,KAAK,CAAC,cAAa;AACrC,WAAA,OAAO,QAAQ,UAAU,aAAa,EAAE,MAAM,CAAC,CAAC,KAAK,KAAK,MAAK;AACrE,UAAI,OAAO,iBAAiB;AACvB,YAAA;AAEH,gBAAM,iBAAiB,OAAO,WAAW,gBAAgB,GAAG,CAAC;AAGtD,iBAAA,OAAO,UAAU,gBAAiB,KAAK;AAAA,iBACtC,OAAO;AAER,iBAAA;AAAA,QACR;AAAA,MACD;AAEO,aAAA;AAAA,IAAA,CACP;AAAA,EACD,CAAA,KAAK;AAER;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const name = "@slicemachine/init";
|
|
4
|
-
const version = "2.10.37
|
|
4
|
+
const version = "2.10.37";
|
|
5
5
|
const description = "Init Prismic Slice Machine in your project";
|
|
6
6
|
const keywords = [
|
|
7
7
|
"typescript",
|
|
@@ -98,7 +98,6 @@ const devDependencies = {
|
|
|
98
98
|
const publishConfig = {
|
|
99
99
|
access: "public"
|
|
100
100
|
};
|
|
101
|
-
const stableVersion = "2.10.36";
|
|
102
101
|
const pkg = {
|
|
103
102
|
name,
|
|
104
103
|
version,
|
|
@@ -117,8 +116,7 @@ const pkg = {
|
|
|
117
116
|
scripts,
|
|
118
117
|
dependencies,
|
|
119
118
|
devDependencies,
|
|
120
|
-
publishConfig
|
|
121
|
-
stableVersion
|
|
119
|
+
publishConfig
|
|
122
120
|
};
|
|
123
121
|
exports.author = author;
|
|
124
122
|
exports.bin = bin;
|
|
@@ -136,7 +134,6 @@ exports.name = name;
|
|
|
136
134
|
exports.publishConfig = publishConfig;
|
|
137
135
|
exports.repository = repository;
|
|
138
136
|
exports.scripts = scripts;
|
|
139
|
-
exports.stableVersion = stableVersion;
|
|
140
137
|
exports.type = type;
|
|
141
138
|
exports.types = types;
|
|
142
139
|
exports.version = version;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const name = "@slicemachine/init";
|
|
2
|
-
const version = "2.10.37
|
|
2
|
+
const version = "2.10.37";
|
|
3
3
|
const description = "Init Prismic Slice Machine in your project";
|
|
4
4
|
const keywords = [
|
|
5
5
|
"typescript",
|
|
@@ -96,7 +96,6 @@ const devDependencies = {
|
|
|
96
96
|
const publishConfig = {
|
|
97
97
|
access: "public"
|
|
98
98
|
};
|
|
99
|
-
const stableVersion = "2.10.36";
|
|
100
99
|
const pkg = {
|
|
101
100
|
name,
|
|
102
101
|
version,
|
|
@@ -115,8 +114,7 @@ const pkg = {
|
|
|
115
114
|
scripts,
|
|
116
115
|
dependencies,
|
|
117
116
|
devDependencies,
|
|
118
|
-
publishConfig
|
|
119
|
-
stableVersion
|
|
117
|
+
publishConfig
|
|
120
118
|
};
|
|
121
119
|
export {
|
|
122
120
|
author,
|
|
@@ -135,7 +133,6 @@ export {
|
|
|
135
133
|
publishConfig,
|
|
136
134
|
repository,
|
|
137
135
|
scripts,
|
|
138
|
-
stableVersion,
|
|
139
136
|
type,
|
|
140
137
|
types,
|
|
141
138
|
version
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slicemachine/init",
|
|
3
|
-
"version": "2.10.37
|
|
3
|
+
"version": "2.10.37",
|
|
4
4
|
"description": "Init Prismic Slice Machine in your project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@antfu/ni": "^0.20.0",
|
|
55
55
|
"@lihbr/listr-update-renderer": "^0.5.3",
|
|
56
56
|
"@sentry/node": "^7.116.0",
|
|
57
|
-
"@slicemachine/manager": "0.25.
|
|
57
|
+
"@slicemachine/manager": "0.25.1",
|
|
58
58
|
"chalk": "^4.1.2",
|
|
59
59
|
"giget": "^1.1.2",
|
|
60
60
|
"globby": "^13.1.3",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
71
|
-
"@slicemachine/plugin-kit": "0.4.
|
|
71
|
+
"@slicemachine/plugin-kit": "0.4.79",
|
|
72
72
|
"@types/listr": "0.14.4",
|
|
73
73
|
"@types/prompts": "2.4.3",
|
|
74
74
|
"@types/semver": "7.3.13",
|
|
@@ -96,6 +96,5 @@
|
|
|
96
96
|
},
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
99
|
-
}
|
|
100
|
-
"stableVersion": "2.10.36"
|
|
99
|
+
}
|
|
101
100
|
}
|
package/src/lib/framework.ts
CHANGED
|
@@ -101,7 +101,7 @@ export const FRAMEWORKS: Record<string, Framework> = {
|
|
|
101
101
|
prismicDocumentation: "https://prismic.dev/init/nuxt",
|
|
102
102
|
adapterName: "@slicemachine/adapter-nuxt",
|
|
103
103
|
compatibility: {
|
|
104
|
-
nuxt: "^3.0.0 || ^4.0.0
|
|
104
|
+
nuxt: "^3.0.0 || ^4.0.0",
|
|
105
105
|
},
|
|
106
106
|
devDependencies: {
|
|
107
107
|
...DEFAULT_DEV_DEPENDENCIES,
|