@osdk/widget.vite-plugin 3.3.2 → 3.4.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,82 +1,67 @@
|
|
|
1
1
|
# @osdk/widget.vite-plugin
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
3
|
+
## 3.4.0-beta.10
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- @osdk/widget.api@3.
|
|
7
|
+
- @osdk/widget.api@3.4.0-beta.10
|
|
8
8
|
|
|
9
|
-
## 3.
|
|
9
|
+
## 3.4.0-beta.9
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 18a6c93: Link to docs on WidgetIdNotFound error
|
|
10
14
|
|
|
11
15
|
### Patch Changes
|
|
12
16
|
|
|
13
|
-
-
|
|
14
|
-
- @osdk/widget.api@3.3.1
|
|
17
|
+
- @osdk/widget.api@3.4.0-beta.9
|
|
15
18
|
|
|
16
|
-
## 3.
|
|
19
|
+
## 3.4.0-beta.8
|
|
17
20
|
|
|
18
21
|
### Patch Changes
|
|
19
22
|
|
|
20
|
-
-
|
|
21
|
-
- 1940934: Support extension-less widget config import and improve reporting when config files not found
|
|
22
|
-
- e6a96c0: Validate widget sets before building their manifest
|
|
23
|
-
- cc33fec: improve dev mode error surfacing
|
|
24
|
-
- 5bd88fc: Fix InvalidDevModeFilePath errors
|
|
25
|
-
- 27f2122: warn when using wrong dev command
|
|
26
|
-
- 54e674e: Fix widget dev mode with tailwind causing project imports
|
|
27
|
-
- edb062f: Propagate validation error cause in message for widget config validation
|
|
28
|
-
- e95637e: Fix Windows dev mode
|
|
29
|
-
- 953c649: Use Vite logger instead of console.warn in validateDevEnvironment
|
|
30
|
-
- af4f3bf: Remove the following features for RC:
|
|
31
|
-
- Property formatting
|
|
32
|
-
- Branching
|
|
33
|
-
- Constant RDPs
|
|
34
|
-
|
|
35
|
-
- Updated dependencies [322c5bc]
|
|
36
|
-
- Updated dependencies [7901ae0]
|
|
37
|
-
- Updated dependencies [baf1e30]
|
|
38
|
-
- Updated dependencies [4d37e98]
|
|
39
|
-
- Updated dependencies [af4f3bf]
|
|
40
|
-
- @osdk/foundry-config-json@1.5.0
|
|
41
|
-
- @osdk/widget.api@3.3.0
|
|
23
|
+
- @osdk/widget.api@3.4.0-beta.8
|
|
42
24
|
|
|
43
|
-
## 3.
|
|
25
|
+
## 3.4.0-beta.7
|
|
44
26
|
|
|
45
27
|
### Patch Changes
|
|
46
28
|
|
|
47
|
-
- @osdk/widget.api@3.
|
|
29
|
+
- @osdk/widget.api@3.4.0-beta.7
|
|
48
30
|
|
|
49
|
-
## 3.
|
|
31
|
+
## 3.4.0-beta.6
|
|
50
32
|
|
|
51
33
|
### Patch Changes
|
|
52
34
|
|
|
53
|
-
- @osdk/widget.api@3.
|
|
35
|
+
- @osdk/widget.api@3.4.0-beta.6
|
|
54
36
|
|
|
55
|
-
## 3.
|
|
37
|
+
## 3.4.0-beta.5
|
|
38
|
+
|
|
39
|
+
### Minor Changes
|
|
40
|
+
|
|
41
|
+
- 239a2a8: Show hint for WidgetIdNotFound errors
|
|
56
42
|
|
|
57
43
|
### Patch Changes
|
|
58
44
|
|
|
59
|
-
- @osdk/widget.api@3.
|
|
45
|
+
- @osdk/widget.api@3.4.0-beta.5
|
|
60
46
|
|
|
61
|
-
## 3.
|
|
47
|
+
## 3.4.0-beta.4
|
|
62
48
|
|
|
63
49
|
### Patch Changes
|
|
64
50
|
|
|
65
|
-
- @osdk/widget.api@3.
|
|
51
|
+
- @osdk/widget.api@3.4.0-beta.4
|
|
66
52
|
|
|
67
|
-
## 3.
|
|
53
|
+
## 3.4.0-beta.3
|
|
68
54
|
|
|
69
55
|
### Patch Changes
|
|
70
56
|
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
- @osdk/widget.api@3.4.0-beta.3
|
|
58
|
+
|
|
59
|
+
## 3.4.0-beta.2
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
75
62
|
|
|
76
|
-
- Updated dependencies [
|
|
77
|
-
-
|
|
78
|
-
- @osdk/widget.api@3.3.0-rc.12
|
|
79
|
-
- @osdk/foundry-config-json@1.5.0-rc.2
|
|
63
|
+
- Updated dependencies [31909c1]
|
|
64
|
+
- @osdk/widget.api@3.4.0-beta.2
|
|
80
65
|
|
|
81
66
|
## 3.3.0-beta.11
|
|
82
67
|
|
|
@@ -41,7 +41,7 @@ class ResponseError extends Error {
|
|
|
41
41
|
}
|
|
42
42
|
function getHintForError(parsed) {
|
|
43
43
|
if (parsed.errorName === "Api:WidgetIdNotFound" || parsed.errorName === "WidgetIdNotFound") {
|
|
44
|
-
return "You first need to publish changes to your widget configuration files before you can develop against them.";
|
|
44
|
+
return "You first need to publish changes to your widget configuration files before you can develop against them.\n\nSee: https://www.palantir.com/docs/foundry/custom-widgets/publish/";
|
|
45
45
|
}
|
|
46
46
|
return undefined;
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publishDevModeSettings.js","names":["loadFoundryConfig","inspect","getCodeWorkspacesFoundryUrl","isCodeWorkspacesMode","enableDevMode","setWidgetSetSettings","ResponseError","Error","response","hint","constructor","message","parsed","JSON","parse","stringify","getHintForError","errorName","undefined","publishDevModeSettings","server","widgetIdToOverrides","baseHref","res","foundryConfig","foundryUrl","config","mode","widgetSetRid","widgetSet","rid","settingsResponse","status","logger","warn","statusText","responseContent","text","enableResponse","setHeader","end","redirectUrl","error","statusCode"],"sources":["publishDevModeSettings.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { loadFoundryConfig } from \"@osdk/foundry-config-json\";\nimport type { ServerResponse } from \"node:http\";\nimport { inspect } from \"node:util\";\nimport type { ViteDevServer } from \"vite\";\nimport {\n getCodeWorkspacesFoundryUrl,\n isCodeWorkspacesMode,\n} from \"./codeWorkspacesMode.js\";\nimport { enableDevMode, setWidgetSetSettings } from \"./network.js\";\n\nclass ResponseError extends Error {\n // To avoid inspect() from logging the error response since it's already logged\n #response: string;\n #hint: string | undefined;\n\n constructor(message: string, response: string) {\n super(message);\n try {\n const parsed = JSON.parse(response);\n this.#response = JSON.stringify(parsed, null, 4);\n this.#hint = getHintForError(parsed);\n } catch {\n this.#response = response;\n }\n }\n\n get response(): string {\n return this.#response;\n }\n\n get hint(): string | undefined {\n return this.#hint;\n }\n}\n\nfunction getHintForError(\n parsed: { errorName?: string },\n): string | undefined {\n if (\n parsed.errorName === \"Api:WidgetIdNotFound\"\n || parsed.errorName === \"WidgetIdNotFound\"\n ) {\n return \"You first need to publish changes to your widget configuration files before you can develop against them
|
|
1
|
+
{"version":3,"file":"publishDevModeSettings.js","names":["loadFoundryConfig","inspect","getCodeWorkspacesFoundryUrl","isCodeWorkspacesMode","enableDevMode","setWidgetSetSettings","ResponseError","Error","response","hint","constructor","message","parsed","JSON","parse","stringify","getHintForError","errorName","undefined","publishDevModeSettings","server","widgetIdToOverrides","baseHref","res","foundryConfig","foundryUrl","config","mode","widgetSetRid","widgetSet","rid","settingsResponse","status","logger","warn","statusText","responseContent","text","enableResponse","setHeader","end","redirectUrl","error","statusCode"],"sources":["publishDevModeSettings.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { loadFoundryConfig } from \"@osdk/foundry-config-json\";\nimport type { ServerResponse } from \"node:http\";\nimport { inspect } from \"node:util\";\nimport type { ViteDevServer } from \"vite\";\nimport {\n getCodeWorkspacesFoundryUrl,\n isCodeWorkspacesMode,\n} from \"./codeWorkspacesMode.js\";\nimport { enableDevMode, setWidgetSetSettings } from \"./network.js\";\n\nclass ResponseError extends Error {\n // To avoid inspect() from logging the error response since it's already logged\n #response: string;\n #hint: string | undefined;\n\n constructor(message: string, response: string) {\n super(message);\n try {\n const parsed = JSON.parse(response);\n this.#response = JSON.stringify(parsed, null, 4);\n this.#hint = getHintForError(parsed);\n } catch {\n this.#response = response;\n }\n }\n\n get response(): string {\n return this.#response;\n }\n\n get hint(): string | undefined {\n return this.#hint;\n }\n}\n\nfunction getHintForError(\n parsed: { errorName?: string },\n): string | undefined {\n if (\n parsed.errorName === \"Api:WidgetIdNotFound\"\n || parsed.errorName === \"WidgetIdNotFound\"\n ) {\n return \"You first need to publish changes to your widget configuration files before you can develop against them.\\n\\nSee: https://www.palantir.com/docs/foundry/custom-widgets/publish/\";\n }\n return undefined;\n}\n\n/**\n * Finish the setup process by setting the widget overrides in Foundry and enabling dev mode.\n */\nexport async function publishDevModeSettings(\n server: ViteDevServer,\n widgetIdToOverrides: Record<string, string[]>,\n baseHref: string,\n res: ServerResponse,\n): Promise<void> {\n try {\n const foundryConfig = await loadFoundryConfig(\"widgetSet\");\n if (foundryConfig == null) {\n throw new Error(\n \"foundry.config.json file not found.\",\n );\n }\n const foundryUrl = isCodeWorkspacesMode(server.config.mode)\n ? getCodeWorkspacesFoundryUrl()\n : foundryConfig.foundryConfig.foundryUrl;\n\n const widgetSetRid = foundryConfig.foundryConfig.widgetSet.rid;\n const settingsResponse = await setWidgetSetSettings(\n foundryUrl,\n widgetSetRid,\n widgetIdToOverrides,\n baseHref,\n server.config.mode,\n );\n if (settingsResponse.status !== 200) {\n server.config.logger.warn(\n `Unable to set widget settings in Foundry: ${settingsResponse.statusText}`,\n );\n const responseContent = await settingsResponse.text();\n server.config.logger.warn(responseContent);\n throw new ResponseError(\n `Unable to set widget settings in Foundry: ${settingsResponse.statusText}`,\n responseContent,\n );\n }\n\n const enableResponse = await enableDevMode(\n foundryUrl,\n server.config.mode,\n );\n if (enableResponse.status !== 200) {\n server.config.logger.warn(\n `Unable to enable dev mode in Foundry: ${enableResponse.statusText}`,\n );\n const responseContent = await enableResponse.text();\n server.config.logger.warn(responseContent);\n throw new ResponseError(\n `Unable to enable dev mode in Foundry: ${enableResponse.statusText}`,\n responseContent,\n );\n }\n\n res.setHeader(\"Content-Type\", \"application/json\");\n res.end(JSON.stringify({\n status: \"success\",\n // In Code Workspaces the preview UI automatically handles this redirect\n redirectUrl: isCodeWorkspacesMode(server.config.mode)\n ? null\n : `${foundryUrl}/workspace/custom-widgets/preview/${widgetSetRid}`,\n }));\n } catch (error: unknown) {\n server.config.logger.error(\n `Failed to start dev mode: ${(error as Error)}\\n\\n${inspect(error)}`,\n );\n res.setHeader(\"Content-Type\", \"application/json\");\n res.statusCode = 500;\n res.end(\n JSON.stringify(\n {\n status: \"error\",\n error: inspect(error),\n response: error instanceof ResponseError ? error.response : undefined,\n hint: error instanceof ResponseError ? error.hint : undefined,\n },\n ),\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,QAAQ,2BAA2B;AAE7D,SAASC,OAAO,QAAQ,WAAW;AAEnC,SACEC,2BAA2B,EAC3BC,oBAAoB,QACf,yBAAyB;AAChC,SAASC,aAAa,EAAEC,oBAAoB,QAAQ,cAAc;AAElE,MAAMC,aAAa,SAASC,KAAK,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CAAC,GACjD,IAAI,GACJ,GAAGF,UAAU,qCAAqCG,YAAY;IACpE,CAAC,CAAC,CAAC;EACL,CAAC,CAAC,OAAOc,KAAc,EAAE;IACvBtB,MAAM,CAACM,MAAM,CAACO,MAAM,CAACS,KAAK,CACxB,6BAA8BA,KAAK,OAAiBzC,OAAO,CAACyC,KAAK,CAAC,EACpE,CAAC;IACDnB,GAAG,CAACgB,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC;IACjDhB,GAAG,CAACoB,UAAU,GAAG,GAAG;IACpBpB,GAAG,CAACiB,GAAG,CACL3B,IAAI,CAACE,SAAS,CACZ;MACEiB,MAAM,EAAE,OAAO;MACfU,KAAK,EAAEzC,OAAO,CAACyC,KAAK,CAAC;MACrBlC,QAAQ,EAAEkC,KAAK,YAAYpC,aAAa,GAAGoC,KAAK,CAAClC,QAAQ,GAAGU,SAAS;MACrET,IAAI,EAAEiC,KAAK,YAAYpC,aAAa,GAAGoC,KAAK,CAACjC,IAAI,GAAGS;IACtD,CACF,CACF,CAAC;EACH;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/widget.vite-plugin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-beta.10",
|
|
4
4
|
"description": "A vite plugin that will extract parameter definitions from TS/JS files + entrypoint info into a manifest file to be uploaded to Foundry ",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"picocolors": "^1.1.1",
|
|
31
31
|
"resolve-package-path": "^4.0.3",
|
|
32
32
|
"sirv": "^3.0.2",
|
|
33
|
-
"@osdk/
|
|
34
|
-
"@osdk/
|
|
33
|
+
"@osdk/foundry-config-json": "~1.6.0-beta.1",
|
|
34
|
+
"@osdk/widget.api": "~3.4.0-beta.10"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"vite": "^6.3.5"
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typescript": "~5.5.4",
|
|
50
50
|
"vite": "^6.3.6",
|
|
51
51
|
"vitest": "^3.2.4",
|
|
52
|
-
"@osdk/monorepo.api-extractor": "~0.
|
|
53
|
-
"@osdk/monorepo.tsconfig": "~0.
|
|
52
|
+
"@osdk/monorepo.api-extractor": "~0.6.0-beta.1",
|
|
53
|
+
"@osdk/monorepo.tsconfig": "~0.6.0-beta.1"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|