houdini-adapter-auto 1.3.13 → 2.0.0-go.0
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/build/index.cjs +2 -2
- package/build/index.js +2 -2
- package/package.json +7 -4
package/build/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
${
|
|
1
|
+
"use strict";var g=Object.create;var c=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},p=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of k(t))!D.call(e,r)&&r!==o&&c(e,r,{get:()=>t[r],enumerable:!(a=w(t,r))||a.enumerable});return e};var l=(e,t,o)=>(o=e!=null?g(h(e)):{},p(t||!e||!e.__esModule?c(o,"default",{value:e,enumerable:!0}):o,e)),F=e=>p(c({},"__esModule",{value:!0}),e);var A={};v(A,{default:()=>$});module.exports=F(A);var u=require("import-meta-resolve"),f=require("child_process"),s=l(require("fs/promises"),1),n=l(require("path"),1),y=require("url"),j=[{name:"CloudFlare Pages",test:()=>!!process.env.CF_PAGES,module:"houdini-adapter-cloudflare"},{name:"HoudiniCloud",test:()=>!!process.env.HOUDINI_CLOUD,module:"houdini-cloud-adapter"},{name:"Node",test:()=>!0,module:"houdini-adapter-node"}],E=async e=>{let t;for(let a of j)if(a.test()){t=a;break}if(!t)throw new Error("Could not identify environment");return console.log(`\u{1F3A9} Identified environment: ${t.name}`),(await N(t))(e)};async function N({module:e}){try{return await m(e)}catch(a){let r=a;if(r.code!=="ERR_MODULE_NOT_FOUND"||!r.message.startsWith(`Cannot find package '${e}'`))throw a}let{package_manager:t}=await O(),o={yarn:"add -D",npm:"install -D",pnpm:"add -D"};try{return(0,f.execSync)(`${t} ${o[t]} ${e}`,{stdio:"inherit",env:{...process.env,NODE_ENV:void 0}}),console.log(`Successfully installed ${e}!`),console.warn(`If you plan on staying in this environment, consider adding ${e} to your project so you don't have to install it every time you build your application.`),await m(e)}catch(a){throw new Error(`Could not install package ${e}. Please install it manually or maybe consider replacing houdini-adapter-auto with ${e}.
|
|
2
|
+
${a.message}`)}}async function m(e){let t=(0,y.pathToFileURL)(process.cwd()).href;return(await import((0,u.resolve)(e,t+"/x.js"))).default}async function O(e=process.cwd()){let t=!1;try{await s.default.stat(n.default.join(e,"tsconfig.json")),t=!0}catch{}let o="npm",a=e;do{try{await s.default.access(n.default.join(a,"pnpm-lock.yaml")),o="pnpm";break}catch{}try{await s.default.access(n.default.join(a,"yarn.lock")),o="yarn";break}catch{}}while(a!==(a=n.default.dirname(a)));return{typescript:t,package_manager:o,...await P(e)}}async function P(e){let t;try{let i=await s.default.readFile(n.default.join(e,"package.json"),"utf-8");if(i)t=JSON.parse(i);else throw new Error("not found")}catch{throw new Error("\u274C houdini init must target an existing node project (with a package.json)")}let{devDependencies:o,dependencies:a}=t,r=i=>!!(o?.[i]||a?.[i]),d={framework:"svelte"};return r("@sveltejs/kit")&&(d={framework:"kit"}),{frameworkInfo:d,module:t.type==="module"?"esm":"commonjs"}}var $=E;
|
package/build/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${
|
|
1
|
+
import{resolve as p}from"import-meta-resolve";import{execSync as l}from"node:child_process";import s from"node:fs/promises";import n from"node:path";import{pathToFileURL as m}from"node:url";var u=[{name:"CloudFlare Pages",test:()=>!!process.env.CF_PAGES,module:"houdini-adapter-cloudflare"},{name:"HoudiniCloud",test:()=>!!process.env.HOUDINI_CLOUD,module:"houdini-cloud-adapter"},{name:"Node",test:()=>!0,module:"houdini-adapter-node"}],f=async e=>{let t;for(let o of u)if(o.test()){t=o;break}if(!t)throw new Error("Could not identify environment");return console.log(`\u{1F3A9} Identified environment: ${t.name}`),(await y(t))(e)};async function y({module:e}){try{return await d(e)}catch(o){let i=o;if(i.code!=="ERR_MODULE_NOT_FOUND"||!i.message.startsWith(`Cannot find package '${e}'`))throw o}let{package_manager:t}=await g(),a={yarn:"add -D",npm:"install -D",pnpm:"add -D"};try{return l(`${t} ${a[t]} ${e}`,{stdio:"inherit",env:{...process.env,NODE_ENV:void 0}}),console.log(`Successfully installed ${e}!`),console.warn(`If you plan on staying in this environment, consider adding ${e} to your project so you don't have to install it every time you build your application.`),await d(e)}catch(o){throw new Error(`Could not install package ${e}. Please install it manually or maybe consider replacing houdini-adapter-auto with ${e}.
|
|
2
|
+
${o.message}`)}}async function d(e){let t=m(process.cwd()).href;return(await import(p(e,t+"/x.js"))).default}async function g(e=process.cwd()){let t=!1;try{await s.stat(n.join(e,"tsconfig.json")),t=!0}catch{}let a="npm",o=e;do{try{await s.access(n.join(o,"pnpm-lock.yaml")),a="pnpm";break}catch{}try{await s.access(n.join(o,"yarn.lock")),a="yarn";break}catch{}}while(o!==(o=n.dirname(o)));return{typescript:t,package_manager:a,...await w(e)}}async function w(e){let t;try{let r=await s.readFile(n.join(e,"package.json"),"utf-8");if(r)t=JSON.parse(r);else throw new Error("not found")}catch{throw new Error("\u274C houdini init must target an existing node project (with a package.json)")}let{devDependencies:a,dependencies:o}=t,i=r=>!!(a?.[r]||o?.[r]),c={framework:"svelte"};return i("@sveltejs/kit")&&(c={framework:"kit"}),{frameworkInfo:c,module:t.type==="module"?"esm":"commonjs"}}var j=f;export{j as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-adapter-auto",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-go.0",
|
|
4
4
|
"description": "An adapter for deploying your Houdini application according to the build environment ",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"houdini",
|
|
@@ -17,13 +17,16 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"type": "module",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
20
23
|
"devDependencies": {
|
|
21
24
|
"tsup": "^7.2.0",
|
|
22
|
-
"scripts": "^
|
|
25
|
+
"scripts": "^2.0.0-go.0"
|
|
23
26
|
},
|
|
24
27
|
"dependencies": {
|
|
25
28
|
"import-meta-resolve": "^3.0.0",
|
|
26
|
-
"houdini": "^
|
|
29
|
+
"houdini": "^2.0.0-go.0"
|
|
27
30
|
},
|
|
28
31
|
"files": [
|
|
29
32
|
"build"
|
|
@@ -43,7 +46,7 @@
|
|
|
43
46
|
"typesVersions": {
|
|
44
47
|
"*": {
|
|
45
48
|
"app": [
|
|
46
|
-
"build/app.d.ts"
|
|
49
|
+
"./build/app.d.ts"
|
|
47
50
|
]
|
|
48
51
|
}
|
|
49
52
|
},
|