houdini-adapter-auto 1.3.13 → 2.0.0-go.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.
package/build/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})},y=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of u(t))!m.call(e,n)&&n!==a&&o(e,n,{get:()=>t[n],enumerable:!(r=p(t,n))||r.enumerable});return e};var h=e=>y(o({},"__esModule",{value:!0}),e);var A={};f(A,{default:()=>$});module.exports=h(A);var s=require("houdini"),d=require("import-meta-resolve"),c=require("child_process"),l=require("url"),g=[{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"}],w=async e=>{let t;for(let r of g)if(r.test()){t=r;break}if(!t)throw new Error("Could not identify environment");return console.log(`\u{1F3A9} Identified environment: ${t.name}`),(await v(t))(e)};async function v({module:e}){try{return await i(e)}catch(r){let n=r;if(n.code!=="ERR_MODULE_NOT_FOUND"||!n.message.startsWith(`Cannot find package '${e}'`))throw r}let{package_manager:t}=await(0,s.detectTools)(),a={yarn:"add -D",npm:"install -D",pnpm:"add -D"};try{return(0,c.execSync)(`${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 i(e)}catch(r){throw new Error(`Could not install package ${e}. Please install it manually or maybe consider replacing houdini-adapter-auto with ${e}.
2
- ${r.message}`)}}async function i(e){let t=(0,l.pathToFileURL)(process.cwd()).href;return(await import((0,d.resolve)(e,t+"/x.js"))).default}var $=w;
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{detectTools as i}from"houdini";import{resolve as s}from"import-meta-resolve";import{execSync as d}from"node:child_process";import{pathToFileURL as c}from"node:url";var l=[{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"}],p=async e=>{let t;for(let r of l)if(r.test()){t=r;break}if(!t)throw new Error("Could not identify environment");return console.log(`\u{1F3A9} Identified environment: ${t.name}`),(await u(t))(e)};async function u({module:e}){try{return await o(e)}catch(r){let n=r;if(n.code!=="ERR_MODULE_NOT_FOUND"||!n.message.startsWith(`Cannot find package '${e}'`))throw r}let{package_manager:t}=await i(),a={yarn:"add -D",npm:"install -D",pnpm:"add -D"};try{return d(`${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 o(e)}catch(r){throw new Error(`Could not install package ${e}. Please install it manually or maybe consider replacing houdini-adapter-auto with ${e}.
2
- ${r.message}`)}}async function o(e){let t=c(process.cwd()).href;return(await import(s(e,t+"/x.js"))).default}var g=p;export{g as default};
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,55 +1,58 @@
1
1
  {
2
- "name": "houdini-adapter-auto",
3
- "version": "1.3.13",
4
- "description": "An adapter for deploying your Houdini application according to the build environment ",
5
- "keywords": [
6
- "houdini",
7
- "adpter",
8
- "cloudflare",
9
- "workers",
10
- "node"
11
- ],
12
- "homepage": "https://github.com/HoudiniGraphql/houdini",
13
- "funding": "https://github.com/sponsors/HoudiniGraphql",
14
- "repository": {
15
- "type": "git",
16
- "url": "https://github.com/HoudiniGraphql/houdini.git"
17
- },
18
- "license": "MIT",
19
- "type": "module",
20
- "devDependencies": {
21
- "tsup": "^7.2.0",
22
- "scripts": "^1.0.0"
23
- },
24
- "dependencies": {
25
- "import-meta-resolve": "^3.0.0",
26
- "houdini": "^1.5.10"
27
- },
28
- "files": [
29
- "build"
30
- ],
31
- "exports": {
32
- "./package.json": "./package.json",
33
- ".": {
34
- "import": "./build/index.js",
35
- "require": "./build/index.cjs"
2
+ "name": "houdini-adapter-auto",
3
+ "version": "2.0.0-go.1",
4
+ "description": "An adapter for deploying your Houdini application according to the build environment ",
5
+ "keywords": [
6
+ "houdini",
7
+ "adpter",
8
+ "cloudflare",
9
+ "workers",
10
+ "node"
11
+ ],
12
+ "homepage": "https://github.com/HoudiniGraphql/houdini",
13
+ "funding": "https://github.com/sponsors/HoudiniGraphql",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/HoudiniGraphql/houdini.git"
36
17
  },
37
- "./app": {
38
- "import": "./build/app.js",
39
- "require": "./build/app.cjs"
40
- }
41
- },
42
- "types": "./build/index.d.ts",
43
- "typesVersions": {
44
- "*": {
45
- "app": [
46
- "build/app.d.ts"
47
- ]
18
+ "license": "MIT",
19
+ "type": "module",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "scripts": {
24
+ "build": "tsup src/* --format esm,cjs --external vite --minify --dts --clean --out-dir build",
25
+ "build:": "cd ../../ && ((run build && cd -) || (cd - && exit 1))",
26
+ "build:build": "pnpm build: && pnpm build"
27
+ },
28
+ "devDependencies": {
29
+ "scripts": "workspace:^",
30
+ "tsup": "^7.2.0"
31
+ },
32
+ "dependencies": {
33
+ "houdini": "workspace:^",
34
+ "import-meta-resolve": "^3.0.0"
35
+ },
36
+ "files": [
37
+ "build"
38
+ ],
39
+ "exports": {
40
+ "./package.json": "./package.json",
41
+ ".": {
42
+ "import": "./build/index.js",
43
+ "require": "./build/index.cjs"
44
+ },
45
+ "./app": {
46
+ "import": "./build/app.js",
47
+ "require": "./build/app.cjs"
48
+ }
49
+ },
50
+ "types": "./build/index.d.ts",
51
+ "typesVersions": {
52
+ "*": {
53
+ "app": [
54
+ "./build/app.d.ts"
55
+ ]
56
+ }
48
57
  }
49
- },
50
- "scripts": {
51
- "build": "tsup src/* --format esm,cjs --external vite --minify --dts --clean --out-dir build",
52
- "build:": "cd ../../ && ((run build && cd -) || (cd - && exit 1))",
53
- "build:build": "pnpm build: && pnpm build"
54
- }
55
- }
58
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Alec Aivazis
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.