@osdk/create-widget 3.85.0 → 3.85.1-main-65dcc111f0439ce4ce5dfd623bc3c12058fc547b
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/CHANGELOG.md
CHANGED
|
@@ -111,15 +111,15 @@ dist-ssr
|
|
|
111
111
|
"preview": "vite preview"
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@osdk/widget.client-react": "^3.
|
|
115
|
-
"@osdk/widget.client": "^3.
|
|
114
|
+
"@osdk/widget.client-react": "^3.85.0",
|
|
115
|
+
"@osdk/widget.client": "^3.85.0",
|
|
116
116
|
"@blueprintjs/core": "^6.10.0",
|
|
117
117
|
"clsx": "^2.1.1",
|
|
118
118
|
"react": "^18",
|
|
119
119
|
"react-dom": "^18"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@osdk/widget.vite-plugin": "^3.
|
|
122
|
+
"@osdk/widget.vite-plugin": "^3.85.0",
|
|
123
123
|
"@eslint/compat": "^1.3.2",
|
|
124
124
|
"@eslint/js": "^9.35.0",
|
|
125
125
|
"@types/react": "^18",
|
|
@@ -158,15 +158,15 @@ dist-ssr
|
|
|
158
158
|
"{{osdkPackage}}": "latest",
|
|
159
159
|
"@osdk/client": "^2.0.0",
|
|
160
160
|
"@osdk/react": "^2.0.0",
|
|
161
|
-
"@osdk/widget.client-react": "^3.
|
|
162
|
-
"@osdk/widget.client": "^3.
|
|
161
|
+
"@osdk/widget.client-react": "^3.85.0",
|
|
162
|
+
"@osdk/widget.client": "^3.85.0",
|
|
163
163
|
"@blueprintjs/core": "^6.10.0",
|
|
164
164
|
"clsx": "^2.1.1",
|
|
165
165
|
"react": "^18",
|
|
166
166
|
"react-dom": "^18"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
|
-
"@osdk/widget.vite-plugin": "^3.
|
|
169
|
+
"@osdk/widget.vite-plugin": "^3.85.0",
|
|
170
170
|
"@eslint/compat": "^1.3.2",
|
|
171
171
|
"@eslint/js": "^9.35.0",
|
|
172
172
|
"@types/react": "^18",
|
|
@@ -345,5 +345,5 @@ export default defineConfig({
|
|
|
345
345
|
}]]);
|
|
346
346
|
|
|
347
347
|
export { files };
|
|
348
|
-
//# sourceMappingURL=esm-
|
|
349
|
-
//# sourceMappingURL=esm-
|
|
348
|
+
//# sourceMappingURL=esm-GTAFOAJ3.js.map
|
|
349
|
+
//# sourceMappingURL=esm-GTAFOAJ3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../create-widget.template.react.v2/build/esm/generatedNoCheck/index.js"],"names":[],"mappings":";AAAO,IAAM,KAAA,mBAAQ,IAAI,GAAA,CAAI,CAAC,CAAC,eAAA,EAAiB;AAAA,EAC9C,IAAA,EAAM,KAAA;AAAA,EACN,IAAA,EAAM,CAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;;AAAA;AAAA;AAAA;;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDR,CAAC,CAAA,EAAG,CAAC,YAAA,EAAc;AAAA,EACjB,IAAA,EAAM,KAAA;AAAA,EACN,IAAA,EAAM,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BR,CAAC,CAAA,EAAG,CAAC,mBAAA,EAAqB;AAAA,EACxB,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAC,CAAA,EAAG,CAAC,YAAA,EAAc;AAAA,EACjB,IAAA,EAAM,KAAA;AAAA,EACN,IAAA,EAAM,CAAA;AAAA;AAAA;AAAA;A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AAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBR,CAAC,CAAC,CAAC","file":"esm-LALUY5ZN.js","sourcesContent":["export const files = new Map([[\"README.md.hbs\", {\n type: \"raw\",\n body: `# {{project}}\n\n{{#if osdkPackage}}\nThis project was generated with [\\`@osdk/create-widget\\`](https://www.npmjs.com/package/@osdk/create-widget) and demonstrates developing custom widgets to be embedded within Foundry UIs such as Workshop. It uses the Ontology SDK package \\`{{osdkPackage}}\\` with React on top of Vite. Check out the [Vite](https://vitejs.dev/guide/) docs for further configuration. The Vite plugin [\\`@osdk/widget.vite-plugin\\`](https://www.npmjs.com/package/@osdk/widget.vite-plugin) automatically generates a \\`widgets.config.json\\` manifest file containing metadata about widgets inside this project during the build command.\n{{else}}\nThis project was generated with [\\`@osdk/create-widget\\`](https://www.npmjs.com/package/@osdk/create-widget) and demonstrates developing custom widgets to be embedded within Foundry UIs such as Workshop. It uses React on top of Vite. Check out the [Vite](https://vitejs.dev/guide/) docs for further configuration. The Vite plugin [\\`@osdk/widget.vite-plugin\\`](https://www.npmjs.com/package/@osdk/widget.vite-plugin) automatically generates a \\`widgets.config.json\\` manifest file containing metadata about widgets inside this project during the build command.\n{{/if}}\n\n## Developing\n\nRun the following commands (or equivalent with your preferred package manager) to start a local development server and follow the instructions printed to set up developer mode in Foundry:\n\n\\`\\`\\`sh\nexport FOUNDRY_TOKEN=<token>\nnpm run dev\n\\`\\`\\`\n\n> **Note:** A widget no longer needs to be published before you can develop on it. Publishing a widget once (see [Deploying](#deploying)) is still required to use it in Workshop so that it becomes selectable in the **Widget setup** panel.\n\n## Deploying\n\nA \\`foundry.config.json\\` file is included in the root of this project containing the deployment configuration to Foundry.\n\nRun the following commands (or equivalent with your preferred package manager) to create a production build of your widgets:\n\n\\`\\`\\`sh\nexport FOUNDRY_TOKEN=<token>\nnpm run build\n\\`\\`\\`\n\nA \\`.palantir/widgets.config.json\\` manifest file containing metadata about your widgets is created during the build.\n\nRun the following command (or equivalent with your preferred package manager) to deploy the production build of your widgets:\n\n\\`\\`\\`sh\nnpx @osdk/cli@latest widgetset deploy\n\\`\\`\\`\n\nBy default the \\`package-json\\` strategy is used for determining the version for your widgets from the \\`version\\` field in this project's \\`package.json\\` file. Remember to update this field and rerun the build command to update the manifest file when deploying a new version.\n\nIf you prefer to infer the version from a git tag, you can use the \\`git-describe\\` strategy by setting the \\`autoVersion\\` field in the \\`foundry.config.json\\` file to:\n\n\\`\\`\\`json\n{\n \"type\": \"git-describe\",\n \"tagPrefix\": \"\"\n}\n\\`\\`\\`\n`\n}], [\".gitignore\", {\n type: \"raw\",\n body: `# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n.pnpm-store\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n`\n}], [\"eslint.config.mjs\", {\n \"type\": \"base64\",\n \"body\": \"Ly8gQHRzLWNoZWNrCmltcG9ydCBlc2xpbnQgZnJvbSAiQGVzbGludC9qcyI7CmltcG9ydCB0c1BhcnNlciBmcm9tICJAdHlwZXNjcmlwdC1lc2xpbnQvcGFyc2VyIjsKaW1wb3J0ICogYXMgaW1wb3J0UGx1Z2luIGZyb20gImVzbGludC1wbHVnaW4taW1wb3J0IjsKaW1wb3J0IGpzeEExMXlQbHVnaW4gZnJvbSAiZXNsaW50LXBsdWdpbi1qc3gtYTExeSI7CmltcG9ydCByZWFjdFBsdWdpbiBmcm9tICJlc2xpbnQtcGx1Z2luLXJlYWN0IjsKaW1wb3J0IHJlYWN0SG9va3NQbHVnaW4gZnJvbSAiZXNsaW50LXBsdWdpbi1yZWFjdC1ob29rcyI7CmltcG9ydCByZWFjdFJlZnJlc2ggZnJvbSAiZXNsaW50LXBsdWdpbi1yZWFjdC1yZWZyZXNoIjsKaW1wb3J0IGdsb2JhbHMgZnJvbSAiZ2xvYmFscyI7CmltcG9ydCB0c2VzbGludCBmcm9tICJ0eXBlc2NyaXB0LWVzbGludCI7CgpleHBvcnQgZGVmYXVsdCB0c2VzbGludC5jb25maWcoewogIGZpbGVzOiBbImVzbGludC5jb25maWcubWpzIiwgInNyYy8qKi8qLntqcyxtanMsY2pzLHRzLGpzeCx0c3h9Il0sCiAgc2V0dGluZ3M6IHsKICAgIHJlYWN0OiB7CiAgICAgIHZlcnNpb246ICJkZXRlY3QiLAogICAgfSwKCiAgICAiaW1wb3J0L3Jlc29sdmVyIjogewogICAgICBub2RlOiB7CiAgICAgICAgZXh0ZW5zaW9uczogWyIuanMiLCAiLmpzeCIsICIudHMiLCAiLnRzeCJdLAogICAgICB9LAogICAgfSwKICB9LAogIGxhbmd1YWdlT3B0aW9uczogewogICAgZ2xvYmFsczogewogICAgICAuLi5nbG9iYWxzLmJyb3dzZXIsCiAgICB9LAoKICAgIHBhcnNlcjogdHNQYXJzZXIsCiAgfSwKICBleHRlbmRzOiBbCiAgICBlc2xpbnQuY29uZmlncy5yZWNvbW1lbmRlZCwKICAgIC4uLnRzZXNsaW50LmNvbmZpZ3MucmVjb21tZW5kZWQsCiAgXSwKICBwbHVnaW5zOiB7CiAgICAicmVhY3QiOiAvKiogQHR5cGUgaW1wb3J0KCJlc2xpbnQiKS5FU0xpbnQuUGx1Z2luICovIChyZWFjdFBsdWdpbiksCiAgICAicmVhY3QtcmVmcmVzaCI6IHJlYWN0UmVmcmVzaCwKICAgICJyZWFjdC1ob29rcyI6CiAgICAgIC8qKiBAdHlwZSBpbXBvcnQoImVzbGludCIpLkVTTGludC5QbHVnaW4gKi8gKHJlYWN0SG9va3NQbHVnaW4pLAogICAgImpzeC1hMTF5IjoganN4QTExeVBsdWdpbiwKICAgICJpbXBvcnQiOiBpbXBvcnRQbHVnaW4sCiAgfSwKICBydWxlczogewogICAgLi4uKAogICAgICAvKiogQHR5cGUgaW1wb3J0KCJlc2xpbnQiKS5MaW50ZXIuUnVsZXNSZWNvcmQgKi8KICAgICAgKHJlYWN0UGx1Z2luLmNvbmZpZ3MuZmxhdD8ucmVjb21tZW5kZWQucnVsZXMpCiAgICApLAogICAgInJlYWN0LWhvb2tzL3J1bGVzLW9mLWhvb2tzIjogImVycm9yIiwKICAgICJyZWFjdC1ob29rcy9leGhhdXN0aXZlLWRlcHMiOiAid2FybiIsCiAgICAuLi5qc3hBMTF5UGx1Z2luLmNvbmZpZ3MucmVjb21tZW5kZWQucnVsZXMsCiAgICAicmVhY3QtcmVmcmVzaC9vbmx5LWV4cG9ydC1jb21wb25lbnRzIjogWyJ3YXJuIiwgewogICAgICBhbGxvd0NvbnN0YW50RXhwb3J0OiB0cnVlLAogICAgfV0sCgogICAgImltcG9ydC9uYW1lZCI6ICJlcnJvciIsCiAgICAiaW1wb3J0L2RlZmF1bHQiOiAiZXJyb3IiLAogICAgImltcG9ydC9uYW1lc3BhY2UiOiAiZXJyb3IiLAogICAgImltcG9ydC9uby1kdXBsaWNhdGVzIjogImVycm9yIiwKICAgICJpbXBvcnQvbm8tZXh0cmFuZW91cy1kZXBlbmRlbmNpZXMiOiAiZXJyb3IiLAoKICAgICJyZWFjdC9yZWFjdC1pbi1qc3gtc2NvcGUiOiAib2ZmIiwKICB9LAp9KTsK\"\n}], [\"index.html\", {\n type: \"raw\",\n body: `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>React Custom Widget</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n`\n}], [\"package.json.no-osdk.hbs\", {\n type: \"raw\",\n body: `{\n \"name\": \"{{project}}\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"tsc && vite build\",\n \"lint\": \"eslint . --report-unused-disable-directives --max-warnings 0\",\n \"test\": \"vitest run --passWithNoTests\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@osdk/widget.client-react\": \"^3.26.0\",\n \"@osdk/widget.client\": \"^3.26.0\",\n \"@blueprintjs/core\": \"^6.10.0\",\n \"clsx\": \"^2.1.1\",\n \"react\": \"^18\",\n \"react-dom\": \"^18\"\n },\n \"devDependencies\": {\n \"@osdk/widget.vite-plugin\": \"^3.26.0\",\n \"@eslint/compat\": \"^1.3.2\",\n \"@eslint/js\": \"^9.35.0\",\n \"@types/react\": \"^18\",\n \"@types/react-dom\": \"^18\",\n \"@typescript-eslint/eslint-plugin\": \"^8.43.0\",\n \"@typescript-eslint/parser\": \"^8.43.0\",\n \"@vitejs/plugin-react\": \"^4.7.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-plugin-import\": \"^2.32.0\",\n \"eslint-plugin-jsx-a11y\": \"^6.10.2\",\n \"eslint-plugin-react\": \"^7.37.5\",\n \"eslint-plugin-react-hooks\": \"^5.2.0\",\n \"eslint-plugin-react-refresh\": \"^0.4.20\",\n \"globals\": \"^15.15.0\",\n \"typescript\": \"~5.5.4\",\n \"typescript-eslint\": \"^8.43.0\",\n \"vite\": \"^7.3.1\",\n \"vitest\": \"^3.2.4\"\n }\n}`\n}], [\"package.json.osdk.hbs\", {\n type: \"raw\",\n body: `{\n \"name\": \"{{project}}\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"tsc && vite build\",\n \"lint\": \"eslint . --report-unused-disable-directives --max-warnings 0\",\n \"test\": \"vitest run --passWithNoTests\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"{{osdkPackage}}\": \"latest\",\n \"@osdk/client\": \"^2.0.0\",\n \"@osdk/react\": \"^2.0.0\",\n \"@osdk/widget.client-react\": \"^3.26.0\",\n \"@osdk/widget.client\": \"^3.26.0\",\n \"@blueprintjs/core\": \"^6.10.0\",\n \"clsx\": \"^2.1.1\",\n \"react\": \"^18\",\n \"react-dom\": \"^18\"\n },\n \"devDependencies\": {\n \"@osdk/widget.vite-plugin\": \"^3.26.0\",\n \"@eslint/compat\": \"^1.3.2\",\n \"@eslint/js\": \"^9.35.0\",\n \"@types/react\": \"^18\",\n \"@types/react-dom\": \"^18\",\n \"@typescript-eslint/eslint-plugin\": \"^8.43.0\",\n \"@typescript-eslint/parser\": \"^8.43.0\",\n \"@vitejs/plugin-react\": \"^4.7.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-plugin-import\": \"^2.32.0\",\n \"eslint-plugin-jsx-a11y\": \"^6.10.2\",\n \"eslint-plugin-react\": \"^7.37.5\",\n \"eslint-plugin-react-hooks\": \"^5.2.0\",\n \"eslint-plugin-react-refresh\": \"^0.4.20\",\n \"globals\": \"^15.15.0\",\n \"typescript\": \"~5.5.4\",\n \"typescript-eslint\": \"^8.43.0\",\n \"vite\": \"^7.3.1\",\n \"vitest\": \"^3.2.4\"\n }\n}`\n}], [\"src/Widget.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LmNvbnRhaW5lciB7CiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1icC1wYWxldHRlLXdoaXRlKTsKICAgIHBhZGRpbmc6IDIwcHg7CiAgICBnYXA6IDIwcHg7CiAgICBkaXNwbGF5OiBmbGV4OwogICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjsKICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjsKICAgIGhlaWdodDogMTAwJTsKfQoKQG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgewogICAgLmNvbnRhaW5lciB7CiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tYnAtcGFsZXR0ZS1kYXJrLWdyYXktMyk7CiAgICB9Cn0KCi5jb250YWluZXIgLmhlYWRlciB7CiAgICBtYXJnaW46IDA7Cn0KCi5jYXJkIHsKICAgIGRpc3BsYXk6IGZsZXg7CiAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgIGdhcDogMTBweDsKICAgIHdpZHRoOiAxNTBweDsKfQo=\"\n}], [\"src/Widget.tsx.hbs\", {\n type: \"raw\",\n body: `{{#if osdkPackage}}\nimport { Button, Card, Classes, H4, Tag } from \"@blueprintjs/core\";\n{{else}}\nimport { Button, Card, Classes, H4 } from \"@blueprintjs/core\";\n{{/if}}\nimport {\n type FoundryWidgetClientContext,\n useFoundryWidgetContext,\n} from \"@osdk/widget.client-react\";\nimport clsx from \"clsx\";\nimport React, { useCallback, useEffect } from \"react\";\nimport type MainConfig from \"./main.config.js\";\nimport { useDarkTheme } from \"./useDarkTheme.js\";\nimport css from \"./Widget.module.css\";\n{{#if osdkPackage}}\n// import { useOsdkClient } from \"@osdk/react\";\n{{/if}}\n\nconst useWidgetContext: () => FoundryWidgetClientContext<typeof MainConfig> =\n useFoundryWidgetContext.withTypes<typeof MainConfig>();\n\nexport const Widget: React.FC = () => {\n{{#if osdkPackage}}\n // View the API documentation for your widget set to learn how to use the Ontology SDK.\n // {{foundryUrl}}/workspace/custom-widgets/widget-set/{{widgetSet}}/sdk/docs\n // const client = useOsdkClient();\n\n{{/if}}\n const { parameters, emitEvent } = useWidgetContext();\n const greetingName = parameters.values.greetingName ?? \"World\";\n const counterValue = parameters.values.counterValue ?? 0;\n\n const setCounterValue = useCallback(\n (value: number) =>\n emitEvent(\"setCounterValue\", {\n parameterUpdates: { counterValue: value },\n }),\n [emitEvent],\n );\n\n const handleResetCounter = useCallback(() => setCounterValue(0), [\n setCounterValue,\n ]);\n\n useEffect(() => {\n const interval = setInterval(() => setCounterValue(counterValue + 1), 1000);\n return () => clearInterval(interval);\n }, [setCounterValue, counterValue]);\n\n const isDarkTheme = useDarkTheme();\n\n return (\n <div className={clsx(css.container, isDarkTheme && Classes.DARK)}>\n <H4 className={css.header}>Hello, {greetingName}!</H4>\n <Card className={css.card} compact={true}>\n <div>Count: {counterValue}</div>\n <Button onClick={handleResetCounter}>Reset</Button>\n </Card>\n{{#if osdkPackage}}\n <div>\n <span>OSDK: </span>\n <Tag minimal={true}>{{osdkPackage}}</Tag>\n </div>\n{{/if}}\n </div>\n );\n};\n`\n}], [\"src/client.ts.osdk.hbs\", {\n type: \"raw\",\n body: `import { \\$ontologyRid } from \"{{osdkPackage}}\";\nimport { createClient } from \"@osdk/client\";\nimport { createFoundryWidgetTokenProvider } from \"@osdk/widget.client\";\n\nexport const client = createClient(\n window.location.origin,\n \\$ontologyRid,\n createFoundryWidgetTokenProvider(),\n);\n`\n}], [\"src/main.config.ts\", {\n \"type\": \"base64\",\n \"body\": \"aW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSAiQG9zZGsvd2lkZ2V0LmNsaWVudCI7CgovLyBVcGRhdGVzIHRvIHRoZSB3aWRnZXQgY29uZmlndXJhdGlvbiBpbiB0aGlzIGZpbGUgcmVxdWlyZSByZWFwcGx5aW5nIGRldiBtb2RlCi8vIHRvIHByZXZpZXcgdGhlIGNoYW5nZXMuIFdoZW4gZGV2ZWxvcGluZyBsb2NhbGx5LCBvcGVuIHRoZSBzZXR1cCBVUkwgcHJpbnRlZAovLyBpbiB5b3VyIHRlcm1pbmFsIGFnYWluLiBXaGVuIGRldmVsb3BpbmcgaW4gQ29kZSBXb3Jrc3BhY2VzLCByZWZyZXNoIHRoZQovLyBwcmV2aWV3IHBhbmVsLgoKZXhwb3J0IGRlZmF1bHQgZGVmaW5lQ29uZmlnKHsKICBpZDogIndpZGdldElkIiwKICBuYW1lOiAiQ3VzdG9tIFdpZGdldCIsCiAgZGVzY3JpcHRpb246ICJBbiBleGFtcGxlIGN1c3RvbSB3aWRnZXQgaW1wbGVtZW50YXRpb24iLAogIHR5cGU6ICJ3b3Jrc2hvcCIsCiAgcGFyYW1ldGVyczogewogICAgZ3JlZXRpbmdOYW1lOiB7CiAgICAgIGRpc3BsYXlOYW1lOiAiR3JlZXRpbmcgbmFtZSIsCiAgICAgIHR5cGU6ICJzdHJpbmciLAogICAgfSwKICAgIGNvdW50ZXJWYWx1ZTogewogICAgICBkaXNwbGF5TmFtZTogIkNvdW50ZXIgdmFsdWUiLAogICAgICB0eXBlOiAibnVtYmVyIiwKICAgIH0sCiAgfSwKICBldmVudHM6IHsKICAgIHNldENvdW50ZXJWYWx1ZTogewogICAgICBkaXNwbGF5TmFtZTogIlNldCBjb3VudGVyIHZhbHVlIiwKICAgICAgcGFyYW1ldGVyVXBkYXRlSWRzOiBbImNvdW50ZXJWYWx1ZSJdLAogICAgfSwKICB9LAp9KTsK\"\n}], [\"src/main.css\", {\n \"type\": \"base64\",\n \"body\": \"aHRtbCwgYm9keSB7CiAgICBtYXJnaW46IDA7Cn0K\"\n}], [\"src/main.tsx.hbs\", {\n type: \"raw\",\n body: `import \"@blueprintjs/core/lib/css/blueprint.css\";\nimport \"./main.css\";\n\n{{#if osdkPackage}}\nimport { OsdkProvider } from \"@osdk/react\";\n{{/if}}\nimport { FoundryWidget } from \"@osdk/widget.client-react\";\nimport { createRoot } from \"react-dom/client\";\n{{#if osdkPackage}}\nimport { client } from \"./client.js\";\n{{/if}}\nimport MainConfig from \"./main.config.js\";\nimport { Widget } from \"./Widget.js\";\n\nconst root = document.getElementById(\"root\")!;\n\ncreateRoot(root).render(\n{{#if osdkPackage}}\n <FoundryWidget config={MainConfig} client={client}>\n <OsdkProvider client={client}>\n <Widget />\n </OsdkProvider>\n </FoundryWidget>,\n{{else}}\n <FoundryWidget config={MainConfig}>\n <Widget />\n </FoundryWidget>,\n{{/if}}\n);\n`\n}], [\"src/useDarkTheme.ts\", {\n \"type\": \"base64\",\n \"body\": \"aW1wb3J0IHsgdXNlRWZmZWN0LCB1c2VTdGF0ZSB9IGZyb20gInJlYWN0IjsKCmV4cG9ydCBjb25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LwogICAgIm1vZHVsZVJlc29sdXRpb24iOiAiYnVuZGxlciIsCiAgICAiYWxsb3dJbXBvcnRpbmdUc0V4dGVuc2lvbnMiOiB0cnVlLAogICAgInJlc29sdmVKc29uTW9kdWxlIjogdHJ1ZSwKICAgICJpc29sYXRlZE1vZHVsZXMiOiB0cnVlLAogICAgIm5vRW1pdCI6IHRydWUsCiAgICAianN4IjogInJlYWN0LWpzeCIsCgogICAgLyogTGludGluZyAqLwogICAgInN0cmljdCI6IHRydWUsCiAgICAibm9VbnVzZWRMb2NhbHMiOiB0cnVlLAogICAgIm5vVW51c2VkUGFyYW1ldGVycyI6IHRydWUsCiAgICAibm9GYWxsdGhyb3VnaENhc2VzSW5Td2l0Y2giOiB0cnVlCiAgfSwKICAiaW5jbHVkZSI6IFsic3JjIl0sCiAgInJlZmVyZW5jZXMiOiBbeyAicGF0aCI6ICIuL3RzY29uZmlnLm5vZGUuanNvbiIgfV0KfQo=\"\n}], [\"tsconfig.node.json\", {\n \"type\": \"base64\",\n \"body\": \"ewogICJjb21waWxlck9wdGlvbnMiOiB7CiAgICAiY29tcG9zaXRlIjogdHJ1ZSwKICAgICJza2lwTGliQ2hlY2siOiB0cnVlLAogICAgIm1vZHVsZSI6ICJFU05leHQiLAogICAgIm1vZHVsZVJlc29sdXRpb24iOiAiYnVuZGxlciIsCiAgICAiYWxsb3dTeW50aGV0aWNEZWZhdWx0SW1wb3J0cyI6IHRydWUKICB9LAogICJpbmNsdWRlIjogWyJ2aXRlLmNvbmZpZy50cyJdCn0K\"\n}], [\"vite.config.ts.hbs\", {\n type: \"raw\",\n body: `import foundryWidgetPlugin from \"@osdk/widget.vite-plugin\";\nimport react from \"@vitejs/plugin-react\";\nimport { defineConfig } from \"vite\";\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [react(), foundryWidgetPlugin()],\n server: {\n port: 8080,\n cors: true,\n },\n build: {\n rollupOptions: {\n input: [\"./index.html\"],\n },\n },\n});\n`\n}]]);"]}
|
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,QAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAC,CAAA,EAAG,CAAC,cAAA,EAAgB;AAAA,EACnB,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAC,CAAA,EAAG,CAAC,kBAAA,EAAoB;AAAA,EACvB,IAAA,EAAM,KAAA;AAAA,EACN,IAAA,EAAM,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BR,CAAC,CAAA,EAAG,CAAC,qBAAA,EAAuB;AAAA,EAC1B,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAC,CAAA,EAAG,CAAC,mBAAA,EAAqB;AAAA,EACxB,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAC,CAAA,EAAG,CAAC,eAAA,EAAiB;AAAA,EACpB,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAC,CAAA,EAAG,CAAC,oBAAA,EAAsB;AAAA,EACzB,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAC,CAAA,EAAG,CAAC,oBAAA,EAAsB;AAAA,EACzB,IAAA,EAAM,KAAA;AAAA,EACN,IAAA,EAAM,CAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBR,CAAC,CAAC,CAAC","file":"esm-GTAFOAJ3.js","sourcesContent":["export const files = new Map([[\"README.md.hbs\", {\n type: \"raw\",\n body: `# {{project}}\n\n{{#if osdkPackage}}\nThis project was generated with [\\`@osdk/create-widget\\`](https://www.npmjs.com/package/@osdk/create-widget) and demonstrates developing custom widgets to be embedded within Foundry UIs such as Workshop. It uses the Ontology SDK package \\`{{osdkPackage}}\\` with React on top of Vite. Check out the [Vite](https://vitejs.dev/guide/) docs for further configuration. The Vite plugin [\\`@osdk/widget.vite-plugin\\`](https://www.npmjs.com/package/@osdk/widget.vite-plugin) automatically generates a \\`widgets.config.json\\` manifest file containing metadata about widgets inside this project during the build command.\n{{else}}\nThis project was generated with [\\`@osdk/create-widget\\`](https://www.npmjs.com/package/@osdk/create-widget) and demonstrates developing custom widgets to be embedded within Foundry UIs such as Workshop. It uses React on top of Vite. Check out the [Vite](https://vitejs.dev/guide/) docs for further configuration. The Vite plugin [\\`@osdk/widget.vite-plugin\\`](https://www.npmjs.com/package/@osdk/widget.vite-plugin) automatically generates a \\`widgets.config.json\\` manifest file containing metadata about widgets inside this project during the build command.\n{{/if}}\n\n## Developing\n\nRun the following commands (or equivalent with your preferred package manager) to start a local development server and follow the instructions printed to set up developer mode in Foundry:\n\n\\`\\`\\`sh\nexport FOUNDRY_TOKEN=<token>\nnpm run dev\n\\`\\`\\`\n\n> **Note:** A widget no longer needs to be published before you can develop on it. Publishing a widget once (see [Deploying](#deploying)) is still required to use it in Workshop so that it becomes selectable in the **Widget setup** panel.\n\n## Deploying\n\nA \\`foundry.config.json\\` file is included in the root of this project containing the deployment configuration to Foundry.\n\nRun the following commands (or equivalent with your preferred package manager) to create a production build of your widgets:\n\n\\`\\`\\`sh\nexport FOUNDRY_TOKEN=<token>\nnpm run build\n\\`\\`\\`\n\nA \\`.palantir/widgets.config.json\\` manifest file containing metadata about your widgets is created during the build.\n\nRun the following command (or equivalent with your preferred package manager) to deploy the production build of your widgets:\n\n\\`\\`\\`sh\nnpx @osdk/cli@latest widgetset deploy\n\\`\\`\\`\n\nBy default the \\`package-json\\` strategy is used for determining the version for your widgets from the \\`version\\` field in this project's \\`package.json\\` file. Remember to update this field and rerun the build command to update the manifest file when deploying a new version.\n\nIf you prefer to infer the version from a git tag, you can use the \\`git-describe\\` strategy by setting the \\`autoVersion\\` field in the \\`foundry.config.json\\` file to:\n\n\\`\\`\\`json\n{\n \"type\": \"git-describe\",\n \"tagPrefix\": \"\"\n}\n\\`\\`\\`\n`\n}], [\".gitignore\", {\n type: \"raw\",\n body: `# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndist-ssr\n*.local\n.pnpm-store\n\n# Editor directories and files\n.vscode/*\n!.vscode/extensions.json\n.idea\n.DS_Store\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw?\n`\n}], [\"eslint.config.mjs\", {\n \"type\": \"base64\",\n \"body\": \"Ly8gQHRzLWNoZWNrCmltcG9ydCBlc2xpbnQgZnJvbSAiQGVzbGludC9qcyI7CmltcG9ydCB0c1BhcnNlciBmcm9tICJAdHlwZXNjcmlwdC1lc2xpbnQvcGFyc2VyIjsKaW1wb3J0ICogYXMgaW1wb3J0UGx1Z2luIGZyb20gImVzbGludC1wbHVnaW4taW1wb3J0IjsKaW1wb3J0IGpzeEExMXlQbHVnaW4gZnJvbSAiZXNsaW50LXBsdWdpbi1qc3gtYTExeSI7CmltcG9ydCByZWFjdFBsdWdpbiBmcm9tICJlc2xpbnQtcGx1Z2luLXJlYWN0IjsKaW1wb3J0IHJlYWN0SG9va3NQbHVnaW4gZnJvbSAiZXNsaW50LXBsdWdpbi1yZWFjdC1ob29rcyI7CmltcG9ydCByZWFjdFJlZnJlc2ggZnJvbSAiZXNsaW50LXBsdWdpbi1yZWFjdC1yZWZyZXNoIjsKaW1wb3J0IGdsb2JhbHMgZnJvbSAiZ2xvYmFscyI7CmltcG9ydCB0c2VzbGludCBmcm9tICJ0eXBlc2NyaXB0LWVzbGludCI7CgpleHBvcnQgZGVmYXVsdCB0c2VzbGludC5jb25maWcoewogIGZpbGVzOiBbImVzbGludC5jb25maWcubWpzIiwgInNyYy8qKi8qLntqcyxtanMsY2pzLHRzLGpzeCx0c3h9Il0sCiAgc2V0dGluZ3M6IHsKICAgIHJlYWN0OiB7CiAgICAgIHZlcnNpb246ICJkZXRlY3QiLAogICAgfSwKCiAgICAiaW1wb3J0L3Jlc29sdmVyIjogewogICAgICBub2RlOiB7CiAgICAgICAgZXh0ZW5zaW9uczogWyIuanMiLCAiLmpzeCIsICIudHMiLCAiLnRzeCJdLAogICAgICB9LAogICAgfSwKICB9LAogIGxhbmd1YWdlT3B0aW9uczogewogICAgZ2xvYmFsczogewogICAgICAuLi5nbG9iYWxzLmJyb3dzZXIsCiAgICB9LAoKICAgIHBhcnNlcjogdHNQYXJzZXIsCiAgfSwKICBleHRlbmRzOiBbCiAgICBlc2xpbnQuY29uZmlncy5yZWNvbW1lbmRlZCwKICAgIC4uLnRzZXNsaW50LmNvbmZpZ3MucmVjb21tZW5kZWQsCiAgXSwKICBwbHVnaW5zOiB7CiAgICAicmVhY3QiOiAvKiogQHR5cGUgaW1wb3J0KCJlc2xpbnQiKS5FU0xpbnQuUGx1Z2luICovIChyZWFjdFBsdWdpbiksCiAgICAicmVhY3QtcmVmcmVzaCI6IHJlYWN0UmVmcmVzaCwKICAgICJyZWFjdC1ob29rcyI6CiAgICAgIC8qKiBAdHlwZSBpbXBvcnQoImVzbGludCIpLkVTTGludC5QbHVnaW4gKi8gKHJlYWN0SG9va3NQbHVnaW4pLAogICAgImpzeC1hMTF5IjoganN4QTExeVBsdWdpbiwKICAgICJpbXBvcnQiOiBpbXBvcnRQbHVnaW4sCiAgfSwKICBydWxlczogewogICAgLi4uKAogICAgICAvKiogQHR5cGUgaW1wb3J0KCJlc2xpbnQiKS5MaW50ZXIuUnVsZXNSZWNvcmQgKi8KICAgICAgKHJlYWN0UGx1Z2luLmNvbmZpZ3MuZmxhdD8ucmVjb21tZW5kZWQucnVsZXMpCiAgICApLAogICAgInJlYWN0LWhvb2tzL3J1bGVzLW9mLWhvb2tzIjogImVycm9yIiwKICAgICJyZWFjdC1ob29rcy9leGhhdXN0aXZlLWRlcHMiOiAid2FybiIsCiAgICAuLi5qc3hBMTF5UGx1Z2luLmNvbmZpZ3MucmVjb21tZW5kZWQucnVsZXMsCiAgICAicmVhY3QtcmVmcmVzaC9vbmx5LWV4cG9ydC1jb21wb25lbnRzIjogWyJ3YXJuIiwgewogICAgICBhbGxvd0NvbnN0YW50RXhwb3J0OiB0cnVlLAogICAgfV0sCgogICAgImltcG9ydC9uYW1lZCI6ICJlcnJvciIsCiAgICAiaW1wb3J0L2RlZmF1bHQiOiAiZXJyb3IiLAogICAgImltcG9ydC9uYW1lc3BhY2UiOiAiZXJyb3IiLAogICAgImltcG9ydC9uby1kdXBsaWNhdGVzIjogImVycm9yIiwKICAgICJpbXBvcnQvbm8tZXh0cmFuZW91cy1kZXBlbmRlbmNpZXMiOiAiZXJyb3IiLAoKICAgICJyZWFjdC9yZWFjdC1pbi1qc3gtc2NvcGUiOiAib2ZmIiwKICB9LAp9KTsK\"\n}], [\"index.html\", {\n type: \"raw\",\n body: `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>React Custom Widget</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n`\n}], [\"package.json.no-osdk.hbs\", {\n type: \"raw\",\n body: `{\n \"name\": \"{{project}}\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"tsc && vite build\",\n \"lint\": \"eslint . --report-unused-disable-directives --max-warnings 0\",\n \"test\": \"vitest run --passWithNoTests\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@osdk/widget.client-react\": \"^3.85.0\",\n \"@osdk/widget.client\": \"^3.85.0\",\n \"@blueprintjs/core\": \"^6.10.0\",\n \"clsx\": \"^2.1.1\",\n \"react\": \"^18\",\n \"react-dom\": \"^18\"\n },\n \"devDependencies\": {\n \"@osdk/widget.vite-plugin\": \"^3.85.0\",\n \"@eslint/compat\": \"^1.3.2\",\n \"@eslint/js\": \"^9.35.0\",\n \"@types/react\": \"^18\",\n \"@types/react-dom\": \"^18\",\n \"@typescript-eslint/eslint-plugin\": \"^8.43.0\",\n \"@typescript-eslint/parser\": \"^8.43.0\",\n \"@vitejs/plugin-react\": \"^4.7.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-plugin-import\": \"^2.32.0\",\n \"eslint-plugin-jsx-a11y\": \"^6.10.2\",\n \"eslint-plugin-react\": \"^7.37.5\",\n \"eslint-plugin-react-hooks\": \"^5.2.0\",\n \"eslint-plugin-react-refresh\": \"^0.4.20\",\n \"globals\": \"^15.15.0\",\n \"typescript\": \"~5.5.4\",\n \"typescript-eslint\": \"^8.43.0\",\n \"vite\": \"^7.3.1\",\n \"vitest\": \"^3.2.4\"\n }\n}`\n}], [\"package.json.osdk.hbs\", {\n type: \"raw\",\n body: `{\n \"name\": \"{{project}}\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"tsc && vite build\",\n \"lint\": \"eslint . --report-unused-disable-directives --max-warnings 0\",\n \"test\": \"vitest run --passWithNoTests\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"{{osdkPackage}}\": \"latest\",\n \"@osdk/client\": \"^2.0.0\",\n \"@osdk/react\": \"^2.0.0\",\n \"@osdk/widget.client-react\": \"^3.85.0\",\n \"@osdk/widget.client\": \"^3.85.0\",\n \"@blueprintjs/core\": \"^6.10.0\",\n \"clsx\": \"^2.1.1\",\n \"react\": \"^18\",\n \"react-dom\": \"^18\"\n },\n \"devDependencies\": {\n \"@osdk/widget.vite-plugin\": \"^3.85.0\",\n \"@eslint/compat\": \"^1.3.2\",\n \"@eslint/js\": \"^9.35.0\",\n \"@types/react\": \"^18\",\n \"@types/react-dom\": \"^18\",\n \"@typescript-eslint/eslint-plugin\": \"^8.43.0\",\n \"@typescript-eslint/parser\": \"^8.43.0\",\n \"@vitejs/plugin-react\": \"^4.7.0\",\n \"eslint\": \"^9.35.0\",\n \"eslint-plugin-import\": \"^2.32.0\",\n \"eslint-plugin-jsx-a11y\": \"^6.10.2\",\n \"eslint-plugin-react\": \"^7.37.5\",\n \"eslint-plugin-react-hooks\": \"^5.2.0\",\n \"eslint-plugin-react-refresh\": \"^0.4.20\",\n \"globals\": \"^15.15.0\",\n \"typescript\": \"~5.5.4\",\n \"typescript-eslint\": \"^8.43.0\",\n \"vite\": \"^7.3.1\",\n \"vitest\": \"^3.2.4\"\n }\n}`\n}], [\"src/Widget.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LmNvbnRhaW5lciB7CiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1icC1wYWxldHRlLXdoaXRlKTsKICAgIHBhZGRpbmc6IDIwcHg7CiAgICBnYXA6IDIwcHg7CiAgICBkaXNwbGF5OiBmbGV4OwogICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjsKICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjsKICAgIGhlaWdodDogMTAwJTsKfQoKQG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgewogICAgLmNvbnRhaW5lciB7CiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tYnAtcGFsZXR0ZS1kYXJrLWdyYXktMyk7CiAgICB9Cn0KCi5jb250YWluZXIgLmhlYWRlciB7CiAgICBtYXJnaW46IDA7Cn0KCi5jYXJkIHsKICAgIGRpc3BsYXk6IGZsZXg7CiAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogICAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICAgIGdhcDogMTBweDsKICAgIHdpZHRoOiAxNTBweDsKfQo=\"\n}], [\"src/Widget.tsx.hbs\", {\n type: \"raw\",\n body: `{{#if osdkPackage}}\nimport { Button, Card, Classes, H4, Tag } from \"@blueprintjs/core\";\n{{else}}\nimport { Button, Card, Classes, H4 } from \"@blueprintjs/core\";\n{{/if}}\nimport {\n type FoundryWidgetClientContext,\n useFoundryWidgetContext,\n} from \"@osdk/widget.client-react\";\nimport clsx from \"clsx\";\nimport React, { useCallback, useEffect } from \"react\";\nimport type MainConfig from \"./main.config.js\";\nimport { useDarkTheme } from \"./useDarkTheme.js\";\nimport css from \"./Widget.module.css\";\n{{#if osdkPackage}}\n// import { useOsdkClient } from \"@osdk/react\";\n{{/if}}\n\nconst useWidgetContext: () => FoundryWidgetClientContext<typeof MainConfig> =\n useFoundryWidgetContext.withTypes<typeof MainConfig>();\n\nexport const Widget: React.FC = () => {\n{{#if osdkPackage}}\n // View the API documentation for your widget set to learn how to use the Ontology SDK.\n // {{foundryUrl}}/workspace/custom-widgets/widget-set/{{widgetSet}}/sdk/docs\n // const client = useOsdkClient();\n\n{{/if}}\n const { parameters, emitEvent } = useWidgetContext();\n const greetingName = parameters.values.greetingName ?? \"World\";\n const counterValue = parameters.values.counterValue ?? 0;\n\n const setCounterValue = useCallback(\n (value: number) =>\n emitEvent(\"setCounterValue\", {\n parameterUpdates: { counterValue: value },\n }),\n [emitEvent],\n );\n\n const handleResetCounter = useCallback(() => setCounterValue(0), [\n setCounterValue,\n ]);\n\n useEffect(() => {\n const interval = setInterval(() => setCounterValue(counterValue + 1), 1000);\n return () => clearInterval(interval);\n }, [setCounterValue, counterValue]);\n\n const isDarkTheme = useDarkTheme();\n\n return (\n <div className={clsx(css.container, isDarkTheme && Classes.DARK)}>\n <H4 className={css.header}>Hello, {greetingName}!</H4>\n <Card className={css.card} compact={true}>\n <div>Count: {counterValue}</div>\n <Button onClick={handleResetCounter}>Reset</Button>\n </Card>\n{{#if osdkPackage}}\n <div>\n <span>OSDK: </span>\n <Tag minimal={true}>{{osdkPackage}}</Tag>\n </div>\n{{/if}}\n </div>\n );\n};\n`\n}], [\"src/client.ts.osdk.hbs\", {\n type: \"raw\",\n body: `import { \\$ontologyRid } from \"{{osdkPackage}}\";\nimport { createClient } from \"@osdk/client\";\nimport { createFoundryWidgetTokenProvider } from \"@osdk/widget.client\";\n\nexport const client = createClient(\n window.location.origin,\n \\$ontologyRid,\n createFoundryWidgetTokenProvider(),\n);\n`\n}], [\"src/main.config.ts\", {\n \"type\": \"base64\",\n \"body\": \"aW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSAiQG9zZGsvd2lkZ2V0LmNsaWVudCI7CgovLyBVcGRhdGVzIHRvIHRoZSB3aWRnZXQgY29uZmlndXJhdGlvbiBpbiB0aGlzIGZpbGUgcmVxdWlyZSByZWFwcGx5aW5nIGRldiBtb2RlCi8vIHRvIHByZXZpZXcgdGhlIGNoYW5nZXMuIFdoZW4gZGV2ZWxvcGluZyBsb2NhbGx5LCBvcGVuIHRoZSBzZXR1cCBVUkwgcHJpbnRlZAovLyBpbiB5b3VyIHRlcm1pbmFsIGFnYWluLiBXaGVuIGRldmVsb3BpbmcgaW4gQ29kZSBXb3Jrc3BhY2VzLCByZWZyZXNoIHRoZQovLyBwcmV2aWV3IHBhbmVsLgoKZXhwb3J0IGRlZmF1bHQgZGVmaW5lQ29uZmlnKHsKICBpZDogIndpZGdldElkIiwKICBuYW1lOiAiQ3VzdG9tIFdpZGdldCIsCiAgZGVzY3JpcHRpb246ICJBbiBleGFtcGxlIGN1c3RvbSB3aWRnZXQgaW1wbGVtZW50YXRpb24iLAogIHR5cGU6ICJ3b3Jrc2hvcCIsCiAgcGFyYW1ldGVyczogewogICAgZ3JlZXRpbmdOYW1lOiB7CiAgICAgIGRpc3BsYXlOYW1lOiAiR3JlZXRpbmcgbmFtZSIsCiAgICAgIHR5cGU6ICJzdHJpbmciLAogICAgfSwKICAgIGNvdW50ZXJWYWx1ZTogewogICAgICBkaXNwbGF5TmFtZTogIkNvdW50ZXIgdmFsdWUiLAogICAgICB0eXBlOiAibnVtYmVyIiwKICAgIH0sCiAgfSwKICBldmVudHM6IHsKICAgIHNldENvdW50ZXJWYWx1ZTogewogICAgICBkaXNwbGF5TmFtZTogIlNldCBjb3VudGVyIHZhbHVlIiwKICAgICAgcGFyYW1ldGVyVXBkYXRlSWRzOiBbImNvdW50ZXJWYWx1ZSJdLAogICAgfSwKICB9LAp9KTsK\"\n}], [\"src/main.css\", {\n \"type\": \"base64\",\n \"body\": \"aHRtbCwgYm9keSB7CiAgICBtYXJnaW46IDA7Cn0K\"\n}], [\"src/main.tsx.hbs\", {\n type: \"raw\",\n body: `import \"@blueprintjs/core/lib/css/blueprint.css\";\nimport \"./main.css\";\n\n{{#if osdkPackage}}\nimport { OsdkProvider } from \"@osdk/react\";\n{{/if}}\nimport { FoundryWidget } from \"@osdk/widget.client-react\";\nimport { createRoot } from \"react-dom/client\";\n{{#if osdkPackage}}\nimport { client } from \"./client.js\";\n{{/if}}\nimport MainConfig from \"./main.config.js\";\nimport { Widget } from \"./Widget.js\";\n\nconst root = document.getElementById(\"root\")!;\n\ncreateRoot(root).render(\n{{#if osdkPackage}}\n <FoundryWidget config={MainConfig} client={client}>\n <OsdkProvider client={client}>\n <Widget />\n </OsdkProvider>\n </FoundryWidget>,\n{{else}}\n <FoundryWidget config={MainConfig}>\n <Widget />\n </FoundryWidget>,\n{{/if}}\n);\n`\n}], [\"src/useDarkTheme.ts\", {\n \"type\": \"base64\",\n \"body\": \"aW1wb3J0IHsgdXNlRWZmZWN0LCB1c2VTdGF0ZSB9IGZyb20gInJlYWN0IjsKCmV4cG9ydCBjb25zdCB1c2VEYXJrVGhlbWUgPSAoKSA9PiB1c2VNZWRpYVF1ZXJ5KCIocHJlZmVycy1jb2xvci1zY2hlbWU6IGRhcmspIik7Cgpjb25zdCB1c2VNZWRpYVF1ZXJ5ID0gKHF1ZXJ5OiBzdHJpbmcpID0+IHsKICBjb25zdCBbbWF0Y2hlcywgc2V0TWF0Y2hlc10gPSB1c2VTdGF0ZShmYWxzZSk7CgogIGNvbnN0IGhhbmRsZUNoYW5nZSA9IChlOiBNZWRpYVF1ZXJ5TGlzdEV2ZW50KSA9PiBzZXRNYXRjaGVzKGUubWF0Y2hlcyk7CgogIHVzZUVmZmVjdCgoKSA9PiB7CiAgICBjb25zdCBtID0gd2luZG93Lm1hdGNoTWVkaWEocXVlcnkpOwogICAgc2V0TWF0Y2hlcyhtLm1hdGNoZXMpOwogICAgbS5hZGRFdmVudExpc3RlbmVyKCJjaGFuZ2UiLCBoYW5kbGVDaGFuZ2UpOwogICAgcmV0dXJuICgpID0+IHsKICAgICAgbS5yZW1vdmVFdmVudExpc3RlbmVyKCJjaGFuZ2UiLCBoYW5kbGVDaGFuZ2UpOwogICAgfTsKICB9LCBbcXVlcnldKTsKCiAgcmV0dXJuIG1hdGNoZXM7Cn07Cg==\"\n}], [\"src/vite-env.d.ts\", {\n \"type\": \"base64\",\n \"body\": \"Ly8vIDxyZWZlcmVuY2UgdHlwZXM9InZpdGUvY2xpZW50IiAvPgo=\"\n}], [\"tsconfig.json\", {\n \"type\": \"base64\",\n \"body\": \"ewogICJjb21waWxlck9wdGlvbnMiOiB7CiAgICAidGFyZ2V0IjogIkVTMjAyMCIsCiAgICAidXNlRGVmaW5lRm9yQ2xhc3NGaWVsZHMiOiB0cnVlLAogICAgImxpYiI6IFsiRVMyMDIwIiwgIkRPTSIsICJET00uSXRlcmFibGUiXSwKICAgICJtb2R1bGUiOiAiRVNOZXh0IiwKICAgICJza2lwTGliQ2hlY2siOiB0cnVlLAoKICAgIC8qIEJ1bmRsZXIgbW9kZSAqLwogICAgIm1vZHVsZVJlc29sdXRpb24iOiAiYnVuZGxlciIsCiAgICAiYWxsb3dJbXBvcnRpbmdUc0V4dGVuc2lvbnMiOiB0cnVlLAogICAgInJlc29sdmVKc29uTW9kdWxlIjogdHJ1ZSwKICAgICJpc29sYXRlZE1vZHVsZXMiOiB0cnVlLAogICAgIm5vRW1pdCI6IHRydWUsCiAgICAianN4IjogInJlYWN0LWpzeCIsCgogICAgLyogTGludGluZyAqLwogICAgInN0cmljdCI6IHRydWUsCiAgICAibm9VbnVzZWRMb2NhbHMiOiB0cnVlLAogICAgIm5vVW51c2VkUGFyYW1ldGVycyI6IHRydWUsCiAgICAibm9GYWxsdGhyb3VnaENhc2VzSW5Td2l0Y2giOiB0cnVlCiAgfSwKICAiaW5jbHVkZSI6IFsic3JjIl0sCiAgInJlZmVyZW5jZXMiOiBbeyAicGF0aCI6ICIuL3RzY29uZmlnLm5vZGUuanNvbiIgfV0KfQo=\"\n}], [\"tsconfig.node.json\", {\n \"type\": \"base64\",\n \"body\": \"ewogICJjb21waWxlck9wdGlvbnMiOiB7CiAgICAiY29tcG9zaXRlIjogdHJ1ZSwKICAgICJza2lwTGliQ2hlY2siOiB0cnVlLAogICAgIm1vZHVsZSI6ICJFU05leHQiLAogICAgIm1vZHVsZVJlc29sdXRpb24iOiAiYnVuZGxlciIsCiAgICAiYWxsb3dTeW50aGV0aWNEZWZhdWx0SW1wb3J0cyI6IHRydWUKICB9LAogICJpbmNsdWRlIjogWyJ2aXRlLmNvbmZpZy50cyJdCn0K\"\n}], [\"vite.config.ts.hbs\", {\n type: \"raw\",\n body: `import foundryWidgetPlugin from \"@osdk/widget.vite-plugin\";\nimport react from \"@vitejs/plugin-react\";\nimport { defineConfig } from \"vite\";\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [react(), foundryWidgetPlugin()],\n server: {\n port: 8080,\n cors: true,\n },\n build: {\n rollupOptions: {\n input: [\"./index.html\"],\n },\n },\n});\n`\n}]]);"]}
|
package/build/esm/index.js
CHANGED
|
@@ -160,7 +160,7 @@ var TEMPLATES = [
|
|
|
160
160
|
supportsOsdk: true,
|
|
161
161
|
hidden: false,
|
|
162
162
|
files: {
|
|
163
|
-
"2.x": getPackageFiles(import('./esm-
|
|
163
|
+
"2.x": getPackageFiles(import('./esm-GTAFOAJ3.js'))
|
|
164
164
|
}
|
|
165
165
|
},
|
|
166
166
|
// Minimal React
|
|
@@ -171,7 +171,7 @@ var TEMPLATES = [
|
|
|
171
171
|
supportsOsdk: false,
|
|
172
172
|
hidden: true,
|
|
173
173
|
files: {
|
|
174
|
-
"2.x": getPackageFiles(import('./esm-
|
|
174
|
+
"2.x": getPackageFiles(import('./esm-GTAFOAJ3.js'))
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
];
|
|
@@ -411,7 +411,7 @@ async function run({
|
|
|
411
411
|
|
|
412
412
|
// src/cli.ts
|
|
413
413
|
async function cli(args = process.argv) {
|
|
414
|
-
const base = yargs(hideBin(args)).version("3.85.
|
|
414
|
+
const base = yargs(hideBin(args)).version("3.85.1-main-65dcc111f0439ce4ce5dfd623bc3c12058fc547b").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK widget set based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
|
|
415
415
|
type: "string",
|
|
416
416
|
describe: "Project name to create"
|
|
417
417
|
}).option("overwrite", {
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/consola.ts","../../src/highlight.ts","../../src/prompts/promptFoundryUrl.ts","../../src/prompts/promptOsdkPackage.ts","../../src/prompts/promptOsdkRegistryUrl.ts","../../src/prompts/promptOverwrite.ts","../../src/prompts/promptProject.ts","../../src/prompts/promptSdkVersion.ts","../../src/getPackageFiles.ts","../../src/generatedNoCheck/templates.ts","../../src/prompts/promptTemplate.ts","../../src/prompts/promptUseOsdk.ts","../../src/prompts/promptWidgetSetRid.ts","../../src/generate/generateFoundryConfigJson.ts","../../src/generate/generateNpmRc.ts","../../src/run.ts","../../src/cli.ts"],"names":["defaultConsola","fs","path","sdkVersion","template","yargs"],"mappings":";;;;;;;;;AAmBA,IAAM,YAAA,GAAe,MAAA,CAAO,GAAA,CAAI,QAAQ,CAAA;AACjC,IAAM,UAAU,aAAA,CAAc;AAAA,EACnC,MAAM,MAAA,CAAO,OAAA,EAAS,IAAA,EAAM;AAC1B,IAAA,MAAM,QAAA,GAAW,MAAMA,SAAA,CAAe,MAAA,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AM,CAAA,GAAI,MAAA;AAChE,EAAA,MAAM,eAAA,GAAkB,OAAA,GAAU,MAAM,qBAAA,CAAsB,MAAM,CAAA,GAAI,MAAA;AACxE,EAAA,MAAM,SAAA,GAAY,MAAM,kBAAA,CAAmB,MAAM,CAAA;AACjD,EAAA,MAAM,GAAA,CAAI;AAAA,IACR,OAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"index.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola as defaultConsola, createConsola } from \"consola\";\n\n// https://github.com/unjs/consola?tab=readme-ov-file#await-promptmessage--type-cancel-\nconst cancelSymbol = Symbol.for(\"cancel\");\nexport const consola = createConsola({\n async prompt(message, opts) {\n const response = await defaultConsola.prompt(message, {\n ...opts,\n cancel: opts?.cancel ?? \"symbol\"\n });\n if (response === cancelSymbol) {\n defaultConsola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n return response;\n }\n});","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { colorize } from \"consola/utils\";\nexport function green(text) {\n return colorize(\"green\", text);\n}\nexport function italic(text) {\n return colorize(\"italic\", text);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptFoundryUrl({\n foundryUrl\n}) {\n while (foundryUrl == null || !foundryUrl.startsWith(\"https://\")) {\n if (foundryUrl != null) {\n consola.fail(\"Please enter a valid Foundry URL\");\n }\n foundryUrl = await consola.prompt(`Enter the URL for your Foundry stack:\\n${italic(\"(Example: https://example.palantirfoundry.com)\")}`, {\n type: \"text\"\n });\n }\n return foundryUrl.replace(/\\/$/u, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkPackage({\n osdkPackage\n}) {\n while (osdkPackage == null || !/^@[a-z0-9-]+\\/sdk$/u.test(osdkPackage)) {\n if (osdkPackage != null) {\n consola.fail(\"Please enter a valid OSDK package name\");\n }\n osdkPackage = await consola.prompt(`Enter the OSDK package name for your widget set:\\n${italic(\"(Example: @my-widget/sdk)\")}`, {\n type: \"text\"\n });\n }\n return osdkPackage;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkRegistryUrl({\n osdkRegistryUrl\n}) {\n while (osdkRegistryUrl == null || !/^https:\\/\\/[^/]+\\/artifacts\\/api\\/repositories\\/ri\\.[^/]+\\/contents\\/release\\/npm\\/?$/u.test(osdkRegistryUrl)) {\n if (osdkRegistryUrl != null) {\n consola.fail(\"Please enter a valid NPM registry URL to install your OSDK package\");\n }\n osdkRegistryUrl = await consola.prompt(`Enter the NPM registry URL to install your OSDK package:\\n${italic(\"(Example: https://example.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.a4a7fe1c-486f-4226-b706-7b90005f527d/contents/release/npm)\")}`, {\n type: \"text\"\n });\n }\n return osdkRegistryUrl.replace(/\\/$/u, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { consola } from \"../consola.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptOverwrite({\n project,\n overwrite\n}) {\n if (overwrite != null) {\n return overwrite;\n }\n if (!fs.existsSync(path.join(process.cwd(), project))) {\n return true;\n }\n const result = await consola.prompt(`The directory ${green(project)} already exists do you want to overwrite or ignore it?`, {\n type: \"select\",\n options: [{\n label: \"Remove existing files and continue\",\n value: \"overwrite\"\n }, {\n label: \"Ignore files and continue\",\n value: \"ignore\"\n }, {\n label: \"Cancel\",\n value: \"cancel\"\n }]\n });\n switch (result) {\n case \"overwrite\":\n return true;\n case \"ignore\":\n return false;\n case \"cancel\":\n consola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptProject({\n project\n}) {\n while (project == null || !/^[a-zA-Z0-9-_]+$/u.test(project)) {\n if (project != null) {\n consola.fail(\"Project name can only contain alphanumeric characters, hyphens and underscores\");\n }\n project = await consola.prompt(\"Project name:\", {\n type: \"text\",\n placeholder: \"my-osdk-widget\",\n default: \"my-osdk-widget\"\n });\n }\n return project;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptSdkVersion({\n sdkVersion,\n template\n}) {\n if (sdkVersion == null) {\n // If the SDK version is not provided, default to the earliest template version for backwards-compatibility\n return Object.keys(template.files)[0];\n }\n if (template.files[sdkVersion] == null) {\n consola.fail(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n sdkVersion = await consola.prompt(`Please choose which version of the OSDK you'd like to use for the ${template.label} template:`, {\n type: \"select\",\n options: Object.keys(template.files).reverse().map(sdkVersion => ({\n label: sdkVersion,\n value: sdkVersion\n }))\n });\n }\n return sdkVersion;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const getPackageFiles = importPromise => async () => (await importPromise).files;","// THIS FILE IS GENERATED. DO NOT MODIFY.\n// You probably want to modify ../../../codegen.mjs instead.\n\nimport { getPackageFiles } from \"../getPackageFiles.js\";\nexport const TEMPLATES = [\n// OSDK React\n{\n id: \"template-widget-react\",\n label: \"OSDK React\",\n buildDirectory: \"./dist\",\n supportsOsdk: true,\n hidden: false,\n files: {\n \"2.x\": getPackageFiles(import(\"@osdk/create-widget.template.react.v2\"))\n }\n},\n// Minimal React\n{\n id: \"template-widget-minimal-react\",\n label: \"Minimal React\",\n buildDirectory: \"./dist\",\n supportsOsdk: false,\n hidden: true,\n files: {\n \"2.x\": getPackageFiles(import(\"@osdk/create-widget.template.react.v2\"))\n }\n}];","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { TEMPLATES } from \"../generatedNoCheck/templates.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptTemplate(parsed) {\n let template = TEMPLATES.find(t => t.id === parsed.template || t.id === `template-${parsed.template}`);\n if (template == null) {\n const availableTemplates = TEMPLATES.filter(template => !template.hidden);\n if (availableTemplates.length === 0) {\n throw new Error(\"No available templates found for the selected options.\");\n }\n const templateId = await consola.prompt(parsed.template != null ? `The provided template ${green(parsed.template)} is invalid please select a framework:` : \"Select a framework:\", {\n type: \"select\",\n options: availableTemplates.map(template => ({\n value: template.id,\n label: template.label\n }))\n });\n template = TEMPLATES.find(t => t.id === templateId);\n if (template == null) {\n throw new Error(`Template ${templateId} should be found`);\n }\n }\n return template;\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptUseOsdk({\n template,\n osdkPackage,\n osdkRegistryUrl,\n skipOsdk\n}) {\n if (!template.supportsOsdk) {\n return false;\n }\n if (skipOsdk) {\n return false;\n }\n if (osdkPackage != null || osdkRegistryUrl != null) {\n return true;\n }\n const answer = await consola.prompt(\"Will you be using an OSDK in your widget set?\", {\n type: \"select\",\n options: [{\n label: \"Yes, I will be using an OSDK\",\n value: \"yes\"\n }, {\n label: \"No (can be added later)\",\n value: \"no\"\n }]\n });\n return answer === \"yes\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptWidgetSetRid({\n widgetSet\n}) {\n while (widgetSet == null || !/^ri\\.widgetregistry\\.\\.widget-set\\.[^.]+$/u.test(widgetSet)) {\n if (widgetSet != null) {\n consola.fail(\"Please enter a valid widget resource identifier (rid)\");\n }\n widgetSet = await consola.prompt(`Enter the resource identifier (rid) for your widget set:\\n${italic(\"(Example: ri.widgetregistry..widget-set.1c66b352-4e00-40d2-995d-061c9d533ace)\")}`, {\n type: \"text\"\n });\n }\n return widgetSet;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateFoundryConfigJson({\n foundryUrl,\n widgetSet,\n repository,\n directory\n}) {\n return JSON.stringify({\n foundryUrl,\n widgetSet: {\n rid: widgetSet,\n repository,\n directory,\n autoVersion: {\n type: \"package-json\"\n }\n }\n }, null, 2) + \"\\n\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateNpmRc({\n foundryUrl,\n osdkPackage,\n osdkRegistryUrl\n}) {\n // pnpm requires a trailing slash in .npmrc\n // https://github.com/pnpm/pnpm/issues/5941\n const osdkRegistryUrlWithTrailingSlash = osdkRegistryUrl.endsWith(\"/\") ? osdkRegistryUrl : osdkRegistryUrl + \"/\";\n const formattedFoundryUrl = foundryUrl.replace(/^https:\\/\\//u, \"\").replace(/\\/$/u, \"\");\n const artifactsApiUrl = formattedFoundryUrl + \"/artifacts/api/\";\n const packageScope = osdkPackage.split(\"/\")[0];\n return `//${artifactsApiUrl}:_authToken=\\${FOUNDRY_TOKEN}\\n` + `${packageScope}:registry=${osdkRegistryUrlWithTrailingSlash}\\n`;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport Handlebars from \"handlebars\";\nimport { consola } from \"./consola.js\";\nimport { generateFoundryConfigJson } from \"./generate/generateFoundryConfigJson.js\";\nimport { generateNpmRc } from \"./generate/generateNpmRc.js\";\nimport { green } from \"./highlight.js\";\nexport async function run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSet,\n repository,\n osdkPackage,\n osdkRegistryUrl\n}) {\n consola.log(\"\");\n consola.start(`Creating project ${green(project)} using template ${green(template.id)}`);\n const cwd = process.cwd();\n const root = path.join(cwd, project);\n if (fs.existsSync(root)) {\n if (overwrite) {\n consola.info(`Overwriting existing project directory`);\n fs.rmSync(root, {\n recursive: true,\n force: true\n });\n fs.mkdirSync(root, {\n recursive: true\n });\n } else {\n consola.info(`Reusing existing project directory`);\n }\n } else {\n consola.info(`Creating project directory`);\n fs.mkdirSync(root, {\n recursive: true\n });\n }\n consola.info(`Copying files into project directory`);\n if (template.files[sdkVersion] == null) {\n throw new Error(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n }\n const files = await template.files[sdkVersion]();\n for (const [filePath, contents] of files) {\n const finalPath = path.join(root, filePath);\n const dirPath = path.dirname(finalPath);\n await fs.promises.mkdir(dirPath, {\n recursive: true\n });\n await fs.promises.writeFile(finalPath, Buffer.from(contents.body, contents.type === \"raw\" ? \"utf-8\" : \"base64\"));\n }\n const templateContext = {\n project,\n foundryUrl,\n widgetSet,\n osdkPackage\n };\n const processFiles = function (dir) {\n fs.readdirSync(dir).forEach(file => {\n let fullPath = dir + \"/\" + file;\n const stat = fs.statSync(fullPath);\n if (stat.isDirectory()) {\n processFiles(fullPath);\n return;\n }\n if (fullPath.endsWith(\"/_gitignore\")) {\n fs.renameSync(fullPath, fullPath.replace(/\\/_gitignore$/u, \"/.gitignore\"));\n return;\n }\n\n // Files with the `.osdk` extension are only kept if the application uses an OSDK\n if (file.includes(\".osdk\")) {\n if (osdkPackage == null) {\n fs.rmSync(fullPath);\n return;\n } else {\n const renamed = dir + \"/\" + file.replace(\".osdk\", \"\");\n fs.renameSync(fullPath, renamed);\n fullPath = renamed;\n }\n // Files with the `.no-osdk` extension are only kept if the application does not use an OSDK\n } else if (file.includes(\".no-osdk\")) {\n if (osdkPackage == null) {\n const renamed = dir + \"/\" + file.replace(\".no-osdk\", \"\");\n fs.renameSync(fullPath, renamed);\n fullPath = renamed;\n } else {\n fs.rmSync(fullPath);\n return;\n }\n }\n if (!fullPath.endsWith(\".hbs\")) {\n return;\n }\n const templated = Handlebars.compile(fs.readFileSync(fullPath, \"utf-8\"))(templateContext);\n fs.writeFileSync(fullPath.replace(/.hbs$/u, \"\"), templated);\n fs.rmSync(fullPath);\n });\n };\n processFiles(root);\n const useOsdk = osdkPackage != null || osdkRegistryUrl != null;\n if (useOsdk) {\n if (osdkPackage == null || osdkRegistryUrl == null) {\n throw new Error(`Template ${template.id} requires OSDK package and registry URL`);\n }\n const npmRc = generateNpmRc({\n osdkPackage,\n osdkRegistryUrl,\n foundryUrl\n });\n fs.writeFileSync(path.join(root, \".npmrc\"), npmRc);\n }\n const foundryConfigJson = generateFoundryConfigJson({\n foundryUrl,\n widgetSet,\n repository,\n directory: template.buildDirectory\n });\n fs.writeFileSync(path.join(root, \"foundry.config.json\"), foundryConfigJson);\n consola.success(\"Success\");\n const cdRelative = path.relative(cwd, root);\n consola.box({\n message: `Done! Run the following commands to get started:\\n` + `\\n` + ` \\`cd ${cdRelative}\\`\\n` + ` \\`export FOUNDRY_TOKEN=<token>\\`\\n` + ` \\`npm install\\`\\n` + ` \\`npm run dev\\``,\n style: {\n padding: 2,\n borderColor: \"green\",\n borderStyle: \"rounded\"\n }\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { promptFoundryUrl } from \"./prompts/promptFoundryUrl.js\";\nimport { promptOsdkPackage } from \"./prompts/promptOsdkPackage.js\";\nimport { promptOsdkRegistryUrl } from \"./prompts/promptOsdkRegistryUrl.js\";\nimport { promptOverwrite } from \"./prompts/promptOverwrite.js\";\nimport { promptProject } from \"./prompts/promptProject.js\";\nimport { promptSdkVersion } from \"./prompts/promptSdkVersion.js\";\nimport { promptTemplate } from \"./prompts/promptTemplate.js\";\nimport { promptUseOsdk } from \"./prompts/promptUseOsdk.js\";\nimport { promptWidgetSetRid } from \"./prompts/promptWidgetSetRid.js\";\nimport { run } from \"./run.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command(\"$0 [project] [--<option>]\", \"Create a new OSDK widget set based on framework templates. Information may be provided through options to skip interactive prompts.\", yargs => yargs.positional(\"project\", {\n type: \"string\",\n describe: \"Project name to create\"\n }).option(\"overwrite\", {\n type: \"boolean\",\n describe: \"Overwrite project directory if already exists\"\n }).option(\"template\", {\n type: \"string\",\n describe: \"Template name to use\"\n }).option(\"sdkVersion\", {\n type: \"string\",\n describe: \"The OSDK version to use\"\n }).option(\"foundryUrl\", {\n type: \"string\",\n describe: \"URL for the Foundry stack\"\n }).option(\"widgetSet\", {\n type: \"string\",\n describe: \"Widget set resource identifier (rid)\"\n }).option(\"repository\", {\n type: \"string\",\n describe: \"Repository resource identifier (rid)\"\n }).option(\"osdkPackage\", {\n type: \"string\",\n describe: \"OSDK package name for application\",\n conflicts: \"skipOsdk\"\n }).option(\"osdkRegistryUrl\", {\n type: \"string\",\n describe: \"URL for NPM registry to install OSDK package\",\n conflicts: \"skipOsdk\"\n }).option(\"skipOsdk\", {\n type: \"boolean\",\n describe: \"Skip filling in OSDK options\"\n }));\n const parsed = base.parseSync();\n const project = await promptProject(parsed);\n const overwrite = await promptOverwrite({\n ...parsed,\n project\n });\n const template = await promptTemplate(parsed);\n const sdkVersion = await promptSdkVersion({\n ...parsed,\n template\n });\n const foundryUrl = await promptFoundryUrl(parsed);\n const repository = parsed.repository;\n const useOsdk = await promptUseOsdk({\n ...parsed,\n template\n });\n const osdkPackage = useOsdk ? await promptOsdkPackage(parsed) : undefined;\n const osdkRegistryUrl = useOsdk ? await promptOsdkRegistryUrl(parsed) : undefined;\n const widgetSet = await promptWidgetSetRid(parsed);\n await run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSet,\n repository,\n osdkPackage,\n osdkRegistryUrl\n });\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/consola.ts","../../src/highlight.ts","../../src/prompts/promptFoundryUrl.ts","../../src/prompts/promptOsdkPackage.ts","../../src/prompts/promptOsdkRegistryUrl.ts","../../src/prompts/promptOverwrite.ts","../../src/prompts/promptProject.ts","../../src/prompts/promptSdkVersion.ts","../../src/getPackageFiles.ts","../../src/generatedNoCheck/templates.ts","../../src/prompts/promptTemplate.ts","../../src/prompts/promptUseOsdk.ts","../../src/prompts/promptWidgetSetRid.ts","../../src/generate/generateFoundryConfigJson.ts","../../src/generate/generateNpmRc.ts","../../src/run.ts","../../src/cli.ts"],"names":["defaultConsola","fs","path","sdkVersion","template","yargs"],"mappings":";;;;;;;;;AAmBA,IAAM,YAAA,GAAe,MAAA,CAAO,GAAA,CAAI,QAAQ,CAAA;AACjC,IAAM,UAAU,aAAA,CAAc;AAAA,EACnC,MAAM,MAAA,CAAO,OAAA,EAAS,IAAA,EAAM;AAC1B,IAAA,MAAM,QAAA,GAAW,MAAMA,SAAA,CAAe,MAAA,CAAO,OAAA,EAAS;AAAA,MACpD,GAAG,IAAA;AAAA,MACH,MAAA,EAAQ,MAAM,MAAA,IAAU;AAAA,KACzB,CAAA;AACD,IAAA,IAAI,aAAa,YAAA,EAAc;AAC7B,MAAAA,SAAA,CAAe,KAAK,qBAAqB,CAAA;AACzC,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,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AA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH","file":"index.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola as defaultConsola, createConsola } from \"consola\";\n\n// https://github.com/unjs/consola?tab=readme-ov-file#await-promptmessage--type-cancel-\nconst cancelSymbol = Symbol.for(\"cancel\");\nexport const consola = createConsola({\n async prompt(message, opts) {\n const response = await defaultConsola.prompt(message, {\n ...opts,\n cancel: opts?.cancel ?? \"symbol\"\n });\n if (response === cancelSymbol) {\n defaultConsola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n return response;\n }\n});","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { colorize } from \"consola/utils\";\nexport function green(text) {\n return colorize(\"green\", text);\n}\nexport function italic(text) {\n return colorize(\"italic\", text);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptFoundryUrl({\n foundryUrl\n}) {\n while (foundryUrl == null || !foundryUrl.startsWith(\"https://\")) {\n if (foundryUrl != null) {\n consola.fail(\"Please enter a valid Foundry URL\");\n }\n foundryUrl = await consola.prompt(`Enter the URL for your Foundry stack:\\n${italic(\"(Example: https://example.palantirfoundry.com)\")}`, {\n type: \"text\"\n });\n }\n return foundryUrl.replace(/\\/$/u, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkPackage({\n osdkPackage\n}) {\n while (osdkPackage == null || !/^@[a-z0-9-]+\\/sdk$/u.test(osdkPackage)) {\n if (osdkPackage != null) {\n consola.fail(\"Please enter a valid OSDK package name\");\n }\n osdkPackage = await consola.prompt(`Enter the OSDK package name for your widget set:\\n${italic(\"(Example: @my-widget/sdk)\")}`, {\n type: \"text\"\n });\n }\n return osdkPackage;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptOsdkRegistryUrl({\n osdkRegistryUrl\n}) {\n while (osdkRegistryUrl == null || !/^https:\\/\\/[^/]+\\/artifacts\\/api\\/repositories\\/ri\\.[^/]+\\/contents\\/release\\/npm\\/?$/u.test(osdkRegistryUrl)) {\n if (osdkRegistryUrl != null) {\n consola.fail(\"Please enter a valid NPM registry URL to install your OSDK package\");\n }\n osdkRegistryUrl = await consola.prompt(`Enter the NPM registry URL to install your OSDK package:\\n${italic(\"(Example: https://example.palantirfoundry.com/artifacts/api/repositories/ri.artifacts.main.repository.a4a7fe1c-486f-4226-b706-7b90005f527d/contents/release/npm)\")}`, {\n type: \"text\"\n });\n }\n return osdkRegistryUrl.replace(/\\/$/u, \"\");\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { consola } from \"../consola.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptOverwrite({\n project,\n overwrite\n}) {\n if (overwrite != null) {\n return overwrite;\n }\n if (!fs.existsSync(path.join(process.cwd(), project))) {\n return true;\n }\n const result = await consola.prompt(`The directory ${green(project)} already exists do you want to overwrite or ignore it?`, {\n type: \"select\",\n options: [{\n label: \"Remove existing files and continue\",\n value: \"overwrite\"\n }, {\n label: \"Ignore files and continue\",\n value: \"ignore\"\n }, {\n label: \"Cancel\",\n value: \"cancel\"\n }]\n });\n switch (result) {\n case \"overwrite\":\n return true;\n case \"ignore\":\n return false;\n case \"cancel\":\n consola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptProject({\n project\n}) {\n while (project == null || !/^[a-zA-Z0-9-_]+$/u.test(project)) {\n if (project != null) {\n consola.fail(\"Project name can only contain alphanumeric characters, hyphens and underscores\");\n }\n project = await consola.prompt(\"Project name:\", {\n type: \"text\",\n placeholder: \"my-osdk-widget\",\n default: \"my-osdk-widget\"\n });\n }\n return project;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptSdkVersion({\n sdkVersion,\n template\n}) {\n if (sdkVersion == null) {\n // If the SDK version is not provided, default to the earliest template version for backwards-compatibility\n return Object.keys(template.files)[0];\n }\n if (template.files[sdkVersion] == null) {\n consola.fail(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n sdkVersion = await consola.prompt(`Please choose which version of the OSDK you'd like to use for the ${template.label} template:`, {\n type: \"select\",\n options: Object.keys(template.files).reverse().map(sdkVersion => ({\n label: sdkVersion,\n value: sdkVersion\n }))\n });\n }\n return sdkVersion;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const getPackageFiles = importPromise => async () => (await importPromise).files;","// THIS FILE IS GENERATED. DO NOT MODIFY.\n// You probably want to modify ../../../codegen.mjs instead.\n\nimport { getPackageFiles } from \"../getPackageFiles.js\";\nexport const TEMPLATES = [\n// OSDK React\n{\n id: \"template-widget-react\",\n label: \"OSDK React\",\n buildDirectory: \"./dist\",\n supportsOsdk: true,\n hidden: false,\n files: {\n \"2.x\": getPackageFiles(import(\"@osdk/create-widget.template.react.v2\"))\n }\n},\n// Minimal React\n{\n id: \"template-widget-minimal-react\",\n label: \"Minimal React\",\n buildDirectory: \"./dist\",\n supportsOsdk: false,\n hidden: true,\n files: {\n \"2.x\": getPackageFiles(import(\"@osdk/create-widget.template.react.v2\"))\n }\n}];","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { TEMPLATES } from \"../generatedNoCheck/templates.js\";\nimport { green } from \"../highlight.js\";\nexport async function promptTemplate(parsed) {\n let template = TEMPLATES.find(t => t.id === parsed.template || t.id === `template-${parsed.template}`);\n if (template == null) {\n const availableTemplates = TEMPLATES.filter(template => !template.hidden);\n if (availableTemplates.length === 0) {\n throw new Error(\"No available templates found for the selected options.\");\n }\n const templateId = await consola.prompt(parsed.template != null ? `The provided template ${green(parsed.template)} is invalid please select a framework:` : \"Select a framework:\", {\n type: \"select\",\n options: availableTemplates.map(template => ({\n value: template.id,\n label: template.label\n }))\n });\n template = TEMPLATES.find(t => t.id === templateId);\n if (template == null) {\n throw new Error(`Template ${templateId} should be found`);\n }\n }\n return template;\n}","/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nexport async function promptUseOsdk({\n template,\n osdkPackage,\n osdkRegistryUrl,\n skipOsdk\n}) {\n if (!template.supportsOsdk) {\n return false;\n }\n if (skipOsdk) {\n return false;\n }\n if (osdkPackage != null || osdkRegistryUrl != null) {\n return true;\n }\n const answer = await consola.prompt(\"Will you be using an OSDK in your widget set?\", {\n type: \"select\",\n options: [{\n label: \"Yes, I will be using an OSDK\",\n value: \"yes\"\n }, {\n label: \"No (can be added later)\",\n value: \"no\"\n }]\n });\n return answer === \"yes\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"../consola.js\";\nimport { italic } from \"../highlight.js\";\nexport async function promptWidgetSetRid({\n widgetSet\n}) {\n while (widgetSet == null || !/^ri\\.widgetregistry\\.\\.widget-set\\.[^.]+$/u.test(widgetSet)) {\n if (widgetSet != null) {\n consola.fail(\"Please enter a valid widget resource identifier (rid)\");\n }\n widgetSet = await consola.prompt(`Enter the resource identifier (rid) for your widget set:\\n${italic(\"(Example: ri.widgetregistry..widget-set.1c66b352-4e00-40d2-995d-061c9d533ace)\")}`, {\n type: \"text\"\n });\n }\n return widgetSet;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateFoundryConfigJson({\n foundryUrl,\n widgetSet,\n repository,\n directory\n}) {\n return JSON.stringify({\n foundryUrl,\n widgetSet: {\n rid: widgetSet,\n repository,\n directory,\n autoVersion: {\n type: \"package-json\"\n }\n }\n }, null, 2) + \"\\n\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function generateNpmRc({\n foundryUrl,\n osdkPackage,\n osdkRegistryUrl\n}) {\n // pnpm requires a trailing slash in .npmrc\n // https://github.com/pnpm/pnpm/issues/5941\n const osdkRegistryUrlWithTrailingSlash = osdkRegistryUrl.endsWith(\"/\") ? osdkRegistryUrl : osdkRegistryUrl + \"/\";\n const formattedFoundryUrl = foundryUrl.replace(/^https:\\/\\//u, \"\").replace(/\\/$/u, \"\");\n const artifactsApiUrl = formattedFoundryUrl + \"/artifacts/api/\";\n const packageScope = osdkPackage.split(\"/\")[0];\n return `//${artifactsApiUrl}:_authToken=\\${FOUNDRY_TOKEN}\\n` + `${packageScope}:registry=${osdkRegistryUrlWithTrailingSlash}\\n`;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport Handlebars from \"handlebars\";\nimport { consola } from \"./consola.js\";\nimport { generateFoundryConfigJson } from \"./generate/generateFoundryConfigJson.js\";\nimport { generateNpmRc } from \"./generate/generateNpmRc.js\";\nimport { green } from \"./highlight.js\";\nexport async function run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSet,\n repository,\n osdkPackage,\n osdkRegistryUrl\n}) {\n consola.log(\"\");\n consola.start(`Creating project ${green(project)} using template ${green(template.id)}`);\n const cwd = process.cwd();\n const root = path.join(cwd, project);\n if (fs.existsSync(root)) {\n if (overwrite) {\n consola.info(`Overwriting existing project directory`);\n fs.rmSync(root, {\n recursive: true,\n force: true\n });\n fs.mkdirSync(root, {\n recursive: true\n });\n } else {\n consola.info(`Reusing existing project directory`);\n }\n } else {\n consola.info(`Creating project directory`);\n fs.mkdirSync(root, {\n recursive: true\n });\n }\n consola.info(`Copying files into project directory`);\n if (template.files[sdkVersion] == null) {\n throw new Error(`The ${template.label} template does not support a \"${sdkVersion}\" SDK version.`);\n }\n const files = await template.files[sdkVersion]();\n for (const [filePath, contents] of files) {\n const finalPath = path.join(root, filePath);\n const dirPath = path.dirname(finalPath);\n await fs.promises.mkdir(dirPath, {\n recursive: true\n });\n await fs.promises.writeFile(finalPath, Buffer.from(contents.body, contents.type === \"raw\" ? \"utf-8\" : \"base64\"));\n }\n const templateContext = {\n project,\n foundryUrl,\n widgetSet,\n osdkPackage\n };\n const processFiles = function (dir) {\n fs.readdirSync(dir).forEach(file => {\n let fullPath = dir + \"/\" + file;\n const stat = fs.statSync(fullPath);\n if (stat.isDirectory()) {\n processFiles(fullPath);\n return;\n }\n if (fullPath.endsWith(\"/_gitignore\")) {\n fs.renameSync(fullPath, fullPath.replace(/\\/_gitignore$/u, \"/.gitignore\"));\n return;\n }\n\n // Files with the `.osdk` extension are only kept if the application uses an OSDK\n if (file.includes(\".osdk\")) {\n if (osdkPackage == null) {\n fs.rmSync(fullPath);\n return;\n } else {\n const renamed = dir + \"/\" + file.replace(\".osdk\", \"\");\n fs.renameSync(fullPath, renamed);\n fullPath = renamed;\n }\n // Files with the `.no-osdk` extension are only kept if the application does not use an OSDK\n } else if (file.includes(\".no-osdk\")) {\n if (osdkPackage == null) {\n const renamed = dir + \"/\" + file.replace(\".no-osdk\", \"\");\n fs.renameSync(fullPath, renamed);\n fullPath = renamed;\n } else {\n fs.rmSync(fullPath);\n return;\n }\n }\n if (!fullPath.endsWith(\".hbs\")) {\n return;\n }\n const templated = Handlebars.compile(fs.readFileSync(fullPath, \"utf-8\"))(templateContext);\n fs.writeFileSync(fullPath.replace(/.hbs$/u, \"\"), templated);\n fs.rmSync(fullPath);\n });\n };\n processFiles(root);\n const useOsdk = osdkPackage != null || osdkRegistryUrl != null;\n if (useOsdk) {\n if (osdkPackage == null || osdkRegistryUrl == null) {\n throw new Error(`Template ${template.id} requires OSDK package and registry URL`);\n }\n const npmRc = generateNpmRc({\n osdkPackage,\n osdkRegistryUrl,\n foundryUrl\n });\n fs.writeFileSync(path.join(root, \".npmrc\"), npmRc);\n }\n const foundryConfigJson = generateFoundryConfigJson({\n foundryUrl,\n widgetSet,\n repository,\n directory: template.buildDirectory\n });\n fs.writeFileSync(path.join(root, \"foundry.config.json\"), foundryConfigJson);\n consola.success(\"Success\");\n const cdRelative = path.relative(cwd, root);\n consola.box({\n message: `Done! Run the following commands to get started:\\n` + `\\n` + ` \\`cd ${cdRelative}\\`\\n` + ` \\`export FOUNDRY_TOKEN=<token>\\`\\n` + ` \\`npm install\\`\\n` + ` \\`npm run dev\\``,\n style: {\n padding: 2,\n borderColor: \"green\",\n borderStyle: \"rounded\"\n }\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { promptFoundryUrl } from \"./prompts/promptFoundryUrl.js\";\nimport { promptOsdkPackage } from \"./prompts/promptOsdkPackage.js\";\nimport { promptOsdkRegistryUrl } from \"./prompts/promptOsdkRegistryUrl.js\";\nimport { promptOverwrite } from \"./prompts/promptOverwrite.js\";\nimport { promptProject } from \"./prompts/promptProject.js\";\nimport { promptSdkVersion } from \"./prompts/promptSdkVersion.js\";\nimport { promptTemplate } from \"./prompts/promptTemplate.js\";\nimport { promptUseOsdk } from \"./prompts/promptUseOsdk.js\";\nimport { promptWidgetSetRid } from \"./prompts/promptWidgetSetRid.js\";\nimport { run } from \"./run.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command(\"$0 [project] [--<option>]\", \"Create a new OSDK widget set based on framework templates. Information may be provided through options to skip interactive prompts.\", yargs => yargs.positional(\"project\", {\n type: \"string\",\n describe: \"Project name to create\"\n }).option(\"overwrite\", {\n type: \"boolean\",\n describe: \"Overwrite project directory if already exists\"\n }).option(\"template\", {\n type: \"string\",\n describe: \"Template name to use\"\n }).option(\"sdkVersion\", {\n type: \"string\",\n describe: \"The OSDK version to use\"\n }).option(\"foundryUrl\", {\n type: \"string\",\n describe: \"URL for the Foundry stack\"\n }).option(\"widgetSet\", {\n type: \"string\",\n describe: \"Widget set resource identifier (rid)\"\n }).option(\"repository\", {\n type: \"string\",\n describe: \"Repository resource identifier (rid)\"\n }).option(\"osdkPackage\", {\n type: \"string\",\n describe: \"OSDK package name for application\",\n conflicts: \"skipOsdk\"\n }).option(\"osdkRegistryUrl\", {\n type: \"string\",\n describe: \"URL for NPM registry to install OSDK package\",\n conflicts: \"skipOsdk\"\n }).option(\"skipOsdk\", {\n type: \"boolean\",\n describe: \"Skip filling in OSDK options\"\n }));\n const parsed = base.parseSync();\n const project = await promptProject(parsed);\n const overwrite = await promptOverwrite({\n ...parsed,\n project\n });\n const template = await promptTemplate(parsed);\n const sdkVersion = await promptSdkVersion({\n ...parsed,\n template\n });\n const foundryUrl = await promptFoundryUrl(parsed);\n const repository = parsed.repository;\n const useOsdk = await promptUseOsdk({\n ...parsed,\n template\n });\n const osdkPackage = useOsdk ? await promptOsdkPackage(parsed) : undefined;\n const osdkRegistryUrl = useOsdk ? await promptOsdkRegistryUrl(parsed) : undefined;\n const widgetSet = await promptWidgetSetRid(parsed);\n await run({\n project,\n overwrite,\n template,\n sdkVersion,\n foundryUrl,\n widgetSet,\n repository,\n osdkPackage,\n osdkRegistryUrl\n });\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/create-widget",
|
|
3
|
-
"version": "3.85.
|
|
3
|
+
"version": "3.85.1-main-65dcc111f0439ce4ce5dfd623bc3c12058fc547b",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"find-up": "7.0.0",
|
|
30
30
|
"handlebars": "4.7.8",
|
|
31
31
|
"yargs": "17.7.2",
|
|
32
|
-
"@osdk/generator-utils": "2.85.
|
|
32
|
+
"@osdk/generator-utils": "2.85.1-main-65dcc111f0439ce4ce5dfd623bc3c12058fc547b"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^18.19.124",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"redent": "^4.0.0",
|
|
40
40
|
"tmp": "^0.2.5",
|
|
41
41
|
"typescript": "~5.5.4",
|
|
42
|
-
"@osdk/create-widget.template.react.v2": "3.85.0",
|
|
43
42
|
"@osdk/monorepo.api-extractor": "~0.7.0",
|
|
43
|
+
"@osdk/create-widget.template.react.v2": "3.85.1-main-65dcc111f0439ce4ce5dfd623bc3c12058fc547b",
|
|
44
44
|
"@osdk/monorepo.tool.check-bundle": "~0.1.0",
|
|
45
45
|
"@osdk/monorepo.tsconfig": "~0.7.0"
|
|
46
46
|
},
|