@superblocksteam/ai-service-templates 2.0.162 → 2.0.163-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/templates.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superblocksteam/ai-service-templates",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.163-next.1",
|
|
4
4
|
"license": "Superblocks Community Software License",
|
|
5
5
|
"files": [
|
|
6
6
|
"reify-template.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^24",
|
|
28
|
-
"vitest": "4.
|
|
28
|
+
"vitest": "4.1.11"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"registry": "https://registry.npmjs.org"
|
package/templates.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export const templates = {
|
|
3
3
|
"api-builder-to-yaml": {
|
|
4
4
|
"bootstrap.mjs": "import { register } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\n\nregister(\"./shim-loader.mjs\", pathToFileURL(\"./\"));\n",
|
|
5
|
-
"package.json": "{\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"tsc\",\n \"test\": \"pnpm build && vitest run src/superblocks-library-shim/*.test.ts\"\n },\n \"dependencies\": {\n \"@types/node\": \"^24\",\n \"@typescript-eslint/parser\": \"^8.54.0\",\n \"acorn\": \"^8.14.0\",\n \"eslint\": \"^9.39.2\",\n \"prettier\": \"^3.7.4\",\n \"typescript\": \"^6.0.3\",\n \"yaml\": \"^2.7.1\"\n },\n \"devDependencies\": {\n \"vitest\": \"4.
|
|
5
|
+
"package.json": "{\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"tsc\",\n \"test\": \"pnpm build && vitest run src/superblocks-library-shim/*.test.ts\"\n },\n \"dependencies\": {\n \"@types/node\": \"^24\",\n \"@typescript-eslint/parser\": \"^8.54.0\",\n \"acorn\": \"^8.14.0\",\n \"eslint\": \"^9.39.2\",\n \"prettier\": \"^3.7.4\",\n \"typescript\": \"^6.0.3\",\n \"yaml\": \"^2.7.1\"\n },\n \"devDependencies\": {\n \"vitest\": \"4.1.11\"\n }\n}\n",
|
|
6
6
|
"pnpm-workspace.yaml": "packages:\n - .\n\n# Template prefetch installs this package without the repo lockfile in /tmp.\n# Keep Vitest's tinyexec transitive on the trust-policy-safe version.\noverrides:\n tinyexec: 1.0.2\n\n# nanoid 3.x dropped npm publish provenance from 3.3.13 onward, so the\n# no-downgrade trust policy rejects 3.3.14. 3.3.15 restored provenance but is\n# still inside the release-age soak, so a fresh resolve falls back to the\n# un-provenanced 3.3.14 and the install fails. Exclude nanoid from the soak so\n# the newest provenance-bearing version (3.3.15) is picked. The no-downgrade\n# trust check stays in force, so any future provenance-less nanoid is still\n# rejected. See https://github.com/ai/nanoid/issues/599.\nminimumReleaseAgeExclude:\n - nanoid\n",
|
|
7
7
|
"shim-loader.mjs": "import path from \"path\";\nimport { pathToFileURL } from \"url\";\n\nconst overrideMap = {\n \"@superblocksteam/library\": \"./dist/superblocks-library-shim/index.js\",\n};\n\nexport async function resolve(specifier, context, nextResolve) {\n if (overrideMap[specifier]) {\n const fullPath = path.resolve(overrideMap[specifier]);\n return {\n shortCircuit: true,\n url: pathToFileURL(fullPath).href,\n };\n }\n\n return nextResolve(specifier, context);\n}\n",
|
|
8
8
|
"src/do-eval-to-sdk.ts": "import fs from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\n\n// finds all JavaScript files in the specified directory,\n// imports each module, converts its JSON representation to SDK,\n// and returns a map with filenames as keys and SDK content as values.\nexport async function processSdkFiles(\n apisDir: string,\n): Promise<Record<string, string>> {\n const files = fs.readdirSync(apisDir);\n const jsFiles = files.filter(\n (file) => file.endsWith(\".js\") && file !== \"__template__.js\",\n );\n const results: Record<string, string> = {};\n\n for (const jsFile of jsFiles) {\n const filePath = path.join(apisDir, jsFile);\n const absolutePath = path.resolve(filePath);\n\n try {\n const fileUrl = new URL(`file://${absolutePath}`);\n const module = await import(fileUrl.href);\n\n const defaultExport = module.default;\n\n if (defaultExport && typeof defaultExport.toSDK === \"function\") {\n const sdkData = await defaultExport.toSDK();\n\n results[jsFile] = sdkData;\n } else {\n console.warn(`${jsFile}: Default export doesn't have a toSDK method`);\n }\n } catch (error) {\n console.error(`Error processing ${jsFile}:`, error);\n }\n }\n\n return results;\n}\n\nasync function main() {\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n const apisDir = path.resolve(__dirname, \"./to-sdk\");\n\n const results = await processSdkFiles(apisDir);\n console.log(JSON.stringify(results, null, 2));\n}\n\nmain().catch((error) => {\n console.error(\"Error:\", error);\n process.exit(1);\n});\n",
|