Skip to content

Commit 5c09713

Browse files
authored
chore(scripts): remove dotenv (#5088)
1 parent 763050d commit 5c09713

File tree

9 files changed

+840
-492
lines changed

9 files changed

+840
-492
lines changed

scripts/ci/actions/restore-artifacts/builddir/index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing
7878
`+s),t.push(n+"m+"+HE.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=k8e()+e+" "+t[0]}function k8e(){return Zr.inspectOpts.hideDate?"":new Date().toISOString()+" "}function O8e(...t){return process.stderr.write(qE.formatWithOptions(Zr.inspectOpts,...t)+`
7979
`)}function F8e(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function L8e(){return process.env.DEBUG}function M8e(t){t.inspectOpts={};let e=Object.keys(Zr.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Zr.inspectOpts[e[r]]}HE.exports=n5()(Zr);var{formatters:Kq}=HE.exports;Kq.o=function(t){return this.inspectOpts.colors=this.useColors,qE.inspect(t,this.inspectOpts).split(`
8080
`).map(e=>e.trim()).join(" ")};Kq.O=function(t){return this.inspectOpts.colors=this.useColors,qE.inspect(t,this.inspectOpts)}});var GE=f((_nt,o5)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?o5.exports=zq():o5.exports=Xq()});var tH=f(_n=>{"use strict";var U8e=_n&&_n.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),q8e=_n&&_n.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Zq=_n&&_n.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&U8e(e,t,r);return q8e(e,t),e};Object.defineProperty(_n,"__esModule",{value:!0});_n.req=_n.json=_n.toBuffer=void 0;var H8e=Zq(require("http")),G8e=Zq(require("https"));async function eH(t){let e=0,r=[];for await(let i of t)e+=i.length,r.push(i);return Buffer.concat(r,e)}_n.toBuffer=eH;async function j8e(t){let r=(await eH(t)).toString("utf8");try{return JSON.parse(r)}catch(i){let n=i;throw n.message+=` (input: ${r})`,n}}_n.json=j8e;function z8e(t,e={}){let i=((typeof t=="string"?t:t.href).startsWith("https:")?G8e:H8e).request(t,e),n=new Promise((s,a)=>{i.once("response",s).once("error",a).end()});return i.then=n.then.bind(n),i}_n.req=z8e});var c5=f(jn=>{"use strict";var iH=jn&&jn.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),V8e=jn&&jn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nH=jn&&jn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&iH(e,t,r);return V8e(e,t),e},Y8e=jn&&jn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iH(e,t,r)};Object.defineProperty(jn,"__esModule",{value:!0});jn.Agent=void 0;var W8e=nH(require("net")),rH=nH(require("http")),J8e=require("https");Y8e(tH(),jn);var Da=Symbol("AgentBaseInternalState"),l5=class extends rH.Agent{constructor(e){super(e),this[Da]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
81-
`).some(i=>i.indexOf("(https.js:")!==-1||i.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new W8e.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let i=this.sockets[e],n=i.indexOf(r);n!==-1&&(i.splice(n,1),this.totalSocketCount--,i.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?J8e.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,i){let n={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(n),a=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,n)).then(o=>{if(this.decrementSockets(s,a),o instanceof rH.Agent)try{return o.addRequest(e,n)}catch(l){return i(l)}this[Da].currentSocket=o,super.createSocket(e,r,i)},o=>{this.decrementSockets(s,a),i(o)})}createConnection(){let e=this[Da].currentSocket;if(this[Da].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Da].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Da]&&(this[Da].defaultPort=e)}get protocol(){return this[Da].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Da]&&(this[Da].protocol=e)}};jn.Agent=l5});var sH=f(Ou=>{"use strict";var $8e=Ou&&Ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ou,"__esModule",{value:!0});Ou.parseProxyResponse=void 0;var K8e=$8e(GE()),jE=(0,K8e.default)("https-proxy-agent:parse-proxy-response");function X8e(t){return new Promise((e,r)=>{let i=0,n=[];function s(){let d=t.read();d?c(d):t.once("readable",s)}function a(){t.removeListener("end",o),t.removeListener("error",l),t.removeListener("readable",s)}function o(){a(),jE("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}function l(d){a(),jE("onerror %o",d),r(d)}function c(d){n.push(d),i+=d.length;let A=Buffer.concat(n,i),u=A.indexOf(`\r
81+
`).some(i=>i.indexOf("(https.js:")!==-1||i.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new W8e.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let i=this.sockets[e],n=i.indexOf(r);n!==-1&&(i.splice(n,1),this.totalSocketCount--,i.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?J8e.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,i){let n={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(n),a=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,n)).then(o=>{if(this.decrementSockets(s,a),o instanceof rH.Agent)try{return o.addRequest(e,n)}catch(l){return i(l)}this[Da].currentSocket=o,super.createSocket(e,r,i)},o=>{this.decrementSockets(s,a),i(o)})}createConnection(){let e=this[Da].currentSocket;if(this[Da].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Da].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Da]&&(this[Da].defaultPort=e)}get protocol(){return this[Da].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Da]&&(this[Da].protocol=e)}};jn.Agent=l5});var sH=f(Ou=>{"use strict";var $8e=Ou&&Ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ou,"__esModule",{value:!0});Ou.parseProxyResponse=void 0;var K8e=$8e(GE()),jE=(0,K8e.default)("https-proxy-agent:parse-proxy-response");function X8e(t){return new Promise((e,r)=>{let i=0,n=[];function s(){let d=t.read();d?c(d):t.once("readable",s)}function a(){t.removeListener("end",o),t.removeListener("error",l),t.removeListener("readable",s)}function o(){a(),jE("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}function l(d){a(),jE("onerror %o",d),r(d)}function c(d){n.push(d),i+=d.length;let A=Buffer.concat(n,i),u=A.indexOf(`\r
8282
\r
8383
`);if(u===-1){jE("have not received end of HTTP headers yet..."),s();return}let p=A.slice(0,u).toString("ascii").split(`\r
8484
`),h=p.shift();if(!h)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let m=h.split(" "),E=+m[1],C=m.slice(2).join(" "),w={};for(let N of p){if(!N)continue;let S=N.indexOf(":");if(S===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${N}"`));let U=N.slice(0,S).toLowerCase(),X=N.slice(S+1).trimStart(),P=w[U];typeof P=="string"?w[U]=[P,X]:Array.isArray(P)?P.push(X):w[U]=X}jE("got proxy server response: %o %o",h,w),a(),e({connect:{statusCode:E,statusText:C,headers:w},buffered:A})}t.on("error",l),t.on("end",o),s()})}Ou.parseProxyResponse=X8e});var AH=f(ys=>{"use strict";var Z8e=ys&&ys.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),e3e=ys&&ys.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cH=ys&&ys.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Z8e(e,t,r);return e3e(e,t),e},dH=ys&&ys.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ys,"__esModule",{value:!0});ys.HttpsProxyAgent=void 0;var zE=cH(require("net")),aH=cH(require("tls")),t3e=dH(require("assert")),r3e=dH(GE()),i3e=c5(),n3e=require("url"),s3e=sH(),bm=(0,r3e.default)("https-proxy-agent"),oH=t=>t.servername===void 0&&t.host&&!zE.isIP(t.host)?{...t,servername:t.host}:t,VE=class extends i3e.Agent{constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new n3e.URL(e):e,this.proxyHeaders=r?.headers??{},bm("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let i=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?lH(r,"headers"):null,host:i,port:n}}async connect(e,r){let{proxy:i}=this;if(!r.host)throw new TypeError('No "host" provided');let n;i.protocol==="https:"?(bm("Creating `tls.Socket`: %o",this.connectOpts),n=aH.connect(oH(this.connectOpts))):(bm("Creating `net.Socket`: %o",this.connectOpts),n=zE.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=zE.isIPv6(r.host)?`[${r.host}]`:r.host,o=`CONNECT ${a}:${r.port} HTTP/1.1\r

scripts/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"chalk": "5.4.1",
3636
"commander": "14.0.0",
3737
"crc": "4.3.2",
38-
"dotenv": "17.0.1",
3938
"esbuild": "0.25.5",
4039
"execa": "9.6.0",
4140
"express": "5.1.0",

scripts/release/createReleasePR.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import path from 'path';
2-
31
import chalk from 'chalk';
4-
import dotenv from 'dotenv';
52
import semver from 'semver';
63

74
import generationCommitText, {
@@ -20,7 +17,6 @@ import {
2017
MAIN_BRANCH,
2118
OWNER,
2219
REPO,
23-
ROOT_DIR,
2420
run,
2521
setVerbose,
2622
TODAY,
@@ -34,8 +30,6 @@ import type { Changelog, Commit, CommitType, ParsedCommit, Scope, Versions } fro
3430
import { updateAPIVersions } from './updateAPIVersions.ts';
3531
import { generateVersionsHistory } from './versionsHistory.ts';
3632

37-
dotenv.config({ path: path.resolve(ROOT_DIR, '.env') });
38-
3933
// python pre-releases have a pattern like `X.Y.ZaN` for alpha or `X.Y.ZbN` for beta
4034
// see https://peps.python.org/pep-0440/
4135
// It also support ruby pre-releases like `X.Y.Z.alpha.N` for alpha or `X.Y.Z.beta.N` for beta

templates/javascript/tests/e2e/e2e.mustache

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import { describe, test, expect } from 'vitest';
33

44
import { union } from '../helpers.js';
55

6-
import * as dotenv from 'dotenv';
7-
8-
dotenv.config({path:'../../.env'});
96
import { {{{clientName}}} } from '{{{importPackage}}}';
107
import type { RequestOptions } from '@algolia/client-common';
118

templates/javascript/tests/package.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
},
1414
"devDependencies": {
1515
"@types/node": "22.16.0",
16-
"dotenv": "17.0.1",
1716
"typescript": "5.8.3",
1817
"vitest": "3.2.4"
1918
}

tests/output/javascript/src/e2e/composition.test.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import path from 'path';
2+
import { loadEnv } from 'vite';
3+
import { defineConfig } from 'vitest/config';
4+
5+
export default defineConfig(({ mode }) => ({
6+
test: {
7+
env: loadEnv(mode, path.join(process.cwd(), '../../'), ''),
8+
},
9+
}));

0 commit comments

Comments
 (0)