arri 0.0.13 → 0.0.16

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.
Files changed (60) hide show
  1. package/dist/chunks/index.cjs +8839 -68
  2. package/dist/chunks/index.mjs +8820 -69
  3. package/dist/cli.cjs +16918 -50228
  4. package/dist/cli.mjs +16898 -50196
  5. package/dist/codegen.cjs +314 -37
  6. package/dist/codegen.d.cts +23 -15
  7. package/dist/codegen.d.mts +23 -15
  8. package/dist/codegen.d.ts +23 -15
  9. package/dist/codegen.mjs +280 -23
  10. package/dist/index.cjs +47 -19
  11. package/dist/index.d.cts +19 -2
  12. package/dist/index.d.mts +19 -2
  13. package/dist/index.d.ts +19 -2
  14. package/dist/index.mjs +30 -1
  15. package/dist/shared/arri.0671bb8c.mjs +641 -0
  16. package/dist/shared/arri.a9b80e98.cjs +655 -0
  17. package/dist/shared/{arri.2ff96786.d.ts → arri.b176bba1.d.cts} +113 -70
  18. package/dist/shared/{arri.2ff96786.d.cts → arri.b176bba1.d.mts} +113 -70
  19. package/dist/shared/{arri.2ff96786.d.mts → arri.b176bba1.d.ts} +113 -70
  20. package/dist/shared/arri.b2f4eb7d.cjs +851 -0
  21. package/dist/shared/arri.fd713b2e.mjs +812 -0
  22. package/package.json +6 -4
  23. package/dist/chunks/acorn.cjs +0 -18
  24. package/dist/chunks/acorn.mjs +0 -15
  25. package/dist/chunks/angular.cjs +0 -7
  26. package/dist/chunks/angular.mjs +0 -4
  27. package/dist/chunks/babel.cjs +0 -21
  28. package/dist/chunks/babel.mjs +0 -18
  29. package/dist/chunks/browser.cjs +0 -21
  30. package/dist/chunks/browser.mjs +0 -19
  31. package/dist/chunks/estree.cjs +0 -42
  32. package/dist/chunks/estree.mjs +0 -37
  33. package/dist/chunks/flow.cjs +0 -26
  34. package/dist/chunks/flow.mjs +0 -23
  35. package/dist/chunks/glimmer.cjs +0 -37
  36. package/dist/chunks/glimmer.mjs +0 -32
  37. package/dist/chunks/graphql.cjs +0 -37
  38. package/dist/chunks/graphql.mjs +0 -31
  39. package/dist/chunks/html.cjs +0 -27
  40. package/dist/chunks/html.mjs +0 -21
  41. package/dist/chunks/index2.cjs +0 -231
  42. package/dist/chunks/index2.mjs +0 -220
  43. package/dist/chunks/index3.cjs +0 -8854
  44. package/dist/chunks/index3.mjs +0 -8832
  45. package/dist/chunks/markdown.cjs +0 -67
  46. package/dist/chunks/markdown.mjs +0 -61
  47. package/dist/chunks/meriyah.cjs +0 -10
  48. package/dist/chunks/meriyah.mjs +0 -7
  49. package/dist/chunks/postcss.cjs +0 -60
  50. package/dist/chunks/postcss.mjs +0 -54
  51. package/dist/chunks/typescript.cjs +0 -30
  52. package/dist/chunks/typescript.mjs +0 -27
  53. package/dist/chunks/xdg-open.cjs +0 -1071
  54. package/dist/chunks/xdg-open.mjs +0 -1069
  55. package/dist/chunks/yaml.cjs +0 -169
  56. package/dist/chunks/yaml.mjs +0 -163
  57. package/dist/shared/arri.3605a96c.cjs +0 -8796
  58. package/dist/shared/arri.a90e77aa.mjs +0 -29680
  59. package/dist/shared/arri.b0ab6d2f.mjs +0 -8756
  60. package/dist/shared/arri.d31eb2d5.cjs +0 -29706
@@ -1,231 +0,0 @@
1
- 'use strict';
2
-
3
- const os = require('node:os');
4
- const fs = require('node:fs');
5
- const path = require('node:path');
6
- const https = require('node:https');
7
- const childProcess = require('node:child_process');
8
- const cli = require('../cli.cjs');
9
- require('node:tty');
10
- require('stream');
11
- require('../shared/arri.3605a96c.cjs');
12
- require('os');
13
- require('path');
14
- require('util');
15
- require('events');
16
- require('fs');
17
- require('node:process');
18
- require('node:url');
19
- require('node:stream');
20
- require('crypto');
21
- require('node:fs/promises');
22
- require('module');
23
- require('perf_hooks');
24
- require('vm');
25
- require('url');
26
- require('assert');
27
- require('process');
28
- require('v8');
29
- require('tty');
30
- require('node:module');
31
- require('node:assert');
32
- require('node:v8');
33
- require('node:util');
34
- require('../shared/arri.d31eb2d5.cjs');
35
- require('fs/promises');
36
- require('child_process');
37
- require('node:http');
38
- require('node:net');
39
- require('http');
40
- require('https');
41
-
42
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
43
-
44
- const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
45
- const path__default = /*#__PURE__*/_interopDefaultCompat(path);
46
- const https__default = /*#__PURE__*/_interopDefaultCompat(https);
47
-
48
- const CLOUDFLARED_VERSION = process.env.CLOUDFLARED_VERSION || "2023.7.3";
49
- const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
50
- const cloudflaredBinPath = cli.path.join(
51
- os.tmpdir(),
52
- "node-untun",
53
- process.platform === "win32" ? `cloudflared.${CLOUDFLARED_VERSION}.exe` : `cloudflared.${CLOUDFLARED_VERSION}`
54
- );
55
- const cloudflaredNotice = `
56
- \u{1F525} Your installation of cloudflared software constitutes a symbol of your signature
57
- indicating that you accept the terms of the Cloudflare License, Terms and Privacy Policy.
58
-
59
- \u276F License: \`https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/license/\`
60
- \u276F Terms: \`https://www.cloudflare.com/terms/\`
61
- \u276F Privacy Policy: \`https://www.cloudflare.com/privacypolicy/\`
62
- `;
63
- const connRegex = /connection[ =]([\da-z-]+)/i;
64
- const ipRegex = /ip=([\d.]+)/;
65
- const locationRegex = /location=([A-Z]+)/;
66
- const indexRegex = /connIndex=(\d)/;
67
-
68
- const LINUX_URL = {
69
- arm64: "cloudflared-linux-arm64",
70
- arm: "cloudflared-linux-arm",
71
- x64: "cloudflared-linux-amd64",
72
- ia32: "cloudflared-linux-386"
73
- };
74
- const MACOS_URL = {
75
- arm64: "cloudflared-darwin-amd64.tgz",
76
- x64: "cloudflared-darwin-amd64.tgz"
77
- };
78
- const WINDOWS_URL = {
79
- x64: "cloudflared-windows-amd64.exe",
80
- ia32: "cloudflared-windows-386.exe"
81
- };
82
- function resolveBase(version) {
83
- if (version === "latest") {
84
- return `${RELEASE_BASE}latest/download/`;
85
- }
86
- return `${RELEASE_BASE}download/${version}/`;
87
- }
88
- function installCloudflared(to = cloudflaredBinPath, version = CLOUDFLARED_VERSION) {
89
- switch (process.platform) {
90
- case "linux": {
91
- return installLinux(to, version);
92
- }
93
- case "darwin": {
94
- return installMacos(to, version);
95
- }
96
- case "win32": {
97
- return installWindows(to, version);
98
- }
99
- default: {
100
- throw new Error("Unsupported platform: " + process.platform);
101
- }
102
- }
103
- }
104
- async function installLinux(to, version = CLOUDFLARED_VERSION) {
105
- const file = LINUX_URL[process.arch];
106
- if (file === void 0) {
107
- throw new Error("Unsupported architecture: " + process.arch);
108
- }
109
- await download(resolveBase(version) + file, to);
110
- fs__default.chmodSync(to, "755");
111
- return to;
112
- }
113
- async function installMacos(to, version = CLOUDFLARED_VERSION) {
114
- const file = MACOS_URL[process.arch];
115
- if (file === void 0) {
116
- throw new Error("Unsupported architecture: " + process.arch);
117
- }
118
- await download(resolveBase(version) + file, `${to}.tgz`);
119
- process.env.DEBUG && console.log(`Extracting to ${to}`);
120
- childProcess.execSync(`tar -xzf ${path__default.basename(`${to}.tgz`)}`, { cwd: path__default.dirname(to) });
121
- fs__default.unlinkSync(`${to}.tgz`);
122
- fs__default.renameSync(`${path__default.dirname(to)}/cloudflared`, to);
123
- return to;
124
- }
125
- async function installWindows(to, version = CLOUDFLARED_VERSION) {
126
- const file = WINDOWS_URL[process.arch];
127
- if (file === void 0) {
128
- throw new Error("Unsupported architecture: " + process.arch);
129
- }
130
- await download(resolveBase(version) + file, to);
131
- return to;
132
- }
133
- function download(url, to, redirect = 0) {
134
- if (redirect === 0) {
135
- process.env.DEBUG && console.log(`Downloading ${url} to ${to}`);
136
- } else {
137
- process.env.DEBUG && console.log(`Redirecting to ${url}`);
138
- }
139
- return new Promise((resolve, reject) => {
140
- if (!fs__default.existsSync(path__default.dirname(to))) {
141
- fs__default.mkdirSync(path__default.dirname(to), { recursive: true });
142
- }
143
- let done = true;
144
- const file = fs__default.createWriteStream(to);
145
- const request = https__default.get(url, (res) => {
146
- if (res.statusCode === 302 && res.headers.location !== void 0) {
147
- const redirection = res.headers.location;
148
- done = false;
149
- file.close(() => resolve(download(redirection, to, redirect + 1)));
150
- return;
151
- }
152
- res.pipe(file);
153
- });
154
- file.on("finish", () => {
155
- if (done) {
156
- file.close(() => resolve(to));
157
- }
158
- });
159
- request.on("error", (err) => {
160
- fs__default.unlink(to, () => reject(err));
161
- });
162
- file.on("error", (err) => {
163
- fs__default.unlink(to, () => reject(err));
164
- });
165
- request.end();
166
- });
167
- }
168
-
169
- function startCloudflaredTunnel(options = {}) {
170
- const args = ["tunnel"];
171
- for (const [key, value] of Object.entries(options)) {
172
- if (typeof value === "string") {
173
- args.push(`${key}`, value);
174
- } else if (typeof value === "number") {
175
- args.push(`${key}`, value.toString());
176
- } else if (value === null) {
177
- args.push(`${key}`);
178
- }
179
- }
180
- if (args.length === 1) {
181
- args.push("--url", "localhost:8080");
182
- }
183
- const child = childProcess.spawn(cloudflaredBinPath, args, {
184
- stdio: ["ignore", "pipe", "pipe"]
185
- });
186
- if (process.env.DEBUG) {
187
- child.stdout.pipe(process.stdout);
188
- child.stderr.pipe(process.stderr);
189
- }
190
- const urlRegex = /\|\s+(https?:\/\/\S+)/;
191
- let urlResolver = () => void 0;
192
- let urlRejector = () => void 0;
193
- const url = new Promise(
194
- (...pair) => [urlResolver, urlRejector] = pair
195
- );
196
- const connectionResolvers = [];
197
- const connectionRejectors = [];
198
- const connections = [];
199
- for (let i = 0; i < 1; i++) {
200
- connections.push(
201
- new Promise(
202
- (...pair) => [connectionResolvers[i], connectionRejectors[i]] = pair
203
- )
204
- );
205
- }
206
- const parser = (data) => {
207
- const str = data.toString();
208
- const urlMatch = str.match(urlRegex);
209
- urlMatch && urlResolver(urlMatch[1]);
210
- const connMatch = str.match(connRegex);
211
- const ipMatch = str.match(ipRegex);
212
- const locationMatch = str.match(locationRegex);
213
- const indexMatch = str.match(indexRegex);
214
- if (connMatch && ipMatch && locationMatch && indexMatch) {
215
- const [, id] = connMatch;
216
- const [, ip] = ipMatch;
217
- const [, location] = locationMatch;
218
- const [, idx] = indexMatch;
219
- connectionResolvers[+idx]?.({ id, ip, location });
220
- }
221
- };
222
- child.stdout.on("data", parser).on("error", urlRejector);
223
- child.stderr.on("data", parser).on("error", urlRejector);
224
- const stop = () => child.kill("SIGINT");
225
- return { url, connections, child, stop };
226
- }
227
-
228
- exports.cloudflaredBinPath = cloudflaredBinPath;
229
- exports.cloudflaredNotice = cloudflaredNotice;
230
- exports.installCloudflared = installCloudflared;
231
- exports.startCloudflaredTunnel = startCloudflaredTunnel;
@@ -1,220 +0,0 @@
1
- import { tmpdir } from 'node:os';
2
- import fs from 'node:fs';
3
- import path$1 from 'node:path';
4
- import https from 'node:https';
5
- import { execSync, spawn } from 'node:child_process';
6
- import { p as path } from '../cli.mjs';
7
- import 'node:tty';
8
- import 'stream';
9
- import '../shared/arri.b0ab6d2f.mjs';
10
- import 'os';
11
- import 'path';
12
- import 'util';
13
- import 'events';
14
- import 'fs';
15
- import 'node:process';
16
- import 'node:url';
17
- import 'node:stream';
18
- import 'crypto';
19
- import 'node:fs/promises';
20
- import 'module';
21
- import 'perf_hooks';
22
- import 'vm';
23
- import 'url';
24
- import 'assert';
25
- import 'process';
26
- import 'v8';
27
- import 'tty';
28
- import 'node:module';
29
- import 'node:assert';
30
- import 'node:v8';
31
- import 'node:util';
32
- import '../shared/arri.a90e77aa.mjs';
33
- import 'fs/promises';
34
- import 'child_process';
35
- import 'node:http';
36
- import 'node:net';
37
- import 'http';
38
- import 'https';
39
-
40
- const CLOUDFLARED_VERSION = process.env.CLOUDFLARED_VERSION || "2023.7.3";
41
- const RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
42
- const cloudflaredBinPath = path.join(
43
- tmpdir(),
44
- "node-untun",
45
- process.platform === "win32" ? `cloudflared.${CLOUDFLARED_VERSION}.exe` : `cloudflared.${CLOUDFLARED_VERSION}`
46
- );
47
- const cloudflaredNotice = `
48
- \u{1F525} Your installation of cloudflared software constitutes a symbol of your signature
49
- indicating that you accept the terms of the Cloudflare License, Terms and Privacy Policy.
50
-
51
- \u276F License: \`https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/license/\`
52
- \u276F Terms: \`https://www.cloudflare.com/terms/\`
53
- \u276F Privacy Policy: \`https://www.cloudflare.com/privacypolicy/\`
54
- `;
55
- const connRegex = /connection[ =]([\da-z-]+)/i;
56
- const ipRegex = /ip=([\d.]+)/;
57
- const locationRegex = /location=([A-Z]+)/;
58
- const indexRegex = /connIndex=(\d)/;
59
-
60
- const LINUX_URL = {
61
- arm64: "cloudflared-linux-arm64",
62
- arm: "cloudflared-linux-arm",
63
- x64: "cloudflared-linux-amd64",
64
- ia32: "cloudflared-linux-386"
65
- };
66
- const MACOS_URL = {
67
- arm64: "cloudflared-darwin-amd64.tgz",
68
- x64: "cloudflared-darwin-amd64.tgz"
69
- };
70
- const WINDOWS_URL = {
71
- x64: "cloudflared-windows-amd64.exe",
72
- ia32: "cloudflared-windows-386.exe"
73
- };
74
- function resolveBase(version) {
75
- if (version === "latest") {
76
- return `${RELEASE_BASE}latest/download/`;
77
- }
78
- return `${RELEASE_BASE}download/${version}/`;
79
- }
80
- function installCloudflared(to = cloudflaredBinPath, version = CLOUDFLARED_VERSION) {
81
- switch (process.platform) {
82
- case "linux": {
83
- return installLinux(to, version);
84
- }
85
- case "darwin": {
86
- return installMacos(to, version);
87
- }
88
- case "win32": {
89
- return installWindows(to, version);
90
- }
91
- default: {
92
- throw new Error("Unsupported platform: " + process.platform);
93
- }
94
- }
95
- }
96
- async function installLinux(to, version = CLOUDFLARED_VERSION) {
97
- const file = LINUX_URL[process.arch];
98
- if (file === void 0) {
99
- throw new Error("Unsupported architecture: " + process.arch);
100
- }
101
- await download(resolveBase(version) + file, to);
102
- fs.chmodSync(to, "755");
103
- return to;
104
- }
105
- async function installMacos(to, version = CLOUDFLARED_VERSION) {
106
- const file = MACOS_URL[process.arch];
107
- if (file === void 0) {
108
- throw new Error("Unsupported architecture: " + process.arch);
109
- }
110
- await download(resolveBase(version) + file, `${to}.tgz`);
111
- process.env.DEBUG && console.log(`Extracting to ${to}`);
112
- execSync(`tar -xzf ${path$1.basename(`${to}.tgz`)}`, { cwd: path$1.dirname(to) });
113
- fs.unlinkSync(`${to}.tgz`);
114
- fs.renameSync(`${path$1.dirname(to)}/cloudflared`, to);
115
- return to;
116
- }
117
- async function installWindows(to, version = CLOUDFLARED_VERSION) {
118
- const file = WINDOWS_URL[process.arch];
119
- if (file === void 0) {
120
- throw new Error("Unsupported architecture: " + process.arch);
121
- }
122
- await download(resolveBase(version) + file, to);
123
- return to;
124
- }
125
- function download(url, to, redirect = 0) {
126
- if (redirect === 0) {
127
- process.env.DEBUG && console.log(`Downloading ${url} to ${to}`);
128
- } else {
129
- process.env.DEBUG && console.log(`Redirecting to ${url}`);
130
- }
131
- return new Promise((resolve, reject) => {
132
- if (!fs.existsSync(path$1.dirname(to))) {
133
- fs.mkdirSync(path$1.dirname(to), { recursive: true });
134
- }
135
- let done = true;
136
- const file = fs.createWriteStream(to);
137
- const request = https.get(url, (res) => {
138
- if (res.statusCode === 302 && res.headers.location !== void 0) {
139
- const redirection = res.headers.location;
140
- done = false;
141
- file.close(() => resolve(download(redirection, to, redirect + 1)));
142
- return;
143
- }
144
- res.pipe(file);
145
- });
146
- file.on("finish", () => {
147
- if (done) {
148
- file.close(() => resolve(to));
149
- }
150
- });
151
- request.on("error", (err) => {
152
- fs.unlink(to, () => reject(err));
153
- });
154
- file.on("error", (err) => {
155
- fs.unlink(to, () => reject(err));
156
- });
157
- request.end();
158
- });
159
- }
160
-
161
- function startCloudflaredTunnel(options = {}) {
162
- const args = ["tunnel"];
163
- for (const [key, value] of Object.entries(options)) {
164
- if (typeof value === "string") {
165
- args.push(`${key}`, value);
166
- } else if (typeof value === "number") {
167
- args.push(`${key}`, value.toString());
168
- } else if (value === null) {
169
- args.push(`${key}`);
170
- }
171
- }
172
- if (args.length === 1) {
173
- args.push("--url", "localhost:8080");
174
- }
175
- const child = spawn(cloudflaredBinPath, args, {
176
- stdio: ["ignore", "pipe", "pipe"]
177
- });
178
- if (process.env.DEBUG) {
179
- child.stdout.pipe(process.stdout);
180
- child.stderr.pipe(process.stderr);
181
- }
182
- const urlRegex = /\|\s+(https?:\/\/\S+)/;
183
- let urlResolver = () => void 0;
184
- let urlRejector = () => void 0;
185
- const url = new Promise(
186
- (...pair) => [urlResolver, urlRejector] = pair
187
- );
188
- const connectionResolvers = [];
189
- const connectionRejectors = [];
190
- const connections = [];
191
- for (let i = 0; i < 1; i++) {
192
- connections.push(
193
- new Promise(
194
- (...pair) => [connectionResolvers[i], connectionRejectors[i]] = pair
195
- )
196
- );
197
- }
198
- const parser = (data) => {
199
- const str = data.toString();
200
- const urlMatch = str.match(urlRegex);
201
- urlMatch && urlResolver(urlMatch[1]);
202
- const connMatch = str.match(connRegex);
203
- const ipMatch = str.match(ipRegex);
204
- const locationMatch = str.match(locationRegex);
205
- const indexMatch = str.match(indexRegex);
206
- if (connMatch && ipMatch && locationMatch && indexMatch) {
207
- const [, id] = connMatch;
208
- const [, ip] = ipMatch;
209
- const [, location] = locationMatch;
210
- const [, idx] = indexMatch;
211
- connectionResolvers[+idx]?.({ id, ip, location });
212
- }
213
- };
214
- child.stdout.on("data", parser).on("error", urlRejector);
215
- child.stderr.on("data", parser).on("error", urlRejector);
216
- const stop = () => child.kill("SIGINT");
217
- return { url, connections, child, stop };
218
- }
219
-
220
- export { cloudflaredBinPath, cloudflaredNotice, installCloudflared, startCloudflaredTunnel };