@picked/config 0.0.111-next.3 → 0.0.111-next.4
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/README.md +33 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/define.js +1 -0
- package/dist/cjs/index.js +3 -3
- package/dist/config-BHuvJukH.js +12 -0
- package/dist/config-BqUv-9JF.cjs +1 -0
- package/dist/esm/define.js +1 -0
- package/dist/esm/index.js +149 -132
- package/dist/types/config.d.ts +55 -8
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/define.d.ts +7 -0
- package/dist/types/define.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/load-config.d.ts +9 -6
- package/dist/types/load-config.d.ts.map +1 -1
- package/package.json +12 -3
package/dist/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../config-BqUv-9JF.cjs");let t=require("node:fs"),n=require("node:fs/promises"),r=require("node:path"),i=require("jiti"),a=require("node:crypto"),o=require("@picked/delivery-api-client");var s=`manifest.json`,c=`schema.json`,l=`schema-manifest.json`,u=`
|
|
2
2
|
# Picked codegen intermediates
|
|
3
3
|
.picked/
|
|
4
|
-
`;function d(e){let t=(0,
|
|
5
|
-
`,`utf8`)}function
|
|
4
|
+
`;function d(e){let t=(0,r.join)(e,`.picked`);return{pickedDir:t,manifestPath:(0,r.join)(t,s),schemaPath:(0,r.join)(t,c),codegenManifestPath:(0,r.join)(t,l)}}function f(e){return(0,a.createHash)(`sha256`).update(e).digest(`hex`)}function p(e){return typeof e!=`object`||!e?!1:`schemaHash`in e&&typeof e.schemaHash==`string`}async function m(e){if(!(0,t.existsSync)(e))return null;let r=await(0,n.readFile)(e,`utf8`),i=JSON.parse(r);return p(i)?i:null}async function ee(e){let t=d(e.projectRoot);await(0,n.mkdir)(t.pickedDir,{recursive:!0}),await(0,n.writeFile)(t.schemaPath,e.schemaJson,`utf8`),await(0,n.writeFile)(t.codegenManifestPath,`${JSON.stringify(e.manifest,null,2)}\n`,`utf8`)}async function h(e){let i=(0,r.join)(e,`.gitignore`);(0,t.existsSync)(i)?(await(0,n.readFile)(i,`utf8`)).includes(`.picked/`)||await(0,n.appendFile)(i,u,`utf8`):await(0,n.writeFile)(i,`.picked/
|
|
5
|
+
`,`utf8`)}function g(e){let t;try{t=new URL(e)}catch{throw Error(`Invalid Picked API URL: ${e}`)}let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`[::1]`;if(t.protocol!==`https:`&&!n)throw Error(`Refusing to use a non-HTTPS Picked API URL (${e}); tokens must not be sent over cleartext.`);return e}function _(e){return new URL(g(e)).origin}var te=`settings.json`,v=384;function y(e){return(0,r.join)(e,`.picked`,te)}function ne(e){return!(typeof e!=`object`||!e||!(`id`in e)||typeof e.id!=`string`||!(`name`in e)||typeof e.name!=`string`||!(`status`in e)||typeof e.status!=`string`||!(`source`in e)||e.source!==`published`&&e.source!==`preview`)}function re(e){return typeof e!=`object`||!e||!(`projectId`in e)||typeof e.projectId!=`string`?!1:!(`workspace`in e)||e.workspace===void 0||ne(e.workspace)}function b(e){return typeof e!=`object`||!e?!1:Object.values(e).every(re)}async function x(e){let r=y(e);if(!(0,t.existsSync)(r))return{};try{let e=JSON.parse(await(0,n.readFile)(r,`utf8`));return b(e)?e:{}}catch{return{}}}async function S(e,t){return(await x(e))[_(t)]??null}async function C(e,t,i){let a=y(e),o={...await x(e),[_(t)]:i};await(0,n.mkdir)((0,r.dirname)(a),{recursive:!0}),await h(e),await(0,n.writeFile)(a,`${JSON.stringify(o,null,2)}\n`,{encoding:`utf8`,mode:v}),await(0,n.chmod)(a,v)}var w=`https://api.picked.app`,T=`./src/picked-env.d.ts`,ie=[`picked.config.ts`,`picked.config.js`,`picked.config.json`];function E(e){return typeof e==`object`&&!!e}function D(e){return typeof e.projectId==`string`&&e.projectId!==``&&(e.app===void 0||k(e.app))}function O(e){return k(e.app)&&(e.projectId===void 0||typeof e.projectId==`string`&&e.projectId!==``)}function k(e){return E(e)&&!Array.isArray(e)&&typeof e.handle==`string`&&e.handle!==``&&typeof e.name==`string`&&e.name!==``}function ae(e,t){if(!E(e)||Array.isArray(e))throw Error(`${t}: \`app\` must be the app manifest, an object.`);if(typeof e.handle!=`string`||e.handle===``)throw Error(`${t}: \`app.handle\` must be a non-empty string.`);if(typeof e.name!=`string`||e.name===``)throw Error(`${t}: \`app.name\` must be a non-empty string.`)}function A(e,t){if(!E(e)||Array.isArray(e))throw Error(`${t}: export a config object.`);if(e.projectId===void 0&&e.app===void 0)throw Error(`${t}: it sets neither \`projectId\` (a project) nor \`app\` (an app). Set one or both.`);if(e.projectId!==void 0&&(typeof e.projectId!=`string`||e.projectId===``))throw Error(`${t}: \`projectId\` must be a non-empty string.`);if(e.app!==void 0&&ae(e.app,t),e.apiUrl!==void 0&&(typeof e.apiUrl!=`string`||e.apiUrl===``))throw Error(`${t}: \`apiUrl\` must be the Picked API origin.`);if(D(e)||O(e))return e;throw Error(`${t}: export a config object.`)}function oe(e){return e===`preview`?`preview`:`published`}var se=new Set([`bundle`,`api`,`snapshot`]);function j(e){return typeof e==`string`&&se.has(e)}function M(e){let t=process.env.PICKED_DATA;if(t!==void 0&&t!==``){if(!j(t))throw Error(`PICKED_DATA is "${t}"; it takes 'bundle', 'api' or 'snapshot'.`);return t}if(e===void 0)return`bundle`;if(!j(e))throw Error(`picked.config \`data\` is ${JSON.stringify(e)}; it takes 'bundle', 'api' or 'snapshot'.`);return e}function N(e,t,n){let i=process.env.PICKED_PREVIEW_TOKEN??null,a=process.env.PICKED_PROJECT_ID,o={apiUrl:g(e.apiUrl??w),typesOutput:(0,r.resolve)(t,e.typesOutput??T),projectRoot:t,telemetry:e.telemetry??!1,data:M(e.data)};if(n){let t=a??n.projectId;if(n.workspace?.source===`preview`){let r=i??n.workspace.previewToken??e.previewToken??null;return{...o,projectId:t,source:`preview`,previewToken:r}}return{...o,projectId:t,source:`published`,previewToken:null}}let s=oe(e.source),c=s===`preview`?i??e.previewToken??null:null;return{...o,projectId:a??e.projectId,source:s,previewToken:c}}async function P(e=process.cwd()){for(let a of ie){let o=(0,r.join)(e,a);if(!(0,t.existsSync)(o))continue;if(a.endsWith(`.json`)){let e=await(0,n.readFile)(o,`utf8`);return A(JSON.parse(e),`Invalid picked.config.json at ${o}`)}let s=await(0,i.createJiti)({}.url,{interopDefault:!0}).import(o);return A(E(s)&&`default`in s?s.default:s,`Invalid ${a} at ${o}`)}return null}function F(e,t){let n=e?.projectId??t?.projectId;return n===void 0||n.length===0?null:{...t,...e,projectId:n,apiUrl:e?.apiUrl??t?.apiUrl,data:e?.data??t?.data}}async function I(t=process.cwd(),n){let r=await P(t),i=F(r,n);if(!i){if(r&&!e.r(r))throw Error(`picked.config in ${t} names no project. Add \`projectId\` beside its \`app\` section.`);return null}return N(i,t,await S(t,i.apiUrl??w))}var L={VERCEL:`vercel`,NETLIFY:`netlify`,CF_PAGES:`cloudflare-pages`,GITHUB_ACTIONS:`github-actions`,GITLAB_CI:`gitlab-ci`,CIRCLECI:`circleci`,BITBUCKET_BUILD_NUMBER:`bitbucket-pipelines`};function R(){let e=!!process.env.CI;for(let[e,t]of Object.entries(L))if(process.env[e])return{provider:t,ci:!0};return{provider:e?`unknown`:`local`,ci:e}}var z=new Set([`1`,`true`]),B=new Set([`0`,`false`]);function V(e){let t=e?.trim().toLowerCase();if(t!==void 0){if(z.has(t))return!0;if(B.has(t))return!1}}function H(){return V(process.env.PICKED_TELEMETRY)===!1||V(process.env.DO_NOT_TRACK)===!0}function U(e,t){return H()?!1:t===void 0?V(process.env.PICKED_TELEMETRY)===!0||e.telemetry:t}var W=`picked.snapshot.json`,G=1,K="Run `picked pull` to write a fresh one.";function q(e){return(0,r.join)(e,W)}function J(e){let t=new Set;for(let n of e.steps)n.layoutContentId&&t.add(n.id);return t.size===0?[]:e.experiences.filter(e=>e.nodes.some(e=>e.type===`step`&&t.has(e.stepId))).map(e=>e.id)}function ce(e,t){return e===t?0:e<t?-1:1}function Y(e){let t={};for(let n of Object.keys(e.experiences).sort(ce)){let r=e.experiences[n];r!==void 0&&(t[n]=r)}let n={snapshotVersion:e.snapshotVersion,projectId:e.projectId,workspaceId:e.workspaceId,projectVersionId:e.projectVersionId,source:e.source,schema:e.schema,projectConfig:e.projectConfig,experiences:t};return`${JSON.stringify(n,null,2)}\n`}function X(e){return typeof e==`object`&&!!e}function le(e){return X(e)&&typeof e.id==`string`&&Array.isArray(e.features)&&Array.isArray(e.experiences)&&Array.isArray(e.steps)}function ue(e){return X(e)&&Object.values(e).every(e=>X(e)&&typeof e.experienceId==`string`&&Array.isArray(e.content))}function de(e){return X(e)&&typeof e.snapshotVersion==`number`&&typeof e.projectId==`string`&&typeof e.workspaceId==`string`&&(typeof e.projectVersionId==`string`||e.projectVersionId===null)&&(e.source===`published`||e.source===`preview`)&&(0,o.isWorkspaceSchema)(e.schema)&&le(e.projectConfig)&&ue(e.experiences)}async function Z(e){let r=q(e);if(!(0,t.existsSync)(r))return null;let i;try{i=JSON.parse(await(0,n.readFile)(r,`utf8`))}catch{throw Error(`${r} is not valid JSON. ${K}`)}if(X(i)&&typeof i.snapshotVersion==`number`&&i.snapshotVersion!==1)throw Error(`${r} is in snapshot format ${i.snapshotVersion.toString()}, and this SDK reads format 1. ${K}`);if(!de(i))throw Error(`${r} is not a Picked snapshot. ${K}`);return i}async function fe(e){let t=await Z(e.projectRoot);if(!t)throw Error(`picked.config sets \`data: 'snapshot'\`, and there is no ${W} in ${e.projectRoot}. Run \`picked pull\` to write one.`);if(t.projectId!==e.projectId)throw Error(`${W} holds project "${t.projectId}", and the project in force is "${e.projectId}". ${K}`);return t}async function pe(e,t){await(0,n.writeFile)(q(e),Y(t),`utf8`)}async function Q(e,t){let n=[],r=await t(e=>{n.push(e)});if(r===null){let t=n.at(-1)??`no response`;throw Error(`Could not fetch ${e}: ${t}`)}return r}function $(e,t,n){if(e!==null&&t!==null&&t!==e)throw Error(`The workspace was published while pulling: the project config is at version ${e} and ${n} at ${t}. Run \`picked pull\` again.`)}async function me(e){let{apiUrl:t,projectId:n,source:r,previewToken:i,headers:a}=e,s={previewToken:i,headers:a},c=await Q(`the workspace schema for "${n}" from ${t}`,e=>(0,o.fetchSchema)(t,n,{...s,onWarn:e})),l=await Q(`the project config for "${n}" from ${t}`,e=>(0,o.fetchProject)(t,n,{...s,onWarn:e})),u=l.versionId;$(u,c[`x-picked-version-id`],`the workspace schema`);let d=await Promise.all(J(l).map(async e=>[e,await Q(`content for experience "${e}"`,r=>(0,o.fetchExperienceContent)(t,n,e,{...s,onWarn:r}))])),f={};for(let[e,t]of d)$(u,t.versionId,`content for experience "${e}"`),f[e]=t;return{snapshotVersion:1,projectId:n,workspaceId:l.workspaceId,projectVersionId:u,source:r,schema:c,projectConfig:l,experiences:f}}exports.SNAPSHOT_FILENAME=W,exports.SNAPSHOT_VERSION=G,exports.appendPickedGitignore=h,exports.assertSecureApiUrl=g,exports.collectCmsExperienceIds=J,exports.defineConfig=e.t,exports.detectHostEnvironment=R,exports.fetchSnapshot=me,exports.hasApp=e.n,exports.hasProject=e.r,exports.hashSchemaJson=f,exports.isTelemetryEnabled=U,exports.isTelemetryForcedOffByEnvironment=H,exports.loadPickedConfig=P,exports.loadResolvedPickedConfig=I,exports.normalizeApiUrl=_,exports.readActiveSelection=S,exports.readCodegenManifest=m,exports.readSnapshot=Z,exports.requireSnapshot=fe,exports.resolvePickedConfig=N,exports.resolvePickedPaths=d,exports.resolveSettingsPath=y,exports.resolveSnapshotPath=q,exports.serializeSnapshot=Y,exports.writeActiveSelection=C,exports.writeCodegenArtifacts=ee,exports.writeSnapshot=pe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e.projectId!==void 0}function t(e){return e.app!==void 0}function n(e){return e}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as defineConfig, n as hasApp, r as hasProject } from "../config-BHuvJukH.js";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
function ne(e) {
|
|
9
|
-
return e;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
1
|
+
import { n as e, r as t, t as n } from "../config-BHuvJukH.js";
|
|
2
|
+
import { existsSync as r } from "node:fs";
|
|
3
|
+
import { appendFile as i, chmod as a, mkdir as o, readFile as s, writeFile as c } from "node:fs/promises";
|
|
4
|
+
import { dirname as l, join as u, resolve as d } from "node:path";
|
|
5
|
+
import { createJiti as ee } from "jiti";
|
|
6
|
+
import { createHash as te } from "node:crypto";
|
|
7
|
+
import { fetchExperienceContent as ne, fetchProject as re, fetchSchema as ie, isWorkspaceSchema as ae } from "@picked/delivery-api-client";
|
|
12
8
|
//#region src/manifest.ts
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
let t =
|
|
9
|
+
var f = "manifest.json", p = "schema.json", m = "schema-manifest.json", h = "\n# Picked codegen intermediates\n.picked/\n";
|
|
10
|
+
function g(e) {
|
|
11
|
+
let t = u(e, ".picked");
|
|
16
12
|
return {
|
|
17
13
|
pickedDir: t,
|
|
18
|
-
manifestPath:
|
|
19
|
-
schemaPath:
|
|
20
|
-
codegenManifestPath:
|
|
14
|
+
manifestPath: u(t, f),
|
|
15
|
+
schemaPath: u(t, p),
|
|
16
|
+
codegenManifestPath: u(t, m)
|
|
21
17
|
};
|
|
22
18
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
19
|
+
function _(e) {
|
|
20
|
+
return te("sha256").update(e).digest("hex");
|
|
25
21
|
}
|
|
26
|
-
function
|
|
22
|
+
function oe(e) {
|
|
27
23
|
return typeof e != "object" || !e ? !1 : "schemaHash" in e && typeof e.schemaHash == "string";
|
|
28
24
|
}
|
|
29
|
-
async function
|
|
30
|
-
if (!e
|
|
31
|
-
let
|
|
32
|
-
return
|
|
25
|
+
async function se(e) {
|
|
26
|
+
if (!r(e)) return null;
|
|
27
|
+
let t = await s(e, "utf8"), n = JSON.parse(t);
|
|
28
|
+
return oe(n) ? n : null;
|
|
33
29
|
}
|
|
34
|
-
async function
|
|
35
|
-
let t =
|
|
36
|
-
await
|
|
30
|
+
async function ce(e) {
|
|
31
|
+
let t = g(e.projectRoot);
|
|
32
|
+
await o(t.pickedDir, { recursive: !0 }), await c(t.schemaPath, e.schemaJson, "utf8"), await c(t.codegenManifestPath, `${JSON.stringify(e.manifest, null, 2)}\n`, "utf8");
|
|
37
33
|
}
|
|
38
|
-
async function v(
|
|
39
|
-
let
|
|
40
|
-
|
|
34
|
+
async function v(e) {
|
|
35
|
+
let t = u(e, ".gitignore");
|
|
36
|
+
r(t) ? (await s(t, "utf8")).includes(".picked/") || await i(t, h, "utf8") : await c(t, ".picked/\n", "utf8");
|
|
41
37
|
}
|
|
42
38
|
//#endregion
|
|
43
39
|
//#region src/url-safety.ts
|
|
@@ -57,83 +53,102 @@ function b(e) {
|
|
|
57
53
|
}
|
|
58
54
|
//#endregion
|
|
59
55
|
//#region src/settings.ts
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
function ce(e) {
|
|
65
|
-
return !(typeof e != "object" || !e || !("id" in e) || typeof e.id != "string" || !("name" in e) || typeof e.name != "string" || !("status" in e) || typeof e.status != "string" || !("source" in e) || e.source !== "published" && e.source !== "preview");
|
|
56
|
+
var x = "settings.json", S = 384;
|
|
57
|
+
function C(e) {
|
|
58
|
+
return u(e, ".picked", x);
|
|
66
59
|
}
|
|
67
60
|
function le(e) {
|
|
68
|
-
return typeof e != "object" || !e || !("
|
|
61
|
+
return !(typeof e != "object" || !e || !("id" in e) || typeof e.id != "string" || !("name" in e) || typeof e.name != "string" || !("status" in e) || typeof e.status != "string" || !("source" in e) || e.source !== "published" && e.source !== "preview");
|
|
69
62
|
}
|
|
70
63
|
function ue(e) {
|
|
71
|
-
return typeof e != "object" || !e ? !1 :
|
|
64
|
+
return typeof e != "object" || !e || !("projectId" in e) || typeof e.projectId != "string" ? !1 : !("workspace" in e) || e.workspace === void 0 || le(e.workspace);
|
|
72
65
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
function de(e) {
|
|
67
|
+
return typeof e != "object" || !e ? !1 : Object.values(e).every(ue);
|
|
68
|
+
}
|
|
69
|
+
async function w(e) {
|
|
70
|
+
let t = C(e);
|
|
71
|
+
if (!r(t)) return {};
|
|
76
72
|
try {
|
|
77
|
-
let e = JSON.parse(await
|
|
78
|
-
return
|
|
73
|
+
let e = JSON.parse(await s(t, "utf8"));
|
|
74
|
+
return de(e) ? e : {};
|
|
79
75
|
} catch {
|
|
80
76
|
return {};
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
|
-
async function
|
|
84
|
-
return (await
|
|
79
|
+
async function T(e, t) {
|
|
80
|
+
return (await w(e))[b(t)] ?? null;
|
|
85
81
|
}
|
|
86
|
-
async function
|
|
87
|
-
let
|
|
88
|
-
...await
|
|
89
|
-
[b(t)]:
|
|
82
|
+
async function fe(e, t, n) {
|
|
83
|
+
let r = C(e), i = {
|
|
84
|
+
...await w(e),
|
|
85
|
+
[b(t)]: n
|
|
90
86
|
};
|
|
91
|
-
await
|
|
87
|
+
await o(l(r), { recursive: !0 }), await v(e), await c(r, `${JSON.stringify(i, null, 2)}\n`, {
|
|
92
88
|
encoding: "utf8",
|
|
93
|
-
mode:
|
|
94
|
-
}), await
|
|
89
|
+
mode: S
|
|
90
|
+
}), await a(r, S);
|
|
95
91
|
}
|
|
96
92
|
//#endregion
|
|
97
93
|
//#region src/load-config.ts
|
|
98
|
-
var
|
|
94
|
+
var E = "https://api.picked.app", D = "./src/picked-env.d.ts", O = [
|
|
99
95
|
"picked.config.ts",
|
|
100
96
|
"picked.config.js",
|
|
101
97
|
"picked.config.json"
|
|
102
98
|
];
|
|
103
|
-
function O(e) {
|
|
104
|
-
return typeof e == "object" && !!e;
|
|
105
|
-
}
|
|
106
99
|
function k(e) {
|
|
107
|
-
return
|
|
100
|
+
return typeof e == "object" && !!e;
|
|
108
101
|
}
|
|
109
102
|
function A(e) {
|
|
103
|
+
return typeof e.projectId == "string" && e.projectId !== "" && (e.app === void 0 || M(e.app));
|
|
104
|
+
}
|
|
105
|
+
function j(e) {
|
|
106
|
+
return M(e.app) && (e.projectId === void 0 || typeof e.projectId == "string" && e.projectId !== "");
|
|
107
|
+
}
|
|
108
|
+
function M(e) {
|
|
109
|
+
return k(e) && !Array.isArray(e) && typeof e.handle == "string" && e.handle !== "" && typeof e.name == "string" && e.name !== "";
|
|
110
|
+
}
|
|
111
|
+
function N(e, t) {
|
|
112
|
+
if (!k(e) || Array.isArray(e)) throw Error(`${t}: \`app\` must be the app manifest, an object.`);
|
|
113
|
+
if (typeof e.handle != "string" || e.handle === "") throw Error(`${t}: \`app.handle\` must be a non-empty string.`);
|
|
114
|
+
if (typeof e.name != "string" || e.name === "") throw Error(`${t}: \`app.name\` must be a non-empty string.`);
|
|
115
|
+
}
|
|
116
|
+
function P(e, t) {
|
|
117
|
+
if (!k(e) || Array.isArray(e)) throw Error(`${t}: export a config object.`);
|
|
118
|
+
if (e.projectId === void 0 && e.app === void 0) throw Error(`${t}: it sets neither \`projectId\` (a project) nor \`app\` (an app). Set one or both.`);
|
|
119
|
+
if (e.projectId !== void 0 && (typeof e.projectId != "string" || e.projectId === "")) throw Error(`${t}: \`projectId\` must be a non-empty string.`);
|
|
120
|
+
if (e.app !== void 0 && N(e.app, t), e.apiUrl !== void 0 && (typeof e.apiUrl != "string" || e.apiUrl === "")) throw Error(`${t}: \`apiUrl\` must be the Picked API origin.`);
|
|
121
|
+
if (A(e) || j(e)) return e;
|
|
122
|
+
throw Error(`${t}: export a config object.`);
|
|
123
|
+
}
|
|
124
|
+
function F(e) {
|
|
110
125
|
return e === "preview" ? "preview" : "published";
|
|
111
126
|
}
|
|
112
|
-
var
|
|
127
|
+
var I = /* @__PURE__ */ new Set([
|
|
113
128
|
"bundle",
|
|
114
129
|
"api",
|
|
115
130
|
"snapshot"
|
|
116
131
|
]);
|
|
117
|
-
function
|
|
118
|
-
return typeof e == "string" &&
|
|
132
|
+
function L(e) {
|
|
133
|
+
return typeof e == "string" && I.has(e);
|
|
119
134
|
}
|
|
120
|
-
function
|
|
135
|
+
function R(e) {
|
|
121
136
|
let t = process.env.PICKED_DATA;
|
|
122
137
|
if (t !== void 0 && t !== "") {
|
|
123
|
-
if (!
|
|
138
|
+
if (!L(t)) throw Error(`PICKED_DATA is "${t}"; it takes 'bundle', 'api' or 'snapshot'.`);
|
|
124
139
|
return t;
|
|
125
140
|
}
|
|
126
141
|
if (e === void 0) return "bundle";
|
|
127
|
-
if (!
|
|
142
|
+
if (!L(e)) throw Error(`picked.config \`data\` is ${JSON.stringify(e)}; it takes 'bundle', 'api' or 'snapshot'.`);
|
|
128
143
|
return e;
|
|
129
144
|
}
|
|
130
|
-
function
|
|
145
|
+
function z(e, t, n) {
|
|
131
146
|
let r = process.env.PICKED_PREVIEW_TOKEN ?? null, i = process.env.PICKED_PROJECT_ID, a = {
|
|
132
|
-
apiUrl: y(e.apiUrl ??
|
|
133
|
-
typesOutput:
|
|
147
|
+
apiUrl: y(e.apiUrl ?? E),
|
|
148
|
+
typesOutput: d(t, e.typesOutput ?? D),
|
|
134
149
|
projectRoot: t,
|
|
135
150
|
telemetry: e.telemetry ?? !1,
|
|
136
|
-
data:
|
|
151
|
+
data: R(e.data)
|
|
137
152
|
};
|
|
138
153
|
if (n) {
|
|
139
154
|
let t = i ?? n.projectId;
|
|
@@ -153,7 +168,7 @@ function P(e, t, n) {
|
|
|
153
168
|
previewToken: null
|
|
154
169
|
};
|
|
155
170
|
}
|
|
156
|
-
let o =
|
|
171
|
+
let o = F(e.source), s = o === "preview" ? r ?? e.previewToken ?? null : null;
|
|
157
172
|
return {
|
|
158
173
|
...a,
|
|
159
174
|
projectId: i ?? e.projectId,
|
|
@@ -161,22 +176,20 @@ function P(e, t, n) {
|
|
|
161
176
|
previewToken: s
|
|
162
177
|
};
|
|
163
178
|
}
|
|
164
|
-
async function
|
|
165
|
-
for (let
|
|
166
|
-
let
|
|
167
|
-
if (!
|
|
168
|
-
if (
|
|
169
|
-
let e = await
|
|
170
|
-
|
|
171
|
-
throw Error(`Invalid picked.config.json at ${r}`);
|
|
179
|
+
async function B(e = process.cwd()) {
|
|
180
|
+
for (let t of O) {
|
|
181
|
+
let n = u(e, t);
|
|
182
|
+
if (!r(n)) continue;
|
|
183
|
+
if (t.endsWith(".json")) {
|
|
184
|
+
let e = await s(n, "utf8");
|
|
185
|
+
return P(JSON.parse(e), `Invalid picked.config.json at ${n}`);
|
|
172
186
|
}
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
throw Error(`Invalid ${n} at ${r}`);
|
|
187
|
+
let i = await ee(import.meta.url, { interopDefault: !0 }).import(n);
|
|
188
|
+
return P(k(i) && "default" in i ? i.default : i, `Invalid ${t} at ${n}`);
|
|
176
189
|
}
|
|
177
190
|
return null;
|
|
178
191
|
}
|
|
179
|
-
function
|
|
192
|
+
function V(e, t) {
|
|
180
193
|
let n = e?.projectId ?? t?.projectId;
|
|
181
194
|
return n === void 0 || n.length === 0 ? null : {
|
|
182
195
|
...t,
|
|
@@ -186,13 +199,17 @@ function I(e, t) {
|
|
|
186
199
|
data: e?.data ?? t?.data
|
|
187
200
|
};
|
|
188
201
|
}
|
|
189
|
-
async function
|
|
190
|
-
let
|
|
191
|
-
|
|
202
|
+
async function H(e = process.cwd(), n) {
|
|
203
|
+
let r = await B(e), i = V(r, n);
|
|
204
|
+
if (!i) {
|
|
205
|
+
if (r && !t(r)) throw Error(`picked.config in ${e} names no project. Add \`projectId\` beside its \`app\` section.`);
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
return z(i, e, await T(e, i.apiUrl ?? E));
|
|
192
209
|
}
|
|
193
210
|
//#endregion
|
|
194
211
|
//#region src/host-environment.ts
|
|
195
|
-
var
|
|
212
|
+
var pe = {
|
|
196
213
|
VERCEL: "vercel",
|
|
197
214
|
NETLIFY: "netlify",
|
|
198
215
|
CF_PAGES: "cloudflare-pages",
|
|
@@ -201,9 +218,9 @@ var R = {
|
|
|
201
218
|
CIRCLECI: "circleci",
|
|
202
219
|
BITBUCKET_BUILD_NUMBER: "bitbucket-pipelines"
|
|
203
220
|
};
|
|
204
|
-
function
|
|
221
|
+
function me() {
|
|
205
222
|
let e = !!process.env.CI;
|
|
206
|
-
for (let [e, t] of Object.entries(
|
|
223
|
+
for (let [e, t] of Object.entries(pe)) if (process.env[e]) return {
|
|
207
224
|
provider: t,
|
|
208
225
|
ci: !0
|
|
209
226
|
};
|
|
@@ -214,37 +231,37 @@ function z() {
|
|
|
214
231
|
}
|
|
215
232
|
//#endregion
|
|
216
233
|
//#region src/telemetry-config.ts
|
|
217
|
-
var
|
|
218
|
-
function
|
|
234
|
+
var he = /* @__PURE__ */ new Set(["1", "true"]), ge = /* @__PURE__ */ new Set(["0", "false"]);
|
|
235
|
+
function U(e) {
|
|
219
236
|
let t = e?.trim().toLowerCase();
|
|
220
237
|
if (t !== void 0) {
|
|
221
|
-
if (
|
|
222
|
-
if (
|
|
238
|
+
if (he.has(t)) return !0;
|
|
239
|
+
if (ge.has(t)) return !1;
|
|
223
240
|
}
|
|
224
241
|
}
|
|
225
|
-
function
|
|
226
|
-
return
|
|
242
|
+
function W() {
|
|
243
|
+
return U(process.env.PICKED_TELEMETRY) === !1 || U(process.env.DO_NOT_TRACK) === !0;
|
|
227
244
|
}
|
|
228
|
-
function
|
|
229
|
-
return
|
|
245
|
+
function _e(e, t) {
|
|
246
|
+
return W() ? !1 : t === void 0 ? U(process.env.PICKED_TELEMETRY) === !0 || e.telemetry : t;
|
|
230
247
|
}
|
|
231
248
|
//#endregion
|
|
232
249
|
//#region src/snapshot.ts
|
|
233
|
-
var
|
|
234
|
-
function K(e) {
|
|
235
|
-
return s(e, W);
|
|
236
|
-
}
|
|
250
|
+
var G = "picked.snapshot.json", ve = 1, K = "Run `picked pull` to write a fresh one.";
|
|
237
251
|
function q(e) {
|
|
252
|
+
return u(e, G);
|
|
253
|
+
}
|
|
254
|
+
function J(e) {
|
|
238
255
|
let t = /* @__PURE__ */ new Set();
|
|
239
256
|
for (let n of e.steps) n.layoutContentId && t.add(n.id);
|
|
240
257
|
return t.size === 0 ? [] : e.experiences.filter((e) => e.nodes.some((e) => e.type === "step" && t.has(e.stepId))).map((e) => e.id);
|
|
241
258
|
}
|
|
242
|
-
function
|
|
259
|
+
function ye(e, t) {
|
|
243
260
|
return e === t ? 0 : e < t ? -1 : 1;
|
|
244
261
|
}
|
|
245
|
-
function
|
|
262
|
+
function Y(e) {
|
|
246
263
|
let t = {};
|
|
247
|
-
for (let n of Object.keys(e.experiences).sort(
|
|
264
|
+
for (let n of Object.keys(e.experiences).sort(ye)) {
|
|
248
265
|
let r = e.experiences[n];
|
|
249
266
|
r !== void 0 && (t[n] = r);
|
|
250
267
|
}
|
|
@@ -260,39 +277,39 @@ function J(e) {
|
|
|
260
277
|
};
|
|
261
278
|
return `${JSON.stringify(n, null, 2)}\n`;
|
|
262
279
|
}
|
|
263
|
-
function
|
|
280
|
+
function X(e) {
|
|
264
281
|
return typeof e == "object" && !!e;
|
|
265
282
|
}
|
|
266
|
-
function
|
|
267
|
-
return
|
|
283
|
+
function be(e) {
|
|
284
|
+
return X(e) && typeof e.id == "string" && Array.isArray(e.features) && Array.isArray(e.experiences) && Array.isArray(e.steps);
|
|
268
285
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
286
|
+
function xe(e) {
|
|
287
|
+
return X(e) && Object.values(e).every((e) => X(e) && typeof e.experienceId == "string" && Array.isArray(e.content));
|
|
271
288
|
}
|
|
272
|
-
function
|
|
273
|
-
return
|
|
289
|
+
function Se(e) {
|
|
290
|
+
return X(e) && typeof e.snapshotVersion == "number" && typeof e.projectId == "string" && typeof e.workspaceId == "string" && (typeof e.projectVersionId == "string" || e.projectVersionId === null) && (e.source === "published" || e.source === "preview") && ae(e.schema) && be(e.projectConfig) && xe(e.experiences);
|
|
274
291
|
}
|
|
275
|
-
async function
|
|
276
|
-
let
|
|
277
|
-
if (!
|
|
278
|
-
let
|
|
292
|
+
async function Z(e) {
|
|
293
|
+
let t = q(e);
|
|
294
|
+
if (!r(t)) return null;
|
|
295
|
+
let n;
|
|
279
296
|
try {
|
|
280
|
-
|
|
297
|
+
n = JSON.parse(await s(t, "utf8"));
|
|
281
298
|
} catch {
|
|
282
|
-
throw Error(`${
|
|
299
|
+
throw Error(`${t} is not valid JSON. ${K}`);
|
|
283
300
|
}
|
|
284
|
-
if (
|
|
285
|
-
if (!
|
|
286
|
-
return
|
|
287
|
-
}
|
|
288
|
-
async function
|
|
289
|
-
let t = await
|
|
290
|
-
if (!t) throw Error(`picked.config sets \`data: 'snapshot'\`, and there is no ${
|
|
291
|
-
if (t.projectId !== e.projectId) throw Error(`${
|
|
301
|
+
if (X(n) && typeof n.snapshotVersion == "number" && n.snapshotVersion !== 1) throw Error(`${t} is in snapshot format ${n.snapshotVersion.toString()}, and this SDK reads format 1. ${K}`);
|
|
302
|
+
if (!Se(n)) throw Error(`${t} is not a Picked snapshot. ${K}`);
|
|
303
|
+
return n;
|
|
304
|
+
}
|
|
305
|
+
async function Ce(e) {
|
|
306
|
+
let t = await Z(e.projectRoot);
|
|
307
|
+
if (!t) throw Error(`picked.config sets \`data: 'snapshot'\`, and there is no ${G} in ${e.projectRoot}. Run \`picked pull\` to write one.`);
|
|
308
|
+
if (t.projectId !== e.projectId) throw Error(`${G} holds project "${t.projectId}", and the project in force is "${e.projectId}". ${K}`);
|
|
292
309
|
return t;
|
|
293
310
|
}
|
|
294
|
-
async function
|
|
295
|
-
await
|
|
311
|
+
async function we(e, t) {
|
|
312
|
+
await c(q(e), Y(t), "utf8");
|
|
296
313
|
}
|
|
297
314
|
async function Q(e, t) {
|
|
298
315
|
let n = [], r = await t((e) => {
|
|
@@ -307,23 +324,23 @@ async function Q(e, t) {
|
|
|
307
324
|
function $(e, t, n) {
|
|
308
325
|
if (e !== null && t !== null && t !== e) throw Error(`The workspace was published while pulling: the project config is at version ${e} and ${n} at ${t}. Run \`picked pull\` again.`);
|
|
309
326
|
}
|
|
310
|
-
async function
|
|
327
|
+
async function Te(e) {
|
|
311
328
|
let { apiUrl: t, projectId: n, source: r, previewToken: i, headers: a } = e, o = {
|
|
312
329
|
previewToken: i,
|
|
313
330
|
headers: a
|
|
314
|
-
}, s = await Q(`the workspace schema for "${n}" from ${t}`, (e) =>
|
|
331
|
+
}, s = await Q(`the workspace schema for "${n}" from ${t}`, (e) => ie(t, n, {
|
|
315
332
|
...o,
|
|
316
333
|
onWarn: e
|
|
317
|
-
})), c = await Q(`the project config for "${n}" from ${t}`, (e) =>
|
|
334
|
+
})), c = await Q(`the project config for "${n}" from ${t}`, (e) => re(t, n, {
|
|
318
335
|
...o,
|
|
319
336
|
onWarn: e
|
|
320
337
|
})), l = c.versionId;
|
|
321
338
|
$(l, s["x-picked-version-id"], "the workspace schema");
|
|
322
|
-
let u = await Promise.all(
|
|
339
|
+
let u = await Promise.all(J(c).map(async (e) => [e, await Q(`content for experience "${e}"`, (r) => ne(t, n, e, {
|
|
323
340
|
...o,
|
|
324
341
|
onWarn: r
|
|
325
|
-
}))])),
|
|
326
|
-
for (let [e, t] of u) $(l, t.versionId, `content for experience "${e}"`),
|
|
342
|
+
}))])), d = {};
|
|
343
|
+
for (let [e, t] of u) $(l, t.versionId, `content for experience "${e}"`), d[e] = t;
|
|
327
344
|
return {
|
|
328
345
|
snapshotVersion: 1,
|
|
329
346
|
projectId: n,
|
|
@@ -332,8 +349,8 @@ async function ye(e) {
|
|
|
332
349
|
source: r,
|
|
333
350
|
schema: s,
|
|
334
351
|
projectConfig: c,
|
|
335
|
-
experiences:
|
|
352
|
+
experiences: d
|
|
336
353
|
};
|
|
337
354
|
}
|
|
338
355
|
//#endregion
|
|
339
|
-
export {
|
|
356
|
+
export { G as SNAPSHOT_FILENAME, ve as SNAPSHOT_VERSION, v as appendPickedGitignore, y as assertSecureApiUrl, J as collectCmsExperienceIds, n as defineConfig, me as detectHostEnvironment, Te as fetchSnapshot, e as hasApp, t as hasProject, _ as hashSchemaJson, _e as isTelemetryEnabled, W as isTelemetryForcedOffByEnvironment, B as loadPickedConfig, H as loadResolvedPickedConfig, b as normalizeApiUrl, T as readActiveSelection, se as readCodegenManifest, Z as readSnapshot, Ce as requireSnapshot, z as resolvePickedConfig, g as resolvePickedPaths, C as resolveSettingsPath, q as resolveSnapshotPath, Y as serializeSnapshot, fe as writeActiveSelection, ce as writeCodegenArtifacts, we as writeSnapshot };
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @file Configuration types for Picked tooling. */
|
|
2
|
+
import type { AppManifest } from '@picked/app-kit';
|
|
2
3
|
/** Schema source for codegen — published or live preview. */
|
|
3
4
|
export type PickedConfigSource = 'published' | 'preview';
|
|
4
5
|
/**
|
|
@@ -7,11 +8,9 @@ export type PickedConfigSource = 'published' | 'preview';
|
|
|
7
8
|
* `'snapshot'` embeds the committed `picked.snapshot.json` and fetches nothing.
|
|
8
9
|
*/
|
|
9
10
|
export type PickedDataMode = 'bundle' | 'api' | 'snapshot';
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/** Picked
|
|
13
|
-
projectId: string;
|
|
14
|
-
/** Origin of the Picked API to call. Defaults to production. */
|
|
11
|
+
/** The `picked.config` fields a project config and an app config share. */
|
|
12
|
+
interface PickedConfigFields {
|
|
13
|
+
/** Origin of the Picked API to call. Defaults to production; `PICKED_API_URL` overrides it. */
|
|
15
14
|
apiUrl?: string;
|
|
16
15
|
/** Path the generated type declarations are written to. */
|
|
17
16
|
typesOutput?: string;
|
|
@@ -36,6 +35,52 @@ export interface PickedConfig {
|
|
|
36
35
|
*/
|
|
37
36
|
data?: PickedDataMode;
|
|
38
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* A `picked.config` that names a project: the shape `picked generate types`, `picked pull` and
|
|
40
|
+
* the Vite plugin read. It may also hold an `app`.
|
|
41
|
+
*/
|
|
42
|
+
export type PickedProjectConfig = PickedConfigFields & {
|
|
43
|
+
/** Picked project that schema and content are read from. */
|
|
44
|
+
projectId: string;
|
|
45
|
+
/**
|
|
46
|
+
* The app manifest `picked app deploy` and `picked app dev` deploy, exactly as Picked receives
|
|
47
|
+
* it and the app serves it at `/manifest.json`. It holds no secrets.
|
|
48
|
+
*/
|
|
49
|
+
app?: AppManifest;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* A `picked.config` that holds an app: the shape `picked app deploy` and `picked app dev` read.
|
|
53
|
+
* It may also name a project.
|
|
54
|
+
*/
|
|
55
|
+
export type PickedAppConfig = PickedConfigFields & {
|
|
56
|
+
/** Picked project that schema and content are read from. */
|
|
57
|
+
projectId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The app manifest `picked app deploy` and `picked app dev` deploy, exactly as Picked receives
|
|
60
|
+
* it and the app serves it at `/manifest.json`. It holds no secrets.
|
|
61
|
+
*/
|
|
62
|
+
app: AppManifest;
|
|
63
|
+
};
|
|
64
|
+
/** User-facing `picked.config` shape: it names a project, holds an app, or both. */
|
|
65
|
+
export type PickedConfig = PickedProjectConfig | PickedAppConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Returns whether a config names a project.
|
|
68
|
+
*
|
|
69
|
+
* @param {PickedConfig} config - A loaded config.
|
|
70
|
+
* @returns {boolean} Whether `config` has a `projectId`.
|
|
71
|
+
* @example
|
|
72
|
+
* if (hasProject(config)) console.log(config.projectId)
|
|
73
|
+
*/
|
|
74
|
+
export declare function hasProject(config: PickedConfig): config is PickedProjectConfig;
|
|
75
|
+
/**
|
|
76
|
+
* Returns whether a config holds an app.
|
|
77
|
+
*
|
|
78
|
+
* @param {PickedConfig} config - A loaded config.
|
|
79
|
+
* @returns {boolean} Whether `config` has an `app` manifest.
|
|
80
|
+
* @example
|
|
81
|
+
* if (hasApp(config)) console.log(config.app.handle)
|
|
82
|
+
*/
|
|
83
|
+
export declare function hasApp(config: PickedConfig): config is PickedAppConfig;
|
|
39
84
|
/** Fully resolved configuration with defaults applied. */
|
|
40
85
|
export interface ResolvedPickedConfig {
|
|
41
86
|
/** Picked project that schema and content are read from. */
|
|
@@ -73,12 +118,14 @@ export interface PickedCodegenManifest {
|
|
|
73
118
|
emitFormatVersion?: number;
|
|
74
119
|
}
|
|
75
120
|
/**
|
|
76
|
-
* Helper for authoring `picked.config.ts` with full type inference.
|
|
121
|
+
* Helper for authoring `picked.config.ts` with full type inference. It returns the config it is
|
|
122
|
+
* given.
|
|
77
123
|
*
|
|
78
|
-
* @param {PickedConfig} config -
|
|
124
|
+
* @param {PickedConfig} config - A project's configuration, an app's, or both in one.
|
|
79
125
|
* @returns {PickedConfig} The same configuration object.
|
|
80
126
|
* @example
|
|
81
|
-
* export default defineConfig({ projectId: 'abc',
|
|
127
|
+
* export default defineConfig({ projectId: 'abc', app: { handle: 'acme', name: 'Acme' } })
|
|
82
128
|
*/
|
|
83
129
|
export declare function defineConfig(config: PickedConfig): PickedConfig;
|
|
130
|
+
export {};
|
|
84
131
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,oDAAoD;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,CAAA;AAExD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAA;AAE1D,2EAA2E;AAC3E,UAAU,kBAAkB;IAC1B,+FAA+F;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sEAAsE;IACtE,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAA;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG;IACrD,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,GAAG,CAAC,EAAE,WAAW,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG;IACjD,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAA;CACjB,CAAA;AAED,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,eAAe,CAAA;AAEhE;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,mBAAmB,CAE9E;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,eAAe,CAEtE;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAA;IACjB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAA;IACnB,sEAAsE;IACtE,MAAM,EAAE,kBAAkB,CAAA;IAC1B,8EAA8E;IAC9E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,wFAAwF;IACxF,WAAW,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,SAAS,EAAE,OAAO,CAAA;IAClB,qFAAqF;IACrF,IAAI,EAAE,cAAc,CAAA;CACrB;AAED,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,oFAAoF;IACpF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,MAAM,EAAE,kBAAkB,CAAA;IAC1B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAE/D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file `@picked/config/define`: `defineConfig`, `hasApp`, `hasProject` and the config types. Nothing
|
|
3
|
+
* it imports reads files or loads a Node built-in.
|
|
4
|
+
*/
|
|
5
|
+
export { defineConfig, hasApp, hasProject } from './config';
|
|
6
|
+
export type { PickedAppConfig, PickedConfig, PickedConfigSource, PickedDataMode, PickedProjectConfig, } from './config';
|
|
7
|
+
//# sourceMappingURL=define.d.ts.map
|