@osdk/create-app 0.17.0-main-20240530094422 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +60 -1
  2. package/build/browser/esm-5B4R5BF5.js +248 -0
  3. package/build/browser/esm-5B4R5BF5.js.map +1 -0
  4. package/build/browser/esm-7ZL7DCMH.js +451 -0
  5. package/build/browser/esm-7ZL7DCMH.js.map +1 -0
  6. package/build/browser/esm-WPXIOIG2.js +1170 -0
  7. package/build/browser/esm-WPXIOIG2.js.map +1 -0
  8. package/build/browser/esm-ZCTE2SEE.js +377 -0
  9. package/build/browser/esm-ZCTE2SEE.js.map +1 -0
  10. package/build/browser/esm-ZDRBH2ME.js +901 -0
  11. package/build/browser/esm-ZDRBH2ME.js.map +1 -0
  12. package/build/browser/index.js +26 -19
  13. package/build/browser/index.js.map +1 -1
  14. package/build/cjs/esm-2ZIGIHPI.cjs +379 -0
  15. package/build/cjs/esm-2ZIGIHPI.cjs.map +1 -0
  16. package/build/cjs/esm-JBGUEJ46.cjs +250 -0
  17. package/build/cjs/esm-JBGUEJ46.cjs.map +1 -0
  18. package/build/cjs/esm-RRFVZF4X.cjs +1172 -0
  19. package/build/cjs/esm-RRFVZF4X.cjs.map +1 -0
  20. package/build/cjs/esm-VSENADXB.cjs +903 -0
  21. package/build/cjs/esm-VSENADXB.cjs.map +1 -0
  22. package/build/cjs/esm-YRGJOBTV.cjs +453 -0
  23. package/build/cjs/esm-YRGJOBTV.cjs.map +1 -0
  24. package/build/cjs/index.cjs +26 -20
  25. package/build/cjs/index.cjs.map +1 -1
  26. package/build/esm/esm-5B4R5BF5.js +248 -0
  27. package/build/esm/esm-5B4R5BF5.js.map +1 -0
  28. package/build/esm/esm-7ZL7DCMH.js +451 -0
  29. package/build/esm/esm-7ZL7DCMH.js.map +1 -0
  30. package/build/esm/esm-WPXIOIG2.js +1170 -0
  31. package/build/esm/esm-WPXIOIG2.js.map +1 -0
  32. package/build/esm/esm-ZCTE2SEE.js +377 -0
  33. package/build/esm/esm-ZCTE2SEE.js.map +1 -0
  34. package/build/esm/esm-ZDRBH2ME.js +901 -0
  35. package/build/esm/esm-ZDRBH2ME.js.map +1 -0
  36. package/build/esm/index.js +26 -19
  37. package/build/esm/index.js.map +1 -1
  38. package/build/esm/run.d.ts.map +1 -1
  39. package/build/esm/templates.d.ts +7 -0
  40. package/build/esm/templates.d.ts.map +1 -1
  41. package/package.json +18 -9
  42. package/templates/template-next-static-export/.eslintrc.json +0 -4
  43. package/templates/template-next-static-export/README.md.hbs +0 -35
  44. package/templates/template-next-static-export/_gitignore +0 -36
  45. package/templates/template-next-static-export/next.config.js.hbs +0 -17
  46. package/templates/template-next-static-export/package.json.hbs +0 -25
  47. package/templates/template-next-static-export/public/next.svg +0 -20
  48. package/templates/template-next-static-export/public/palantir.svg +0 -3
  49. package/templates/template-next-static-export/src/app/auth/callback/page.tsx +0 -25
  50. package/templates/template-next-static-export/src/app/globals.css +0 -81
  51. package/templates/template-next-static-export/src/app/icon.svg +0 -20
  52. package/templates/template-next-static-export/src/app/layout.module.css +0 -11
  53. package/templates/template-next-static-export/src/app/layout.tsx +0 -51
  54. package/templates/template-next-static-export/src/app/login/page.tsx +0 -43
  55. package/templates/template-next-static-export/src/app/page.module.css +0 -7
  56. package/templates/template-next-static-export/src/app/page.tsx.hbs +0 -53
  57. package/templates/template-next-static-export/src/lib/client.ts.hbs +0 -31
  58. package/templates/template-next-static-export/src/lib/useAuthenticated.ts +0 -25
  59. package/templates/template-next-static-export/tsconfig.json +0 -27
  60. package/templates/template-react/.eslintrc.cjs +0 -18
  61. package/templates/template-react/README.md.hbs +0 -35
  62. package/templates/template-react/_gitignore +0 -24
  63. package/templates/template-react/index.html +0 -15
  64. package/templates/template-react/package.json.hbs +0 -30
  65. package/templates/template-react/public/palantir.svg +0 -3
  66. package/templates/template-react/public/react.svg +0 -1
  67. package/templates/template-react/src/AuthCallback.tsx +0 -24
  68. package/templates/template-react/src/AuthenticatedRoute.tsx +0 -33
  69. package/templates/template-react/src/Home.module.css +0 -7
  70. package/templates/template-react/src/Home.tsx.hbs +0 -47
  71. package/templates/template-react/src/Layout.module.css +0 -10
  72. package/templates/template-react/src/Layout.tsx +0 -29
  73. package/templates/template-react/src/Login.tsx +0 -40
  74. package/templates/template-react/src/client.ts.hbs +0 -31
  75. package/templates/template-react/src/index.css +0 -81
  76. package/templates/template-react/src/main.tsx +0 -33
  77. package/templates/template-react/src/vite-env.d.ts +0 -1
  78. package/templates/template-react/tsconfig.json +0 -25
  79. package/templates/template-react/tsconfig.node.json +0 -10
  80. package/templates/template-react/vite.config.ts.hbs +0 -19
  81. package/templates/template-tutorial-todo-app/.eslintrc.cjs +0 -18
  82. package/templates/template-tutorial-todo-app/README.md.hbs +0 -33
  83. package/templates/template-tutorial-todo-app/index.html +0 -15
  84. package/templates/template-tutorial-todo-app/package.json.hbs +0 -31
  85. package/templates/template-tutorial-todo-app/public/todo-app.svg +0 -4
  86. package/templates/template-tutorial-todo-app/src/AuthCallback.tsx +0 -24
  87. package/templates/template-tutorial-todo-app/src/AuthenticatedRoute.tsx +0 -33
  88. package/templates/template-tutorial-todo-app/src/CreateProjectButton.tsx +0 -33
  89. package/templates/template-tutorial-todo-app/src/CreateProjectDialog.tsx +0 -56
  90. package/templates/template-tutorial-todo-app/src/CreateTaskButton.tsx +0 -35
  91. package/templates/template-tutorial-todo-app/src/CreateTaskDialog.tsx +0 -52
  92. package/templates/template-tutorial-todo-app/src/DeleteProjectButton.tsx +0 -34
  93. package/templates/template-tutorial-todo-app/src/DeleteProjectDialog.tsx +0 -46
  94. package/templates/template-tutorial-todo-app/src/Dialog.module.css +0 -5
  95. package/templates/template-tutorial-todo-app/src/Dialog.tsx +0 -19
  96. package/templates/template-tutorial-todo-app/src/Home.module.css +0 -35
  97. package/templates/template-tutorial-todo-app/src/Home.tsx +0 -62
  98. package/templates/template-tutorial-todo-app/src/Layout.module.css +0 -16
  99. package/templates/template-tutorial-todo-app/src/Layout.tsx +0 -21
  100. package/templates/template-tutorial-todo-app/src/Login.module.css +0 -5
  101. package/templates/template-tutorial-todo-app/src/Login.tsx +0 -42
  102. package/templates/template-tutorial-todo-app/src/ProjectSelect.tsx +0 -40
  103. package/templates/template-tutorial-todo-app/src/TaskList.module.css +0 -6
  104. package/templates/template-tutorial-todo-app/src/TaskList.tsx +0 -38
  105. package/templates/template-tutorial-todo-app/src/TaskListItem.module.css +0 -3
  106. package/templates/template-tutorial-todo-app/src/TaskListItem.tsx +0 -37
  107. package/templates/template-tutorial-todo-app/src/client.ts.hbs +0 -31
  108. package/templates/template-tutorial-todo-app/src/index.css +0 -80
  109. package/templates/template-tutorial-todo-app/src/main.tsx +0 -33
  110. package/templates/template-tutorial-todo-app/src/mocks.ts +0 -137
  111. package/templates/template-tutorial-todo-app/src/useProjectTasks.ts +0 -55
  112. package/templates/template-tutorial-todo-app/src/useProjects.ts +0 -43
  113. package/templates/template-tutorial-todo-app/src/vite-env.d.ts +0 -1
  114. package/templates/template-tutorial-todo-app/tsconfig.json +0 -25
  115. package/templates/template-tutorial-todo-app/tsconfig.node.json +0 -10
  116. package/templates/template-tutorial-todo-app/vite.config.ts.hbs +0 -19
  117. package/templates/template-vue/.vscode/extensions.json +0 -3
  118. package/templates/template-vue/README.md.hbs +0 -35
  119. package/templates/template-vue/_gitignore +0 -24
  120. package/templates/template-vue/index.html +0 -15
  121. package/templates/template-vue/package.json.hbs +0 -22
  122. package/templates/template-vue/public/palantir.svg +0 -3
  123. package/templates/template-vue/public/vue.svg +0 -1
  124. package/templates/template-vue/src/AuthCallback.vue +0 -22
  125. package/templates/template-vue/src/Home.vue.hbs +0 -38
  126. package/templates/template-vue/src/Layout.vue +0 -26
  127. package/templates/template-vue/src/Login.vue +0 -36
  128. package/templates/template-vue/src/client.ts.hbs +0 -31
  129. package/templates/template-vue/src/main.ts +0 -35
  130. package/templates/template-vue/src/style.css +0 -81
  131. package/templates/template-vue/src/vite-env.d.ts +0 -1
  132. package/templates/template-vue/tsconfig.json +0 -25
  133. package/templates/template-vue/tsconfig.node.json +0 -10
  134. package/templates/template-vue/vite.config.ts.hbs +0 -24
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../create-app.template.tutorial-todo-app/build/esm/index.js"],"names":[],"mappings":";AACA,IAAI,KAAuB,mBAAA,IAAI,GAAI,CAAA,CAAC,CAAC,eAAiB,EAAA;AAAA,EACpD,IAAM,EAAA,KAAA;AAAA,EACN,IAAM,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAmBR,CAAC,CAAA,EAAG,CAAC,eAAiB,EAAA;AAAA,EACpB,IAAM,EAAA,KAAA;AAAA,EACN,IAAM,EAAA,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,CAAA;AAkCR,CAAC,CAAA,EAAG,CAAC,YAAc,EAAA;AAAA,EACjB,IAAM,EAAA,KAAA;AAAA,EACN,IAAM,EAAA,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,CAAA;AAyBR,CAAC,CAAA,EAAG,CAAC,YAAc,EAAA;AAAA,EACjB,IAAM,EAAA,KAAA;AAAA,EACN,IAAM,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAgBR,CAAC,CAAA,EAA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AAA;AAAA,EACR,MAAQ,EAAA,0yBAAA;AACV,CAAC,CAAA,EAAG,CAAC,oBAAsB,EAAA;AAAA,EACzB,MAAQ,EAAA,QAAA;AAAA,EACR,MAAQ,EAAA,8RAAA;AACV,CAAC,CAAA,EAAG,CAAC,oBAAsB,EAAA;AAAA,EACzB,IAAM,EAAA,KAAA;AAAA,EACN,IAAM,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAoBR,CAAC,CAAC,CAAC","file":"esm-ZDRBH2ME.js","sourcesContent":["// src/generatedNoCheck/index.ts\nvar files = /* @__PURE__ */new Map([[\".eslintrc.cjs\", {\n type: \"raw\",\n body: `module.exports = {\n root: true,\n env: { browser: true, es2020: true },\n extends: [\n \"eslint:recommended\",\n \"plugin:@typescript-eslint/recommended\",\n \"plugin:react-hooks/recommended\",\n ],\n ignorePatterns: [\"dist\", \".eslintrc.cjs\"],\n parser: \"@typescript-eslint/parser\",\n plugins: [\"react-refresh\"],\n rules: {\n \"react-refresh/only-export-components\": [\n \"warn\",\n { allowConstantExport: true },\n ],\n },\n};\n`\n}], [\"README.md.hbs\", {\n type: \"raw\",\n body: `# {{project}}\n\nThis project was generated with \\`@osdk/create-app\\` and is intended to be used alongside the Developer Console tutorial for creating a To Do App against a reference Ontology.\n\n## Developing\n\nRun the following command or equivalent with your preferred package manager to start a local development server on \\`http://localhost:8080\\`:\n\n\\`\\`\\`sh\nnpm run dev\n\\`\\`\\`\n\nDevelopment configuration is stored in \\`.env.development\\`.\n\n{{#if corsProxy}}\nIn order to make API requests to Foundry, a CORS proxy has been set up for local development which may be removed if the stack is configured to allow \\`http://localhost:8080\\` to load resources. The configured OAuth client must also allow \\`http://localhost:8080/auth/callback\\` as a redirect URL.\n{{else}}\nIn order to make API requests to Foundry, CORS must be configured for the stack to allow \\`http://localhost:8080\\` to load resources. The configured OAuth client must also allow \\`http://localhost:8080/auth/callback\\` as a redirect URL.\n{{/if}}\n\n## Deploying\n\nRun the following command or equivalent with your preferred package manager to create a production build of your application:\n\n\\`\\`\\`sh\nnpm run build\n\\`\\`\\`\n\nProduction configuration is stored in \\`.env.production\\`.\n\nIf you did not fill in the URL your production application will be hosted on you will need to fill in the \\`VITE_FOUNDRY_REDIRECT_URL\\` in \\`.env.production\\`.\n\nIn order to make API requests to Foundry, CORS must be configured for the stack to allow the production origin to load resources. The configured OAuth client must also allow the production origin auth callback as a redirect URL.\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\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}], [\"index.html\", {\n type: \"raw\",\n body: `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/todo-app.svg\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Ontology SDK Tutorial - Todo App</title>\n </head>\n <body>\n <div id=\"root-container\">\n <div id=\"root\"></div>\n </div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n`\n}], [\"package.json.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 . --ext ts,tsx --report-unused-disable-directives --max-warnings 0\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"{{osdkPackage}}\": \"latest\",\n \"react\": \"^18\",\n \"react-dom\": \"^18\",\n \"react-router-dom\": \"^6.23.1\",\n \"swr\": \"^2.2.5\"\n },\n \"devDependencies\": {\n \"@types/react\": \"^18\",\n \"@types/react-dom\": \"^18\",\n \"@typescript-eslint/eslint-plugin\": \"^7.16.0\",\n \"@typescript-eslint/parser\": \"^7.16.0\",\n \"@vitejs/plugin-react\": \"^4.2.0\",\n \"eslint\": \"^8.57.0\",\n \"eslint-plugin-react-hooks\": \"^4.6.2\",\n \"eslint-plugin-react-refresh\": \"^0.4.6\",\n \"typescript\": \"^5.5.4\",\n \"vite\": \"^5.3.4\"\n }\n}`\n}], [\"public/todo-app.svg\", {\n \"type\": \"base64\",\n \"body\": \"PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiByeD0iMTYiIGZpbGw9IiNGQkIzNjAiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yOCA4MlY5NEg0MFY4MkgyOFpNMjIgNzBINDZDNDkuMyA3MCA1MiA3Mi43IDUyIDc2VjEwMEM1MiAxMDMuMyA0OS4zIDEwNiA0NiAxMDZIMjJDMTguNyAxMDYgMTYgMTAzLjMgMTYgMTAwVjc2QzE2IDcyLjcgMTguNyA3MCAyMiA3MFpNNzYgMzRIMTA2QzEwOS4zIDM0IDExMiAzNi43IDExMiA0MEMxMTIgNDMuMyAxMDkuMyA0NiAxMDYgNDZINzZDNzIuNyA0NiA3MCA0My4zIDcwIDQwQzcwIDM2LjcgNzIuNyAzNCA3NiAzNFpNNTIgMjJDNTUuMyAyMiA1OCAyNC43IDU4IDI4QzU4IDI5LjY4IDU3LjM0IDMxLjE4IDU2LjI2IDMyLjI2TDM4LjI2IDU2LjI2QzM3LjE4IDU3LjM0IDM1LjY4IDU4IDM0IDU4QzMyLjMyIDU4IDMwLjgyIDU3LjM0IDI5Ljc0IDU2LjI2TDE3Ljc0IDQ0LjI2QzE2LjY2IDQzLjE4IDE2IDQxLjY4IDE2IDQwQzE2IDM2LjcgMTguNyAzNCAyMiAzNEMyMy42OCAzNCAyNS4xOCAzNC42NiAyNi4yNiAzNS43NEwzNCA0My41NEw0Ny43NCAyMy43NEM0OC44MiAyMi42NiA1MC4zMiAyMiA1MiAyMlpNNzYgODJIMTA2QzEwOS4zIDgyIDExMiA4NC43IDExMiA4OEMxMTIgOTEuMyAxMDkuMyA5NCAxMDYgOTRINzZDNzIuNyA5NCA3MCA5MS4zIDcwIDg4QzcwIDg0LjcgNzIuNyA4MiA3NiA4MloiIGZpbGw9IiM3NzQ1MEQiLz4KPC9zdmc+Cg==\"\n}], [\"src/AuthCallback.tsx\", {\n type: \"raw\",\n body: `import { useEffect, useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport client from \"./client\";\n\n/**\n * Component to render at \\`/auth/callback\\`\n * This calls signIn() again to save the token, and then navigates the user back to the home page.\n */\nfunction AuthCallback() {\n const [error, setError] = useState<string | undefined>(undefined);\n const navigate = useNavigate();\n\n // This effect conflicts with React 18 strict mode in development\n // https://react.dev/learn/synchronizing-with-effects#how-to-handle-the-effect-firing-twice-in-development\n useEffect(() => {\n client.auth\n .signIn()\n .then(() => navigate(\"/\", { replace: true }))\n .catch((e: unknown) => setError((e as Error).message ?? e));\n }, [navigate]);\n return <div>{error != null ? error : \"Authenticating\\u2026\"}</div>;\n}\n\nexport default AuthCallback;\n`\n}], [\"src/AuthenticatedRoute.tsx\", {\n type: \"raw\",\n body: `import { useEffect, useState } from \"react\";\nimport { Outlet, useNavigate } from \"react-router-dom\";\nimport client from \"./client\";\n\n/**\n * A component that can be used to wrap routes that require authentication.\n * Nested routes may assume that a valid token is present.\n */\nfunction AuthenticatedRoute() {\n const navigate = useNavigate();\n const [token, setToken] = useState(client.auth.token);\n useEffect(() => {\n if (client.auth.token == null || client.auth.token.isExpired) {\n client.auth\n .refresh()\n .then(() => {\n setToken(client.auth.token);\n })\n .catch(() => {\n // If we cannot refresh the token (i.e. the user is not logged in) we redirect to the login page\n navigate(\"/login\");\n });\n }\n }, [navigate]);\n\n if (token == null || token.isExpired) {\n return null;\n }\n\n return <Outlet />;\n}\n\nexport default AuthenticatedRoute;\n`\n}], [\"src/CreateProjectButton.tsx\", {\n type: \"raw\",\n body: `import { useCallback, useState } from \"react\";\nimport CreateProjectDialog from \"./CreateProjectDialog\";\nimport useProjects from \"./useProjects\";\n\ninterface CreateProjectButtonProps {\n onProjectCreated?: (projectId: string) => void;\n}\n\nfunction CreateProjectButton({ onProjectCreated }: CreateProjectButtonProps) {\n const { isLoading: isLoadingProjects, isError: isErrorProjects } =\n useProjects();\n\n const [isOpen, setIsOpen] = useState(false);\n const handleOpen = useCallback(() => setIsOpen(true), []);\n const handleClose = useCallback(() => setIsOpen(false), []);\n\n if (isLoadingProjects || isErrorProjects) {\n return null;\n }\n\n return (\n <>\n <button onClick={handleOpen}>Create Project</button>\n <CreateProjectDialog\n isOpen={isOpen}\n onClose={handleClose}\n onProjectCreated={onProjectCreated}\n />\n </>\n );\n}\n\nexport default CreateProjectButton;\n`\n}], [\"src/CreateProjectDialog.tsx\", {\n type: \"raw\",\n body: `import { ChangeEvent, useCallback, useEffect, useState } from \"react\";\nimport Dialog from \"./Dialog\";\nimport useProjects from \"./useProjects\";\n\ninterface CreateProjectDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onProjectCreated?: (projectId: string) => void;\n}\n\nfunction CreateProjectDialog({\n isOpen,\n onClose,\n onProjectCreated,\n}: CreateProjectDialogProps) {\n const { createProject } = useProjects();\n\n const [name, setName] = useState<string>(\"New project\");\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => setName(e.target.value),\n [],\n );\n\n useEffect(() => setName(\"New project\"), [isOpen]);\n\n const [isCreating, setIsCreating] = useState(false);\n const handleSubmit = useCallback(async () => {\n setIsCreating(true);\n try {\n const projectId = await createProject(name);\n onProjectCreated?.(projectId);\n } finally {\n setIsCreating(false);\n onClose();\n }\n }, [onProjectCreated, onClose, createProject, name]);\n\n return (\n <Dialog\n isOpen={isOpen}\n buttons={[\n <button disabled={isCreating} onClick={onClose} key=\"cancel\">\n Cancel\n </button>,\n <button disabled={isCreating} onClick={handleSubmit} key=\"create\">\n Create project\n </button>,\n ]}\n >\n <label>\n Project name: <input type=\"text\" value={name} onChange={handleChange} />\n </label>\n </Dialog>\n );\n}\nexport default CreateProjectDialog;\n`\n}], [\"src/CreateTaskButton.tsx\", {\n type: \"raw\",\n body: `import { useCallback, useState } from \"react\";\nimport CreateTaskDialog from \"./CreateTaskDialog\";\nimport { MockProject } from \"./mocks\";\nimport { useProjectTasks } from \"./useProjectTasks\";\n\ninterface CreateTaskButtonProps {\n project: MockProject;\n}\n\nfunction CreateTaskButton({ project }: CreateTaskButtonProps) {\n const { isLoading: isLoadingTasks, isError: isErrorTasks } = useProjectTasks(\n project,\n );\n\n const [isOpen, setIsOpen] = useState(false);\n const handleOpen = useCallback(() => setIsOpen(true), []);\n const handleClose = useCallback(() => setIsOpen(false), []);\n\n if (isLoadingTasks || isErrorTasks) {\n return null;\n }\n\n return (\n <>\n <button onClick={handleOpen}>Create Task</button>\n <CreateTaskDialog\n project={project}\n isOpen={isOpen}\n onClose={handleClose}\n />\n </>\n );\n}\n\nexport default CreateTaskButton;\n`\n}], [\"src/CreateTaskDialog.tsx\", {\n type: \"raw\",\n body: `import { ChangeEvent, useCallback, useEffect, useState } from \"react\";\nimport Dialog from \"./Dialog\";\nimport { MockProject } from \"./mocks\";\nimport { useProjectTasks } from \"./useProjectTasks\";\n\ninterface CreateTaskDialogProps {\n project: MockProject;\n isOpen: boolean;\n onClose: () => void;\n}\n\nfunction CreateTaskDialog({ project, isOpen, onClose }: CreateTaskDialogProps) {\n const { createTask } = useProjectTasks(project);\n\n const [name, setName] = useState<string>(\"New task\");\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => setName(e.target.value),\n [],\n );\n\n useEffect(() => setName(\"New task\"), [isOpen]);\n\n const [isCreating, setIsCreating] = useState(false);\n const handleSubmit = useCallback(async () => {\n setIsCreating(true);\n try {\n await createTask(name);\n } finally {\n setIsCreating(false);\n onClose();\n }\n }, [onClose, createTask, name]);\n\n return (\n <Dialog\n isOpen={isOpen}\n buttons={[\n <button disabled={isCreating} onClick={onClose} key=\"cancel\">\n Cancel\n </button>,\n <button disabled={isCreating} onClick={handleSubmit} key=\"create\">\n Create task\n </button>,\n ]}\n >\n <label>\n Task name: <input type=\"text\" value={name} onChange={handleChange} />\n </label>\n </Dialog>\n );\n}\nexport default CreateTaskDialog;\n`\n}], [\"src/DeleteProjectButton.tsx\", {\n type: \"raw\",\n body: `import { useCallback, useState } from \"react\";\nimport DeleteProjectDialog from \"./DeleteProjectDialog\";\nimport { MockProject } from \"./mocks\";\nimport useProjects from \"./useProjects\";\n\ninterface DeleteProjectButtonProps {\n project: MockProject;\n}\n\nfunction DeleteProjectButton({ project }: DeleteProjectButtonProps) {\n const { isLoading: isLoadingProjects, isError: isErrorProjects } =\n useProjects();\n\n const [isOpen, setIsOpen] = useState(false);\n const handleOpen = useCallback(() => setIsOpen(true), []);\n const handleClose = useCallback(() => setIsOpen(false), []);\n\n if (isLoadingProjects || isErrorProjects) {\n return null;\n }\n\n return (\n <>\n <button onClick={handleOpen}>Delete Project</button>\n <DeleteProjectDialog\n project={project}\n isOpen={isOpen}\n onClose={handleClose}\n />\n </>\n );\n}\n\nexport default DeleteProjectButton;\n`\n}], [\"src/DeleteProjectDialog.tsx\", {\n type: \"raw\",\n body: `import { useCallback, useState } from \"react\";\nimport Dialog from \"./Dialog\";\nimport { MockProject } from \"./mocks\";\nimport useProjects from \"./useProjects\";\n\ninterface DeleteProjectDialogProps {\n project: MockProject;\n isOpen: boolean;\n onClose: () => void;\n}\n\nfunction DeleteProjectDialog({\n project,\n isOpen,\n onClose,\n}: DeleteProjectDialogProps) {\n const { deleteProject } = useProjects();\n\n const [isDeleting, setIsDeleting] = useState(false);\n const handleSubmit = useCallback(async () => {\n setIsDeleting(true);\n try {\n await deleteProject(project);\n } finally {\n setIsDeleting(false);\n onClose();\n }\n }, [deleteProject, onClose, project]);\n\n return (\n <Dialog\n isOpen={isOpen}\n buttons={[\n <button disabled={isDeleting} onClick={onClose} key=\"cancel\">\n Cancel\n </button>,\n <button disabled={isDeleting} onClick={handleSubmit} key=\"delete\">\n Delete\n </button>,\n ]}\n >\n Are you sure you want to delete this project?\n </Dialog>\n );\n}\nexport default DeleteProjectDialog;\n`\n}], [\"src/Dialog.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LmJ1dHRvbnMgewogIGRpc3BsYXk6IGZsZXg7CiAgZ2FwOiAxZW07CiAgbWFyZ2luLXRvcDogMWVtOwp9CgouZGlhbG9nIHsKICBib3JkZXI6IDFweCBzb2xpZCBibGFjazsKICBib3JkZXItcmFkaXVzOiAxMHB4Owp9\"\n}], [\"src/Dialog.tsx\", {\n type: \"raw\",\n body: `import { PropsWithChildren } from \"react\";\nimport css from \"./Dialog.module.css\";\n\ninterface DialogProps {\n isOpen: boolean;\n buttons?: React.ReactElement[];\n}\n\nfunction Dialog({ children, isOpen, buttons }: PropsWithChildren<DialogProps>) {\n return (\n <dialog open={isOpen} className={css.dialog}>\n {children}\n {buttons != null && buttons.length > 0 && (\n <div className={css.buttons}>{buttons}</div>\n )}\n </dialog>\n );\n}\nexport default Dialog;\n`\n}], [\"src/Home.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LnR1dG9yaWFsQmFubmVyV3JhcHBlciB7CiAgZGlzcGxheTogZmxleDsKICBtYXJnaW46IDJlbTsKfQoKLnR1dG9yaWFsQmFubmVyIHsKICBmbGV4OiAxOwogIHdpZHRoOiAwOwogIGJhY2tncm91bmQ6IGhzbCgzNSwgMTAwJSwgNzAlKTsKICBib3JkZXItcmFkaXVzOiAxZW07CiAgcGFkZGluZzogMWVtOwogIGJveC1zaGFkb3c6IDAgMTBweCAxNXB4IC0zcHggcmdiKDAgMCAwIC8gMC4xKSwgMCA0cHggNnB4IC00cHggcmdiKDAgMCAwIC8gMC4xKTsKfQoKLnR1dG9yaWFsQmFubmVyVGl0bGUgewogIG1hcmdpbi10b3A6IDA7CiAgZm9udC13ZWlnaHQ6IDYwMDsKfQoKLnByb2plY3RTZWxlY3QgewogIGRpc3BsYXk6IGZsZXg7CiAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICBnYXA6IDFlbTsKICBtYXJnaW46IDJlbTsKICBmb250LXdlaWdodDogNjAwOwp9CgoucHJvamVjdENhcmQgewogIG1hcmdpbjogMmVtOwp9CgoucHJvamVjdFRpdGxlIHsKICBmb250LXNpemU6IDEuNWVtOwp9Cg==\"\n}], [\"src/Home.tsx\", {\n type: \"raw\",\n body: `import { useCallback, useEffect, useState } from \"react\";\nimport CreateProjectButton from \"./CreateProjectButton\";\nimport CreateTaskButton from \"./CreateTaskButton\";\nimport DeleteProjectButton from \"./DeleteProjectButton\";\nimport css from \"./Home.module.css\";\nimport Layout from \"./Layout\";\nimport { MockProject } from \"./mocks\";\nimport ProjectSelect from \"./ProjectSelect\";\nimport TaskList from \"./TaskList\";\nimport useProjects from \"./useProjects\";\n\nfunction Home() {\n const [projectId, setProjectId] = useState<string | undefined>(undefined);\n const { projects } = useProjects();\n const project = projects?.find((p) => p.id === projectId);\n\n const handleSelectProject = useCallback(\n (p: MockProject) => setProjectId(p.id),\n [],\n );\n\n useEffect(() => {\n if (project == null && projects != null && projects.length > 0) {\n setProjectId(projects[0].id);\n }\n }, [project, projects]);\n\n return (\n <Layout>\n <div className={css.tutorialBannerWrapper}>\n <div className={css.tutorialBanner}>\n <p className={css.tutorialBannerTitle}>\n \\u{1F4A1} Welcome to To Do app tutorial!\n </p>\n <p>\n The To Do App is implemented with mock in-memory data.\n <br />Can you solve how to switch it to use the Ontology SDK\n instead?\n </p>\n </div>\n </div>\n <div className={css.projectSelect}>\n <span>Project:</span>\n <ProjectSelect\n project={project}\n projects={projects ?? []}\n onSelectProject={handleSelectProject}\n />\n <CreateProjectButton onProjectCreated={setProjectId} />\n {project != null && <DeleteProjectButton project={project} />}\n </div>\n {project != null && (\n <div className={css.projectCard} key={project.id}>\n <h1 className={css.projectTitle}>{project.name}</h1>\n <TaskList project={project} />\n <CreateTaskButton project={project} />\n </div>\n )}\n </Layout>\n );\n}\n\nexport default Home;\n`\n}], [\"src/Layout.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LmhlYWRlciB7CiAgZGlzcGxheTogZmxleDsKICBhbGlnbi1pdGVtczogY2VudGVyOwogIG1hcmdpbjogMmVtOwp9CgoubG9nbyB7CiAgaGVpZ2h0OiA0ZW07CiAgYWxpZ24taXRlbXM6IGNlbnRlcjsKICBtYXJnaW4tcmlnaHQ6IDFlbTsKfQoKLnRpdGxlIHsKICBmb250LXdlaWdodDogNjAwOwogIGZvbnQtc2l6ZTogMS41ZW07Cn0K\"\n}], [\"src/Layout.tsx\", {\n type: \"raw\",\n body: `import todoAppLogo from \"/todo-app.svg\";\nimport React from \"react\";\nimport css from \"./Layout.module.css\";\n\ninterface LayoutProps {\n children?: React.ReactNode;\n}\n\nfunction Layout({ children }: LayoutProps) {\n return (\n <>\n <div className={css.header}>\n <img src={todoAppLogo} className={css.logo} alt=\"Todo App logo\" />\n <div className={css.title}>Ontology SDK Tutorial - Todo App</div>\n </div>\n {children}\n </>\n );\n}\n\nexport default Layout;\n`\n}], [\"src/Login.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LmxvZ2luQnV0dG9uIHsKICBkaXNwbGF5OiBmbGV4OwogIGp1c3RpZnktY29udGVudDogY2VudGVyOwogIG1hcmdpbjogMmVtOwp9Cg==\"\n}], [\"src/Login.tsx\", {\n type: \"raw\",\n body: `import { useCallback, useState } from \"react\";\nimport { Navigate } from \"react-router-dom\";\nimport client from \"./client\";\nimport Layout from \"./Layout\";\nimport css from \"./Login.module.css\";\n\nfunction Login() {\n const [isLoggingIn, setIsLoggingIn] = useState(false);\n const [error, setError] = useState<string | undefined>(undefined);\n const token = client.auth.token;\n\n const handleLogin = useCallback(async () => {\n setIsLoggingIn(true);\n try {\n // Initiate the OAuth flow, which will redirect the user to log into Foundry\n // Once the login has completed, the user will be redirected back to the route defined via the\n // FOUNDRY_REDIRECT_URL variable in .env.development\n await client.auth.signIn();\n } catch (e: unknown) {\n console.error(e);\n setError((e as Error).message ?? e);\n } finally {\n setIsLoggingIn(false);\n }\n }, []);\n\n // If the token exists but a user tries to load /login, redirect to the home page instead\n if (token != null) {\n return <Navigate to=\"/\" replace={true} />;\n }\n\n return (\n <Layout>\n <div className={css.loginButton}>\n <button onClick={handleLogin}>\n {isLoggingIn ? \"Logging in\\u2026\" : \"Log in \"}\n </button>\n </div>\n {error && <div>Unable to log in: {error}</div>}\n </Layout>\n );\n}\n\nexport default Login;\n`\n}], [\"src/ProjectSelect.tsx\", {\n type: \"raw\",\n body: `import { ChangeEvent, useCallback } from \"react\";\nimport { MockProject } from \"./mocks\";\n\ninterface ProjectSelectProps {\n project: MockProject | undefined;\n projects: MockProject[];\n onSelectProject: (project: MockProject) => void;\n}\n\nfunction ProjectSelect({\n project,\n projects,\n onSelectProject,\n}: ProjectSelectProps) {\n const handleSelect = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n const nextProject = projects.find((p) => \\`\\${p.id}\\` === e.target.value);\n if (nextProject != null) {\n onSelectProject(nextProject);\n }\n },\n [projects, onSelectProject],\n );\n\n return (\n <select value={project?.id} onChange={handleSelect}>\n <option hidden disabled value=\"\">\n -- select a project --\n </option>\n\n {projects.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n );\n}\n\nexport default ProjectSelect;\n`\n}], [\"src/TaskList.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LnRhc2tMaXN0IHsKICBsaXN0LXN0eWxlOiBub25lOwogIHBhZGRpbmc6IDA7CiAgbWFyZ2luLXRvcDogMWVtOwogIG1hcmdpbi1ib3R0b206IDFlbTsKfQo=\"\n}], [\"src/TaskList.tsx\", {\n type: \"raw\",\n body: `import { MockProject } from \"./mocks\";\nimport css from \"./TaskList.module.css\";\nimport TaskListItem from \"./TaskListItem\";\nimport { useProjectTasks } from \"./useProjectTasks\";\n\ninterface TaskListProps {\n project: MockProject;\n}\n\nfunction TaskList({ project }: TaskListProps) {\n const {\n tasks,\n isLoading: isLoadingTasks,\n isError: isErrorTasks,\n deleteTask,\n } = useProjectTasks(project);\n\n if (isErrorTasks) {\n return <div className={css.taskList}>Error loading tasks!</div>;\n } else if (isLoadingTasks) {\n return null;\n }\n\n const data = tasks ?? [];\n if (data.length === 0) {\n return <div className={css.taskList}>No tasks found</div>;\n }\n\n return (\n <ul className={css.taskList}>\n {data.map((task) => (\n <TaskListItem key={task.id} task={task} deleteTask={deleteTask} />\n ))}\n </ul>\n );\n}\n\nexport default TaskList;\n`\n}], [\"src/TaskListItem.module.css\", {\n \"type\": \"base64\",\n \"body\": \"LmxhYmVsIHsKICBtYXJnaW4tbGVmdDogMC41ZW07Cn0KCi5jaGVja2VkIHsKICB0ZXh0LWRlY29yYXRpb246IGxpbmUtdGhyb3VnaDsKfQoKLmRlbGV0ZSB7CiAgYm9yZGVyOiAxcHggc29saWQgI2NjYzsKICBwYWRkaW5nOiAycHg7Cn0KCg==\"\n}], [\"src/TaskListItem.tsx\", {\n type: \"raw\",\n body: `import { useCallback, useState } from \"react\";\nimport { MockTask } from \"./mocks\";\nimport css from \"./TaskListItem.module.css\";\n\ninterface TaskListItemProps {\n task: MockTask;\n deleteTask: (task: MockTask) => Promise<void>;\n}\n\nfunction TaskListItem({ task, deleteTask }: TaskListItemProps) {\n const [isDeleting, setIsDeleting] = useState(false);\n const handleClick = useCallback(async () => {\n setIsDeleting(true);\n try {\n await deleteTask(task);\n } finally {\n setIsDeleting(false);\n }\n }, [deleteTask, task]);\n\n return (\n <li>\n <label\n className={\\`\\${css.label} \\${isDeleting ? css.checked : \"\"}\\`}\n htmlFor={\\`\\${task.id}\\`}\n >\n <input\n type=\"checkbox\"\n onChange={handleClick}\n checked={isDeleting}\n className={css.delete}\n title=\"Delete task\"\n />\n {task.title}\n </label>\n </li>\n );\n}\n\nexport default TaskListItem;\n`\n}], [\"src/client.ts.hbs\", {\n type: \"raw\",\n body: `import { FoundryClient, PublicClientAuth } from \"{{osdkPackage}}\";\n\nconst url = import.meta.env.VITE_FOUNDRY_API_URL;\nconst clientId = import.meta.env.VITE_FOUNDRY_CLIENT_ID;\nconst redirectUrl = import.meta.env.VITE_FOUNDRY_REDIRECT_URL;\ncheckEnv(url, \"VITE_FOUNDRY_API_URL\");\ncheckEnv(clientId, \"VITE_FOUNDRY_CLIENT_ID\");\ncheckEnv(redirectUrl, \"VITE_FOUNDRY_REDIRECT_URL\");\n\nfunction checkEnv(\n value: string | undefined,\n name: string,\n): asserts value is string {\n if (value == null) {\n throw new Error(\\`Missing environment variable: \\${name}\\`);\n }\n}\n\n/**\n * Initialize the client to interact with the Ontology SDK\n */\nconst client = new FoundryClient({\n url,\n auth: new PublicClientAuth({\n clientId,\n url,\n redirectUrl,\n }),\n});\n\nexport default client;\n`\n}], [\"src/index.css\", {\n \"type\": \"base64\",\n \"body\": \"OnJvb3QgewogIGZvbnQtZmFtaWx5OiBJbnRlciwgc3lzdGVtLXVpLCBBdmVuaXIsIEhlbHZldGljYSwgQXJpYWwsIHNhbnMtc2VyaWY7CiAgbGluZS1oZWlnaHQ6IDEuNTsKICBmb250LXdlaWdodDogNDAwOwoKICBmb250LXN5bnRoZXNpczogbm9uZTsKICB0ZXh0LXJlbmRlcmluZzogb3B0aW1pemVMZWdpYmlsaXR5OwogIC13ZWJraXQtZm9udC1zbW9vdGhpbmc6IGFudGlhbGlhc2VkOwogIC1tb3otb3N4LWZvbnQtc21vb3RoaW5nOiBncmF5c2NhbGU7Cn0KCiNyb290LWNvbnRhaW5lciB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4OiA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9CiAgYnV0dG9uIHsKICAgIGJhY2tncm91bmQtY29sb3I6ICNmOWY5Zjk7CiAgfQp9Cg==\"\n}], [\"src/main.tsx\", {\n type: \"raw\",\n body: `import ReactDOM from \"react-dom/client\";\nimport { createBrowserRouter, RouterProvider } from \"react-router-dom\";\nimport AuthCallback from \"./AuthCallback\";\nimport AuthenticatedRoute from \"./AuthenticatedRoute\";\nimport Home from \"./Home\";\nimport Login from \"./Login\";\nimport \"./index.css\";\n\nconst router = createBrowserRouter(\n [\n {\n path: \"/\",\n element: <AuthenticatedRoute />,\n children: [\n {\n path: \"/\",\n element: <Home />,\n },\n ],\n },\n {\n path: \"/login\",\n element: <Login />,\n },\n {\n // This is the route defined in your application's redirect URL\n path: \"/auth/callback\",\n element: <AuthCallback />,\n },\n ],\n { basename: import.meta.env.BASE_URL },\n);\n\nReactDOM.createRoot(document.getElementById(\"root\")!).render(\n <RouterProvider router={router} />,\n);\n`\n}], [\"src/mocks.ts\", {\n \"type\": \"base64\",\n \"body\": \"ZXhwb3J0IGludGVyZmFjZSBNb2NrUHJvamVjdCB7CiAgJGFwaU5hbWU6IHN0cmluZzsKICAkcHJpbWFyeUtleTogc3RyaW5nOwogIGlkOiBzdHJpbmc7CiAgbmFtZTogc3RyaW5nOwogIHRhc2tzOiBNb2NrVGFza1tdOwp9CgpleHBvcnQgaW50ZXJmYWNlIE1vY2tUYXNrIHsKICAkYXBpTmFtZTogc3RyaW5nOwogICRwcmltYXJ5S2V5OiBzdHJpbmc7CiAgaWQ6IHN0cmluZzsKICB0aXRsZTogc3RyaW5nOwp9Cgpjb25zdCBwcm9qZWN0czogTW9ja1Byb2plY3RbXSA9IFsKICB7CiAgICAkYXBpTmFtZTogIk1vY2tQcm9qZWN0IiwKICAgICRwcmltYXJ5S2V5OiAiMSIsCiAgICBpZDogIjEiLAogICAgbmFtZTogIk1vY2sgcHJvamVjdCIsCiAgICB0YXNrczogWwogICAgICB7CiAgICAgICAgJGFwaU5hbWU6ICJNb2NrVGFzayIsCiAgICAgICAgJHByaW1hcnlLZXk6ICIxIiwKICAgICAgICBpZDogIjEiLAogICAgICAgIHRpdGxlOiAiVHJ5IHRvIiwKICAgICAgfSwKICAgICAgewogICAgICAgICRhcGlOYW1lOiAiTW9ja1Rhc2siLAogICAgICAgICRwcmltYXJ5S2V5OiAiMiIsCiAgICAgICAgaWQ6ICIyIiwKICAgICAgICB0aXRsZTogIkltcGxlbWVudCB0aGlzIiwKICAgICAgfSwKICAgICAgewogICAgICAgICRhcGlOYW1lOiAiTW9ja1Rhc2siLAogICAgICAgICRwcmltYXJ5S2V5OiAiMyIsCiAgICAgICAgaWQ6ICIzIiwKICAgICAgICB0aXRsZTogIldpdGggdGhlIE9udG9sb2d5IFNESyEiLAogICAgICB9LAogICAgXSwKICB9LAogIHsKICAgICRhcGlOYW1lOiAiTW9ja1Byb2plY3QiLAogICAgJHByaW1hcnlLZXk6ICIyIiwKICAgIGlkOiAiMiIsCiAgICBuYW1lOiAiWWV0IGFub3RoZXIgbW9jayBwcm9qZWN0IiwKICAgIHRhc2tzOiBbCiAgICAgIHsKICAgICAgICAkYXBpTmFtZTogIk1vY2tUYXNrIiwKICAgICAgICAkcHJpbWFyeUtleTogIjQiLAogICAgICAgIGlkOiAiNCIsCiAgICAgICAgdGl0bGU6ICJNb3JlIHRhc2tzIGhlcmUiLAogICAgICB9LAogICAgXSwKICB9LApdOwoKYXN5bmMgZnVuY3Rpb24gZGVsYXkoKTogUHJvbWlzZTx2b2lkPiB7CiAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PgogICAgc2V0VGltZW91dCgoKSA9PiByZXNvbHZlKCksIDUwMCArIE1hdGgucmFuZG9tKCkgKiAxMDAwKQogICk7Cn0KCi8vIEdvb2QgZW5vdWdoIHJhbmRvbSBpZCBmb3IgbW9ja3MKZnVuY3Rpb24gcmFuZG9tSWQoKTogc3RyaW5nIHsKICByZXR1cm4gYCR7TWF0aC5mbG9vcihNYXRoLnJhbmRvb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7CgogIGNvbnN0IGNyZWF0ZVByb2plY3Q6IChuYW1lOiBzdHJpbmcpID0+IFByb21pc2U8TW9ja1Byb2plY3RbIiRwcmltYXJ5S2V5Il0+ID0KICAgIHVzZUNhbGxiYWNrKAogICAgICBhc3luYyAobmFtZSkgPT4gewogICAgICAgIC8vIFRyeSB0byBpbXBsZW1lbnQgdGhpcyB3aXRoIHRoZSBPbnRvbG9neSBTREshCiAgICAgICAgY29uc3QgaWQgPSBhd2FpdCBNb2Nrcy5jcmVhdGVQcm9qZWN0KHsgbmFtZSB9KTsKICAgICAgICBhd2FpdCBtdXRhdGUoKTsKICAgICAgICByZXR1cm4gaWQ7CiAgICAgIH0sCiAgICAgIFttdXRhdGVdLAogICAgKTsKCiAgY29uc3QgZGVsZXRlUHJvamVjdDogKHByb2plY3Q6IE1vY2tQcm9qZWN0KSA9PiBQcm9taXNlPHZvaWQ+ID0gdXNlQ2FsbGJhY2soCiAgICBhc3luYyAocHJvamVjdCkgPT4gewogICAgICAvLyBUcnkgdG8gaW1wbGVtZW50IHRoaXMgd2l0aCB0aGUgT250b2xvZ3kgU0RLIQogICAgICBhd2FpdCBNb2Nrcy5kZWxldGVQcm9qZWN0KHByb2plY3QuJHByaW1hcnlLZXkpOwogICAgICBhd2FpdCBtdXRhdGUoKTsKICAgIH0sCiAgICBbbXV0YXRlXSwKICApOwoKICByZXR1cm4gewogICAgcHJvamVjdHM6IGRhdGEsCiAgICBpc0xvYWRpbmcsCiAgICBpc1ZhbGlkYXRpbmcsCiAgICBpc0Vycm9yOiBlcnJvciwKICAgIGNyZWF0ZVByb2plY3QsCiAgICBkZWxldGVQcm9qZWN0LAogIH07Cn0KCmV4cG9ydCBkZWZhdWx0IHVzZVByb2plY3RzOwo=\"\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 react from \"@vitejs/plugin-react\";\nimport { defineConfig } from \"vite\";\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [react()],\n server: {\n port: 8080,\n {{#if corsProxy}}\n proxy: {\n \"^(/multipass/api|/api)\": {\n target: \"{{foundryUrl}}\",\n changeOrigin: true,\n secure: true,\n },\n },\n {{/if}}\n },\n});\n`\n}]]);\nexport { files };"]}
@@ -4,9 +4,7 @@ import { createConsola, consola as consola$1 } from 'consola';
4
4
  import { colorize } from 'consola/utils';
5
5
  import fs2 from 'fs';
6
6
  import path2 from 'path';
7
- import { findUpSync } from 'find-up';
8
7
  import Handlebars from 'handlebars';
9
- import { fileURLToPath } from 'url';
10
8
 
11
9
  // src/cli.ts
12
10
  var consola = createConsola({
@@ -221,23 +219,34 @@ var TEMPLATES = [{
221
219
  id: "template-react",
222
220
  label: "React",
223
221
  envPrefix: "VITE_",
224
- buildDirectory: "./dist"
222
+ buildDirectory: "./dist",
223
+ getFiles: async () => (await import('./esm-7ZL7DCMH.js')).files
225
224
  }, {
226
225
  id: "template-vue",
227
226
  label: "Vue",
228
227
  envPrefix: "VITE_",
229
- buildDirectory: "./dist"
228
+ buildDirectory: "./dist",
229
+ getFiles: async () => (await import('./esm-5B4R5BF5.js')).files
230
230
  }, {
231
231
  id: "template-next-static-export",
232
232
  label: "Next (static export)",
233
233
  envPrefix: "NEXT_PUBLIC_",
234
- buildDirectory: "./out"
234
+ buildDirectory: "./out",
235
+ getFiles: async () => (await import('./esm-ZCTE2SEE.js')).files
235
236
  }, {
236
237
  id: "template-tutorial-todo-app",
237
- label: "Tutorial: Todo App",
238
+ label: "Tutorial: To do App",
239
+ envPrefix: "VITE_",
240
+ buildDirectory: "./dist",
241
+ hidden: true,
242
+ getFiles: async () => (await import('./esm-ZDRBH2ME.js')).files
243
+ }, {
244
+ id: "template-tutorial-todo-aip-app",
245
+ label: "Tutorial: To do AIP App",
238
246
  envPrefix: "VITE_",
239
247
  buildDirectory: "./dist",
240
- hidden: true
248
+ hidden: true,
249
+ getFiles: async () => (await import('./esm-WPXIOIG2.js')).files
241
250
  }];
242
251
 
243
252
  // src/prompts/promptTemplate.ts
@@ -369,17 +378,15 @@ async function run({
369
378
  });
370
379
  }
371
380
  consola.info(`Copying files into project directory`);
372
- const templatesDir = findUpSync("templates", {
373
- cwd: path2.dirname(fileURLToPath(import.meta.url)),
374
- type: "directory"
375
- });
376
- if (templatesDir == null) {
377
- throw new Error(`Could not find templates directory`);
381
+ const files = await template.getFiles();
382
+ for (const [filePath, contents] of files) {
383
+ const finalPath = path2.join(root, filePath);
384
+ const dirPath = path2.dirname(finalPath);
385
+ await fs2.promises.mkdir(dirPath, {
386
+ recursive: true
387
+ });
388
+ await fs2.promises.writeFile(finalPath, Buffer.from(contents.body, contents.type === "raw" ? "utf-8" : "base64"));
378
389
  }
379
- const templateDir = path2.resolve(templatesDir, template.id);
380
- fs2.cpSync(templateDir, root, {
381
- recursive: true
382
- });
383
390
  const templateContext = {
384
391
  project,
385
392
  foundryUrl,
@@ -451,7 +458,7 @@ async function run({
451
458
 
452
459
  // src/cli.ts
453
460
  async function cli(args = process.argv) {
454
- const base = yargs(hideBin(args)).version("0.17.0-main-20240530094422").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK application based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
461
+ const base = yargs(hideBin(args)).version("0.17.1").wrap(Math.min(150, yargs().terminalWidth())).strict().help().command("$0 [project] [--<option>]", "Create a new OSDK application based on framework templates. Information may be provided through options to skip interactive prompts.", (yargs2) => yargs2.positional("project", {
455
462
  type: "string",
456
463
  describe: "Project name to create"
457
464
  }).option("overwrite", {
@@ -515,5 +522,5 @@ async function cli(args = process.argv) {
515
522
  }
516
523
 
517
524
  export { TEMPLATES, cli, run };
518
- //# sourceMappingURL=out.js.map
525
+ //# sourceMappingURL=index.js.map
519
526
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli.ts","../../src/consola.ts","../../src/highlight.ts","../../src/prompts/promptApplicationRid.ts","../../src/prompts/promptApplicationUrl.ts","../../src/prompts/promptClientId.ts","../../src/prompts/promptCorsProxy.ts","../../src/prompts/promptFoundryUrl.ts","../../src/prompts/promptOsdkPackage.ts","../../src/prompts/promptOsdkRegistryUrl.ts","../../src/prompts/promptOverwrite.ts","../../src/prompts/promptProject.ts","../../src/templates.ts","../../src/prompts/promptTemplate.ts","../../src/run.ts","../../src/generate/generateEnv.ts","../../src/generate/generateFoundryConfigJson.ts","../../src/generate/generateNpmRc.ts"],"names":["template","fs","path","yargs"],"mappings":";AAgBA,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACDxB,SAAS,WAAW,gBAAgB,qBAAqB;AAClD,IAAM,UAAU,cAAc;AAAA;AAAA,EAEnC,MAAM,UAAU,QAAQ;AACtB,UAAM,WAAW,MAAM,eAAe,OAAO,GAAG,MAAM;AACtD,QAAI,OAAO,aAAa,YAAY,SAAS,SAAS,MAAM,wBAAwB;AAClF,qBAAe,KAAK,qBAAqB;AACzC,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,WAAO;AAAA,EACT;AACF,CAAC;;;ACXD,SAAS,gBAAgB;AAClB,SAAS,MAAM,MAAM;AAC1B,SAAO,SAAS,SAAS,IAAI;AAC/B;AACO,SAAS,OAAO,MAAM;AAC3B,SAAO,SAAS,UAAU,IAAI;AAChC;;;ACJA,eAAsB,qBAAqB;AAAA,EACzC;AACF,GAAG;AACD,SAAO,eAAe,QAAQ,CAAC,4DAA4D,KAAK,WAAW,GAAG;AAC5G,QAAI,eAAe,MAAM;AACvB,cAAQ,KAAK,4DAA4D;AAAA,IAC3E;AACA,kBAAc,MAAM,QAAQ,OAAO;AAAA,EAAiG,OAAO,8FAA8F,CAAC,IAAI;AAAA,MAC5O,MAAM;AA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AAkB;AAAA,IAC1B,MAAM;AAAA,IACN,UAAU;AAAA,IACV,WAAW;AAAA,EACb,CAAC,EAAE,OAAO,sBAAsB;AAAA,IAC9B,MAAM;AAAA,IACN,UAAU;AAAA,EACZ,CAAC,EAAE,OAAO,eAAe;AAAA,IACvB,MAAM;AAAA,IACN,UAAU;AAAA,EACZ,CAAC,EAAE,OAAO,YAAY;AAAA,IACpB,MAAM;AAAA,IACN,UAAU;AAAA,EACZ,CAAC,EAAE,OAAO,eAAe;AAAA,IACvB,MAAM;AAAA,IACN,UAAU;AAAA,EACZ,CAAC,EAAE,OAAO,mBAAmB;AAAA,IAC3B,MAAM;AAAA,IACN,UAAU;AAAA,EACZ,CAAC,EAAE,OAAO,aAAa;AAAA,IACrB,MAAM;AAAA,IACN,UAAU;AAAA,EACZ,CAAC,CAAC;AACF,QAAM,SAAS,KAAK,UAAU;AAC9B,QAAM,UAAU,MAAM,cAAc,MAAM;AAC1C,QAAM,YAAY,MAAM,gBAAgB;AAAA,IACtC,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACD,QAAM,WAAW,MAAM,eAAe,MAAM;AAC5C,QAAM,aAAa,MAAM,iBAAiB,MAAM;AAChD,QAAM,iBAAiB,MAAM,qBAAqB,MAAM;AACxD,QAAM,cAAc,MAAM,qBAAqB,MAAM;AACrD,QAAM,WAAW,MAAM,eAAe,MAAM;AAC5C,QAAM,cAAc,MAAM,kBAAkB,MAAM;AAClD,QAAM,kBAAkB,MAAM,sBAAsB,MAAM;AAC1D,QAAM,YAAY,MAAM,gBAAgB,MAAM;AAC9C,QAAM,IAAI;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH","sourcesContent":["/*\n * Copyright 2023 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 { promptApplicationRid } from \"./prompts/promptApplicationRid.js\";\nimport { promptApplicationUrl } from \"./prompts/promptApplicationUrl.js\";\nimport { promptClientId } from \"./prompts/promptClientId.js\";\nimport { promptCorsProxy } from \"./prompts/promptCorsProxy.js\";\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 { promptTemplate } from \"./prompts/promptTemplate.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 application 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(\"foundryUrl\", {\n type: \"string\",\n describe: \"URL for the Foundry stack\"\n }).option(\"applicationUrl\", {\n type: \"string\",\n describe: \"URL the production application will be hosted on\",\n conflicts: \"skipApplicationUrl\"\n }).option(\"skipApplicationUrl\", {\n type: \"boolean\",\n describe: \"Skip filling in URL the production application will be hosted on\"\n }).option(\"application\", {\n type: \"string\",\n describe: \"Application resource identifier (rid)\"\n }).option(\"clientId\", {\n type: \"string\",\n describe: \"OAuth client ID for application\"\n }).option(\"osdkPackage\", {\n type: \"string\",\n describe: \"OSDK package name for application\"\n }).option(\"osdkRegistryUrl\", {\n type: \"string\",\n describe: \"URL for NPM registry to install OSDK package\"\n }).option(\"corsProxy\", {\n type: \"boolean\",\n describe: \"Include a CORS proxy for Foundry API requests during local development\"\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 foundryUrl = await promptFoundryUrl(parsed);\n const applicationUrl = await promptApplicationUrl(parsed);\n const application = await promptApplicationRid(parsed);\n const clientId = await promptClientId(parsed);\n const osdkPackage = await promptOsdkPackage(parsed);\n const osdkRegistryUrl = await promptOsdkRegistryUrl(parsed);\n const corsProxy = await promptCorsProxy(parsed);\n await run({\n project,\n overwrite,\n template,\n foundryUrl,\n applicationUrl,\n application,\n clientId,\n osdkPackage,\n osdkRegistryUrl,\n corsProxy\n });\n}","/*\n * Copyright 2023 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\";\nexport const consola = createConsola({\n // https://github.com/unjs/consola/issues/251\n async prompt(...params) {\n const response = await defaultConsola.prompt(...params);\n if (typeof response === \"symbol\" && response.toString() === \"Symbol(clack:cancel)\") {\n defaultConsola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n return response;\n }\n});","/*\n * Copyright 2023 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 2023 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 promptApplicationRid({\n application\n}) {\n while (application == null || !/^ri\\.third-party-applications\\.[^.]+\\.application\\.[^.]+$/.test(application)) {\n if (application != null) {\n consola.fail(\"Please enter a valid application resource identifier (rid)\");\n }\n application = await consola.prompt(`Enter the application resource identifier (rid) for your application from Developer Console:\\n${italic(\"(Example: ri.third-party-applications.main.application.1c66b352-4e00-40d2-995d-061c9d533ace)\")}`, {\n type: \"text\"\n });\n }\n return application;\n}","/*\n * Copyright 2023 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 promptApplicationUrl({\n skipApplicationUrl,\n applicationUrl\n}) {\n if (skipApplicationUrl) {\n return undefined;\n }\n if (applicationUrl == null) {\n const skip = await consola.prompt(`Do you know the URL your production application will be hosted on? This is required to create a production build of your application with the correct OAuth redirect URL.`, {\n type: \"select\",\n options: [{\n label: \"Yes, let me fill it here\",\n value: \"yes\"\n }, {\n label: \"No, I will fill it in later following the instructions in the generated README\",\n value: \"no\"\n }]\n }\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n );\n if (skip === \"no\") {\n return undefined;\n }\n }\n while (applicationUrl == null || !/^https?:\\/\\//.test(applicationUrl)) {\n if (applicationUrl != null) {\n consola.fail(\"Please enter a valid application URL\");\n }\n applicationUrl = await consola.prompt(`Enter the URL your production application will be hosted on:\\n${italic(\"(Example: https://myapp.example.palantirfoundry.com)\")}`, {\n type: \"text\"\n });\n }\n return applicationUrl.replace(/\\/$/, \"\");\n}","/*\n * Copyright 2023 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 promptClientId({\n clientId\n}) {\n while (clientId == null || !/^[0-9a-f]+$/.test(clientId)) {\n if (clientId != null) {\n consola.fail(\"Please enter a valid OAuth client ID\");\n }\n clientId = await consola.prompt(`Enter the OAuth client ID for your application from Developer Console:\\n${italic(\"(Example: 2650385ab6c5e0df3b44aff776b00a42)\")}`, {\n type: \"text\"\n });\n }\n return clientId;\n}","/*\n * Copyright 2023 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 promptCorsProxy({\n corsProxy\n}) {\n if (corsProxy != null) {\n return corsProxy;\n }\n return consola.prompt(`Include a CORS proxy for Foundry API requests during local development?\\n${italic(\"This is required if your enrollment has not allowed localhost for CORS.\")}`, {\n type: \"confirm\",\n initial: false\n });\n}","/*\n * Copyright 2023 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(/\\/$/, \"\");\n}","/*\n * Copyright 2023 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$/.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 application from Developer Console:\\n${italic(\"(Example: @my-app/sdk)\")}`, {\n type: \"text\"\n });\n }\n return osdkPackage;\n}","/*\n * Copyright 2023 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\\.artifacts\\.[^/]+\\/contents\\/release\\/npm\\/?$/.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 from Developer Console:\\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(/\\/$/, \"\");\n}","/*\n * Copyright 2023 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 // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\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 2023 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-_]+$/.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-app\",\n default: \"my-osdk-app\"\n });\n }\n return project;\n}","/*\n * Copyright 2023 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 TEMPLATES = [{\n id: \"template-react\",\n label: \"React\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\"\n}, {\n id: \"template-vue\",\n label: \"Vue\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\"\n}, {\n id: \"template-next-static-export\",\n label: \"Next (static export)\",\n envPrefix: \"NEXT_PUBLIC_\",\n buildDirectory: \"./out\"\n}, {\n id: \"template-tutorial-todo-app\",\n label: \"Tutorial: Todo App\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n hidden: true\n}];","/*\n * Copyright 2023 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 { green } from \"../highlight.js\";\nimport { TEMPLATES } from \"../templates.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 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: TEMPLATES.filter(template => template.hidden !== true).map(template => ({\n value: template.id,\n label: template.label\n }))\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\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 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 { findUpSync } from \"find-up\";\nimport Handlebars from \"handlebars\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { consola } from \"./consola.js\";\nimport { generateEnvDevelopment, generateEnvProduction } from \"./generate/generateEnv.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 foundryUrl,\n applicationUrl,\n application,\n clientId,\n osdkPackage,\n osdkRegistryUrl,\n corsProxy\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 const templatesDir = findUpSync(\"templates\", {\n cwd: path.dirname(fileURLToPath(import.meta.url)),\n type: \"directory\"\n });\n if (templatesDir == null) {\n throw new Error(`Could not find templates directory`);\n }\n const templateDir = path.resolve(templatesDir, template.id);\n fs.cpSync(templateDir, root, {\n recursive: true\n });\n const templateContext = {\n project,\n foundryUrl,\n osdkPackage,\n corsProxy\n };\n const processFiles = function (dir) {\n fs.readdirSync(dir).forEach(function (file) {\n file = dir + \"/\" + file;\n const stat = fs.statSync(file);\n if (stat.isDirectory()) {\n processFiles(file);\n return;\n }\n if (file.endsWith(\"/_gitignore\")) {\n fs.renameSync(file, file.replace(/\\/_gitignore$/, \"/.gitignore\"));\n return;\n }\n if (!file.endsWith(\".hbs\")) {\n return;\n }\n const templated = Handlebars.compile(fs.readFileSync(file, \"utf-8\"))(templateContext);\n fs.writeFileSync(file.replace(/.hbs$/, \"\"), templated);\n fs.rmSync(file);\n });\n };\n processFiles(root);\n const npmRc = generateNpmRc({\n osdkPackage,\n osdkRegistryUrl\n });\n fs.writeFileSync(path.join(root, \".npmrc\"), npmRc);\n const envDevelopment = generateEnvDevelopment({\n envPrefix: template.envPrefix,\n foundryUrl,\n clientId,\n corsProxy\n });\n fs.writeFileSync(path.join(root, \".env.development\"), envDevelopment);\n const envProduction = generateEnvProduction({\n envPrefix: template.envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n });\n fs.writeFileSync(path.join(root, \".env.production\"), envProduction);\n const foundryConfigJson = generateFoundryConfigJson({\n foundryUrl,\n application,\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 2023 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 generateEnvDevelopment({\n envPrefix,\n foundryUrl,\n clientId,\n corsProxy\n}) {\n return generateEnv({\n envPrefix,\n foundryUrl: corsProxy ? \"http://localhost:8080\" : foundryUrl,\n applicationUrl: \"http://localhost:8080\",\n clientId\n });\n}\nexport function generateEnvProduction({\n envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n}) {\n return generateEnv({\n envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n });\n}\nfunction generateEnv({\n envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n}) {\n return `${envPrefix}FOUNDRY_API_URL=${foundryUrl}\\n` + `${applicationUrl == null ? \"# \" : \"\"}${envPrefix}FOUNDRY_REDIRECT_URL=${applicationUrl ?? \"<Fill in the domain at which you deploy your application>\"}/auth/callback\\n` + `${envPrefix}FOUNDRY_CLIENT_ID=${clientId}\\n`;\n}","/*\n * Copyright 2023 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 application,\n directory\n}) {\n return JSON.stringify({\n foundryUrl,\n site: {\n application,\n directory,\n autoVersion: {\n type: \"git-describe\",\n tagPrefix: \"\"\n }\n }\n }, null, 2) + \"\\n\";\n}","/*\n * Copyright 2023 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 osdkPackage,\n osdkRegistryUrl\n}) {\n // pnpm requires a trailing slash in .npmrc\n // https://github.com/pnpm/pnpm/issues/5941\n const withTrailingSlash = osdkRegistryUrl.endsWith(\"/\") ? osdkRegistryUrl : osdkRegistryUrl + \"/\";\n const withoutProtocol = withTrailingSlash.replace(/^https:\\/\\//, \"\");\n const packageScope = osdkPackage.split(\"/\")[0];\n return `//${withoutProtocol}:_authToken=\\${FOUNDRY_TOKEN}\\n` + `${packageScope}:registry=${withTrailingSlash}\\n`;\n}"]}
1
+ {"version":3,"sources":["../../src/consola.ts","../../src/highlight.ts","../../src/prompts/promptApplicationRid.ts","../../src/prompts/promptApplicationUrl.ts","../../src/prompts/promptClientId.ts","../../src/prompts/promptCorsProxy.ts","../../src/prompts/promptFoundryUrl.ts","../../src/prompts/promptOsdkPackage.ts","../../src/prompts/promptOsdkRegistryUrl.ts","../../src/prompts/promptOverwrite.ts","../../src/prompts/promptProject.ts","../../src/templates.ts","../../src/prompts/promptTemplate.ts","../../src/generate/generateEnv.ts","../../src/generate/generateFoundryConfigJson.ts","../../src/generate/generateNpmRc.ts","../../src/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MAAA,MAAA,GAAS,KAAK,SAAU,EAAA,CAAA;AAC9B,EAAM,MAAA,OAAA,GAAU,MAAM,aAAA,CAAc,MAAM,CAAA,CAAA;AAC1C,EAAM,MAAA,SAAA,GAAY,MAAM,eAAgB,CAAA;AAAA,IACtC,GAAG,MAAA;AAAA,IACH,OAAA;AAAA,GACD,CAAA,CAAA;AACD,EAAM,MAAA,QAAA,GAAW,MAAM,cAAA,CAAe,MAAM,CAAA,CAAA;AAC5C,EAAM,MAAA,UAAA,GAAa,MAAM,gBAAA,CAAiB,MAAM,CAAA,CAAA;AAChD,EAAM,MAAA,cAAA,GAAiB,MAAM,oBAAA,CAAqB,MAAM,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAc,MAAM,oBAAA,CAAqB,MAAM,CAAA,CAAA;AACrD,EAAM,MAAA,QAAA,GAAW,MAAM,cAAA,CAAe,MAAM,CAAA,CAAA;AAC5C,EAAM,MAAA,WAAA,GAAc,MAAM,iBAAA,CAAkB,MAAM,CAAA,CAAA;AAClD,EAAM,MAAA,eAAA,GAAkB,MAAM,qBAAA,CAAsB,MAAM,CAAA,CAAA;AAC1D,EAAM,MAAA,SAAA,GAAY,MAAM,eAAA,CAAgB,MAAM,CAAA,CAAA;AAC9C,EAAA,MAAM,GAAI,CAAA;AAAA,IACR,OAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA,SAAA;AAAA,GACD,CAAA,CAAA;AACH","file":"index.js","sourcesContent":["/*\n * Copyright 2023 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\";\nexport const consola = createConsola({\n // https://github.com/unjs/consola/issues/251\n async prompt(...params) {\n const response = await defaultConsola.prompt(...params);\n if (typeof response === \"symbol\" && response.toString() === \"Symbol(clack:cancel)\") {\n defaultConsola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n return response;\n }\n});","/*\n * Copyright 2023 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 2023 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 promptApplicationRid({\n application\n}) {\n while (application == null || !/^ri\\.third-party-applications\\.[^.]+\\.application\\.[^.]+$/.test(application)) {\n if (application != null) {\n consola.fail(\"Please enter a valid application resource identifier (rid)\");\n }\n application = await consola.prompt(`Enter the application resource identifier (rid) for your application from Developer Console:\\n${italic(\"(Example: ri.third-party-applications.main.application.1c66b352-4e00-40d2-995d-061c9d533ace)\")}`, {\n type: \"text\"\n });\n }\n return application;\n}","/*\n * Copyright 2023 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 promptApplicationUrl({\n skipApplicationUrl,\n applicationUrl\n}) {\n if (skipApplicationUrl) {\n return undefined;\n }\n if (applicationUrl == null) {\n const skip = await consola.prompt(`Do you know the URL your production application will be hosted on? This is required to create a production build of your application with the correct OAuth redirect URL.`, {\n type: \"select\",\n options: [{\n label: \"Yes, let me fill it here\",\n value: \"yes\"\n }, {\n label: \"No, I will fill it in later following the instructions in the generated README\",\n value: \"no\"\n }]\n }\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\n );\n if (skip === \"no\") {\n return undefined;\n }\n }\n while (applicationUrl == null || !/^https?:\\/\\//.test(applicationUrl)) {\n if (applicationUrl != null) {\n consola.fail(\"Please enter a valid application URL\");\n }\n applicationUrl = await consola.prompt(`Enter the URL your production application will be hosted on:\\n${italic(\"(Example: https://myapp.example.palantirfoundry.com)\")}`, {\n type: \"text\"\n });\n }\n return applicationUrl.replace(/\\/$/, \"\");\n}","/*\n * Copyright 2023 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 promptClientId({\n clientId\n}) {\n while (clientId == null || !/^[0-9a-f]+$/.test(clientId)) {\n if (clientId != null) {\n consola.fail(\"Please enter a valid OAuth client ID\");\n }\n clientId = await consola.prompt(`Enter the OAuth client ID for your application from Developer Console:\\n${italic(\"(Example: 2650385ab6c5e0df3b44aff776b00a42)\")}`, {\n type: \"text\"\n });\n }\n return clientId;\n}","/*\n * Copyright 2023 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 promptCorsProxy({\n corsProxy\n}) {\n if (corsProxy != null) {\n return corsProxy;\n }\n return consola.prompt(`Include a CORS proxy for Foundry API requests during local development?\\n${italic(\"This is required if your enrollment has not allowed localhost for CORS.\")}`, {\n type: \"confirm\",\n initial: false\n });\n}","/*\n * Copyright 2023 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(/\\/$/, \"\");\n}","/*\n * Copyright 2023 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$/.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 application from Developer Console:\\n${italic(\"(Example: @my-app/sdk)\")}`, {\n type: \"text\"\n });\n }\n return osdkPackage;\n}","/*\n * Copyright 2023 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\\.artifacts\\.[^/]+\\/contents\\/release\\/npm\\/?$/.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 from Developer Console:\\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(/\\/$/, \"\");\n}","/*\n * Copyright 2023 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 // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\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 2023 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-_]+$/.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-app\",\n default: \"my-osdk-app\"\n });\n }\n return project;\n}","/*\n * Copyright 2023 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 TEMPLATES = [{\n id: \"template-react\",\n label: \"React\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n getFiles: async () => (await import(`@osdk/create-app.template.react`)).files\n}, {\n id: \"template-vue\",\n label: \"Vue\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n getFiles: async () => (await import(`@osdk/create-app.template.vue`)).files\n}, {\n id: \"template-next-static-export\",\n label: \"Next (static export)\",\n envPrefix: \"NEXT_PUBLIC_\",\n buildDirectory: \"./out\",\n getFiles: async () => (await import(`@osdk/create-app.template.next-static-export`)).files\n}, {\n id: \"template-tutorial-todo-app\",\n label: \"Tutorial: To do App\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n hidden: true,\n getFiles: async () => (await import(`@osdk/create-app.template.tutorial-todo-app`)).files\n}, {\n id: \"template-tutorial-todo-aip-app\",\n label: \"Tutorial: To do AIP App\",\n envPrefix: \"VITE_\",\n buildDirectory: \"./dist\",\n hidden: true,\n getFiles: async () => (await import(`@osdk/create-app.template.tutorial-todo-aip-app`)).files\n}];","/*\n * Copyright 2023 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 { green } from \"../highlight.js\";\nimport { TEMPLATES } from \"../templates.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 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: TEMPLATES.filter(template => template.hidden !== true).map(template => ({\n value: template.id,\n label: template.label\n }))\n // Types for \"select\" are wrong the value is returned rather than the option object\n // https://github.com/unjs/consola/pull/238\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 2023 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 generateEnvDevelopment({\n envPrefix,\n foundryUrl,\n clientId,\n corsProxy\n}) {\n return generateEnv({\n envPrefix,\n foundryUrl: corsProxy ? \"http://localhost:8080\" : foundryUrl,\n applicationUrl: \"http://localhost:8080\",\n clientId\n });\n}\nexport function generateEnvProduction({\n envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n}) {\n return generateEnv({\n envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n });\n}\nfunction generateEnv({\n envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n}) {\n return `${envPrefix}FOUNDRY_API_URL=${foundryUrl}\\n` + `${applicationUrl == null ? \"# \" : \"\"}${envPrefix}FOUNDRY_REDIRECT_URL=${applicationUrl ?? \"<Fill in the domain at which you deploy your application>\"}/auth/callback\\n` + `${envPrefix}FOUNDRY_CLIENT_ID=${clientId}\\n`;\n}","/*\n * Copyright 2023 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 application,\n directory\n}) {\n return JSON.stringify({\n foundryUrl,\n site: {\n application,\n directory,\n autoVersion: {\n type: \"git-describe\",\n tagPrefix: \"\"\n }\n }\n }, null, 2) + \"\\n\";\n}","/*\n * Copyright 2023 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 osdkPackage,\n osdkRegistryUrl\n}) {\n // pnpm requires a trailing slash in .npmrc\n // https://github.com/pnpm/pnpm/issues/5941\n const withTrailingSlash = osdkRegistryUrl.endsWith(\"/\") ? osdkRegistryUrl : osdkRegistryUrl + \"/\";\n const withoutProtocol = withTrailingSlash.replace(/^https:\\/\\//, \"\");\n const packageScope = osdkPackage.split(\"/\")[0];\n return `//${withoutProtocol}:_authToken=\\${FOUNDRY_TOKEN}\\n` + `${packageScope}:registry=${withTrailingSlash}\\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 Handlebars from \"handlebars\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { consola } from \"./consola.js\";\nimport { generateEnvDevelopment, generateEnvProduction } from \"./generate/generateEnv.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 foundryUrl,\n applicationUrl,\n application,\n clientId,\n osdkPackage,\n osdkRegistryUrl,\n corsProxy\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 const files = await template.getFiles();\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 osdkPackage,\n corsProxy\n };\n const processFiles = function (dir) {\n fs.readdirSync(dir).forEach(function (file) {\n file = dir + \"/\" + file;\n const stat = fs.statSync(file);\n if (stat.isDirectory()) {\n processFiles(file);\n return;\n }\n if (file.endsWith(\"/_gitignore\")) {\n fs.renameSync(file, file.replace(/\\/_gitignore$/, \"/.gitignore\"));\n return;\n }\n if (!file.endsWith(\".hbs\")) {\n return;\n }\n const templated = Handlebars.compile(fs.readFileSync(file, \"utf-8\"))(templateContext);\n fs.writeFileSync(file.replace(/.hbs$/, \"\"), templated);\n fs.rmSync(file);\n });\n };\n processFiles(root);\n const npmRc = generateNpmRc({\n osdkPackage,\n osdkRegistryUrl\n });\n fs.writeFileSync(path.join(root, \".npmrc\"), npmRc);\n const envDevelopment = generateEnvDevelopment({\n envPrefix: template.envPrefix,\n foundryUrl,\n clientId,\n corsProxy\n });\n fs.writeFileSync(path.join(root, \".env.development\"), envDevelopment);\n const envProduction = generateEnvProduction({\n envPrefix: template.envPrefix,\n foundryUrl,\n applicationUrl,\n clientId\n });\n fs.writeFileSync(path.join(root, \".env.production\"), envProduction);\n const foundryConfigJson = generateFoundryConfigJson({\n foundryUrl,\n application,\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 2023 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 { promptApplicationRid } from \"./prompts/promptApplicationRid.js\";\nimport { promptApplicationUrl } from \"./prompts/promptApplicationUrl.js\";\nimport { promptClientId } from \"./prompts/promptClientId.js\";\nimport { promptCorsProxy } from \"./prompts/promptCorsProxy.js\";\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 { promptTemplate } from \"./prompts/promptTemplate.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 application 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(\"foundryUrl\", {\n type: \"string\",\n describe: \"URL for the Foundry stack\"\n }).option(\"applicationUrl\", {\n type: \"string\",\n describe: \"URL the production application will be hosted on\",\n conflicts: \"skipApplicationUrl\"\n }).option(\"skipApplicationUrl\", {\n type: \"boolean\",\n describe: \"Skip filling in URL the production application will be hosted on\"\n }).option(\"application\", {\n type: \"string\",\n describe: \"Application resource identifier (rid)\"\n }).option(\"clientId\", {\n type: \"string\",\n describe: \"OAuth client ID for application\"\n }).option(\"osdkPackage\", {\n type: \"string\",\n describe: \"OSDK package name for application\"\n }).option(\"osdkRegistryUrl\", {\n type: \"string\",\n describe: \"URL for NPM registry to install OSDK package\"\n }).option(\"corsProxy\", {\n type: \"boolean\",\n describe: \"Include a CORS proxy for Foundry API requests during local development\"\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 foundryUrl = await promptFoundryUrl(parsed);\n const applicationUrl = await promptApplicationUrl(parsed);\n const application = await promptApplicationRid(parsed);\n const clientId = await promptClientId(parsed);\n const osdkPackage = await promptOsdkPackage(parsed);\n const osdkRegistryUrl = await promptOsdkRegistryUrl(parsed);\n const corsProxy = await promptCorsProxy(parsed);\n await run({\n project,\n overwrite,\n template,\n foundryUrl,\n applicationUrl,\n application,\n clientId,\n osdkPackage,\n osdkRegistryUrl,\n corsProxy\n });\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/run.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAEhE,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,GAAG,CACvB,EACE,OAAO,EACP,SAAS,EACT,QAAQ,EACR,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,WAAW,EACX,eAAe,EACf,SAAS,GACV,EAAE,OAAO,GACT,OAAO,CAAC,IAAI,CAAC,CA0Gf"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/run.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAEhE,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,GAAG,CACvB,EACE,OAAO,EACP,SAAS,EACT,QAAQ,EACR,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,WAAW,EACX,eAAe,EACf,SAAS,GACV,EAAE,OAAO,GACT,OAAO,CAAC,IAAI,CAAC,CAiHf"}
@@ -4,6 +4,13 @@ export interface Template {
4
4
  envPrefix: string;
5
5
  buildDirectory: string;
6
6
  hidden?: boolean;
7
+ getFiles: () => Promise<Map<string, {
8
+ type: "base64";
9
+ body: string;
10
+ } | {
11
+ type: "raw";
12
+ body: string;
13
+ }>>;
7
14
  }
8
15
  export interface TemplateContext {
9
16
  project: string;
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/templates.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,SAAS,QAAQ,EA0BxC,CAAC"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/templates.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,OAAO,CACrB,GAAG,CACD,MAAM,EACN;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CACjE,CACF,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,SAAS,QAAQ,EAgDxC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/create-app",
3
- "version": "0.17.0-main-20240530094422",
3
+ "version": "0.17.1",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -10,12 +10,12 @@
10
10
  },
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./build/esm/index.js",
14
- "browser": "./build/browser/index.browser.js"
13
+ "browser": "./build/browser/index.js",
14
+ "import": "./build/esm/index.js"
15
15
  },
16
16
  "./*": {
17
- "import": "./build/esm/public/*.js",
18
- "browser": "./build/browser/public/*.js"
17
+ "browser": "./build/browser/public/*.js",
18
+ "import": "./build/esm/public/*.js"
19
19
  }
20
20
  },
21
21
  "dependencies": {
@@ -29,7 +29,15 @@
29
29
  "@types/tmp": "^0.2.6",
30
30
  "@types/yargs": "^17.0.29",
31
31
  "tmp": "^0.2.3",
32
- "typescript": "^5.4.5"
32
+ "typescript": "^5.5.4",
33
+ "@osdk/create-app.template.next-static-export": "0.17.1",
34
+ "@osdk/create-app.template.tutorial-todo-aip-app": "0.17.1",
35
+ "@osdk/create-app.template.react": "0.17.1",
36
+ "@osdk/create-app.template.tutorial-todo-app": "0.17.1",
37
+ "@osdk/create-app.template.vue": "0.17.1",
38
+ "@osdk/monorepo.tsconfig": "~0.0.0",
39
+ "@osdk/monorepo.tsup": "~0.0.0",
40
+ "@osdk/monorepo.api-extractor": "~0.0.0"
33
41
  },
34
42
  "publishConfig": {
35
43
  "access": "public"
@@ -50,14 +58,15 @@
50
58
  "types": "./build/esm/index.d.ts",
51
59
  "type": "module",
52
60
  "scripts": {
53
- "check-attw": "../../scripts/build_common/check-attw.sh esm",
61
+ "check-attw": "monorepo.tool.attw esm",
62
+ "check-spelling": "cspell --quiet .",
54
63
  "clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
55
64
  "fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
56
65
  "lint": "eslint . && dprint check --config $(find-up dprint.json)",
57
66
  "test": "vitest run --pool=forks",
58
67
  "test:watch": "vitest",
59
- "transpile": "tsup",
68
+ "transpile": "monorepo.tool.transpile",
60
69
  "transpileWatch": "tsup --watch",
61
- "typecheck": "../../scripts/build_common/typecheck.sh esm"
70
+ "typecheck": "monorepo.tool.typecheck esm"
62
71
  }
63
72
  }
@@ -1,4 +0,0 @@
1
- {
2
- "root": true,
3
- "extends": "next/core-web-vitals"
4
- }
@@ -1,35 +0,0 @@
1
- # {{project}}
2
-
3
- This project was generated with [`@osdk/create-app`](https://www.npmjs.com/package/@osdk/create-app) and demonstrates using the Ontology SDK package `{{osdkPackage}}` with React on top of Next.js. Check out the [Next.js](https://nextjs.org/docs) docs for further configuration.
4
-
5
- ## Developing
6
-
7
- Run the following command or equivalent with your preferred package manager to start a local development server on `http://localhost:8080`:
8
-
9
- ```sh
10
- npm run dev
11
- ```
12
-
13
- Development configuration is stored in `.env.development`.
14
-
15
- {{#if corsProxy}}
16
- In order to make API requests to Foundry, a CORS proxy has been set up for local development which may be removed if the stack is configured to allow `http://localhost:8080` to load resources. The configured OAuth client must also allow `http://localhost:8080/auth/callback` as a redirect URL.
17
- {{else}}
18
- In order to make API requests to Foundry, CORS must be configured for the stack to allow `http://localhost:8080` to load resources. If this has not been configured and you are unable to request this, you can alternatively generate your project again with `--corsProxy true` to use a proxy for API requests during local development. The configured OAuth client must also allow `http://localhost:8080/auth/callback` as a redirect URL.
19
- {{/if}}
20
-
21
- ## Deploying
22
-
23
- Run the following command or equivalent with your preferred package manager to create a production build of your application:
24
-
25
- ```sh
26
- npm run build
27
- ```
28
-
29
- Production configuration is stored in `.env.production`.
30
-
31
- If you did not fill in the URL your production application will be hosted on you will need to fill in the `NEXT_PUBLIC_FOUNDRY_REDIRECT_URL` in `.env.production`.
32
-
33
- In order to make API requests to Foundry, CORS must be configured for the stack to allow the production origin to load resources. This will be automatically done for you if you are using Foundry website hosting. The configured OAuth client must also allow the production origin auth callback as a redirect URL.
34
-
35
- A `foundry.config.json` file is included in the root of this project to make deploying to Foundry website hosting with [`@osdk/cli`](https://www.npmjs.com/package/@osdk/cli) easier. If you are not using Foundry website hosting for your application you may delete this file.
@@ -1,36 +0,0 @@
1
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
-
3
- # dependencies
4
- /node_modules
5
- /.pnp
6
- .pnp.js
7
- .yarn/install-state.gz
8
-
9
- # testing
10
- /coverage
11
-
12
- # next.js
13
- /.next
14
- /out
15
-
16
- # production
17
- /build
18
-
19
- # misc
20
- .DS_Store
21
- *.pem
22
-
23
- # debug
24
- npm-debug.log*
25
- yarn-debug.log*
26
- yarn-error.log*
27
-
28
- # local env files
29
- .env*.local
30
-
31
- # vercel
32
- .vercel
33
-
34
- # typescript
35
- *.tsbuildinfo
36
- next-env.d.ts
@@ -1,17 +0,0 @@
1
- /** @type {import('next').NextConfig} */
2
- const nextConfig = {
3
- reactStrictMode: false,
4
- output: "export",
5
- {{#if corsProxy}}
6
- // Rewrites are used to proxy requests during local development only for CORS
7
- // and will warn when using this feature together with export.
8
- rewrites: () => [
9
- {
10
- source: "/:prefix(multipass/api|api)/:path*",
11
- destination: "{{foundryUrl}}/:prefix/:path*",
12
- },
13
- ],
14
- {{/if}}
15
- };
16
-
17
- module.exports = nextConfig;