@picked/vite-plugin-picked 0.0.1-dev.1771902850952 → 0.0.1-dev.1771973228237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +17 -12
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@picked/client/plugins/dynamic-experiences"),n="https://api.picked.app",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@picked/client/plugins/dynamic-experiences"),o=require("vite"),n="https://api.picked.app",f="__PICKED_PROJECT_CONFIG__";function d(e){const r=e.apiUrl??n,c=o.createLogger(void 0,{prefix:"[picked]"});return{name:"picked",config:async()=>{c.info(`Fetching project config for "${e.projectId}" from ${r}`);const t=await i.fetchProject(r,e.projectId);if(!t){c.warn(`Failed to fetch project config for "${e.projectId}"`);return}return c.info(`Project config fetched successfully for "${e.projectId}"`),{define:{[f]:JSON.stringify(t)}}}}}exports.picked=d;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import { fetchProject as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { fetchProject as t } from "@picked/client/plugins/dynamic-experiences";
|
|
2
|
+
import { createLogger as f } from "vite";
|
|
3
|
+
const i = "https://api.picked.app", n = "__PICKED_PROJECT_CONFIG__";
|
|
4
|
+
function a(c) {
|
|
5
|
+
const r = c.apiUrl ?? i, e = f(void 0, { prefix: "[picked]" });
|
|
5
6
|
return {
|
|
6
7
|
name: "picked",
|
|
7
8
|
config: async () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
e.info(`Fetching project config for "${c.projectId}" from ${r}`);
|
|
10
|
+
const o = await t(r, c.projectId);
|
|
11
|
+
if (!o) {
|
|
12
|
+
e.warn(`Failed to fetch project config for "${c.projectId}"`);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
return e.info(`Project config fetched successfully for "${c.projectId}"`), {
|
|
16
|
+
define: {
|
|
17
|
+
[n]: JSON.stringify(o)
|
|
18
|
+
}
|
|
19
|
+
};
|
|
15
20
|
}
|
|
16
21
|
};
|
|
17
22
|
}
|
|
18
23
|
export {
|
|
19
|
-
|
|
24
|
+
a as picked
|
|
20
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAA;AAKhD,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAwB3D"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/vite-plugin-picked",
|
|
3
3
|
"description": "Vite plugin for build-time config injection",
|
|
4
|
-
"version": "0.0.1-dev.
|
|
4
|
+
"version": "0.0.1-dev.1771973228237",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@picked/client": "0.0.1-dev.
|
|
6
|
+
"@picked/client": "0.0.1-dev.1771973228237"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@repo/eslint-config": "workspace:*",
|