From 0b690dedac51285a165321f125a2c1a83af2e323 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 13:19:09 -0300 Subject: [PATCH 01/14] Update detsys-ts --- dist/index.js | 1240 ++++++++++++++++++++++++++++++++---------------- package.json | 4 +- pnpm-lock.yaml | 372 ++++++++------- src/index.ts | 73 ++- 4 files changed, 1060 insertions(+), 629 deletions(-) diff --git a/dist/index.js b/dist/index.js index aa83945..3751b01 100644 --- a/dist/index.js +++ b/dist/index.js @@ -796,7 +796,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.downloadCacheStorageSDK = exports.downloadCacheHttpClientConcurrent = exports.downloadCacheHttpClient = exports.DownloadProgress = void 0; const core = __importStar(__nccwpck_require__(9093)); const http_client_1 = __nccwpck_require__(6372); -const storage_blob_1 = __nccwpck_require__(5542); +const storage_blob_1 = __nccwpck_require__(4883); const buffer = __importStar(__nccwpck_require__(4300)); const fs = __importStar(__nccwpck_require__(7147)); const stream = __importStar(__nccwpck_require__(2781)); @@ -11923,7 +11923,7 @@ exports.setSpanContext = setSpanContext; /***/ }), -/***/ 5542: +/***/ 4883: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -20435,7 +20435,7 @@ const timeoutInSeconds = { const version = { parameterPath: "version", mapper: { - defaultValue: "2023-11-03", + defaultValue: "2024-05-04", isConstant: true, serializedName: "x-ms-version", type: { @@ -25266,8 +25266,8 @@ const logger = logger$1.createClientLogger("storage-blob"); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -const SDK_VERSION = "12.17.0"; -const SERVICE_VERSION = "2023-11-03"; +const SDK_VERSION = "12.18.0"; +const SERVICE_VERSION = "2024-05-04"; const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB const BLOCK_BLOB_MAX_BLOCKS = 50000; @@ -27127,7 +27127,7 @@ class StorageSharedKeyCredential extends Credential { * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ const packageName = "azure-storage-blob"; -const packageVersion = "12.17.0"; +const packageVersion = "12.18.0"; class StorageClientContext extends coreHttp__namespace.ServiceClient { /** * Initializes a new instance of the StorageClientContext class. @@ -27153,7 +27153,7 @@ class StorageClientContext extends coreHttp__namespace.ServiceClient { // Parameter assignments this.url = url; // Assigning values to Constant parameters - this.version = options.version || "2023-11-03"; + this.version = options.version || "2024-05-04"; } } @@ -43993,133 +43993,6 @@ module.exports = function(dst, src) { }; -/***/ }), - -/***/ 1210: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -const {PassThrough: PassThroughStream} = __nccwpck_require__(2781); - -module.exports = options => { - options = {...options}; - - const {array} = options; - let {encoding} = options; - const isBuffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || isBuffer); - } else { - encoding = encoding || 'utf8'; - } - - if (isBuffer) { - encoding = null; - } - - const stream = new PassThroughStream({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - let length = 0; - const chunks = []; - - stream.on('data', chunk => { - chunks.push(chunk); - - if (objectMode) { - length = chunks.length; - } else { - length += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return chunks; - } - - return isBuffer ? Buffer.concat(chunks, length) : chunks.join(''); - }; - - stream.getBufferedLength = () => length; - - return stream; -}; - - -/***/ }), - -/***/ 1798: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - - -const {constants: BufferConstants} = __nccwpck_require__(4300); -const stream = __nccwpck_require__(2781); -const {promisify} = __nccwpck_require__(3837); -const bufferStream = __nccwpck_require__(1210); - -const streamPipelinePromisified = promisify(stream.pipeline); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -async function getStream(inputStream, options) { - if (!inputStream) { - throw new Error('Expected a stream'); - } - - options = { - maxBuffer: Infinity, - ...options - }; - - const {maxBuffer} = options; - const stream = bufferStream(options); - - await new Promise((resolve, reject) => { - const rejectPromise = error => { - // Don't retrieve an oversized buffer. - if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) { - error.bufferedData = stream.getBufferedValue(); - } - - reject(error); - }; - - (async () => { - try { - await streamPipelinePromisified(inputStream, stream); - resolve(); - } catch (error) { - rejectPromise(error); - } - })(); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }); - - return stream.getBufferedValue(); -} - -module.exports = getStream; -module.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'}); -module.exports.array = (stream, options) => getStream(stream, {...options, array: true}); -module.exports.MaxBufferError = MaxBufferError; - - /***/ }), /***/ 7893: @@ -89427,7 +89300,7 @@ var external_os_ = __nccwpck_require__(2037); const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto"); // EXTERNAL MODULE: ./node_modules/.pnpm/@actions+cache@3.2.4/node_modules/@actions/cache/lib/cache.js var cache = __nccwpck_require__(6878); -;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.3.0/node_modules/@sindresorhus/is/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.3.1/node_modules/@sindresorhus/is/dist/index.js const typedArrayTypeNames = [ 'Int8Array', 'Uint8Array', @@ -90858,7 +90731,7 @@ class PCancelable { Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/errors.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/errors.js // A hacky check to prevent circular references. function isRequest(x) { @@ -91410,8 +91283,449 @@ function normalizeUrl(urlString, options) { return urlString; } -// EXTERNAL MODULE: ./node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js -var get_stream = __nccwpck_require__(1798); +;// CONCATENATED MODULE: ./node_modules/.pnpm/is-stream@4.0.1/node_modules/is-stream/index.js +function isStream(stream, {checkOpen = true} = {}) { + return stream !== null + && typeof stream === 'object' + && (stream.writable || stream.readable || !checkOpen || (stream.writable === undefined && stream.readable === undefined)) + && typeof stream.pipe === 'function'; +} + +function isWritableStream(stream, {checkOpen = true} = {}) { + return isStream(stream, {checkOpen}) + && (stream.writable || !checkOpen) + && typeof stream.write === 'function' + && typeof stream.end === 'function' + && typeof stream.writable === 'boolean' + && typeof stream.writableObjectMode === 'boolean' + && typeof stream.destroy === 'function' + && typeof stream.destroyed === 'boolean'; +} + +function isReadableStream(stream, {checkOpen = true} = {}) { + return isStream(stream, {checkOpen}) + && (stream.readable || !checkOpen) + && typeof stream.read === 'function' + && typeof stream.readable === 'boolean' + && typeof stream.readableObjectMode === 'boolean' + && typeof stream.destroy === 'function' + && typeof stream.destroyed === 'boolean'; +} + +function isDuplexStream(stream, options) { + return isWritableStream(stream, options) + && isReadableStream(stream, options); +} + +function isTransformStream(stream, options) { + return isDuplexStream(stream, options) + && typeof stream._transform === 'function'; +} + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@sec-ant+readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js +const a = Object.getPrototypeOf( + Object.getPrototypeOf( + /* istanbul ignore next */ + async function* () { + } + ).prototype +); +class c { + #t; + #n; + #r = !1; + #e = void 0; + constructor(e, t) { + this.#t = e, this.#n = t; + } + next() { + const e = () => this.#s(); + return this.#e = this.#e ? this.#e.then(e, e) : e(), this.#e; + } + return(e) { + const t = () => this.#i(e); + return this.#e ? this.#e.then(t, t) : t(); + } + async #s() { + if (this.#r) + return { + done: !0, + value: void 0 + }; + let e; + try { + e = await this.#t.read(); + } catch (t) { + throw this.#e = void 0, this.#r = !0, this.#t.releaseLock(), t; + } + return e.done && (this.#e = void 0, this.#r = !0, this.#t.releaseLock()), e; + } + async #i(e) { + if (this.#r) + return { + done: !0, + value: e + }; + if (this.#r = !0, !this.#n) { + const t = this.#t.cancel(e); + return this.#t.releaseLock(), await t, { + done: !0, + value: e + }; + } + return this.#t.releaseLock(), { + done: !0, + value: e + }; + } +} +const n = Symbol(); +function i() { + return this[n].next(); +} +Object.defineProperty(i, "name", { value: "next" }); +function o(r) { + return this[n].return(r); +} +Object.defineProperty(o, "name", { value: "return" }); +const u = Object.create(a, { + next: { + enumerable: !0, + configurable: !0, + writable: !0, + value: i + }, + return: { + enumerable: !0, + configurable: !0, + writable: !0, + value: o + } +}); +function h({ preventCancel: r = !1 } = {}) { + const e = this.getReader(), t = new c( + e, + r + ), s = Object.create(u); + return s[n] = t, s; +} + + +;// CONCATENATED MODULE: ./node_modules/.pnpm/@sec-ant+readable-stream@0.4.1/node_modules/@sec-ant/readable-stream/dist/ponyfill/index.js + + + + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/stream.js + + + +const getAsyncIterable = stream => { + if (isReadableStream(stream, {checkOpen: false}) && nodeImports.on !== undefined) { + return getStreamIterable(stream); + } + + if (typeof stream?.[Symbol.asyncIterator] === 'function') { + return stream; + } + + // `ReadableStream[Symbol.asyncIterator]` support is missing in multiple browsers, so we ponyfill it + if (stream_toString.call(stream) === '[object ReadableStream]') { + return h.call(stream); + } + + throw new TypeError('The first argument must be a Readable, a ReadableStream, or an async iterable.'); +}; + +const {toString: stream_toString} = Object.prototype; + +// The default iterable for Node.js streams does not allow for multiple readers at once, so we re-implement it +const getStreamIterable = async function * (stream) { + const controller = new AbortController(); + const state = {}; + handleStreamEnd(stream, controller, state); + + try { + for await (const [chunk] of nodeImports.on(stream, 'data', {signal: controller.signal})) { + yield chunk; + } + } catch (error) { + // Stream failure, for example due to `stream.destroy(error)` + if (state.error !== undefined) { + throw state.error; + // `error` event directly emitted on stream + } else if (!controller.signal.aborted) { + throw error; + // Otherwise, stream completed successfully + } + // The `finally` block also runs when the caller throws, for example due to the `maxBuffer` option + } finally { + stream.destroy(); + } +}; + +const handleStreamEnd = async (stream, controller, state) => { + try { + await nodeImports.finished(stream, { + cleanup: true, + readable: true, + writable: false, + error: false, + }); + } catch (error) { + state.error = error; + } finally { + controller.abort(); + } +}; + +// Loaded by the Node entrypoint, but not by the browser one. +// This prevents using dynamic imports. +const nodeImports = {}; + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/contents.js + + +const contents_getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => { + const asyncIterable = getAsyncIterable(stream); + + const state = init(); + state.length = 0; + + try { + for await (const chunk of asyncIterable) { + const chunkType = getChunkType(chunk); + const convertedChunk = convertChunk[chunkType](chunk, state); + appendChunk({ + convertedChunk, + state, + getSize, + truncateChunk, + addChunk, + maxBuffer, + }); + } + + appendFinalChunk({ + state, + convertChunk, + getSize, + truncateChunk, + addChunk, + getFinalChunk, + maxBuffer, + }); + return finalize(state); + } catch (error) { + const normalizedError = typeof error === 'object' && error !== null ? error : new Error(error); + normalizedError.bufferedData = finalize(state); + throw normalizedError; + } +}; + +const appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => { + const convertedChunk = getFinalChunk(state); + if (convertedChunk !== undefined) { + appendChunk({ + convertedChunk, + state, + getSize, + truncateChunk, + addChunk, + maxBuffer, + }); + } +}; + +const appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => { + const chunkSize = getSize(convertedChunk); + const newLength = state.length + chunkSize; + + if (newLength <= maxBuffer) { + addNewChunk(convertedChunk, state, addChunk, newLength); + return; + } + + const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length); + + if (truncatedChunk !== undefined) { + addNewChunk(truncatedChunk, state, addChunk, maxBuffer); + } + + throw new MaxBufferError(); +}; + +const addNewChunk = (convertedChunk, state, addChunk, newLength) => { + state.contents = addChunk(convertedChunk, state, newLength); + state.length = newLength; +}; + +const getChunkType = chunk => { + const typeOfChunk = typeof chunk; + + if (typeOfChunk === 'string') { + return 'string'; + } + + if (typeOfChunk !== 'object' || chunk === null) { + return 'others'; + } + + if (globalThis.Buffer?.isBuffer(chunk)) { + return 'buffer'; + } + + const prototypeName = objectToString.call(chunk); + + if (prototypeName === '[object ArrayBuffer]') { + return 'arrayBuffer'; + } + + if (prototypeName === '[object DataView]') { + return 'dataView'; + } + + if ( + Number.isInteger(chunk.byteLength) + && Number.isInteger(chunk.byteOffset) + && objectToString.call(chunk.buffer) === '[object ArrayBuffer]' + ) { + return 'typedArray'; + } + + return 'others'; +}; + +const {toString: objectToString} = Object.prototype; + +class MaxBufferError extends Error { + name = 'MaxBufferError'; + + constructor() { + super('maxBuffer exceeded'); + } +} + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/utils.js +const identity = value => value; + +const noop = () => undefined; + +const getContentsProperty = ({contents}) => contents; + +const throwObjectStream = chunk => { + throw new Error(`Streams in object mode are not supported: ${String(chunk)}`); +}; + +const getLengthProperty = convertedChunk => convertedChunk.length; + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/array-buffer.js + + + +async function getStreamAsArrayBuffer(stream, options) { + return contents_getStreamContents(stream, arrayBufferMethods, options); +} + +const initArrayBuffer = () => ({contents: new ArrayBuffer(0)}); + +const useTextEncoder = chunk => textEncoder.encode(chunk); +const textEncoder = new TextEncoder(); + +const useUint8Array = chunk => new Uint8Array(chunk); + +const useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); + +const truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); + +// `contents` is an increasingly growing `Uint8Array`. +const addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => { + const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length); + new Uint8Array(newContents).set(convertedChunk, previousLength); + return newContents; +}; + +// Without `ArrayBuffer.resize()`, `contents` size is always a power of 2. +// This means its last bytes are zeroes (not stream data), which need to be +// trimmed at the end with `ArrayBuffer.slice()`. +const resizeArrayBufferSlow = (contents, length) => { + if (length <= contents.byteLength) { + return contents; + } + + const arrayBuffer = new ArrayBuffer(getNewContentsLength(length)); + new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); + return arrayBuffer; +}; + +// With `ArrayBuffer.resize()`, `contents` size matches exactly the size of +// the stream data. It does not include extraneous zeroes to trim at the end. +// The underlying `ArrayBuffer` does allocate a number of bytes that is a power +// of 2, but those bytes are only visible after calling `ArrayBuffer.resize()`. +const resizeArrayBuffer = (contents, length) => { + if (length <= contents.maxByteLength) { + contents.resize(length); + return contents; + } + + const arrayBuffer = new ArrayBuffer(length, {maxByteLength: getNewContentsLength(length)}); + new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); + return arrayBuffer; +}; + +// Retrieve the closest `length` that is both >= and a power of 2 +const getNewContentsLength = length => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)); + +const SCALE_FACTOR = 2; + +const finalizeArrayBuffer = ({contents, length}) => hasArrayBufferResize() ? contents : contents.slice(0, length); + +// `ArrayBuffer.slice()` is slow. When `ArrayBuffer.resize()` is available +// (Node >=20.0.0, Safari >=16.4 and Chrome), we can use it instead. +// eslint-disable-next-line no-warning-comments +// TODO: remove after dropping support for Node 20. +// eslint-disable-next-line no-warning-comments +// TODO: use `ArrayBuffer.transferToFixedLength()` instead once it is available +const hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype; + +const arrayBufferMethods = { + init: initArrayBuffer, + convertChunk: { + string: useTextEncoder, + buffer: useUint8Array, + arrayBuffer: useUint8Array, + dataView: useUint8ArrayWithOffset, + typedArray: useUint8ArrayWithOffset, + others: throwObjectStream, + }, + getSize: getLengthProperty, + truncateChunk: truncateArrayBufferChunk, + addChunk: addArrayBufferChunk, + getFinalChunk: noop, + finalize: finalizeArrayBuffer, +}; + +;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@9.0.1/node_modules/get-stream/source/buffer.js + + +async function getStreamAsBuffer(stream, options) { + if (!('Buffer' in globalThis)) { + throw new Error('getStreamAsBuffer() is only supported in Node.js'); + } + + try { + return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options)); + } catch (error) { + if (error.bufferedData !== undefined) { + error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData); + } + + throw error; + } +} + +const arrayBufferToNodeBuffer = arrayBuffer => globalThis.Buffer.from(arrayBuffer); + // EXTERNAL MODULE: ./node_modules/.pnpm/http-cache-semantics@4.1.1/node_modules/http-cache-semantics/index.js var http_cache_semantics = __nccwpck_require__(7893); ;// CONCATENATED MODULE: ./node_modules/.pnpm/lowercase-keys@3.0.0/node_modules/lowercase-keys/index.js @@ -91539,7 +91853,7 @@ function mimicResponse(fromStream, toStream) { return toStream; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/cacheable-request@10.2.14/node_modules/cacheable-request/dist/types.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/cacheable-request@12.0.1/node_modules/cacheable-request/dist/types.js // Type definitions for cacheable-request 6.0 // Project: https://github.com/lukechilds/cacheable-request#readme // Definitions by: BendingBender @@ -91559,7 +91873,7 @@ class types_CacheError extends Error { } } //# sourceMappingURL=types.js.map -;// CONCATENATED MODULE: ./node_modules/.pnpm/cacheable-request@10.2.14/node_modules/cacheable-request/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/cacheable-request@12.0.1/node_modules/cacheable-request/dist/index.js @@ -91574,7 +91888,7 @@ class types_CacheError extends Error { class CacheableRequest { constructor(cacheRequest, cacheAdapter) { this.hooks = new Map(); - this.request = () => (options, cb) => { + this.request = () => (options, callback) => { let url; if (typeof options === 'string') { url = normalizeUrlObject(external_node_url_namespaceObject.parse(options)); @@ -91603,7 +91917,7 @@ class CacheableRequest { options.headers = Object.fromEntries(entries(options.headers).map(([key, value]) => [key.toLowerCase(), value])); const ee = new external_node_events_(); const normalizedUrlString = normalizeUrl(external_node_url_namespaceObject.format(url), { - stripWWW: false, + stripWWW: false, // eslint-disable-line @typescript-eslint/naming-convention removeTrailingSlash: false, stripAuthentication: false, }); @@ -91648,7 +91962,9 @@ class CacheableRequest { .once('end', resolve); }); const headers = convertHeaders(revalidatedPolicy.policy.responseHeaders()); - response = new Response({ statusCode: revalidate.statusCode, headers, body: revalidate.body, url: revalidate.url }); + response = new Response({ + statusCode: revalidate.statusCode, headers, body: revalidate.body, url: revalidate.url, + }); response.cachePolicy = revalidatedPolicy.policy; response.fromCache = true; } @@ -91662,10 +91978,10 @@ class CacheableRequest { clonedResponse = cloneResponse(response); (async () => { try { - const bodyPromise = get_stream.buffer(response); + const bodyPromise = getStreamAsBuffer(response); await Promise.race([ requestErrorPromise, - new Promise(resolve => response.once('end', resolve)), + new Promise(resolve => response.once('end', resolve)), // eslint-disable-line no-promise-executor-return new Promise(resolve => response.once('close', resolve)), // eslint-disable-line no-promise-executor-return ]); const body = await bodyPromise; @@ -91704,8 +92020,8 @@ class CacheableRequest { })(); } ee.emit('response', clonedResponse ?? response); - if (typeof cb === 'function') { - cb(clonedResponse ?? response); + if (typeof callback === 'function') { + callback(clonedResponse ?? response); } }; try { @@ -91730,12 +92046,14 @@ class CacheableRequest { const policy = http_cache_semantics.fromObject(cacheEntry.cachePolicy); if (policy.satisfiesWithoutRevalidation(options_) && !options_.forceRefresh) { const headers = convertHeaders(policy.responseHeaders()); - const response = new Response({ statusCode: cacheEntry.statusCode, headers, body: cacheEntry.body, url: cacheEntry.url }); + const response = new Response({ + statusCode: cacheEntry.statusCode, headers, body: cacheEntry.body, url: cacheEntry.url, + }); response.cachePolicy = policy; response.fromCache = true; ee.emit('response', response); - if (typeof cb === 'function') { - cb(response); + if (typeof callback === 'function') { + callback(response); } } else if (policy.satisfiesWithoutRevalidation(options_) && Date.now() >= policy.timeToLive() && options_.forceRefresh) { @@ -91768,14 +92086,14 @@ class CacheableRequest { })(); return ee; }; - this.addHook = (name, fn) => { + this.addHook = (name, function_) => { if (!this.hooks.has(name)) { - this.hooks.set(name, fn); + this.hooks.set(name, function_); } }; this.removeHook = (name) => this.hooks.delete(name); this.getHook = (name) => this.hooks.get(name); - this.runHook = async (name, ...args) => this.hooks.get(name)?.(...args); + this.runHook = async (name, ...arguments_) => this.hooks.get(name)?.(...arguments_); if (cacheAdapter instanceof src) { this.cache = cacheAdapter; } @@ -91838,7 +92156,7 @@ const onResponse = 'onResponse'; // EXTERNAL MODULE: ./node_modules/.pnpm/decompress-response@6.0.0/node_modules/decompress-response/index.js var decompress_response = __nccwpck_require__(7748); ;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js -const contents_getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => { +const source_contents_getStreamContents = async (stream, {init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize}, {maxBuffer = Number.POSITIVE_INFINITY} = {}) => { if (!contents_isAsyncIterable(stream)) { throw new Error('The first argument must be a Readable, a ReadableStream, or an async iterable.'); } @@ -91848,12 +92166,12 @@ const contents_getStreamContents = async (stream, {init, convertChunk, getSize, try { for await (const chunk of stream) { - const chunkType = getChunkType(chunk); + const chunkType = contents_getChunkType(chunk); const convertedChunk = convertChunk[chunkType](chunk, state); - appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); + contents_appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); } - appendFinalChunk({state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}); + contents_appendFinalChunk({state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}); return finalize(state); } catch (error) { error.bufferedData = finalize(state); @@ -91861,39 +92179,39 @@ const contents_getStreamContents = async (stream, {init, convertChunk, getSize, } }; -const appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => { +const contents_appendFinalChunk = ({state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer}) => { const convertedChunk = getFinalChunk(state); if (convertedChunk !== undefined) { - appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); + contents_appendChunk({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}); } }; -const appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => { +const contents_appendChunk = ({convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer}) => { const chunkSize = getSize(convertedChunk); const newLength = state.length + chunkSize; if (newLength <= maxBuffer) { - addNewChunk(convertedChunk, state, addChunk, newLength); + contents_addNewChunk(convertedChunk, state, addChunk, newLength); return; } const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length); if (truncatedChunk !== undefined) { - addNewChunk(truncatedChunk, state, addChunk, maxBuffer); + contents_addNewChunk(truncatedChunk, state, addChunk, maxBuffer); } - throw new MaxBufferError(); + throw new contents_MaxBufferError(); }; -const addNewChunk = (convertedChunk, state, addChunk, newLength) => { +const contents_addNewChunk = (convertedChunk, state, addChunk, newLength) => { state.contents = addChunk(convertedChunk, state, newLength); state.length = newLength; }; const contents_isAsyncIterable = stream => typeof stream === 'object' && stream !== null && typeof stream[Symbol.asyncIterator] === 'function'; -const getChunkType = chunk => { +const contents_getChunkType = chunk => { const typeOfChunk = typeof chunk; if (typeOfChunk === 'string') { @@ -91909,7 +92227,7 @@ const getChunkType = chunk => { return 'buffer'; } - const prototypeName = objectToString.call(chunk); + const prototypeName = contents_objectToString.call(chunk); if (prototypeName === '[object ArrayBuffer]') { return 'arrayBuffer'; @@ -91922,7 +92240,7 @@ const getChunkType = chunk => { if ( Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) - && objectToString.call(chunk.buffer) === '[object ArrayBuffer]' + && contents_objectToString.call(chunk.buffer) === '[object ArrayBuffer]' ) { return 'typedArray'; } @@ -91930,9 +92248,9 @@ const getChunkType = chunk => { return 'others'; }; -const {toString: objectToString} = Object.prototype; +const {toString: contents_objectToString} = Object.prototype; -class MaxBufferError extends Error { +class contents_MaxBufferError extends Error { name = 'MaxBufferError'; constructor() { @@ -91941,13 +92259,13 @@ class MaxBufferError extends Error { } ;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js -const identity = value => value; +const utils_identity = value => value; -const noop = () => undefined; +const utils_noop = () => undefined; const getContentsProp = ({contents}) => contents; -const throwObjectStream = chunk => { +const utils_throwObjectStream = chunk => { throw new Error(`Streams in object mode are not supported: ${String(chunk)}`); }; @@ -91973,17 +92291,17 @@ const addArrayChunk = (convertedChunk, {contents}) => { const arrayMethods = { init: initArray, convertChunk: { - string: identity, - buffer: identity, - arrayBuffer: identity, - dataView: identity, - typedArray: identity, - others: identity, + string: utils_identity, + buffer: utils_identity, + arrayBuffer: utils_identity, + dataView: utils_identity, + typedArray: utils_identity, + others: utils_identity, }, getSize: increment, - truncateChunk: noop, + truncateChunk: utils_noop, addChunk: addArrayChunk, - getFinalChunk: noop, + getFinalChunk: utils_noop, finalize: getContentsProp, }; @@ -91991,24 +92309,24 @@ const arrayMethods = { -async function getStreamAsArrayBuffer(stream, options) { - return contents_getStreamContents(stream, arrayBufferMethods, options); +async function array_buffer_getStreamAsArrayBuffer(stream, options) { + return source_contents_getStreamContents(stream, array_buffer_arrayBufferMethods, options); } -const initArrayBuffer = () => ({contents: new ArrayBuffer(0)}); +const array_buffer_initArrayBuffer = () => ({contents: new ArrayBuffer(0)}); -const useTextEncoder = chunk => textEncoder.encode(chunk); -const textEncoder = new TextEncoder(); +const array_buffer_useTextEncoder = chunk => array_buffer_textEncoder.encode(chunk); +const array_buffer_textEncoder = new TextEncoder(); -const useUint8Array = chunk => new Uint8Array(chunk); +const array_buffer_useUint8Array = chunk => new Uint8Array(chunk); -const useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); +const array_buffer_useUint8ArrayWithOffset = chunk => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); -const truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); +const array_buffer_truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); // `contents` is an increasingly growing `Uint8Array`. -const addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => { - const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length); +const array_buffer_addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, length) => { + const newContents = array_buffer_hasArrayBufferResize() ? array_buffer_resizeArrayBuffer(contents, length) : array_buffer_resizeArrayBufferSlow(contents, length); new Uint8Array(newContents).set(convertedChunk, previousLength); return newContents; }; @@ -92016,12 +92334,12 @@ const addArrayBufferChunk = (convertedChunk, {contents, length: previousLength}, // Without `ArrayBuffer.resize()`, `contents` size is always a power of 2. // This means its last bytes are zeroes (not stream data), which need to be // trimmed at the end with `ArrayBuffer.slice()`. -const resizeArrayBufferSlow = (contents, length) => { +const array_buffer_resizeArrayBufferSlow = (contents, length) => { if (length <= contents.byteLength) { return contents; } - const arrayBuffer = new ArrayBuffer(getNewContentsLength(length)); + const arrayBuffer = new ArrayBuffer(array_buffer_getNewContentsLength(length)); new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); return arrayBuffer; }; @@ -92030,23 +92348,23 @@ const resizeArrayBufferSlow = (contents, length) => { // the stream data. It does not include extraneous zeroes to trim at the end. // The underlying `ArrayBuffer` does allocate a number of bytes that is a power // of 2, but those bytes are only visible after calling `ArrayBuffer.resize()`. -const resizeArrayBuffer = (contents, length) => { +const array_buffer_resizeArrayBuffer = (contents, length) => { if (length <= contents.maxByteLength) { contents.resize(length); return contents; } - const arrayBuffer = new ArrayBuffer(length, {maxByteLength: getNewContentsLength(length)}); + const arrayBuffer = new ArrayBuffer(length, {maxByteLength: array_buffer_getNewContentsLength(length)}); new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); return arrayBuffer; }; // Retrieve the closest `length` that is both >= and a power of 2 -const getNewContentsLength = length => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)); +const array_buffer_getNewContentsLength = length => array_buffer_SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(array_buffer_SCALE_FACTOR)); -const SCALE_FACTOR = 2; +const array_buffer_SCALE_FACTOR = 2; -const finalizeArrayBuffer = ({contents, length}) => hasArrayBufferResize() ? contents : contents.slice(0, length); +const array_buffer_finalizeArrayBuffer = ({contents, length}) => array_buffer_hasArrayBufferResize() ? contents : contents.slice(0, length); // `ArrayBuffer.slice()` is slow. When `ArrayBuffer.resize()` is available // (Node >=20.0.0, Safari >=16.4 and Chrome), we can use it instead. @@ -92054,38 +92372,38 @@ const finalizeArrayBuffer = ({contents, length}) => hasArrayBufferResize() ? con // TODO: remove after dropping support for Node 20. // eslint-disable-next-line no-warning-comments // TODO: use `ArrayBuffer.transferToFixedLength()` instead once it is available -const hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype; +const array_buffer_hasArrayBufferResize = () => 'resize' in ArrayBuffer.prototype; -const arrayBufferMethods = { - init: initArrayBuffer, +const array_buffer_arrayBufferMethods = { + init: array_buffer_initArrayBuffer, convertChunk: { - string: useTextEncoder, - buffer: useUint8Array, - arrayBuffer: useUint8Array, - dataView: useUint8ArrayWithOffset, - typedArray: useUint8ArrayWithOffset, - others: throwObjectStream, + string: array_buffer_useTextEncoder, + buffer: array_buffer_useUint8Array, + arrayBuffer: array_buffer_useUint8Array, + dataView: array_buffer_useUint8ArrayWithOffset, + typedArray: array_buffer_useUint8ArrayWithOffset, + others: utils_throwObjectStream, }, getSize: getLengthProp, - truncateChunk: truncateArrayBufferChunk, - addChunk: addArrayBufferChunk, - getFinalChunk: noop, - finalize: finalizeArrayBuffer, + truncateChunk: array_buffer_truncateArrayBufferChunk, + addChunk: array_buffer_addArrayBufferChunk, + getFinalChunk: utils_noop, + finalize: array_buffer_finalizeArrayBuffer, }; ;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js -async function getStreamAsBuffer(stream, options) { +async function buffer_getStreamAsBuffer(stream, options) { if (!('Buffer' in globalThis)) { throw new Error('getStreamAsBuffer() is only supported in Node.js'); } try { - return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options)); + return buffer_arrayBufferToNodeBuffer(await array_buffer_getStreamAsArrayBuffer(stream, options)); } catch (error) { if (error.bufferedData !== undefined) { - error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData); + error.bufferedData = buffer_arrayBufferToNodeBuffer(error.bufferedData); } throw error; @@ -92093,7 +92411,7 @@ async function getStreamAsBuffer(stream, options) { } // eslint-disable-next-line n/prefer-global/buffer -const arrayBufferToNodeBuffer = arrayBuffer => globalThis.Buffer.from(arrayBuffer); +const buffer_arrayBufferToNodeBuffer = arrayBuffer => globalThis.Buffer.from(arrayBuffer); ;// CONCATENATED MODULE: ./node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js @@ -92119,12 +92437,12 @@ const getFinalStringChunk = ({textDecoder}) => { const stringMethods = { init: initString, convertChunk: { - string: identity, + string: utils_identity, buffer: useTextDecoder, arrayBuffer: useTextDecoder, dataView: useTextDecoder, typedArray: useTextDecoder, - others: throwObjectStream, + others: utils_throwObjectStream, }, getSize: getLengthProp, truncateChunk: truncateStringChunk, @@ -92503,13 +92821,13 @@ getContentLength_fn = function() { }; -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/is-form-data.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/is-form-data.js function is_form_data_isFormData(body) { return dist.nodeStream(body) && dist.function_(body.getBoundary); } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/get-body-size.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/get-body-size.js @@ -92533,12 +92851,12 @@ async function getBodySize(body, headers) { return undefined; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/proxy-events.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/proxy-events.js function proxyEvents(from, to, events) { const eventFunctions = {}; for (const event of events) { - const eventFunction = (...args) => { - to.emit(event, ...args); + const eventFunction = (...arguments_) => { + to.emit(event, ...arguments_); }; eventFunctions[event] = eventFunction; from.on(event, eventFunction); @@ -92552,7 +92870,7 @@ function proxyEvents(from, to, events) { ;// CONCATENATED MODULE: external "node:net" const external_node_net_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:net"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/unhandle.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/unhandle.js // When attaching listeners, it's very easy to forget about them. // Especially if you do error handling and set timeouts. // So instead of checking if it's proper to throw an error on every timeout ever, @@ -92560,9 +92878,9 @@ const external_node_net_namespaceObject = __WEBPACK_EXTERNAL_createRequire(impor function unhandle() { const handlers = []; return { - once(origin, event, fn) { - origin.once(event, fn); - handlers.push({ origin, event, fn }); + once(origin, event, function_) { + origin.once(event, function_); + handlers.push({ origin, event, fn: function_ }); }, unhandleAll() { for (const handler of handlers) { @@ -92574,7 +92892,7 @@ function unhandle() { }; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/timed-out.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/timed-out.js const reentry = Symbol('reentry'); @@ -92705,7 +93023,7 @@ function timedOut(request, delays, options) { return cancelTimeouts; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/url-to-options.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/url-to-options.js function urlToOptions(url) { // Cast to URL @@ -92729,7 +93047,7 @@ function urlToOptions(url) { return options; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/weakable-map.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/weakable-map.js class WeakableMap { weakMap; map; @@ -92759,7 +93077,7 @@ class WeakableMap { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/calculate-retry-delay.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/calculate-retry-delay.js const calculateRetryDelay = ({ attemptCount, retryOptions, error, retryAfter, computedValue, }) => { if (error.name === 'RetryError') { return 1; @@ -93246,7 +93564,7 @@ class CacheableLookup { // EXTERNAL MODULE: ./node_modules/.pnpm/http2-wrapper@2.2.1/node_modules/http2-wrapper/source/index.js var http2_wrapper_source = __nccwpck_require__(9695); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/parse-link-header.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/parse-link-header.js function parseLinkHeader(link) { const parsed = []; const items = link.split(','); @@ -93281,7 +93599,7 @@ function parseLinkHeader(link) { return parsed; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/options.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/options.js @@ -93458,7 +93776,7 @@ const defaultInternals = { shouldContinue: () => true, countLimit: Number.POSITIVE_INFINITY, backoff: 0, - requestLimit: 10000, + requestLimit: 10_000, stackAllItems: false, }, setHost: true, @@ -94918,7 +95236,7 @@ class Options { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/response.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/response.js const isResponseOk = (response) => { const { statusCode } = response; @@ -94961,19 +95279,19 @@ const parseBody = (response, responseType, parseJson, encoding) => { }, response); }; -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/is-client-request.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/is-client-request.js function isClientRequest(clientRequest) { return clientRequest.writable && !clientRequest.writableEnded; } /* harmony default export */ const is_client_request = (isClientRequest); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/utils/is-unix-socket-url.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/utils/is-unix-socket-url.js // eslint-disable-next-line @typescript-eslint/naming-convention function isUnixSocketURL(url) { return url.protocol === 'unix:' || url.hostname === 'unix'; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/core/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/core/index.js @@ -95603,7 +95921,7 @@ class Request extends external_node_stream_.Duplex { } try { // Errors are emitted via the `error` event - const rawBody = await getStreamAsBuffer(from); + const rawBody = await buffer_getStreamAsBuffer(from); // TODO: Switch to this: // let rawBody = await from.toArray(); // rawBody = Buffer.concat(rawBody); @@ -95800,9 +96118,7 @@ class Request extends external_node_stream_.Duplex { break; } } - if (!request) { - request = options.getRequestFunction(); - } + request ||= options.getRequestFunction(); const url = options.url; this._requestOptions = options.createNativeRequestOptions(); if (options.cache) { @@ -95812,11 +96128,11 @@ class Request extends external_node_stream_.Duplex { this._prepareCache(options.cache); } // Cache support - const fn = options.cache ? this._createCacheableRequest : request; + const function_ = options.cache ? this._createCacheableRequest : request; try { // We can't do `await fn(...)`, // because stream `error` event can be emitted before `Promise.resolve()`. - let requestOrResponse = fn(url, this._requestOptions); + let requestOrResponse = function_(url, this._requestOptions); if (dist.promise(requestOrResponse)) { requestOrResponse = await requestOrResponse; } @@ -95979,7 +96295,7 @@ class Request extends external_node_stream_.Duplex { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/as-promise/types.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/as-promise/types.js /** An error to be thrown when the request is aborted with `.cancel()`. @@ -95998,7 +96314,7 @@ class types_CancelError extends RequestError { } } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/as-promise/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/as-promise/index.js @@ -96131,12 +96447,12 @@ function asPromise(firstRequest) { }; makeRequest(0); }); - promise.on = (event, fn) => { - emitter.on(event, fn); + promise.on = (event, function_) => { + emitter.on(event, function_); return promise; }; - promise.off = (event, fn) => { - emitter.off(event, fn); + promise.off = (event, function_) => { + emitter.off(event, function_); return promise; }; const shortcut = (responseType) => { @@ -96164,7 +96480,7 @@ function asPromise(firstRequest) { return promise; } -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/create.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/create.js @@ -96205,9 +96521,7 @@ const create = (defaults) => { if (normalized.isStream) { return request; } - if (!promise) { - promise = asPromise(request); - } + promise ||= asPromise(request); return promise; }; let iteration = 0; @@ -96215,9 +96529,7 @@ const create = (defaults) => { const handler = defaults.handlers[iteration++] ?? lastHandler; const result = handler(newOptions, iterateHandlers); if (dist.promise(result) && !request.options.isStream) { - if (!promise) { - promise = asPromise(request); - } + promise ||= asPromise(request); if (result !== promise) { const descriptors = Object.getOwnPropertyDescriptors(promise); for (const key in descriptors) { @@ -96353,7 +96665,7 @@ const create = (defaults) => { }; /* harmony default export */ const source_create = (create); -;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.2.1/node_modules/got/dist/source/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/got@14.3.0/node_modules/got/dist/source/index.js const defaults = { @@ -96376,11 +96688,13 @@ const got = source_create(defaults); +;// CONCATENATED MODULE: external "node:child_process" +const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); ;// CONCATENATED MODULE: external "node:stream/promises" const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@2391ba1ef3d22027cd4d9ecce147007a88f63643_is35d24tynybsms6zejuqsabhi/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@180884918b85ef67dad81f70b4130eca5268242e_o7ea7dhs7wrsl7wvvt2otnlz3q/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -96684,45 +96998,6 @@ function hashEnvironmentVariables(prefix, variables) { return `${prefix}-${hash.digest("hex")}`; } -// src/platform.ts -var platform_exports = {}; -__export(platform_exports, { - getArchOs: () => getArchOs, - getNixPlatform: () => getNixPlatform -}); - -function getArchOs() { - const envArch = process.env.RUNNER_ARCH; - const envOs = process.env.RUNNER_OS; - if (envArch && envOs) { - return `${envArch}-${envOs}`; - } else { - core.error( - `Can't identify the platform: RUNNER_ARCH or RUNNER_OS undefined (${envArch}-${envOs})` - ); - throw new Error("RUNNER_ARCH and/or RUNNER_OS is not defined"); - } -} -function getNixPlatform(archOs) { - const archOsMap = /* @__PURE__ */ new Map([ - ["X64-macOS", "x86_64-darwin"], - ["ARM64-macOS", "aarch64-darwin"], - ["X64-Linux", "x86_64-linux"], - ["ARM64-Linux", "aarch64-linux"] - ]); - const mappedTo = archOsMap.get(archOs); - if (mappedTo) { - return mappedTo; - } else { - core.error( - `ArchOs (${archOs}) doesn't map to a supported Nix platform.` - ); - throw new Error( - `Cannot convert ArchOs (${archOs}) to a supported Nix platform.` - ); - } -} - // src/inputs.ts var inputs_exports = {}; __export(inputs_exports, { @@ -96787,38 +97062,77 @@ var getStringOrUndefined = (name) => { } }; +// src/platform.ts +var platform_exports = {}; +__export(platform_exports, { + getArchOs: () => getArchOs, + getNixPlatform: () => getNixPlatform +}); + +function getArchOs() { + const envArch = process.env.RUNNER_ARCH; + const envOs = process.env.RUNNER_OS; + if (envArch && envOs) { + return `${envArch}-${envOs}`; + } else { + core.error( + `Can't identify the platform: RUNNER_ARCH or RUNNER_OS undefined (${envArch}-${envOs})` + ); + throw new Error("RUNNER_ARCH and/or RUNNER_OS is not defined"); + } +} +function getNixPlatform(archOs) { + const archOsMap = /* @__PURE__ */ new Map([ + ["X64-macOS", "x86_64-darwin"], + ["ARM64-macOS", "aarch64-darwin"], + ["X64-Linux", "x86_64-linux"], + ["ARM64-Linux", "aarch64-linux"] + ]); + const mappedTo = archOsMap.get(archOs); + if (mappedTo) { + return mappedTo; + } else { + core.error( + `ArchOs (${archOs}) doesn't map to a supported Nix platform.` + ); + throw new Error( + `Cannot convert ArchOs (${archOs}) to a supported Nix platform.` + ); + } +} + // src/sourcedef.ts function constructSourceParameters(legacyPrefix) { - const noisilyGetInput = (suffix) => { - const preferredInput = getStringOrUndefined(`source-${suffix}`); - if (!legacyPrefix) { - return preferredInput; - } - const legacyInput = getStringOrUndefined(`${legacyPrefix}-${suffix}`); - if (preferredInput && legacyInput) { - core.warning( - `The supported option source-${suffix} and the legacy option ${legacyPrefix}-${suffix} are both set. Preferring source-${suffix}. Please stop setting ${legacyPrefix}-${suffix}.` - ); - return preferredInput; - } else if (legacyInput) { - core.warning( - `The legacy option ${legacyPrefix}-${suffix} is set. Please migrate to source-${suffix}.` - ); - return legacyInput; - } else { - return preferredInput; - } - }; return { - path: noisilyGetInput("path"), - url: noisilyGetInput("url"), - tag: noisilyGetInput("tag"), - pr: noisilyGetInput("pr"), - branch: noisilyGetInput("branch"), - revision: noisilyGetInput("revision") + path: noisilyGetInput("path", legacyPrefix), + url: noisilyGetInput("url", legacyPrefix), + tag: noisilyGetInput("tag", legacyPrefix), + pr: noisilyGetInput("pr", legacyPrefix), + branch: noisilyGetInput("branch", legacyPrefix), + revision: noisilyGetInput("revision", legacyPrefix) }; } +function noisilyGetInput(suffix, legacyPrefix) { + const preferredInput = getStringOrUndefined(`source-${suffix}`); + if (!legacyPrefix) { + return preferredInput; + } + const legacyInput = getStringOrUndefined(`${legacyPrefix}-${suffix}`); + if (preferredInput && legacyInput) { + core.warning( + `The supported option source-${suffix} and the legacy option ${legacyPrefix}-${suffix} are both set. Preferring source-${suffix}. Please stop setting ${legacyPrefix}-${suffix}.` + ); + return preferredInput; + } else if (legacyInput) { + core.warning( + `The legacy option ${legacyPrefix}-${suffix} is set. Please migrate to source-${suffix}.` + ); + return legacyInput; + } else { + return preferredInput; + } +} // src/index.ts @@ -96832,22 +97146,45 @@ function constructSourceParameters(legacyPrefix) { + + + var DEFAULT_IDS_HOST = "https://install.determinate.systems"; var IDS_HOST = process.env["IDS_HOST"] ?? DEFAULT_IDS_HOST; var EVENT_EXCEPTION = "exception"; var EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit"; var EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss"; var EVENT_ARTIFACT_CACHE_PERSIST = "artifact_cache_persist"; +var EVENT_PREFLIGHT_REQUIRE_NIX_DENIED = "preflight-require-nix-denied"; var FACT_ENDED_WITH_EXCEPTION = "ended_with_exception"; var FACT_FINAL_EXCEPTION = "final_exception"; +var FACT_OS = "$os"; +var FACT_OS_VERSION = "$os_version"; var FACT_SOURCE_URL = "source_url"; var FACT_SOURCE_URL_ETAG = "source_url_etag"; -var IdsToolbox = class { +var FACT_NIX_LOCATION = "nix_location"; +var FACT_NIX_STORE_TRUST = "nix_store_trusted"; +var FACT_NIX_STORE_VERSION = "nix_store_version"; +var FACT_NIX_STORE_CHECK_METHOD = "nix_store_check_method"; +var FACT_NIX_STORE_CHECK_ERROR = "nix_store_check_error"; +var STATE_KEY_EXECUTION_PHASE = "detsys_action_execution_phase"; +var STATE_KEY_NIX_NOT_FOUND = "detsys_action_nix_not_found"; +var STATE_NOT_FOUND = "not-found"; +var DetSysAction = class { + determineExecutionPhase() { + const currentPhase = core.getState(STATE_KEY_EXECUTION_PHASE); + if (currentPhase === "") { + core.saveState(STATE_KEY_EXECUTION_PHASE, "post"); + return "main"; + } else { + return "post"; + } + } constructor(actionOptions) { this.actionOptions = makeOptionsConfident(actionOptions); - this.hookMain = void 0; - this.hookPost = void 0; this.exceptionAttachments = /* @__PURE__ */ new Map(); + this.nixStoreTrust = "unknown"; + this.strictMode = getBool("ci-mode"); this.events = []; this.client = got_dist_source.extend({ retry: { @@ -96891,25 +97228,19 @@ var IdsToolbox = class { { getDetails().then((details) => { if (details.name !== "unknown") { - this.addFact("$os", details.name); + this.addFact(FACT_OS, details.name); } if (details.version !== "unknown") { - this.addFact("$os_version", details.version); + this.addFact(FACT_OS_VERSION, details.version); } }).catch((e) => { - core.debug(`Failure getting platform details: ${e}`); + core.debug( + `Failure getting platform details: ${stringifyError(e)}` + ); }); } - { - const phase = core.getState("idstoolbox_execution_phase"); - if (phase === "") { - core.saveState("idstoolbox_execution_phase", "post"); - this.executionPhase = "main"; - } else { - this.executionPhase = "post"; - } - this.facts.execution_phase = this.executionPhase; - } + this.executionPhase = this.determineExecutionPhase(); + this.facts.execution_phase = this.executionPhase; if (this.actionOptions.fetchStyle === "gh-env-style") { this.architectureFetchSuffix = this.archOs; } else if (this.actionOptions.fetchStyle === "nix-style") { @@ -96937,20 +97268,31 @@ var IdsToolbox = class { stapleFile(name, location) { this.exceptionAttachments.set(name, location); } - onMain(callback) { - this.hookMain = callback; - } - onPost(callback) { - this.hookPost = callback; + setExecutionPhase() { + const phase = core.getState(STATE_KEY_EXECUTION_PHASE); + if (phase === "") { + core.saveState(STATE_KEY_EXECUTION_PHASE, "post"); + this.executionPhase = "main"; + } else { + this.executionPhase = "post"; + } + this.facts.execution_phase = this.executionPhase; } + /** + * Execute the Action as defined. + */ execute() { this.executeAsync().catch((error2) => { console.log(error2); process.exitCode = 1; }); } - stringifyError(error2) { - return error2 instanceof Error || typeof error2 == "string" ? error2.toString() : JSON.stringify(error2); + // Whether the + get isMain() { + return this.executionPhase === "main"; + } + get isPost() { + return this.executionPhase === "post"; } async executeAsync() { try { @@ -96958,38 +97300,41 @@ var IdsToolbox = class { this.getCorrelationHashes() ); if (!await this.preflightRequireNix()) { - this.recordEvent("preflight-require-nix-denied"); + this.recordEvent(EVENT_PREFLIGHT_REQUIRE_NIX_DENIED); return; + } else { + await this.preflightNixStoreInfo(); + this.addFact(FACT_NIX_STORE_TRUST, this.nixStoreTrust); } - if (this.executionPhase === "main" && this.hookMain) { - await this.hookMain(); - } else if (this.executionPhase === "post" && this.hookPost) { - await this.hookPost(); + if (this.isMain) { + await this.main(); + } else if (this.isPost) { + await this.post(); } this.addFact(FACT_ENDED_WITH_EXCEPTION, false); - } catch (error2) { + } catch (e) { this.addFact(FACT_ENDED_WITH_EXCEPTION, true); - const reportable = this.stringifyError(error2); + const reportable = stringifyError(e); this.addFact(FACT_FINAL_EXCEPTION, reportable); - if (this.executionPhase === "post") { + if (this.isPost) { core.warning(reportable); } else { core.setFailed(reportable); } - const do_gzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gzip); + const doGzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gzip); const exceptionContext = /* @__PURE__ */ new Map(); for (const [attachmentLabel, filePath] of this.exceptionAttachments) { try { const logText = (0,external_node_fs_namespaceObject.readFileSync)(filePath); - const buf = await do_gzip(logText); + const buf = await doGzip(logText); exceptionContext.set( `staple_value_${attachmentLabel}`, buf.toString("base64") ); - } catch (e) { + } catch (innerError) { exceptionContext.set( `staple_failure_${attachmentLabel}`, - this.stringifyError(e) + stringifyError(innerError) ); } } @@ -97020,7 +97365,24 @@ var IdsToolbox = class { uuid: (0,external_node_crypto_namespaceObject.randomUUID)() }); } - async fetch() { + /** + * Fetches a file in `.xz` format, imports its contents into the Nix store, + * and returns the path of the executable at `/nix/store/STORE_PATH/bin/${bin}`. + */ + async unpackClosure(bin) { + const artifact = this.fetchArtifact(); + const { stdout } = await (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.exec)( + `cat "${artifact}" | xz -d | nix-store --import` + ); + const paths = stdout.split(external_node_os_.EOL); + const lastPath = paths.at(-2); + return `${lastPath}/bin/${bin}`; + } + /** + * Fetch an artifact, such as a tarball, from the URL determined by the `source-*` + * inputs and other factors. + */ + async fetchArtifact() { core.startGroup( `Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}` ); @@ -97064,7 +97426,7 @@ var IdsToolbox = class { try { await this.saveCachedVersion(v, destFile); } catch (e) { - core.debug(`Error caching the artifact: ${e}`); + core.debug(`Error caching the artifact: ${stringifyError(e)}`); } } return destFile; @@ -97072,11 +97434,24 @@ var IdsToolbox = class { core.endGroup(); } } + /** + * Fetches the executable at the URL determined by the `source-*` inputs and + * other facts, `chmod`s it, and returns the path to the executable on disk. + */ async fetchExecutable() { - const binaryPath = await this.fetch(); + const binaryPath = await this.fetchArtifact(); await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP); return binaryPath; } + /** + * A helper function for failing on error only if strict mode is enabled. + * This is intended only for CI environments testing Actions themselves. + */ + failOnError(msg) { + if (this.strictMode) { + core.setFailed(`strict mode failure: ${msg}`); + } + } async complete() { this.recordEvent(`complete_${this.executionPhase}`); await this.submitEvents(); @@ -97165,40 +97540,85 @@ var IdsToolbox = class { await promises_namespaceObject.access(candidateNix, promises_namespaceObject.constants.X_OK); core.debug(`Found Nix at ${candidateNix}`); nixLocation = candidateNix; + break; } catch { core.debug(`Nix not at ${candidateNix}`); } } - this.addFact("nix_location", nixLocation || ""); + this.addFact(FACT_NIX_LOCATION, nixLocation || ""); if (this.actionOptions.requireNix === "ignore") { return true; } - const currentNotFoundState = core.getState( - "idstoolbox_nix_not_found" - ); - if (currentNotFoundState === "not-found") { + const currentNotFoundState = core.getState(STATE_KEY_NIX_NOT_FOUND); + if (currentNotFoundState === STATE_NOT_FOUND) { return false; } if (nixLocation !== void 0) { return true; } - core.saveState("idstoolbox_nix_not_found", "not-found"); + core.saveState(STATE_KEY_NIX_NOT_FOUND, STATE_NOT_FOUND); switch (this.actionOptions.requireNix) { case "fail": core.setFailed( - "This action can only be used when Nix is installed. Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." + [ + "This action can only be used when Nix is installed.", + "Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." + ].join(" ") ); break; case "warn": core.warning( - "This action is in no-op mode because Nix is not installed. Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." + [ + "This action is in no-op mode because Nix is not installed.", + "Add `- uses: DeterminateSystems/nix-installer-action@main` earlier in your workflow." + ].join(" ") ); break; } return false; } + async preflightNixStoreInfo() { + let output = ""; + const options = {}; + options.silent = true; + options.listeners = { + stdout: (data) => { + output += data.toString(); + } + }; + try { + output = ""; + await exec.exec("nix", ["store", "info", "--json"], options); + this.addFact(FACT_NIX_STORE_CHECK_METHOD, "info"); + } catch { + try { + output = ""; + await exec.exec("nix", ["store", "ping", "--json"], options); + this.addFact(FACT_NIX_STORE_CHECK_METHOD, "ping"); + } catch { + this.addFact(FACT_NIX_STORE_CHECK_METHOD, "none"); + return; + } + } + try { + const parsed = JSON.parse(output); + if (parsed.trusted === 1) { + this.nixStoreTrust = "trusted"; + } else if (parsed.trusted === 0) { + this.nixStoreTrust = "untrusted"; + } else if (parsed.trusted !== void 0) { + this.addFact( + FACT_NIX_STORE_CHECK_ERROR, + `Mysterious trusted value: ${JSON.stringify(parsed.trusted)}` + ); + } + this.addFact(FACT_NIX_STORE_VERSION, JSON.stringify(parsed.version)); + } catch (e) { + this.addFact(FACT_NIX_STORE_CHECK_ERROR, stringifyError(e)); + } + } async submitEvents() { - if (!this.actionOptions.diagnosticsUrl) { + if (this.actionOptions.diagnosticsUrl === void 0) { core.debug( "Diagnostics are disabled. Not sending the following events:" ); @@ -97214,8 +97634,10 @@ var IdsToolbox = class { await this.client.post(this.actionOptions.diagnosticsUrl, { json: batch }); - } catch (error2) { - core.debug(`Error submitting diagnostics event: ${error2}`); + } catch (e) { + core.debug( + `Error submitting diagnostics event: ${stringifyError(e)}` + ); } this.events = []; } @@ -97224,6 +97646,9 @@ var IdsToolbox = class { return external_node_path_namespaceObject.join(_tmpdir, `${this.actionOptions.name}-${(0,external_node_crypto_namespaceObject.randomUUID)()}`); } }; +function stringifyError(error2) { + return error2 instanceof Error || typeof error2 == "string" ? error2.toString() : JSON.stringify(error2); +} function makeOptionsConfident(actionOptions) { const idsProjectName = actionOptions.idsProjectName ?? actionOptions.name; const finalOpts = { @@ -97259,7 +97684,7 @@ function determineDiagnosticsUrl(idsProjectName, urlOption) { return mungeDiagnosticEndpoint(new URL(providedDiagnosticEndpoint)); } catch (e) { core.info( - `User-provided diagnostic endpoint ignored: not a valid URL: ${e}` + `User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError(e)}` ); } } @@ -97271,7 +97696,7 @@ function determineDiagnosticsUrl(idsProjectName, urlOption) { return diagnosticUrl; } catch (e) { core.info( - `Generated diagnostic endpoint ignored: not a valid URL: ${e}` + `Generated diagnostic endpoint ignored: not a valid URL: ${stringifyError(e)}` ); } return void 0; @@ -97292,7 +97717,9 @@ function mungeDiagnosticEndpoint(inputUrl) { inputUrl.password = currentIdsHost.password; return inputUrl; } catch (e) { - core.info(`Default or overridden IDS host isn't a valid URL: ${e}`); + core.info( + `Default or overridden IDS host isn't a valid URL: ${stringifyError(e)}` + ); } return inputUrl; } @@ -97335,9 +97762,9 @@ var FACT_HAS_SYSTEMD = "has_systemd"; var FACT_IN_ACT = "in_act"; var FACT_IN_NAMESPACE_SO = "in_namespace_so"; var FACT_NIX_INSTALLER_PLANNER = "nix_installer_planner"; -var NixInstallerAction = class { +var NixInstallerAction = class extends DetSysAction { constructor() { - this.idslib = new IdsToolbox({ + super({ name: "nix-installer", fetchStyle: "nix-style", legacySourcePrefix: "nix-installer", @@ -97374,6 +97801,14 @@ var NixInstallerAction = class { this.startDaemon = inputs_exports.getBool("start-daemon"); this.trustRunnerUser = inputs_exports.getBool("trust-runner-user"); } + async main() { + await this.detectAndForceDockerShim(); + await this.install(); + } + async post() { + await this.cleanupDockerShim(); + await this.reportOverall(); + } async detectAndForceDockerShim() { const runnerOs = process.env["RUNNER_OS"]; if (runnerOs !== "Linux") { @@ -97395,7 +97830,7 @@ var NixInstallerAction = class { throwIfNoEntry: false }); if (systemdCheck?.isDirectory()) { - this.idslib.addFact(FACT_HAS_SYSTEMD, true); + this.addFact(FACT_HAS_SYSTEMD, true); if (this.forceDockerShim) { core.warning( "Systemd is detected, but ignoring it since force-docker-shim is enabled." @@ -97404,11 +97839,11 @@ var NixInstallerAction = class { return; } } - this.idslib.addFact(FACT_HAS_SYSTEMD, false); + this.addFact(FACT_HAS_SYSTEMD, false); core.debug( "Linux detected without systemd, testing for Docker with `docker info` as an alternative daemon supervisor." ); - this.idslib.addFact(FACT_HAS_DOCKER, false); + this.addFact(FACT_HAS_DOCKER, false); let exitCode; try { exitCode = await exec.exec("docker", ["info"], { @@ -97441,7 +97876,7 @@ var NixInstallerAction = class { return; } } - this.idslib.addFact(FACT_HAS_DOCKER, true); + this.addFact(FACT_HAS_DOCKER, true); if (!this.forceDockerShim && await this.detectDockerWithMountedDockerSocket()) { core.debug( "Detected a Docker container with a Docker socket mounted, not enabling docker shim." @@ -97552,7 +97987,7 @@ ${stderrBuffer}` const runnerOs = process.env["RUNNER_OS"]; executionEnv.NIX_INSTALLER_NO_CONFIRM = "true"; executionEnv.NIX_INSTALLER_DIAGNOSTIC_ATTRIBUTION = JSON.stringify( - this.idslib.getCorrelationHashes() + this.getCorrelationHashes() ); if (this.backtrace !== null) { executionEnv.RUST_BACKTRACE = this.backtrace; @@ -97588,7 +98023,7 @@ ${stderrBuffer}` if (this.sslCertFile !== null) { executionEnv.NIX_INSTALLER_SSL_CERT_FILE = this.sslCertFile; } - executionEnv.NIX_INSTALLER_DIAGNOSTIC_ENDPOINT = this.idslib.getDiagnosticsUrl()?.toString() ?? ""; + executionEnv.NIX_INSTALLER_DIAGNOSTIC_ENDPOINT = this.getDiagnosticsUrl()?.toString() ?? ""; if (this.macEncrypt !== null) { if (runnerOs !== "macOS") { throw new Error("`mac-encrypt` while `$RUNNER_OS` was not `macOS`"); @@ -97668,14 +98103,14 @@ ${stderrBuffer}` } executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; if (process.env["ACT"] && !process.env["NOT_ACT"]) { - this.idslib.addFact(FACT_IN_ACT, true); + this.addFact(FACT_IN_ACT, true); core.info( "Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`" ); executionEnv.NIX_INSTALLER_INIT = "none"; } if (process.env["NSC_VM_ID"] && !process.env["NOT_NAMESPACE"]) { - this.idslib.addFact(FACT_IN_NAMESPACE_SO, true); + this.addFact(FACT_IN_NAMESPACE_SO, true); core.info( "Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace" ); @@ -97690,17 +98125,17 @@ ${stderrBuffer}` ); const args = ["install"]; if (this.planner) { - this.idslib.addFact(FACT_NIX_INSTALLER_PLANNER, this.planner); + this.addFact(FACT_NIX_INSTALLER_PLANNER, this.planner); args.push(this.planner); } else { - this.idslib.addFact(FACT_NIX_INSTALLER_PLANNER, getDefaultPlanner()); + this.addFact(FACT_NIX_INSTALLER_PLANNER, getDefaultPlanner()); args.push(getDefaultPlanner()); } if (this.extraArgs) { const extraArgs = parseArgsStringToArgv(this.extraArgs); args.concat(extraArgs); } - this.idslib.recordEvent(EVENT_INSTALL_NIX_START); + this.recordEvent(EVENT_INSTALL_NIX_START); const exitCode = await exec.exec(binaryPath, args, { env: { ...executionEnv, @@ -97709,12 +98144,12 @@ ${stderrBuffer}` } }); if (exitCode !== 0) { - this.idslib.recordEvent(EVENT_INSTALL_NIX_FAILURE, { + this.recordEvent(EVENT_INSTALL_NIX_FAILURE, { exitCode }); throw new Error(`Non-zero exit code of \`${exitCode}\` detected`); } - this.idslib.recordEvent(EVENT_INSTALL_NIX_SUCCESS); + this.recordEvent(EVENT_INSTALL_NIX_SUCCESS); return exitCode; } async install() { @@ -97800,7 +98235,7 @@ ${stderrBuffer}` } { core.debug("Starting the Nix daemon through Docker..."); - this.idslib.recordEvent(EVENT_START_DOCKER_SHIM); + this.recordEvent(EVENT_START_DOCKER_SHIM); const exitCode = await exec.exec( "docker", [ @@ -97827,7 +98262,7 @@ ${stderrBuffer}` "always", "--init", "--name", - `determinate-nix-shim-${this.idslib.getUniqueId()}-${(0,external_node_crypto_namespaceObject.randomUUID)()}`, + `determinate-nix-shim-${this.getUniqueId()}-${(0,external_node_crypto_namespaceObject.randomUUID)()}`, "determinate-nix-shim:latest" ], { @@ -97883,7 +98318,7 @@ ${stderrBuffer}` } } if (cleaned) { - this.idslib.recordEvent(EVENT_CLEAN_UP_DOCKER_SHIM); + this.recordEvent(EVENT_CLEAN_UP_DOCKER_SHIM); } else { core.warning( "Giving up on cleaning up the nix daemon container" @@ -97908,7 +98343,7 @@ ${stderrBuffer}` } } async flakehubLogin() { - this.idslib.recordEvent(EVENT_LOGIN_TO_FLAKEHUB); + this.recordEvent(EVENT_LOGIN_TO_FLAKEHUB); const netrcPath = `${process.env["RUNNER_TEMP"]}/determinate-nix-installer-netrc`; const jwt = await core.getIDToken("api.flakehub.com"); await (0,promises_namespaceObject.writeFile)( @@ -97927,7 +98362,7 @@ ${stderrBuffer}` return netrcPath; } async executeUninstall() { - this.idslib.recordEvent(EVENT_UNINSTALL_NIX); + this.recordEvent(EVENT_UNINSTALL_NIX); const exitCode = await exec.exec( `/nix/nix-installer`, ["uninstall"], @@ -97954,7 +98389,7 @@ ${stderrBuffer}` } } async setupKvm() { - this.idslib.recordEvent(EVENT_SETUP_KVM); + this.recordEvent(EVENT_SETUP_KVM); const currentUser = (0,external_node_os_.userInfo)(); const isRoot = currentUser.uid === 0; const maybeSudo = isRoot ? "" : "sudo"; @@ -98037,7 +98472,7 @@ ${stderrBuffer}` } async fetchBinary() { if (!this.localRoot) { - return await this.idslib.fetchExecutable(); + return await this.fetchExecutable(); } else { const localPath = (0,external_node_path_namespaceObject.join)(this.localRoot, `nix-installer-${this.platform}`); core.info(`Using binary ${localPath}`); @@ -98046,7 +98481,7 @@ ${stderrBuffer}` } async reportOverall() { try { - this.idslib.recordEvent(EVENT_CONCLUDE_WORKFLOW, { + this.recordEvent(EVENT_CONCLUDE_WORKFLOW, { conclusion: await this.getWorkflowConclusion() }); } catch (e) { @@ -98098,16 +98533,7 @@ function getDefaultPlanner() { } } function main() { - const installer = new NixInstallerAction(); - installer.idslib.onMain(async () => { - await installer.detectAndForceDockerShim(); - await installer.install(); - }); - installer.idslib.onPost(async () => { - await installer.cleanupDockerShim(); - await installer.reportOverall(); - }); - installer.idslib.execute(); + new NixInstallerAction().execute(); } main(); diff --git a/package.json b/package.json index 491b056..55d0edd 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,9 @@ }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@types/node": "^20.12.11", + "@types/node": "^20.12.12", "@types/uuid": "^9.0.8", - "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/eslint-plugin": "^7.10.0", "@vercel/ncc": "^0.38.1", "eslint": "^8.57.0", "eslint-import-resolver-typescript": "^3.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 31a8bf6..aaf3c16 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ dependencies: version: 5.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/2391ba1ef3d22027cd4d9ecce147007a88f63643 + version: github.com/DeterminateSystems/detsys-ts/180884918b85ef67dad81f70b4130eca5268242e string-argv: specifier: ^0.3.2 version: 0.3.2 @@ -26,14 +26,14 @@ devDependencies: specifier: ^4.3.0 version: 4.3.0(prettier@3.2.5) "@types/node": - specifier: ^20.12.11 - version: 20.12.11 + specifier: ^20.12.12 + version: 20.12.12 "@types/uuid": specifier: ^9.0.8 version: 9.0.8 "@typescript-eslint/eslint-plugin": - specifier: ^7.8.0 - version: 7.8.0(@typescript-eslint/parser@7.8.0)(eslint@8.57.0)(typescript@5.4.5) + specifier: ^7.10.0 + version: 7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5) "@vercel/ncc": specifier: ^0.38.1 version: 0.38.1 @@ -42,13 +42,13 @@ devDependencies: version: 8.57.0 eslint-import-resolver-typescript: specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@7.8.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + version: 3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-plugin-github: specifier: ^4.10.2 version: 4.10.2(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-prettier: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) @@ -76,7 +76,7 @@ packages: "@actions/io": 1.1.3 "@azure/abort-controller": 1.1.0 "@azure/ms-rest-js": 2.7.0 - "@azure/storage-blob": 12.17.0 + "@azure/storage-blob": 12.18.0 semver: 6.3.1 uuid: 3.4.0 transitivePeerDependencies: @@ -273,10 +273,10 @@ packages: - encoding dev: false - /@azure/storage-blob@12.17.0: + /@azure/storage-blob@12.18.0: resolution: { - integrity: sha512-sM4vpsCpcCApagRW5UIjQNlNylo02my2opgp0Emi8x888hZUvJ3dN69Oq20cEGXkMUWnoCrBaB0zyS3yeB87sQ==, + integrity: sha512-BzBZJobMoDyjJsPRMLNHvqHycTGrT8R/dtcTx9qUFcqwSRfGVK9A/cZ7Nx38UQydT9usZGbaDCN75QRNjezSAA==, } engines: { node: ">=14.0.0" } dependencies: @@ -300,7 +300,7 @@ packages: engines: { node: ">=6.9.0" } dependencies: "@babel/highlight": 7.24.5 - picocolors: 1.0.0 + picocolors: 1.0.1 dev: true /@babel/generator@7.17.7: @@ -393,7 +393,7 @@ packages: "@babel/helper-validator-identifier": 7.24.5 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.0 + picocolors: 1.0.1 dev: true /@babel/parser@7.24.5: @@ -1076,10 +1076,10 @@ packages: engines: { node: ^12.20.0 || ^14.18.0 || >=16.0.0 } dev: true - /@rollup/rollup-android-arm-eabi@4.17.2: + /@rollup/rollup-android-arm-eabi@4.18.0: resolution: { - integrity: sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==, + integrity: sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==, } cpu: [arm] os: [android] @@ -1087,10 +1087,10 @@ packages: dev: true optional: true - /@rollup/rollup-android-arm64@4.17.2: + /@rollup/rollup-android-arm64@4.18.0: resolution: { - integrity: sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==, + integrity: sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==, } cpu: [arm64] os: [android] @@ -1098,10 +1098,10 @@ packages: dev: true optional: true - /@rollup/rollup-darwin-arm64@4.17.2: + /@rollup/rollup-darwin-arm64@4.18.0: resolution: { - integrity: sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==, + integrity: sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==, } cpu: [arm64] os: [darwin] @@ -1109,10 +1109,10 @@ packages: dev: true optional: true - /@rollup/rollup-darwin-x64@4.17.2: + /@rollup/rollup-darwin-x64@4.18.0: resolution: { - integrity: sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==, + integrity: sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==, } cpu: [x64] os: [darwin] @@ -1120,10 +1120,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.17.2: + /@rollup/rollup-linux-arm-gnueabihf@4.18.0: resolution: { - integrity: sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==, + integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==, } cpu: [arm] os: [linux] @@ -1131,10 +1131,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-arm-musleabihf@4.17.2: + /@rollup/rollup-linux-arm-musleabihf@4.18.0: resolution: { - integrity: sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==, + integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==, } cpu: [arm] os: [linux] @@ -1142,10 +1142,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.17.2: + /@rollup/rollup-linux-arm64-gnu@4.18.0: resolution: { - integrity: sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==, + integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==, } cpu: [arm64] os: [linux] @@ -1153,10 +1153,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.17.2: + /@rollup/rollup-linux-arm64-musl@4.18.0: resolution: { - integrity: sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==, + integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==, } cpu: [arm64] os: [linux] @@ -1164,10 +1164,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-powerpc64le-gnu@4.17.2: + /@rollup/rollup-linux-powerpc64le-gnu@4.18.0: resolution: { - integrity: sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==, + integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==, } cpu: [ppc64] os: [linux] @@ -1175,10 +1175,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.17.2: + /@rollup/rollup-linux-riscv64-gnu@4.18.0: resolution: { - integrity: sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==, + integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==, } cpu: [riscv64] os: [linux] @@ -1186,10 +1186,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-s390x-gnu@4.17.2: + /@rollup/rollup-linux-s390x-gnu@4.18.0: resolution: { - integrity: sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==, + integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==, } cpu: [s390x] os: [linux] @@ -1197,10 +1197,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.17.2: + /@rollup/rollup-linux-x64-gnu@4.18.0: resolution: { - integrity: sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==, + integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==, } cpu: [x64] os: [linux] @@ -1208,10 +1208,10 @@ packages: dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.17.2: + /@rollup/rollup-linux-x64-musl@4.18.0: resolution: { - integrity: sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==, + integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==, } cpu: [x64] os: [linux] @@ -1219,10 +1219,10 @@ packages: dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.17.2: + /@rollup/rollup-win32-arm64-msvc@4.18.0: resolution: { - integrity: sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==, + integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==, } cpu: [arm64] os: [win32] @@ -1230,10 +1230,10 @@ packages: dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.17.2: + /@rollup/rollup-win32-ia32-msvc@4.18.0: resolution: { - integrity: sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==, + integrity: sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==, } cpu: [ia32] os: [win32] @@ -1241,10 +1241,10 @@ packages: dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.17.2: + /@rollup/rollup-win32-x64-msvc@4.18.0: resolution: { - integrity: sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==, + integrity: sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==, } cpu: [x64] os: [win32] @@ -1252,10 +1252,17 @@ packages: dev: true optional: true - /@sindresorhus/is@6.3.0: + /@sec-ant/readable-stream@0.4.1: resolution: { - integrity: sha512-bOSPck7aIJjASXIg1qvXSIjXhVBpIEKdl2Wxg4pVqoTRPL8wWExKBrnGIh6CEnhkFQHfc36k7APhO3uXV4g5xg==, + integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==, + } + dev: false + + /@sindresorhus/is@6.3.1: + resolution: + { + integrity: sha512-FX4MfcifwJyFOI2lPoX7PQxCqx8BG1HCho7WdiXwpEQx1Ycij0JxkfYtGK7yqNScrZGSlt6RE6sw8QYoH7eKnQ==, } engines: { node: ">=16" } dev: false @@ -1307,13 +1314,6 @@ packages: } dev: false - /@types/json-schema@7.0.15: - resolution: - { - integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==, - } - dev: true - /@types/json5@0.0.29: resolution: { @@ -1327,32 +1327,25 @@ packages: integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==, } dependencies: - "@types/node": 20.12.11 + "@types/node": 20.12.12 form-data: 4.0.0 dev: false - /@types/node@20.12.11: + /@types/node@20.12.12: resolution: { - integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==, + integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==, } dependencies: undici-types: 5.26.5 - /@types/semver@7.5.8: - resolution: - { - integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==, - } - dev: true - /@types/tunnel@0.0.3: resolution: { integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==, } dependencies: - "@types/node": 20.12.11 + "@types/node": 20.12.12 dev: false /@types/uuid@9.0.8: @@ -1362,10 +1355,10 @@ packages: } dev: true - /@typescript-eslint/eslint-plugin@7.8.0(@typescript-eslint/parser@7.8.0)(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==, + integrity: sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1377,27 +1370,25 @@ packages: optional: true dependencies: "@eslint-community/regexpp": 4.10.0 - "@typescript-eslint/parser": 7.8.0(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/scope-manager": 7.8.0 - "@typescript-eslint/type-utils": 7.8.0(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/utils": 7.8.0(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/visitor-keys": 7.8.0 - debug: 4.3.4 + "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/scope-manager": 7.10.0 + "@typescript-eslint/type-utils": 7.10.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/utils": 7.10.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/visitor-keys": 7.10.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - semver: 7.6.2 ts-api-utils: 1.3.0(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@7.8.0(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==, + integrity: sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1407,10 +1398,10 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/scope-manager": 7.8.0 - "@typescript-eslint/types": 7.8.0 - "@typescript-eslint/typescript-estree": 7.8.0(typescript@5.4.5) - "@typescript-eslint/visitor-keys": 7.8.0 + "@typescript-eslint/scope-manager": 7.10.0 + "@typescript-eslint/types": 7.10.0 + "@typescript-eslint/typescript-estree": 7.10.0(typescript@5.4.5) + "@typescript-eslint/visitor-keys": 7.10.0 debug: 4.3.4 eslint: 8.57.0 typescript: 5.4.5 @@ -1418,21 +1409,21 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@7.8.0: + /@typescript-eslint/scope-manager@7.10.0: resolution: { - integrity: sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==, + integrity: sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==, } engines: { node: ^18.18.0 || >=20.0.0 } dependencies: - "@typescript-eslint/types": 7.8.0 - "@typescript-eslint/visitor-keys": 7.8.0 + "@typescript-eslint/types": 7.10.0 + "@typescript-eslint/visitor-keys": 7.10.0 dev: true - /@typescript-eslint/type-utils@7.8.0(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/type-utils@7.10.0(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==, + integrity: sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1442,8 +1433,8 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/typescript-estree": 7.8.0(typescript@5.4.5) - "@typescript-eslint/utils": 7.8.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/typescript-estree": 7.10.0(typescript@5.4.5) + "@typescript-eslint/utils": 7.10.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4 eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) @@ -1452,18 +1443,18 @@ packages: - supports-color dev: true - /@typescript-eslint/types@7.8.0: + /@typescript-eslint/types@7.10.0: resolution: { - integrity: sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==, + integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==, } engines: { node: ^18.18.0 || >=20.0.0 } dev: true - /@typescript-eslint/typescript-estree@7.8.0(typescript@5.4.5): + /@typescript-eslint/typescript-estree@7.10.0(typescript@5.4.5): resolution: { - integrity: sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==, + integrity: sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1472,8 +1463,8 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/types": 7.8.0 - "@typescript-eslint/visitor-keys": 7.8.0 + "@typescript-eslint/types": 7.10.0 + "@typescript-eslint/visitor-keys": 7.10.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1485,36 +1476,33 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@7.8.0(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/utils@7.10.0(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==, + integrity: sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: eslint: ^8.56.0 dependencies: "@eslint-community/eslint-utils": 4.4.0(eslint@8.57.0) - "@types/json-schema": 7.0.15 - "@types/semver": 7.5.8 - "@typescript-eslint/scope-manager": 7.8.0 - "@typescript-eslint/types": 7.8.0 - "@typescript-eslint/typescript-estree": 7.8.0(typescript@5.4.5) + "@typescript-eslint/scope-manager": 7.10.0 + "@typescript-eslint/types": 7.10.0 + "@typescript-eslint/typescript-estree": 7.10.0(typescript@5.4.5) eslint: 8.57.0 - semver: 7.6.2 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@7.8.0: + /@typescript-eslint/visitor-keys@7.10.0: resolution: { - integrity: sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==, + integrity: sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==, } engines: { node: ^18.18.0 || >=20.0.0 } dependencies: - "@typescript-eslint/types": 7.8.0 + "@typescript-eslint/types": 7.10.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1825,14 +1813,14 @@ packages: balanced-match: 1.0.2 dev: true - /braces@3.0.2: + /braces@3.0.3: resolution: { - integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==, + integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==, } engines: { node: ">=8" } dependencies: - fill-range: 7.0.1 + fill-range: 7.1.1 dev: true /browserslist@4.23.0: @@ -1843,10 +1831,10 @@ packages: engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 } hasBin: true dependencies: - caniuse-lite: 1.0.30001617 - electron-to-chromium: 1.4.761 + caniuse-lite: 1.0.30001621 + electron-to-chromium: 1.4.777 node-releases: 2.0.14 - update-browserslist-db: 1.0.15(browserslist@4.23.0) + update-browserslist-db: 1.0.16(browserslist@4.23.0) dev: true /bundle-require@4.1.0(esbuild@0.19.12): @@ -1878,15 +1866,15 @@ packages: engines: { node: ">=14.16" } dev: false - /cacheable-request@10.2.14: + /cacheable-request@12.0.1: resolution: { - integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==, + integrity: sha512-Yo9wGIQUaAfIbk+qY0X4cDQgCosecfBe3V9NSyeY4qPC2SAkbCS4Xj79VP8WOzitpJUZKc/wsRCYF5ariDIwkg==, } - engines: { node: ">=14.16" } + engines: { node: ">=18" } dependencies: "@types/http-cache-semantics": 4.0.4 - get-stream: 6.0.1 + get-stream: 9.0.1 http-cache-semantics: 4.1.1 keyv: 4.5.4 mimic-response: 4.0.0 @@ -1916,10 +1904,10 @@ packages: engines: { node: ">=6" } dev: true - /caniuse-lite@1.0.30001617: + /caniuse-lite@1.0.30001621: resolution: { - integrity: sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA==, + integrity: sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==, } dev: true @@ -1954,7 +1942,7 @@ packages: engines: { node: ">= 8.10.0" } dependencies: anymatch: 3.1.3 - braces: 3.0.2 + braces: 3.0.3 glob-parent: 5.1.2 is-binary-path: 2.1.0 is-glob: 4.0.3 @@ -2214,10 +2202,10 @@ packages: } dev: true - /electron-to-chromium@1.4.761: + /electron-to-chromium@1.4.777: resolution: { - integrity: sha512-PIbxpiJGx6Bb8dQaonNc6CGTRlVntdLg/2nMa1YhnrwYOORY9a3ZgGN0UQYE6lAcj/lkyduJN7BPt/JiY+jAQQ==, + integrity: sha512-n02NCwLJ3wexLfK/yQeqfywCblZqLcXphzmid5e8yVPdtEcida7li0A5WQKghHNG0FeOMCzeFOzEbtAh5riXFw==, } dev: true @@ -2468,7 +2456,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.8.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): resolution: { integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==, @@ -2481,8 +2469,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.16.1 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.8.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -2494,7 +2482,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.8.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: { integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==, @@ -2518,11 +2506,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - "@typescript-eslint/parser": 7.8.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.8.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) transitivePeerDependencies: - supports-color dev: true @@ -2578,8 +2566,8 @@ packages: eslint: ^8.0.1 dependencies: "@github/browserslist-config": 1.0.0 - "@typescript-eslint/eslint-plugin": 7.8.0(@typescript-eslint/parser@7.8.0)(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/parser": 7.8.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/eslint-plugin": 7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) aria-query: 5.3.0 eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) @@ -2587,7 +2575,7 @@ packages: eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) eslint-plugin-filenames: 1.3.2(eslint@8.57.0) eslint-plugin-i18n-text: 1.0.1(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-no-only-tests: 3.1.0 eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) @@ -2614,7 +2602,7 @@ packages: eslint: 8.57.0 dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.8.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: { integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==, @@ -2627,7 +2615,7 @@ packages: "@typescript-eslint/parser": optional: true dependencies: - "@typescript-eslint/parser": 7.8.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -2636,7 +2624,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.8.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2896,7 +2884,7 @@ packages: "@nodelib/fs.walk": 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 - micromatch: 4.0.5 + micromatch: 4.0.7 dev: true /fast-json-stable-stringify@2.1.0: @@ -2932,10 +2920,10 @@ packages: flat-cache: 3.2.0 dev: true - /fill-range@7.0.1: + /fill-range@7.1.1: resolution: { - integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==, + integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==, } engines: { node: ">=8" } dependencies: @@ -3089,6 +3077,7 @@ packages: integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==, } engines: { node: ">=10" } + dev: true /get-stream@8.0.1: resolution: @@ -3098,6 +3087,17 @@ packages: engines: { node: ">=16" } dev: false + /get-stream@9.0.1: + resolution: + { + integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==, + } + engines: { node: ">=18" } + dependencies: + "@sec-ant/readable-stream": 0.4.1 + is-stream: 4.0.1 + dev: false + /get-symbol-description@1.0.2: resolution: { @@ -3139,19 +3139,19 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.14: + /glob@10.3.16: resolution: { - integrity: sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g==, + integrity: sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==, } - engines: { node: ">=16 || 14 >=14.17" } + engines: { node: ">=16 || 14 >=14.18" } hasBin: true dependencies: foreground-child: 3.1.1 - jackspeak: 2.3.6 + jackspeak: 3.1.2 minimatch: 9.0.4 minipass: 7.1.1 - path-scurry: 1.11.0 + path-scurry: 1.11.1 dev: true /glob@7.2.3: @@ -3221,17 +3221,17 @@ packages: get-intrinsic: 1.2.4 dev: true - /got@14.2.1: + /got@14.3.0: resolution: { - integrity: sha512-KOaPMremmsvx6l9BLC04LYE6ZFW4x7e4HkTe3LwBmtuYYQwpeS4XKqzhubTIkaQ1Nr+eXxeori0zuwupXMovBQ==, + integrity: sha512-vZkrXdq5BtPWTXqvjXSpl6zky3zpHaOVfSug/RfFHu3YrtSsvYzopVMDqrh2do77WnGoCSSRCHW25zXOSAQ9zw==, } engines: { node: ">=20" } dependencies: - "@sindresorhus/is": 6.3.0 + "@sindresorhus/is": 6.3.1 "@szmarczak/http-timer": 5.0.1 cacheable-lookup: 7.0.0 - cacheable-request: 10.2.14 + cacheable-request: 12.0.1 decompress-response: 6.0.0 form-data-encoder: 4.0.2 get-stream: 8.0.1 @@ -3625,6 +3625,14 @@ packages: engines: { node: ">=8" } dev: true + /is-stream@4.0.1: + resolution: + { + integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==, + } + engines: { node: ">=18" } + dev: false + /is-string@1.0.7: resolution: { @@ -3710,10 +3718,10 @@ packages: set-function-name: 2.0.2 dev: true - /jackspeak@2.3.6: + /jackspeak@3.1.2: resolution: { - integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==, + integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==, } engines: { node: ">=14" } dependencies: @@ -3814,10 +3822,10 @@ packages: dependencies: json-buffer: 3.0.1 - /language-subtag-registry@0.3.22: + /language-subtag-registry@0.3.23: resolution: { - integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==, + integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==, } dev: true @@ -3828,7 +3836,7 @@ packages: } engines: { node: ">=0.10" } dependencies: - language-subtag-registry: 0.3.22 + language-subtag-registry: 0.3.23 dev: true /levn@0.4.1: @@ -3955,14 +3963,14 @@ packages: engines: { node: ">= 8" } dev: true - /micromatch@4.0.5: + /micromatch@4.0.7: resolution: { - integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==, + integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==, } engines: { node: ">=8.6" } dependencies: - braces: 3.0.2 + braces: 3.0.3 picomatch: 2.3.1 dev: true @@ -4308,12 +4316,12 @@ packages: } dev: true - /path-scurry@1.11.0: + /path-scurry@1.11.1: resolution: { - integrity: sha512-LNHTaVkzaYaLGlO+0u3rQTz7QrHTFOuKyba9JMTQutkmtNew8dw8wOD7mTU/5fCPZzCWpfW0XnQKzY61P0aTaw==, + integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==, } - engines: { node: ">=16 || 14 >=14.17" } + engines: { node: ">=16 || 14 >=14.18" } dependencies: lru-cache: 10.2.2 minipass: 7.1.1 @@ -4327,10 +4335,10 @@ packages: engines: { node: ">=8" } dev: true - /picocolors@1.0.0: + /picocolors@1.0.1: resolution: { - integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==, + integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==, } dev: true @@ -4551,32 +4559,32 @@ packages: glob: 7.2.3 dev: true - /rollup@4.17.2: + /rollup@4.18.0: resolution: { - integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==, + integrity: sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==, } engines: { node: ">=18.0.0", npm: ">=8.0.0" } hasBin: true dependencies: "@types/estree": 1.0.5 optionalDependencies: - "@rollup/rollup-android-arm-eabi": 4.17.2 - "@rollup/rollup-android-arm64": 4.17.2 - "@rollup/rollup-darwin-arm64": 4.17.2 - "@rollup/rollup-darwin-x64": 4.17.2 - "@rollup/rollup-linux-arm-gnueabihf": 4.17.2 - "@rollup/rollup-linux-arm-musleabihf": 4.17.2 - "@rollup/rollup-linux-arm64-gnu": 4.17.2 - "@rollup/rollup-linux-arm64-musl": 4.17.2 - "@rollup/rollup-linux-powerpc64le-gnu": 4.17.2 - "@rollup/rollup-linux-riscv64-gnu": 4.17.2 - "@rollup/rollup-linux-s390x-gnu": 4.17.2 - "@rollup/rollup-linux-x64-gnu": 4.17.2 - "@rollup/rollup-linux-x64-musl": 4.17.2 - "@rollup/rollup-win32-arm64-msvc": 4.17.2 - "@rollup/rollup-win32-ia32-msvc": 4.17.2 - "@rollup/rollup-win32-x64-msvc": 4.17.2 + "@rollup/rollup-android-arm-eabi": 4.18.0 + "@rollup/rollup-android-arm64": 4.18.0 + "@rollup/rollup-darwin-arm64": 4.18.0 + "@rollup/rollup-darwin-x64": 4.18.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.18.0 + "@rollup/rollup-linux-arm-musleabihf": 4.18.0 + "@rollup/rollup-linux-arm64-gnu": 4.18.0 + "@rollup/rollup-linux-arm64-musl": 4.18.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.18.0 + "@rollup/rollup-linux-riscv64-gnu": 4.18.0 + "@rollup/rollup-linux-s390x-gnu": 4.18.0 + "@rollup/rollup-linux-x64-gnu": 4.18.0 + "@rollup/rollup-linux-x64-musl": 4.18.0 + "@rollup/rollup-win32-arm64-msvc": 4.18.0 + "@rollup/rollup-win32-ia32-msvc": 4.18.0 + "@rollup/rollup-win32-x64-msvc": 4.18.0 fsevents: 2.3.3 dev: true @@ -4859,7 +4867,7 @@ packages: dependencies: "@jridgewell/gen-mapping": 0.3.5 commander: 4.1.1 - glob: 10.3.14 + glob: 10.3.16 lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.6 @@ -5064,7 +5072,7 @@ packages: joycon: 3.1.1 postcss-load-config: 4.0.2 resolve-from: 5.0.0 - rollup: 4.17.2 + rollup: 4.18.0 source-map: 0.8.0-beta.0 sucrase: 3.35.0 tree-kill: 1.2.2 @@ -5200,10 +5208,10 @@ packages: } dev: false - /update-browserslist-db@1.0.15(browserslist@4.23.0): + /update-browserslist-db@1.0.16(browserslist@4.23.0): resolution: { - integrity: sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==, + integrity: sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==, } hasBin: true peerDependencies: @@ -5211,7 +5219,7 @@ packages: dependencies: browserslist: 4.23.0 escalade: 3.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 dev: true /uri-js@4.4.1: @@ -5421,10 +5429,10 @@ packages: engines: { node: ">=10" } dev: true - github.com/DeterminateSystems/detsys-ts/2391ba1ef3d22027cd4d9ecce147007a88f63643: + github.com/DeterminateSystems/detsys-ts/180884918b85ef67dad81f70b4130eca5268242e: resolution: { - tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/2391ba1ef3d22027cd4d9ecce147007a88f63643, + tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/180884918b85ef67dad81f70b4130eca5268242e, } name: detsys-ts version: 1.0.0 @@ -5432,7 +5440,7 @@ packages: "@actions/cache": 3.2.4 "@actions/core": 1.10.1 "@actions/exec": 1.1.1 - got: 14.2.1 + got: 14.3.0 transitivePeerDependencies: - encoding dev: false diff --git a/src/index.ts b/src/index.ts index 8f1dbe4..739dacc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import fs from "node:fs"; import { userInfo } from "node:os"; import stringArgv from "string-argv"; import * as path from "path"; -import { IdsToolbox, inputs, platform } from "detsys-ts"; +import { DetSysAction, inputs, platform } from "detsys-ts"; import { randomUUID } from "node:crypto"; // Nix installation events @@ -34,8 +34,7 @@ const FACT_IN_ACT = "in_act"; const FACT_IN_NAMESPACE_SO = "in_namespace_so"; const FACT_NIX_INSTALLER_PLANNER = "nix_installer_planner"; -class NixInstallerAction { - idslib: IdsToolbox; +class NixInstallerAction extends DetSysAction { platform: string; nixPackageUrl: string | null; backtrace: string | null; @@ -68,7 +67,7 @@ class NixInstallerAction { trustRunnerUser: boolean | null; constructor() { - this.idslib = new IdsToolbox({ + super({ name: "nix-installer", fetchStyle: "nix-style", legacySourcePrefix: "nix-installer", @@ -107,6 +106,16 @@ class NixInstallerAction { this.trustRunnerUser = inputs.getBool("trust-runner-user"); } + async main(): Promise { + await this.detectAndForceDockerShim(); + await this.install(); + } + + async post(): Promise { + await this.cleanupDockerShim(); + await this.reportOverall(); + } + async detectAndForceDockerShim(): Promise { const runnerOs = process.env["RUNNER_OS"]; @@ -134,7 +143,7 @@ class NixInstallerAction { throwIfNoEntry: false, }); if (systemdCheck?.isDirectory()) { - this.idslib.addFact(FACT_HAS_SYSTEMD, true); + this.addFact(FACT_HAS_SYSTEMD, true); if (this.forceDockerShim) { actionsCore.warning( "Systemd is detected, but ignoring it since force-docker-shim is enabled.", @@ -143,13 +152,13 @@ class NixInstallerAction { return; } } - this.idslib.addFact(FACT_HAS_SYSTEMD, false); + this.addFact(FACT_HAS_SYSTEMD, false); actionsCore.debug( "Linux detected without systemd, testing for Docker with `docker info` as an alternative daemon supervisor.", ); - this.idslib.addFact(FACT_HAS_DOCKER, false); // Set to false here, and only in the success case do we set it to true + this.addFact(FACT_HAS_DOCKER, false); // Set to false here, and only in the success case do we set it to true let exitCode; try { exitCode = await actionsExec.exec("docker", ["info"], { @@ -183,7 +192,7 @@ class NixInstallerAction { return; } } - this.idslib.addFact(FACT_HAS_DOCKER, true); + this.addFact(FACT_HAS_DOCKER, true); if ( !this.forceDockerShim && @@ -320,7 +329,7 @@ class NixInstallerAction { executionEnv.NIX_INSTALLER_NO_CONFIRM = "true"; executionEnv.NIX_INSTALLER_DIAGNOSTIC_ATTRIBUTION = JSON.stringify( - this.idslib.getCorrelationHashes(), + this.getCorrelationHashes(), ); if (this.backtrace !== null) { @@ -368,7 +377,7 @@ class NixInstallerAction { } executionEnv.NIX_INSTALLER_DIAGNOSTIC_ENDPOINT = - this.idslib.getDiagnosticsUrl()?.toString() ?? ""; + this.getDiagnosticsUrl()?.toString() ?? ""; // TODO: Error if the user uses these on not-MacOS if (this.macEncrypt !== null) { @@ -460,7 +469,7 @@ class NixInstallerAction { executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; if (process.env["ACT"] && !process.env["NOT_ACT"]) { - this.idslib.addFact(FACT_IN_ACT, true); + this.addFact(FACT_IN_ACT, true); actionsCore.info( "Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`", ); @@ -468,7 +477,7 @@ class NixInstallerAction { } if (process.env["NSC_VM_ID"] && !process.env["NOT_NAMESPACE"]) { - this.idslib.addFact(FACT_IN_NAMESPACE_SO, true); + this.addFact(FACT_IN_NAMESPACE_SO, true); actionsCore.info( "Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace", ); @@ -486,10 +495,10 @@ class NixInstallerAction { const args = ["install"]; if (this.planner) { - this.idslib.addFact(FACT_NIX_INSTALLER_PLANNER, this.planner); + this.addFact(FACT_NIX_INSTALLER_PLANNER, this.planner); args.push(this.planner); } else { - this.idslib.addFact(FACT_NIX_INSTALLER_PLANNER, getDefaultPlanner()); + this.addFact(FACT_NIX_INSTALLER_PLANNER, getDefaultPlanner()); args.push(getDefaultPlanner()); } @@ -498,7 +507,7 @@ class NixInstallerAction { args.concat(extraArgs); } - this.idslib.recordEvent(EVENT_INSTALL_NIX_START); + this.recordEvent(EVENT_INSTALL_NIX_START); const exitCode = await actionsExec.exec(binaryPath, args, { env: { ...executionEnv, @@ -507,13 +516,13 @@ class NixInstallerAction { }); if (exitCode !== 0) { - this.idslib.recordEvent(EVENT_INSTALL_NIX_FAILURE, { + this.recordEvent(EVENT_INSTALL_NIX_FAILURE, { exitCode, }); throw new Error(`Non-zero exit code of \`${exitCode}\` detected`); } - this.idslib.recordEvent(EVENT_INSTALL_NIX_SUCCESS); + this.recordEvent(EVENT_INSTALL_NIX_SUCCESS); return exitCode; } @@ -613,7 +622,7 @@ class NixInstallerAction { { actionsCore.debug("Starting the Nix daemon through Docker..."); - this.idslib.recordEvent(EVENT_START_DOCKER_SHIM); + this.recordEvent(EVENT_START_DOCKER_SHIM); const exitCode = await actionsExec.exec( "docker", [ @@ -640,7 +649,7 @@ class NixInstallerAction { "always", "--init", "--name", - `determinate-nix-shim-${this.idslib.getUniqueId()}-${randomUUID()}`, + `determinate-nix-shim-${this.getUniqueId()}-${randomUUID()}`, "determinate-nix-shim:latest", ], { @@ -703,7 +712,7 @@ class NixInstallerAction { } if (cleaned) { - this.idslib.recordEvent(EVENT_CLEAN_UP_DOCKER_SHIM); + this.recordEvent(EVENT_CLEAN_UP_DOCKER_SHIM); } else { actionsCore.warning( "Giving up on cleaning up the nix daemon container", @@ -732,7 +741,7 @@ class NixInstallerAction { } async flakehubLogin(): Promise { - this.idslib.recordEvent(EVENT_LOGIN_TO_FLAKEHUB); + this.recordEvent(EVENT_LOGIN_TO_FLAKEHUB); const netrcPath = `${process.env["RUNNER_TEMP"]}/determinate-nix-installer-netrc`; const jwt = await actionsCore.getIDToken("api.flakehub.com"); @@ -759,7 +768,7 @@ class NixInstallerAction { } async executeUninstall(): Promise { - this.idslib.recordEvent(EVENT_UNINSTALL_NIX); + this.recordEvent(EVENT_UNINSTALL_NIX); const exitCode = await actionsExec.exec( `/nix/nix-installer`, ["uninstall"], @@ -791,7 +800,7 @@ class NixInstallerAction { } private async setupKvm(): Promise { - this.idslib.recordEvent(EVENT_SETUP_KVM); + this.recordEvent(EVENT_SETUP_KVM); const currentUser = userInfo(); const isRoot = currentUser.uid === 0; const maybeSudo = isRoot ? "" : "sudo"; @@ -887,7 +896,7 @@ class NixInstallerAction { private async fetchBinary(): Promise { if (!this.localRoot) { - return await this.idslib.fetchExecutable(); + return await this.fetchExecutable(); } else { const localPath = join(this.localRoot, `nix-installer-${this.platform}`); actionsCore.info(`Using binary ${localPath}`); @@ -897,7 +906,7 @@ class NixInstallerAction { async reportOverall(): Promise { try { - this.idslib.recordEvent(EVENT_CONCLUDE_WORKFLOW, { + this.recordEvent(EVENT_CONCLUDE_WORKFLOW, { conclusion: await this.getWorkflowConclusion(), }); } catch (e) { @@ -994,19 +1003,7 @@ function getDefaultPlanner(): string { } function main(): void { - const installer = new NixInstallerAction(); - - installer.idslib.onMain(async () => { - await installer.detectAndForceDockerShim(); - await installer.install(); - }); - - installer.idslib.onPost(async () => { - await installer.cleanupDockerShim(); - await installer.reportOverall(); - }); - - installer.idslib.execute(); + new NixInstallerAction().execute(); } main(); From 61795779f33618bc3159225f130d91dcede9464a Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 13:24:59 -0300 Subject: [PATCH 02/14] Add ci-mode to action.yml --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 4322016..75f39ac 100644 --- a/action.yml +++ b/action.yml @@ -129,6 +129,9 @@ inputs: nix-installer-url: description: (deprecated) A URL pointing to a `nix-installer.sh` script required: false + ci-mode: + description: Whether to fail when any errors are thrown. Used only to test the Action; do not set this in your own workflows. + default: false runs: using: "node20" From f6047128c4817586ccc165f64ab66411863bde34 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 13:40:01 -0300 Subject: [PATCH 03/14] Streamline runner OS logic --- dist/index.js | 51 ++++++++++++++++++++++++++------------------ src/index.ts | 59 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 65 insertions(+), 45 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3751b01..3c10119 100644 --- a/dist/index.js +++ b/dist/index.js @@ -97800,6 +97800,7 @@ var NixInstallerAction = class extends DetSysAction { this.reinstall = inputs_exports.getBool("reinstall"); this.startDaemon = inputs_exports.getBool("start-daemon"); this.trustRunnerUser = inputs_exports.getBool("trust-runner-user"); + this.runnerOs = process.env["RUNNER_OS"]; } async main() { await this.detectAndForceDockerShim(); @@ -97809,9 +97810,17 @@ var NixInstallerAction = class extends DetSysAction { await this.cleanupDockerShim(); await this.reportOverall(); } + get isMacOS() { + return this.runnerOs === "macOS"; + } + get isLinux() { + return this.runnerOs === "Linux"; + } + get isAct() { + return process.env["ACT"] !== "" && !(process.env["NOT_ACT"] === ""); + } async detectAndForceDockerShim() { - const runnerOs = process.env["RUNNER_OS"]; - if (runnerOs !== "Linux") { + if (this.isLinux) { if (this.forceDockerShim) { core.warning( "Ignoring force-docker-shim which is set to true, as it is only supported on Linux." @@ -97820,7 +97829,7 @@ var NixInstallerAction = class extends DetSysAction { } return; } - if (process.env["ACT"] && !process.env["NOT_ACT"]) { + if (this.isAct) { core.debug( "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act." ); @@ -97984,7 +97993,6 @@ ${stderrBuffer}` } async executionEnvironment() { const executionEnv = {}; - const runnerOs = process.env["RUNNER_OS"]; executionEnv.NIX_INSTALLER_NO_CONFIRM = "true"; executionEnv.NIX_INSTALLER_DIAGNOSTIC_ATTRIBUTION = JSON.stringify( this.getCorrelationHashes() @@ -98025,13 +98033,13 @@ ${stderrBuffer}` } executionEnv.NIX_INSTALLER_DIAGNOSTIC_ENDPOINT = this.getDiagnosticsUrl()?.toString() ?? ""; if (this.macEncrypt !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error("`mac-encrypt` while `$RUNNER_OS` was not `macOS`"); } executionEnv.NIX_INSTALLER_ENCRYPT = this.macEncrypt; } if (this.macCaseSensitive !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error( "`mac-case-sensitive` while `$RUNNER_OS` was not `macOS`" ); @@ -98039,7 +98047,7 @@ ${stderrBuffer}` executionEnv.NIX_INSTALLER_CASE_SENSITIVE = this.macCaseSensitive; } if (this.macVolumeLabel !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error( "`mac-volume-label` while `$RUNNER_OS` was not `macOS`" ); @@ -98047,7 +98055,7 @@ ${stderrBuffer}` executionEnv.NIX_INSTALLER_VOLUME_LABEL = this.macVolumeLabel; } if (this.macRootDisk !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error("`mac-root-disk` while `$RUNNER_OS` was not `macOS`"); } executionEnv.NIX_INSTALLER_ROOT_DISK = this.macRootDisk; @@ -98059,7 +98067,7 @@ ${stderrBuffer}` executionEnv.NIX_INSTALLER_LOG_DIRECTIVES = this.logDirectives; } if (this.init !== null) { - if (runnerOs === "macOS") { + if (this.isMacOS) { throw new Error( "`init` is not a valid option when `$RUNNER_OS` is `macOS`" ); @@ -98128,8 +98136,8 @@ ${stderrBuffer}` this.addFact(FACT_NIX_INSTALLER_PLANNER, this.planner); args.push(this.planner); } else { - this.addFact(FACT_NIX_INSTALLER_PLANNER, getDefaultPlanner()); - args.push(getDefaultPlanner()); + this.addFact(FACT_NIX_INSTALLER_PLANNER, this.defaultPlanner); + args.push(this.defaultPlanner); } if (this.extraArgs) { const extraArgs = parseArgsStringToArgv(this.extraArgs); @@ -98521,17 +98529,18 @@ ${stderrBuffer}` return "unavailable"; } } -}; -function getDefaultPlanner() { - const envOs = process.env["RUNNER_OS"]; - if (envOs === "macOS") { - return "macos"; - } else if (envOs === "Linux") { - return "linux"; - } else { - throw new Error(`Unsupported \`RUNNER_OS\` (currently \`${envOs}\`)`); + get defaultPlanner() { + if (this.isMacOS) { + return "macos"; + } else if (this.isLinux) { + return "linux"; + } else { + throw new Error( + `Unsupported \`RUNNER_OS\` (currently \`${this.runnerOs}\`)` + ); + } } -} +}; function main() { new NixInstallerAction().execute(); } diff --git a/src/index.ts b/src/index.ts index 739dacc..29fba57 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,6 +65,7 @@ class NixInstallerAction extends DetSysAction { reinstall: boolean; startDaemon: boolean; trustRunnerUser: boolean | null; + runnerOs: string | undefined; constructor() { super({ @@ -104,6 +105,7 @@ class NixInstallerAction extends DetSysAction { this.reinstall = inputs.getBool("reinstall"); this.startDaemon = inputs.getBool("start-daemon"); this.trustRunnerUser = inputs.getBool("trust-runner-user"); + this.runnerOs = process.env["RUNNER_OS"]; } async main(): Promise { @@ -116,13 +118,23 @@ class NixInstallerAction extends DetSysAction { await this.reportOverall(); } - async detectAndForceDockerShim(): Promise { - const runnerOs = process.env["RUNNER_OS"]; + private get isMacOS(): boolean { + return this.runnerOs === "macOS"; + } + private get isLinux(): boolean { + return this.runnerOs === "Linux"; + } + + private get isAct(): boolean { + return process.env["ACT"] !== "" && !(process.env["NOT_ACT"] === ""); + } + + async detectAndForceDockerShim(): Promise { // Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker. // This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/), // and especially GitHub Enterprise Server. - if (runnerOs !== "Linux") { + if (this.isLinux) { if (this.forceDockerShim) { actionsCore.warning( "Ignoring force-docker-shim which is set to true, as it is only supported on Linux.", @@ -132,7 +144,7 @@ class NixInstallerAction extends DetSysAction { return; } - if (process.env["ACT"] && !process.env["NOT_ACT"]) { + if (this.isAct) { actionsCore.debug( "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act.", ); @@ -325,7 +337,6 @@ class NixInstallerAction extends DetSysAction { private async executionEnvironment(): Promise { const executionEnv: ExecuteEnvironment = {}; - const runnerOs = process.env["RUNNER_OS"]; executionEnv.NIX_INSTALLER_NO_CONFIRM = "true"; executionEnv.NIX_INSTALLER_DIAGNOSTIC_ATTRIBUTION = JSON.stringify( @@ -381,14 +392,14 @@ class NixInstallerAction extends DetSysAction { // TODO: Error if the user uses these on not-MacOS if (this.macEncrypt !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error("`mac-encrypt` while `$RUNNER_OS` was not `macOS`"); } executionEnv.NIX_INSTALLER_ENCRYPT = this.macEncrypt; } if (this.macCaseSensitive !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error( "`mac-case-sensitive` while `$RUNNER_OS` was not `macOS`", ); @@ -397,7 +408,7 @@ class NixInstallerAction extends DetSysAction { } if (this.macVolumeLabel !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error( "`mac-volume-label` while `$RUNNER_OS` was not `macOS`", ); @@ -406,7 +417,7 @@ class NixInstallerAction extends DetSysAction { } if (this.macRootDisk !== null) { - if (runnerOs !== "macOS") { + if (!this.isMacOS) { throw new Error("`mac-root-disk` while `$RUNNER_OS` was not `macOS`"); } executionEnv.NIX_INSTALLER_ROOT_DISK = this.macRootDisk; @@ -422,7 +433,7 @@ class NixInstallerAction extends DetSysAction { // TODO: Error if the user uses these on MacOS if (this.init !== null) { - if (runnerOs === "macOS") { + if (this.isMacOS) { throw new Error( "`init` is not a valid option when `$RUNNER_OS` is `macOS`", ); @@ -498,8 +509,8 @@ class NixInstallerAction extends DetSysAction { this.addFact(FACT_NIX_INSTALLER_PLANNER, this.planner); args.push(this.planner); } else { - this.addFact(FACT_NIX_INSTALLER_PLANNER, getDefaultPlanner()); - args.push(getDefaultPlanner()); + this.addFact(FACT_NIX_INSTALLER_PLANNER, this.defaultPlanner); + args.push(this.defaultPlanner); } if (this.extraArgs) { @@ -962,6 +973,18 @@ class NixInstallerAction extends DetSysAction { return "unavailable"; } } + + private get defaultPlanner(): string { + if (this.isMacOS) { + return "macos"; + } else if (this.isLinux) { + return "linux"; + } else { + throw new Error( + `Unsupported \`RUNNER_OS\` (currently \`${this.runnerOs}\`)`, + ); + } + } } type ExecuteEnvironment = { @@ -990,18 +1013,6 @@ type ExecuteEnvironment = { NIX_INSTALLER_LOGGER?: string; }; -function getDefaultPlanner(): string { - const envOs = process.env["RUNNER_OS"]; - - if (envOs === "macOS") { - return "macos"; - } else if (envOs === "Linux") { - return "linux"; - } else { - throw new Error(`Unsupported \`RUNNER_OS\` (currently \`${envOs}\`)`); - } -} - function main(): void { new NixInstallerAction().execute(); } From cd7602a5a89e7a37062defa7697ad514a7f2d5de Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 13:43:59 -0300 Subject: [PATCH 04/14] Add workflow conclusion enum --- src/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 29fba57..90a32f4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,6 +34,13 @@ const FACT_IN_ACT = "in_act"; const FACT_IN_NAMESPACE_SO = "in_namespace_so"; const FACT_NIX_INSTALLER_PLANNER = "nix_installer_planner"; +type WorkflowConclusion = + | "success" + | "failure" + | "cancelled" + | "unavailable" + | "no-jobs"; + class NixInstallerAction extends DetSysAction { platform: string; nixPackageUrl: string | null; @@ -926,7 +933,7 @@ class NixInstallerAction extends DetSysAction { } private async getWorkflowConclusion(): Promise< - undefined | "success" | "failure" | "cancelled" | "unavailable" | "no-jobs" + undefined | WorkflowConclusion > { if (this.githubToken == null) { return undefined; From a56dda90ad46ebcb21714cb81060854d10028ee3 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 13:47:58 -0300 Subject: [PATCH 05/14] Update detsys-ts again --- action.yml | 2 +- dist/index.js | 4 ++-- pnpm-lock.yaml | 6 +++--- src/index.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 75f39ac..0306268 100644 --- a/action.yml +++ b/action.yml @@ -129,7 +129,7 @@ inputs: nix-installer-url: description: (deprecated) A URL pointing to a `nix-installer.sh` script required: false - ci-mode: + _internal-strict-mode: description: Whether to fail when any errors are thrown. Used only to test the Action; do not set this in your own workflows. default: false diff --git a/dist/index.js b/dist/index.js index 3c10119..7f48b04 100644 --- a/dist/index.js +++ b/dist/index.js @@ -96694,7 +96694,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@180884918b85ef67dad81f70b4130eca5268242e_o7ea7dhs7wrsl7wvvt2otnlz3q/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@ed02129aed8e4d6402d920152652877189bece70_3whmnlhrx56zhgtsjnkrhnutfu/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -97184,7 +97184,7 @@ var DetSysAction = class { this.actionOptions = makeOptionsConfident(actionOptions); this.exceptionAttachments = /* @__PURE__ */ new Map(); this.nixStoreTrust = "unknown"; - this.strictMode = getBool("ci-mode"); + this.strictMode = getBool("_internal-strict-mode"); this.events = []; this.client = got_dist_source.extend({ retry: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aaf3c16..5779c5a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ dependencies: version: 5.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/180884918b85ef67dad81f70b4130eca5268242e + version: github.com/DeterminateSystems/detsys-ts/ed02129aed8e4d6402d920152652877189bece70 string-argv: specifier: ^0.3.2 version: 0.3.2 @@ -5429,10 +5429,10 @@ packages: engines: { node: ">=10" } dev: true - github.com/DeterminateSystems/detsys-ts/180884918b85ef67dad81f70b4130eca5268242e: + github.com/DeterminateSystems/detsys-ts/ed02129aed8e4d6402d920152652877189bece70: resolution: { - tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/180884918b85ef67dad81f70b4130eca5268242e, + tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/ed02129aed8e4d6402d920152652877189bece70, } name: detsys-ts version: 1.0.0 diff --git a/src/index.ts b/src/index.ts index 90a32f4..2405a4a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -51,7 +51,7 @@ class NixInstallerAction extends DetSysAction { kvm: boolean; githubServerUrl: string | null; githubToken: string | null; - forceDockerShim: boolean | null; + forceDockerShim: boolean; init: string | null; localRoot: string | null; logDirectives: string | null; @@ -71,7 +71,7 @@ class NixInstallerAction extends DetSysAction { planner: string | null; reinstall: boolean; startDaemon: boolean; - trustRunnerUser: boolean | null; + trustRunnerUser: boolean; runnerOs: string | undefined; constructor() { From e4f741cb67f65902544a9542cb745522f9d62d05 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 15:41:57 -0300 Subject: [PATCH 06/14] Apply internal strict mode to CI runs --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcd7447..702ed72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,7 @@ jobs: logger: pretty log-directives: nix_installer=trace backtrace: full + _internal-strict-mode: true - name: echo $PATH run: echo $PATH @@ -90,6 +91,7 @@ jobs: logger: pretty log-directives: nix_installer=trace backtrace: full + _internal-strict-mode: true - name: Test `nix` with `$GITHUB_PATH` if: success() || failure() run: | @@ -107,6 +109,7 @@ jobs: reinstall: true extra-conf: | use-sqlite-wal = true + _internal-strict-mode: true - name: Test `nix` with `$GITHUB_PATH` if: success() || failure() run: | @@ -148,6 +151,7 @@ jobs: logger: pretty log-directives: nix_installer=trace backtrace: full + _internal-strict-mode: true - name: echo $PATH run: echo $PATH - name: Test `nix` with `$GITHUB_PATH` @@ -176,6 +180,7 @@ jobs: logger: pretty log-directives: nix_installer=trace backtrace: full + _internal-strict-mode: true - name: Test `nix` with `$GITHUB_PATH` if: success() || failure() run: | @@ -193,6 +198,7 @@ jobs: reinstall: true extra-conf: | use-sqlite-wal = true + _internal-strict-mode: true - name: Test `nix` with `$GITHUB_PATH` if: success() || failure() run: | @@ -234,5 +240,6 @@ jobs: uses: ./ with: source-${{ matrix.inputs.key }}: ${{ matrix.inputs.value }} + _internal-strict-mode: true - name: Ensure that the expected Nix version ${{ matrix.inputs.nix-version }} is installed via alternative source-${{ matrix.inputs.key }} run: .github/verify-version.sh ${{ matrix.inputs.nix-version }} From 7b0893fcd8b9ce92b004ce129da6007289679e92 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 18:29:40 -0300 Subject: [PATCH 07/14] Regenerate dist --- dist/index.js | 135 ++++++++++++++++++++++++------------------------- pnpm-lock.yaml | 6 +-- 2 files changed, 70 insertions(+), 71 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7f48b04..ace9f45 100644 --- a/dist/index.js +++ b/dist/index.js @@ -96694,7 +96694,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@ed02129aed8e4d6402d920152652877189bece70_3whmnlhrx56zhgtsjnkrhnutfu/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@848cedfa44c31ae5ed7995350bb2707b9422840e_heluh4h342h2muwandvhzbsvpi/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -97156,6 +97156,7 @@ var EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit"; var EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss"; var EVENT_ARTIFACT_CACHE_PERSIST = "artifact_cache_persist"; var EVENT_PREFLIGHT_REQUIRE_NIX_DENIED = "preflight-require-nix-denied"; +var FACT_ARTIFACT_FETCHED_FROM_CACHE = "artifact_fetched_from_cache"; var FACT_ENDED_WITH_EXCEPTION = "ended_with_exception"; var FACT_FINAL_EXCEPTION = "final_exception"; var FACT_OS = "$os"; @@ -97268,16 +97269,6 @@ var DetSysAction = class { stapleFile(name, location) { this.exceptionAttachments.set(name, location); } - setExecutionPhase() { - const phase = core.getState(STATE_KEY_EXECUTION_PHASE); - if (phase === "") { - core.saveState(STATE_KEY_EXECUTION_PHASE, "post"); - this.executionPhase = "main"; - } else { - this.executionPhase = "post"; - } - this.facts.execution_phase = this.executionPhase; - } /** * Execute the Action as defined. */ @@ -97287,7 +97278,55 @@ var DetSysAction = class { process.exitCode = 1; }); } - // Whether the + getTemporaryName() { + const tmpDir = process.env["RUNNER_TEMP"] || (0,external_node_os_.tmpdir)(); + return external_node_path_namespaceObject.join(tmpDir, `${this.actionOptions.name}-${(0,external_node_crypto_namespaceObject.randomUUID)()}`); + } + addFact(key, value) { + this.facts[key] = value; + } + getDiagnosticsUrl() { + return this.actionOptions.diagnosticsUrl; + } + getUniqueId() { + return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)(); + } + getCorrelationHashes() { + return this.identity; + } + recordEvent(eventName, context = {}) { + this.events.push({ + event_name: `${this.actionOptions.eventPrefix}${eventName}`, + context, + correlation: this.identity, + facts: this.facts, + timestamp: /* @__PURE__ */ new Date(), + uuid: (0,external_node_crypto_namespaceObject.randomUUID)() + }); + } + /** + * Unpacks the closure returned by `fetchArtifact()`, imports the + * contents into the Nix store, and returns the path of the executable at + * `/nix/store/STORE_PATH/bin/${bin}`. + */ + async unpackClosure(bin) { + const artifact = await this.fetchArtifact(); + const { stdout } = await (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.exec)( + `cat "${artifact}" | xz -d | nix-store --import` + ); + const paths = stdout.split(external_node_os_.EOL); + const lastPath = paths.at(-2); + return `${lastPath}/bin/${bin}`; + } + /** + * Fetches the executable at the URL determined by the `source-*` inputs and + * other facts, `chmod`s it, and returns the path to the executable on disk. + */ + async fetchExecutable() { + const binaryPath = await this.fetchArtifact(); + await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP); + return binaryPath; + } get isMain() { return this.executionPhase === "main"; } @@ -97343,52 +97382,25 @@ var DetSysAction = class { await this.complete(); } } - addFact(key, value) { - this.facts[key] = value; - } - getDiagnosticsUrl() { - return this.actionOptions.diagnosticsUrl; - } - getUniqueId() { - return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)(); - } - getCorrelationHashes() { - return this.identity; - } - recordEvent(eventName, context = {}) { - this.events.push({ - event_name: `${this.actionOptions.eventPrefix}${eventName}`, - context, - correlation: this.identity, - facts: this.facts, - timestamp: /* @__PURE__ */ new Date(), - uuid: (0,external_node_crypto_namespaceObject.randomUUID)() - }); - } /** - * Fetches a file in `.xz` format, imports its contents into the Nix store, - * and returns the path of the executable at `/nix/store/STORE_PATH/bin/${bin}`. - */ - async unpackClosure(bin) { - const artifact = this.fetchArtifact(); - const { stdout } = await (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.exec)( - `cat "${artifact}" | xz -d | nix-store --import` - ); - const paths = stdout.split(external_node_os_.EOL); - const lastPath = paths.at(-2); - return `${lastPath}/bin/${bin}`; - } - /** - * Fetch an artifact, such as a tarball, from the URL determined by the `source-*` - * inputs and other factors. + * Fetch an artifact, such as a tarball, from the location determined by the + * `source-*` inputs. If `source-binary` is specified, this will return a path + * to a binary on disk; otherwise, the artifact will be downloaded from the + * URL determined by the other `source-*` inputs (`source-url`, `source-pr`, + * etc.). */ async fetchArtifact() { + const sourceBinary = getStringOrNull("source-binary"); + if (sourceBinary !== null && sourceBinary !== "") { + core.debug(`Using the provided source binary at ${sourceBinary}`); + return sourceBinary; + } core.startGroup( `Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}` ); try { - core.info(`Fetching from ${this.getUrl()}`); - const correlatedUrl = this.getUrl(); + core.info(`Fetching from ${this.getSourceUrl()}`); + const correlatedUrl = this.getSourceUrl(); correlatedUrl.searchParams.set("ci", "github"); correlatedUrl.searchParams.set( "correlation", @@ -97399,16 +97411,16 @@ var DetSysAction = class { const v = versionCheckup.headers.etag; this.addFact(FACT_SOURCE_URL_ETAG, v); core.debug( - `Checking the tool cache for ${this.getUrl()} at ${v}` + `Checking the tool cache for ${this.getSourceUrl()} at ${v}` ); const cached = await this.getCachedVersion(v); if (cached) { - this.facts["artifact_fetched_from_cache"] = true; + this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = true; core.debug(`Tool cache hit.`); return cached; } } - this.facts["artifact_fetched_from_cache"] = false; + this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = false; core.debug( `No match from the cache, re-fetching from the redirect: ${versionCheckup.url}` ); @@ -97434,15 +97446,6 @@ var DetSysAction = class { core.endGroup(); } } - /** - * Fetches the executable at the URL determined by the `source-*` inputs and - * other facts, `chmod`s it, and returns the path to the executable on disk. - */ - async fetchExecutable() { - const binaryPath = await this.fetchArtifact(); - await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP); - return binaryPath; - } /** * A helper function for failing on error only if strict mode is enabled. * This is intended only for CI environments testing Actions themselves. @@ -97456,7 +97459,7 @@ var DetSysAction = class { this.recordEvent(`complete_${this.executionPhase}`); await this.submitEvents(); } - getUrl() { + getSourceUrl() { const p = this.sourceParameters; if (p.url) { this.addFact(FACT_SOURCE_URL, p.url); @@ -97641,10 +97644,6 @@ var DetSysAction = class { } this.events = []; } - getTemporaryName() { - const _tmpdir = process.env["RUNNER_TEMP"] || (0,external_node_os_.tmpdir)(); - return external_node_path_namespaceObject.join(_tmpdir, `${this.actionOptions.name}-${(0,external_node_crypto_namespaceObject.randomUUID)()}`); - } }; function stringifyError(error2) { return error2 instanceof Error || typeof error2 == "string" ? error2.toString() : JSON.stringify(error2); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5779c5a..2ea9ebb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ dependencies: version: 5.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/ed02129aed8e4d6402d920152652877189bece70 + version: github.com/DeterminateSystems/detsys-ts/848cedfa44c31ae5ed7995350bb2707b9422840e string-argv: specifier: ^0.3.2 version: 0.3.2 @@ -5429,10 +5429,10 @@ packages: engines: { node: ">=10" } dev: true - github.com/DeterminateSystems/detsys-ts/ed02129aed8e4d6402d920152652877189bece70: + github.com/DeterminateSystems/detsys-ts/848cedfa44c31ae5ed7995350bb2707b9422840e: resolution: { - tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/ed02129aed8e4d6402d920152652877189bece70, + tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/848cedfa44c31ae5ed7995350bb2707b9422840e, } name: detsys-ts version: 1.0.0 From 3c042d09d2874a6f8ece854bc14871979b140154 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 22 May 2024 18:35:27 -0300 Subject: [PATCH 08/14] Add source-binary to action.yml --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 0306268..fec30a8 100644 --- a/action.yml +++ b/action.yml @@ -79,6 +79,9 @@ inputs: nix-build-user-prefix: description: The Nix build user prefix (user numbers will be postfixed) required: false + source-binary: + description: Run a version of the nix-installer binary from somewhere already on disk. Conflicts with all other `source-*` options. Intended only for testing this Action. + required: false source-branch: description: The branch of `nix-installer` to use (conflicts with `source-tag`, `source-revision`, `source-pr`) required: false From c3983e7949071482414e5e9d0a474901cc2db5ca Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Thu, 23 May 2024 12:14:07 -0300 Subject: [PATCH 09/14] Make strict mode input not required --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index fec30a8..d925739 100644 --- a/action.yml +++ b/action.yml @@ -134,6 +134,7 @@ inputs: required: false _internal-strict-mode: description: Whether to fail when any errors are thrown. Used only to test the Action; do not set this in your own workflows. + required: false default: false runs: From 23e5c435a9b8a8a9ee46e2311e90e2e08c91156b Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 29 May 2024 15:16:45 -0300 Subject: [PATCH 10/14] Update detsys-ts --- dist/index.js | 97 ++++++++++++++----- package.json | 4 +- pnpm-lock.yaml | 253 +++++++++++++++++++++++++------------------------ 3 files changed, 203 insertions(+), 151 deletions(-) diff --git a/dist/index.js b/dist/index.js index ace9f45..f4a7a92 100644 --- a/dist/index.js +++ b/dist/index.js @@ -50738,7 +50738,7 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, /***/ }), -/***/ 1538: +/***/ 4438: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ;(function (sax) { // wrapper for non-node envs @@ -50814,6 +50814,12 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, parser.ns = Object.create(rootNS) } + // disallow unquoted attribute values if not otherwise configured + // and strict mode is true + if (parser.opt.unquotedAttributeValues === undefined) { + parser.opt.unquotedAttributeValues = !strict; + } + // mostly just for error reporting parser.trackPosition = parser.opt.position !== false if (parser.trackPosition) { @@ -51833,15 +51839,22 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, continue case S.SGML_DECL: - if ((parser.sgmlDecl + c).toUpperCase() === CDATA) { + if (parser.sgmlDecl + c === '--') { + parser.state = S.COMMENT + parser.comment = '' + parser.sgmlDecl = '' + continue; + } + + if (parser.doctype && parser.doctype !== true && parser.sgmlDecl) { + parser.state = S.DOCTYPE_DTD + parser.doctype += ' new Promise((resolve, continue case S.DOCTYPE_DTD: - parser.doctype += c if (c === ']') { + parser.doctype += c parser.state = S.DOCTYPE + } else if (c === '<') { + parser.state = S.OPEN_WAKA + parser.startTagPosition = parser.position } else if (isQuote(c)) { + parser.doctype += c parser.state = S.DOCTYPE_DTD_QUOTED parser.q = c + } else { + parser.doctype += c } continue @@ -51941,6 +51960,8 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, // which is a comment of " blah -- bloo " parser.comment += '--' + c parser.state = S.COMMENT + } else if (parser.doctype && parser.doctype !== true) { + parser.state = S.DOCTYPE_DTD } else { parser.state = S.TEXT } @@ -52108,7 +52129,9 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, parser.q = c parser.state = S.ATTRIB_VALUE_QUOTED } else { - strictFail(parser, 'Unquoted attribute value') + if (!parser.opt.unquotedAttributeValues) { + error(parser, 'Unquoted attribute value') + } parser.state = S.ATTRIB_VALUE_UNQUOTED parser.attribValue = c } @@ -52226,13 +52249,13 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, } if (c === ';') { - if (parser.opt.unparsedEntities) { - var parsedEntity = parseEntity(parser) + var parsedEntity = parseEntity(parser) + if (parser.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) { parser.entity = '' parser.state = returnState parser.write(parsedEntity) } else { - parser[buffer] += parseEntity(parser) + parser[buffer] += parsedEntity parser.entity = '' parser.state = returnState } @@ -80073,7 +80096,7 @@ function wrappy (fn, cb) { extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; - sax = __nccwpck_require__(1538); + sax = __nccwpck_require__(4438); events = __nccwpck_require__(2361); @@ -96694,7 +96717,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@848cedfa44c31ae5ed7995350bb2707b9422840e_heluh4h342h2muwandvhzbsvpi/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@5fcb0532d85556ebc2de286e483885976531339d_uqngfub4ls4loys67iy653x57e/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -97002,6 +97025,7 @@ function hashEnvironmentVariables(prefix, variables) { var inputs_exports = {}; __export(inputs_exports, { getArrayOfStrings: () => getArrayOfStrings, + getArrayOfStringsOrNull: () => getArrayOfStringsOrNull, getBool: () => getBool, getMultilineStringOrNull: () => getMultilineStringOrNull, getNumberOrNull: () => getNumberOrNull, @@ -97018,6 +97042,14 @@ var getArrayOfStrings = (name, separator) => { const original = getString(name); return handleString(original, separator); }; +var getArrayOfStringsOrNull = (name, separator) => { + const original = getStringOrNull(name); + if (original === null) { + return null; + } else { + return handleString(original, separator); + } +}; var handleString = (input, separator) => { const sepChar = separator === "comma" ? "," : /\s+/; const trimmed = input.trim(); @@ -97149,6 +97181,19 @@ function noisilyGetInput(suffix, legacyPrefix) { + +// src/errors.ts +function stringifyError(e) { + if (e instanceof Error) { + return e.message; + } else if (typeof e === "string") { + return e; + } else { + return JSON.stringify(e); + } +} + +// src/index.ts var DEFAULT_IDS_HOST = "https://install.determinate.systems"; var IDS_HOST = process.env["IDS_HOST"] ?? DEFAULT_IDS_HOST; var EVENT_EXCEPTION = "exception"; @@ -97171,6 +97216,7 @@ var FACT_NIX_STORE_CHECK_ERROR = "nix_store_check_error"; var STATE_KEY_EXECUTION_PHASE = "detsys_action_execution_phase"; var STATE_KEY_NIX_NOT_FOUND = "detsys_action_nix_not_found"; var STATE_NOT_FOUND = "not-found"; +var DIAGNOSTIC_ENDPOINT_TIMEOUT_MS = 3e4; var DetSysAction = class { determineExecutionPhase() { const currentPhase = core.getState(STATE_KEY_EXECUTION_PHASE); @@ -97236,7 +97282,7 @@ var DetSysAction = class { } }).catch((e) => { core.debug( - `Failure getting platform details: ${stringifyError(e)}` + `Failure getting platform details: ${stringifyError2(e)}` ); }); } @@ -97353,7 +97399,7 @@ var DetSysAction = class { this.addFact(FACT_ENDED_WITH_EXCEPTION, false); } catch (e) { this.addFact(FACT_ENDED_WITH_EXCEPTION, true); - const reportable = stringifyError(e); + const reportable = stringifyError2(e); this.addFact(FACT_FINAL_EXCEPTION, reportable); if (this.isPost) { core.warning(reportable); @@ -97373,7 +97419,7 @@ var DetSysAction = class { } catch (innerError) { exceptionContext.set( `staple_failure_${attachmentLabel}`, - stringifyError(innerError) + stringifyError2(innerError) ); } } @@ -97438,7 +97484,7 @@ var DetSysAction = class { try { await this.saveCachedVersion(v, destFile); } catch (e) { - core.debug(`Error caching the artifact: ${stringifyError(e)}`); + core.debug(`Error caching the artifact: ${stringifyError2(e)}`); } } return destFile; @@ -97617,7 +97663,7 @@ var DetSysAction = class { } this.addFact(FACT_NIX_STORE_VERSION, JSON.stringify(parsed.version)); } catch (e) { - this.addFact(FACT_NIX_STORE_CHECK_ERROR, stringifyError(e)); + this.addFact(FACT_NIX_STORE_CHECK_ERROR, stringifyError2(e)); } } async submitEvents() { @@ -97635,17 +97681,20 @@ var DetSysAction = class { }; try { await this.client.post(this.actionOptions.diagnosticsUrl, { - json: batch + json: batch, + timeout: { + request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS + } }); } catch (e) { core.debug( - `Error submitting diagnostics event: ${stringifyError(e)}` + `Error submitting diagnostics event: ${stringifyError2(e)}` ); } this.events = []; } }; -function stringifyError(error2) { +function stringifyError2(error2) { return error2 instanceof Error || typeof error2 == "string" ? error2.toString() : JSON.stringify(error2); } function makeOptionsConfident(actionOptions) { @@ -97683,7 +97732,7 @@ function determineDiagnosticsUrl(idsProjectName, urlOption) { return mungeDiagnosticEndpoint(new URL(providedDiagnosticEndpoint)); } catch (e) { core.info( - `User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError(e)}` + `User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}` ); } } @@ -97695,7 +97744,7 @@ function determineDiagnosticsUrl(idsProjectName, urlOption) { return diagnosticUrl; } catch (e) { core.info( - `Generated diagnostic endpoint ignored: not a valid URL: ${stringifyError(e)}` + `Generated diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}` ); } return void 0; @@ -97717,7 +97766,7 @@ function mungeDiagnosticEndpoint(inputUrl) { return inputUrl; } catch (e) { core.info( - `Default or overridden IDS host isn't a valid URL: ${stringifyError(e)}` + `Default or overridden IDS host isn't a valid URL: ${stringifyError2(e)}` ); } return inputUrl; diff --git a/package.json b/package.json index 55d0edd..a9b4033 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,9 @@ }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@types/node": "^20.12.12", + "@types/node": "^20.12.13", "@types/uuid": "^9.0.8", - "@typescript-eslint/eslint-plugin": "^7.10.0", + "@typescript-eslint/eslint-plugin": "^7.11.0", "@vercel/ncc": "^0.38.1", "eslint": "^8.57.0", "eslint-import-resolver-typescript": "^3.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ea9ebb..c1200fa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ dependencies: version: 5.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/848cedfa44c31ae5ed7995350bb2707b9422840e + version: github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d string-argv: specifier: ^0.3.2 version: 0.3.2 @@ -26,14 +26,14 @@ devDependencies: specifier: ^4.3.0 version: 4.3.0(prettier@3.2.5) "@types/node": - specifier: ^20.12.12 - version: 20.12.12 + specifier: ^20.12.13 + version: 20.12.13 "@types/uuid": specifier: ^9.0.8 version: 9.0.8 "@typescript-eslint/eslint-plugin": - specifier: ^7.10.0 - version: 7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5) + specifier: ^7.11.0 + version: 7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5) "@vercel/ncc": specifier: ^0.38.1 version: 0.38.1 @@ -42,13 +42,13 @@ devDependencies: version: 8.57.0 eslint-import-resolver-typescript: specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + version: 3.6.1(@typescript-eslint/parser@7.11.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-plugin-github: specifier: ^4.10.2 version: 4.10.2(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-prettier: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) @@ -292,14 +292,14 @@ packages: - encoding dev: false - /@babel/code-frame@7.24.2: + /@babel/code-frame@7.24.6: resolution: { - integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==, + integrity: sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/highlight": 7.24.5 + "@babel/highlight": 7.24.6 picocolors: 1.0.1 dev: true @@ -315,91 +315,91 @@ packages: source-map: 0.5.7 dev: true - /@babel/generator@7.24.5: + /@babel/generator@7.24.6: resolution: { - integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==, + integrity: sha512-S7m4eNa6YAPJRHmKsLHIDJhNAGNKoWNiWefz1MBbpnt8g9lvMDl1hir4P9bo/57bQEmuwEhnRU/AMWsD0G/Fbg==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/types": 7.24.5 + "@babel/types": 7.24.6 "@jridgewell/gen-mapping": 0.3.5 "@jridgewell/trace-mapping": 0.3.25 jsesc: 2.5.2 dev: true - /@babel/helper-environment-visitor@7.22.20: + /@babel/helper-environment-visitor@7.24.6: resolution: { - integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==, + integrity: sha512-Y50Cg3k0LKLMjxdPjIl40SdJgMB85iXn27Vk/qbHZCFx/o5XO3PSnpi675h1KEmmDb6OFArfd5SCQEQ5Q4H88g==, } engines: { node: ">=6.9.0" } dev: true - /@babel/helper-function-name@7.23.0: + /@babel/helper-function-name@7.24.6: resolution: { - integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==, + integrity: sha512-xpeLqeeRkbxhnYimfr2PC+iA0Q7ljX/d1eZ9/inYbmfG2jpl8Lu3DyXvpOAnrS5kxkfOWJjioIMQsaMBXFI05w==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/template": 7.24.0 - "@babel/types": 7.24.5 + "@babel/template": 7.24.6 + "@babel/types": 7.24.6 dev: true - /@babel/helper-hoist-variables@7.22.5: + /@babel/helper-hoist-variables@7.24.6: resolution: { - integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==, + integrity: sha512-SF/EMrC3OD7dSta1bLJIlrsVxwtd0UpjRJqLno6125epQMJ/kyFmpTT4pbvPbdQHzCHg+biQ7Syo8lnDtbR+uA==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/types": 7.24.5 + "@babel/types": 7.24.6 dev: true - /@babel/helper-split-export-declaration@7.24.5: + /@babel/helper-split-export-declaration@7.24.6: resolution: { - integrity: sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q==, + integrity: sha512-CvLSkwXGWnYlF9+J3iZUvwgAxKiYzK3BWuo+mLzD/MDGOZDj7Gq8+hqaOkMxmJwmlv0iu86uH5fdADd9Hxkymw==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/types": 7.24.5 + "@babel/types": 7.24.6 dev: true - /@babel/helper-string-parser@7.24.1: + /@babel/helper-string-parser@7.24.6: resolution: { - integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==, + integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==, } engines: { node: ">=6.9.0" } dev: true - /@babel/helper-validator-identifier@7.24.5: + /@babel/helper-validator-identifier@7.24.6: resolution: { - integrity: sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==, + integrity: sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==, } engines: { node: ">=6.9.0" } dev: true - /@babel/highlight@7.24.5: + /@babel/highlight@7.24.6: resolution: { - integrity: sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==, + integrity: sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/helper-validator-identifier": 7.24.5 + "@babel/helper-validator-identifier": 7.24.6 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.1 dev: true - /@babel/parser@7.24.5: + /@babel/parser@7.24.6: resolution: { - integrity: sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==, + integrity: sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==, } engines: { node: ">=6.0.0" } hasBin: true @@ -407,26 +407,26 @@ packages: "@babel/types": 7.17.0 dev: true - /@babel/runtime@7.24.5: + /@babel/runtime@7.24.6: resolution: { - integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==, + integrity: sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==, } engines: { node: ">=6.9.0" } dependencies: regenerator-runtime: 0.14.1 dev: true - /@babel/template@7.24.0: + /@babel/template@7.24.6: resolution: { - integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==, + integrity: sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/code-frame": 7.24.2 - "@babel/parser": 7.24.5 - "@babel/types": 7.24.5 + "@babel/code-frame": 7.24.6 + "@babel/parser": 7.24.6 + "@babel/types": 7.24.6 dev: true /@babel/traverse@7.23.2: @@ -436,14 +436,14 @@ packages: } engines: { node: ">=6.9.0" } dependencies: - "@babel/code-frame": 7.24.2 - "@babel/generator": 7.24.5 - "@babel/helper-environment-visitor": 7.22.20 - "@babel/helper-function-name": 7.23.0 - "@babel/helper-hoist-variables": 7.22.5 - "@babel/helper-split-export-declaration": 7.24.5 - "@babel/parser": 7.24.5 - "@babel/types": 7.24.5 + "@babel/code-frame": 7.24.6 + "@babel/generator": 7.24.6 + "@babel/helper-environment-visitor": 7.24.6 + "@babel/helper-function-name": 7.24.6 + "@babel/helper-hoist-variables": 7.24.6 + "@babel/helper-split-export-declaration": 7.24.6 + "@babel/parser": 7.24.6 + "@babel/types": 7.24.6 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -457,19 +457,19 @@ packages: } engines: { node: ">=6.9.0" } dependencies: - "@babel/helper-validator-identifier": 7.24.5 + "@babel/helper-validator-identifier": 7.24.6 to-fast-properties: 2.0.0 dev: true - /@babel/types@7.24.5: + /@babel/types@7.24.6: resolution: { - integrity: sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==, + integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==, } engines: { node: ">=6.9.0" } dependencies: - "@babel/helper-string-parser": 7.24.1 - "@babel/helper-validator-identifier": 7.24.5 + "@babel/helper-string-parser": 7.24.6 + "@babel/helper-validator-identifier": 7.24.6 to-fast-properties: 2.0.0 dev: true @@ -1290,7 +1290,7 @@ packages: optional: true dependencies: "@babel/generator": 7.17.7 - "@babel/parser": 7.24.5 + "@babel/parser": 7.24.6 "@babel/traverse": 7.23.2 "@babel/types": 7.17.0 javascript-natural-sort: 0.7.1 @@ -1327,14 +1327,14 @@ packages: integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==, } dependencies: - "@types/node": 20.12.12 + "@types/node": 20.12.13 form-data: 4.0.0 dev: false - /@types/node@20.12.12: + /@types/node@20.12.13: resolution: { - integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==, + integrity: sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==, } dependencies: undici-types: 5.26.5 @@ -1345,7 +1345,7 @@ packages: integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==, } dependencies: - "@types/node": 20.12.12 + "@types/node": 20.12.13 dev: false /@types/uuid@9.0.8: @@ -1355,10 +1355,10 @@ packages: } dev: true - /@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==, + integrity: sha512-P+qEahbgeHW4JQ/87FuItjBj8O3MYv5gELDzr8QaQ7fsll1gSMTYb6j87MYyxwf3DtD7uGFB9ShwgmCJB5KmaQ==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1370,11 +1370,11 @@ packages: optional: true dependencies: "@eslint-community/regexpp": 4.10.0 - "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/scope-manager": 7.10.0 - "@typescript-eslint/type-utils": 7.10.0(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/utils": 7.10.0(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/visitor-keys": 7.10.0 + "@typescript-eslint/parser": 7.11.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/scope-manager": 7.11.0 + "@typescript-eslint/type-utils": 7.11.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/utils": 7.11.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/visitor-keys": 7.11.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -1385,10 +1385,10 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==, + integrity: sha512-yimw99teuaXVWsBcPO1Ais02kwJ1jmNA1KxE7ng0aT7ndr1pT1wqj0OJnsYVGKKlc4QJai86l/025L6z8CljOg==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1398,10 +1398,10 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/scope-manager": 7.10.0 - "@typescript-eslint/types": 7.10.0 - "@typescript-eslint/typescript-estree": 7.10.0(typescript@5.4.5) - "@typescript-eslint/visitor-keys": 7.10.0 + "@typescript-eslint/scope-manager": 7.11.0 + "@typescript-eslint/types": 7.11.0 + "@typescript-eslint/typescript-estree": 7.11.0(typescript@5.4.5) + "@typescript-eslint/visitor-keys": 7.11.0 debug: 4.3.4 eslint: 8.57.0 typescript: 5.4.5 @@ -1409,21 +1409,21 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@7.10.0: + /@typescript-eslint/scope-manager@7.11.0: resolution: { - integrity: sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==, + integrity: sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==, } engines: { node: ^18.18.0 || >=20.0.0 } dependencies: - "@typescript-eslint/types": 7.10.0 - "@typescript-eslint/visitor-keys": 7.10.0 + "@typescript-eslint/types": 7.11.0 + "@typescript-eslint/visitor-keys": 7.11.0 dev: true - /@typescript-eslint/type-utils@7.10.0(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/type-utils@7.11.0(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==, + integrity: sha512-WmppUEgYy+y1NTseNMJ6mCFxt03/7jTOy08bcg7bxJJdsM4nuhnchyBbE8vryveaJUf62noH7LodPSo5Z0WUCg==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1433,8 +1433,8 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/typescript-estree": 7.10.0(typescript@5.4.5) - "@typescript-eslint/utils": 7.10.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/typescript-estree": 7.11.0(typescript@5.4.5) + "@typescript-eslint/utils": 7.11.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4 eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) @@ -1443,18 +1443,18 @@ packages: - supports-color dev: true - /@typescript-eslint/types@7.10.0: + /@typescript-eslint/types@7.11.0: resolution: { - integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==, + integrity: sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==, } engines: { node: ^18.18.0 || >=20.0.0 } dev: true - /@typescript-eslint/typescript-estree@7.10.0(typescript@5.4.5): + /@typescript-eslint/typescript-estree@7.11.0(typescript@5.4.5): resolution: { - integrity: sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==, + integrity: sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: @@ -1463,8 +1463,8 @@ packages: typescript: optional: true dependencies: - "@typescript-eslint/types": 7.10.0 - "@typescript-eslint/visitor-keys": 7.10.0 + "@typescript-eslint/types": 7.11.0 + "@typescript-eslint/visitor-keys": 7.11.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1476,33 +1476,33 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@7.10.0(eslint@8.57.0)(typescript@5.4.5): + /@typescript-eslint/utils@7.11.0(eslint@8.57.0)(typescript@5.4.5): resolution: { - integrity: sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==, + integrity: sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==, } engines: { node: ^18.18.0 || >=20.0.0 } peerDependencies: eslint: ^8.56.0 dependencies: "@eslint-community/eslint-utils": 4.4.0(eslint@8.57.0) - "@typescript-eslint/scope-manager": 7.10.0 - "@typescript-eslint/types": 7.10.0 - "@typescript-eslint/typescript-estree": 7.10.0(typescript@5.4.5) + "@typescript-eslint/scope-manager": 7.11.0 + "@typescript-eslint/types": 7.11.0 + "@typescript-eslint/typescript-estree": 7.11.0(typescript@5.4.5) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@7.10.0: + /@typescript-eslint/visitor-keys@7.11.0: resolution: { - integrity: sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==, + integrity: sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==, } engines: { node: ^18.18.0 || >=20.0.0 } dependencies: - "@typescript-eslint/types": 7.10.0 + "@typescript-eslint/types": 7.11.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1831,8 +1831,8 @@ packages: engines: { node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7 } hasBin: true dependencies: - caniuse-lite: 1.0.30001621 - electron-to-chromium: 1.4.777 + caniuse-lite: 1.0.30001625 + electron-to-chromium: 1.4.784 node-releases: 2.0.14 update-browserslist-db: 1.0.16(browserslist@4.23.0) dev: true @@ -1904,10 +1904,10 @@ packages: engines: { node: ">=6" } dev: true - /caniuse-lite@1.0.30001621: + /caniuse-lite@1.0.30001625: resolution: { - integrity: sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==, + integrity: sha512-4KE9N2gcRH+HQhpeiRZXd+1niLB/XNLAhSy4z7fI8EzcbcPoAqjNInxVHTiTwWfTIV4w096XG8OtCOCQQKPv3w==, } dev: true @@ -2202,10 +2202,10 @@ packages: } dev: true - /electron-to-chromium@1.4.777: + /electron-to-chromium@1.4.784: resolution: { - integrity: sha512-n02NCwLJ3wexLfK/yQeqfywCblZqLcXphzmid5e8yVPdtEcida7li0A5WQKghHNG0FeOMCzeFOzEbtAh5riXFw==, + integrity: sha512-9CZwh+sDrhDAeOEFh8s3PqwduzTyYIeYwZolc1b9ENAUt3ePu7R1sJSCWr/820ISssRxCJUyHI9Wb7j+0Uo1AA==, } dev: true @@ -2456,7 +2456,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.11.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): resolution: { integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==, @@ -2469,8 +2469,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.16.1 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -2482,7 +2482,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: { integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==, @@ -2506,11 +2506,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/parser": 7.11.0(eslint@8.57.0)(typescript@5.4.5) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.11.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) transitivePeerDependencies: - supports-color dev: true @@ -2566,8 +2566,8 @@ packages: eslint: ^8.0.1 dependencies: "@github/browserslist-config": 1.0.0 - "@typescript-eslint/eslint-plugin": 7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5) - "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/eslint-plugin": 7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/parser": 7.11.0(eslint@8.57.0)(typescript@5.4.5) aria-query: 5.3.0 eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) @@ -2575,7 +2575,7 @@ packages: eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) eslint-plugin-filenames: 1.3.2(eslint@8.57.0) eslint-plugin-i18n-text: 1.0.1(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-no-only-tests: 3.1.0 eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) @@ -2602,7 +2602,7 @@ packages: eslint: 8.57.0 dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: { integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==, @@ -2615,7 +2615,7 @@ packages: "@typescript-eslint/parser": optional: true dependencies: - "@typescript-eslint/parser": 7.10.0(eslint@8.57.0)(typescript@5.4.5) + "@typescript-eslint/parser": 7.11.0(eslint@8.57.0)(typescript@5.4.5) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -2624,7 +2624,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2649,7 +2649,7 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: - "@babel/runtime": 7.24.5 + "@babel/runtime": 7.24.6 aria-query: 5.3.0 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 @@ -3139,10 +3139,10 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.16: + /glob@10.4.1: resolution: { - integrity: sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==, + integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==, } engines: { node: ">=16 || 14 >=14.18" } hasBin: true @@ -3150,7 +3150,7 @@ packages: foreground-child: 3.1.1 jackspeak: 3.1.2 minimatch: 9.0.4 - minipass: 7.1.1 + minipass: 7.1.2 path-scurry: 1.11.1 dev: true @@ -3159,6 +3159,7 @@ packages: { integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==, } + deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -3381,6 +3382,7 @@ packages: { integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==, } + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -4041,10 +4043,10 @@ packages: } dev: true - /minipass@7.1.1: + /minipass@7.1.2: resolution: { - integrity: sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==, + integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==, } engines: { node: ">=16 || 14 >=14.17" } dev: true @@ -4324,7 +4326,7 @@ packages: engines: { node: ">=16 || 14 >=14.18" } dependencies: lru-cache: 10.2.2 - minipass: 7.1.1 + minipass: 7.1.2 dev: true /path-type@4.0.0: @@ -4554,6 +4556,7 @@ packages: { integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==, } + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true dependencies: glob: 7.2.3 @@ -4622,10 +4625,10 @@ packages: is-regex: 1.1.4 dev: true - /sax@1.3.0: + /sax@1.4.1: resolution: { - integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==, + integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==, } dev: false @@ -4867,7 +4870,7 @@ packages: dependencies: "@jridgewell/gen-mapping": 0.3.5 commander: 4.1.1 - glob: 10.3.16 + glob: 10.4.1 lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.6 @@ -5400,7 +5403,7 @@ packages: } engines: { node: ">=4.0.0" } dependencies: - sax: 1.3.0 + sax: 1.4.1 xmlbuilder: 11.0.1 dev: false @@ -5429,10 +5432,10 @@ packages: engines: { node: ">=10" } dev: true - github.com/DeterminateSystems/detsys-ts/848cedfa44c31ae5ed7995350bb2707b9422840e: + github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d: resolution: { - tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/848cedfa44c31ae5ed7995350bb2707b9422840e, + tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/5fcb0532d85556ebc2de286e483885976531339d, } name: detsys-ts version: 1.0.0 From 9c4e8b237e1d6c4b38db9a2ade8f5d224c88ad42 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 29 May 2024 15:51:33 -0300 Subject: [PATCH 11/14] Provide better if statement --- dist/index.js | 11 +++++++---- src/index.ts | 15 +++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index f4a7a92..598f7bd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -97864,9 +97864,12 @@ var NixInstallerAction = class extends DetSysAction { get isLinux() { return this.runnerOs === "Linux"; } - get isAct() { + get runningInAct() { return process.env["ACT"] !== "" && !(process.env["NOT_ACT"] === ""); } + get runningInNamespaceRunner() { + return process.env["NSC_VM_ID"] !== void 0 && !(process.env["NOT_NAMESPACE"] === "true"); + } async detectAndForceDockerShim() { if (this.isLinux) { if (this.forceDockerShim) { @@ -97877,7 +97880,7 @@ var NixInstallerAction = class extends DetSysAction { } return; } - if (this.isAct) { + if (this.runningInAct) { core.debug( "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act." ); @@ -98158,14 +98161,14 @@ ${stderrBuffer}` extraConf += "\n"; } executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; - if (process.env["ACT"] && !process.env["NOT_ACT"]) { + if (this.runningInAct) { this.addFact(FACT_IN_ACT, true); core.info( "Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`" ); executionEnv.NIX_INSTALLER_INIT = "none"; } - if (process.env["NSC_VM_ID"] && !process.env["NOT_NAMESPACE"]) { + if (this.runningInNamespaceRunner) { this.addFact(FACT_IN_NAMESPACE_SO, true); core.info( "Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace" diff --git a/src/index.ts b/src/index.ts index 2405a4a..e43960f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -133,10 +133,17 @@ class NixInstallerAction extends DetSysAction { return this.runnerOs === "Linux"; } - private get isAct(): boolean { + private get runningInAct(): boolean { return process.env["ACT"] !== "" && !(process.env["NOT_ACT"] === ""); } + private get runningInNamespaceRunner(): boolean { + return ( + process.env["NSC_VM_ID"] !== undefined && + !(process.env["NOT_NAMESPACE"] === "true") + ); + } + async detectAndForceDockerShim(): Promise { // Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker. // This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/), @@ -151,7 +158,7 @@ class NixInstallerAction extends DetSysAction { return; } - if (this.isAct) { + if (this.runningInAct) { actionsCore.debug( "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act.", ); @@ -486,7 +493,7 @@ class NixInstallerAction extends DetSysAction { } executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; - if (process.env["ACT"] && !process.env["NOT_ACT"]) { + if (this.runningInAct) { this.addFact(FACT_IN_ACT, true); actionsCore.info( "Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`", @@ -494,7 +501,7 @@ class NixInstallerAction extends DetSysAction { executionEnv.NIX_INSTALLER_INIT = "none"; } - if (process.env["NSC_VM_ID"] && !process.env["NOT_NAMESPACE"]) { + if (this.runningInNamespaceRunner) { this.addFact(FACT_IN_NAMESPACE_SO, true); actionsCore.info( "Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace", From ad8814ae5da0650ddd7e585c72b3a1287d9db91d Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 29 May 2024 15:59:19 -0300 Subject: [PATCH 12/14] Fix check for ACT environment --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 598f7bd..6a79287 100644 --- a/dist/index.js +++ b/dist/index.js @@ -97865,7 +97865,7 @@ var NixInstallerAction = class extends DetSysAction { return this.runnerOs === "Linux"; } get runningInAct() { - return process.env["ACT"] !== "" && !(process.env["NOT_ACT"] === ""); + return process.env["ACT"] !== void 0 && !(process.env["NOT_ACT"] === ""); } get runningInNamespaceRunner() { return process.env["NSC_VM_ID"] !== void 0 && !(process.env["NOT_NAMESPACE"] === "true"); diff --git a/src/index.ts b/src/index.ts index e43960f..3028607 100644 --- a/src/index.ts +++ b/src/index.ts @@ -134,7 +134,7 @@ class NixInstallerAction extends DetSysAction { } private get runningInAct(): boolean { - return process.env["ACT"] !== "" && !(process.env["NOT_ACT"] === ""); + return process.env["ACT"] !== undefined && !(process.env["NOT_ACT"] === ""); } private get runningInNamespaceRunner(): boolean { From 8ef3f8c93e35d2c38d2eae9fdc2ce219b4474f8a Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 29 May 2024 16:07:07 -0300 Subject: [PATCH 13/14] Fix direction of Boolean check --- action.yml | 1 + dist/index.js | 12 ++++++------ src/index.ts | 12 ++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index d925739..d3f7c14 100644 --- a/action.yml +++ b/action.yml @@ -19,6 +19,7 @@ inputs: default: false force-docker-shim: description: Force the use of Docker as a process supervisor. This setting is automatically enabled when necessary. + required: false default: false github-token: description: A GitHub token for making authenticated requests (which have a higher rate-limit quota than unauthenticated requests) diff --git a/dist/index.js b/dist/index.js index 6a79287..11d49c8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -97864,14 +97864,14 @@ var NixInstallerAction = class extends DetSysAction { get isLinux() { return this.runnerOs === "Linux"; } - get runningInAct() { + get isRunningInAct() { return process.env["ACT"] !== void 0 && !(process.env["NOT_ACT"] === ""); } - get runningInNamespaceRunner() { + get isRunningInNamespaceRunner() { return process.env["NSC_VM_ID"] !== void 0 && !(process.env["NOT_NAMESPACE"] === "true"); } async detectAndForceDockerShim() { - if (this.isLinux) { + if (!this.isLinux) { if (this.forceDockerShim) { core.warning( "Ignoring force-docker-shim which is set to true, as it is only supported on Linux." @@ -97880,7 +97880,7 @@ var NixInstallerAction = class extends DetSysAction { } return; } - if (this.runningInAct) { + if (this.isRunningInAct) { core.debug( "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act." ); @@ -98161,14 +98161,14 @@ ${stderrBuffer}` extraConf += "\n"; } executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; - if (this.runningInAct) { + if (this.isRunningInAct) { this.addFact(FACT_IN_ACT, true); core.info( "Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`" ); executionEnv.NIX_INSTALLER_INIT = "none"; } - if (this.runningInNamespaceRunner) { + if (this.isRunningInNamespaceRunner) { this.addFact(FACT_IN_NAMESPACE_SO, true); core.info( "Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace" diff --git a/src/index.ts b/src/index.ts index 3028607..8bce7f5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -133,11 +133,11 @@ class NixInstallerAction extends DetSysAction { return this.runnerOs === "Linux"; } - private get runningInAct(): boolean { + private get isRunningInAct(): boolean { return process.env["ACT"] !== undefined && !(process.env["NOT_ACT"] === ""); } - private get runningInNamespaceRunner(): boolean { + private get isRunningInNamespaceRunner(): boolean { return ( process.env["NSC_VM_ID"] !== undefined && !(process.env["NOT_NAMESPACE"] === "true") @@ -148,7 +148,7 @@ class NixInstallerAction extends DetSysAction { // Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker. // This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/), // and especially GitHub Enterprise Server. - if (this.isLinux) { + if (!this.isLinux) { if (this.forceDockerShim) { actionsCore.warning( "Ignoring force-docker-shim which is set to true, as it is only supported on Linux.", @@ -158,7 +158,7 @@ class NixInstallerAction extends DetSysAction { return; } - if (this.runningInAct) { + if (this.isRunningInAct) { actionsCore.debug( "Not bothering to detect if the docker shim should be used, as it is typically incompatible with act.", ); @@ -493,7 +493,7 @@ class NixInstallerAction extends DetSysAction { } executionEnv.NIX_INSTALLER_EXTRA_CONF = extraConf; - if (this.runningInAct) { + if (this.isRunningInAct) { this.addFact(FACT_IN_ACT, true); actionsCore.info( "Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the setting of the `init` to be compatible with `act`", @@ -501,7 +501,7 @@ class NixInstallerAction extends DetSysAction { executionEnv.NIX_INSTALLER_INIT = "none"; } - if (this.runningInNamespaceRunner) { + if (this.isRunningInNamespaceRunner) { this.addFact(FACT_IN_NAMESPACE_SO, true); actionsCore.info( "Detected Namespace runner, assuming this is a https://namespace.so created container, set `NOT_NAMESPACE=true` to override this. This will change the setting of the `init` to be compatible with Namespace", From e5b417b85fa54c92925241c5914a88a119c9d2a9 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 29 May 2024 16:26:46 -0300 Subject: [PATCH 14/14] Move comment to better location --- dist/index.js | 3 +++ src/index.ts | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 11d49c8..c0ecb8d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -97870,6 +97870,9 @@ var NixInstallerAction = class extends DetSysAction { get isRunningInNamespaceRunner() { return process.env["NSC_VM_ID"] !== void 0 && !(process.env["NOT_NAMESPACE"] === "true"); } + // Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker. + // This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/), + // and especially GitHub Enterprise Server. async detectAndForceDockerShim() { if (!this.isLinux) { if (this.forceDockerShim) { diff --git a/src/index.ts b/src/index.ts index 8bce7f5..66854e7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -144,10 +144,10 @@ class NixInstallerAction extends DetSysAction { ); } + // Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker. + // This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/), + // and especially GitHub Enterprise Server. async detectAndForceDockerShim(): Promise { - // Detect if we're in a GHA runner which is Linux, doesn't have Systemd, and does have Docker. - // This is a common case in self-hosted runners, providers like [Namespace](https://namespace.so/), - // and especially GitHub Enterprise Server. if (!this.isLinux) { if (this.forceDockerShim) { actionsCore.warning(