From 9740aac337e518a7969cdc53d38d9907eb1cde25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:42:28 +0000 Subject: [PATCH 1/9] build(deps-dev): bump webpack from 5.91.0 to 5.95.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.91.0 to 5.95.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.95.0) --- updated-dependencies: - dependency-name: webpack dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 46 ++++++++++++---------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index ab8b75383..1db300afa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3741,28 +3741,6 @@ "@types/ms": "*" } }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "peer": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "dev": true, @@ -4419,10 +4397,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peer": true, "peerDependencies": { @@ -6939,9 +6917,10 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.16.0", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, - "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -18841,22 +18820,21 @@ } }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.95.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", + "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "dev": true, "peer": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", From 634d2b0c5f2346ccf76c1a2965b048b313d1ba1f Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Mon, 18 Nov 2024 12:25:40 +0100 Subject: [PATCH 2/9] feat: added experimental volume support for golem-js --- src/activity/exe-unit/exe-unit.ts | 35 ++++++++++++++++- src/activity/script/command.ts | 26 ++++++++++++- src/golem-network/golem-network.ts | 54 +++++++++++++++++++++++--- src/network/node.ts | 5 ++- src/resource-rental/resource-rental.ts | 2 +- 5 files changed, 112 insertions(+), 10 deletions(-) diff --git a/src/activity/exe-unit/exe-unit.ts b/src/activity/exe-unit/exe-unit.ts index f32d68ca7..3569a90b2 100644 --- a/src/activity/exe-unit/exe-unit.ts +++ b/src/activity/exe-unit/exe-unit.ts @@ -23,9 +23,17 @@ import { Agreement, ProviderInfo } from "../../market"; import { TcpProxy } from "../../network/tcp-proxy"; import { ExecutionOptions, ExeScriptExecutor } from "../exe-script-executor"; import { lastValueFrom, tap, toArray } from "rxjs"; +import { DeployArgs } from "../script/command"; export type LifecycleFunction = (exe: ExeUnit) => Promise; +export type VolumeSpec = { + /** Size of the volume to mount */ + sizeGib: number; + /** Location of the volume */ + path: string; +}; + export interface ExeUnitOptions { activityDeployingTimeout?: number; storageProvider?: StorageProvider; @@ -38,6 +46,7 @@ export interface ExeUnitOptions { teardown?: LifecycleFunction; executionOptions?: ExecutionOptions; signalOrTimeout?: number | AbortSignal; + volumes?: Record; } export interface CommandOptions { @@ -158,7 +167,13 @@ export class ExeUnit { private async deployActivity() { try { const executionMetadata = await this.executor.execute( - new Script([new Deploy(this.networkNode?.getNetworkConfig?.()), new Start()]).getExeScriptRequest(), + new Script([ + new Deploy({ + ...this.networkNode?.getNetworkDeploymentArg?.(), + ...this.getVolumeDeploymentArg(), + }), + new Start(), + ]).getExeScriptRequest(), ); const result$ = this.executor.getResultsObservable(executionMetadata); // if any result is an error, throw an error @@ -422,4 +437,22 @@ export class ExeUnit { return allResults[0]; } + + private getVolumeDeploymentArg(): Pick { + if (!this.options?.volumes) { + return {}; + } + + const argument: Required> = { + volumes: {}, + }; + + for (const [, volumeSpec] of Object.entries(this.options.volumes)) { + argument.volumes[volumeSpec.path] = { + storage: { size: `${volumeSpec.sizeGib}g`, errors: "panic" }, + }; + } + + return argument; + } } diff --git a/src/activity/script/command.ts b/src/activity/script/command.ts index 012e9592b..b711acdfd 100644 --- a/src/activity/script/command.ts +++ b/src/activity/script/command.ts @@ -59,8 +59,32 @@ export class Command { } } +export type DeployArgs = { + net?: DeployNetworkArgs[]; + volumes?: DeployVolumesArgs; +}; + +type DeployNetworkArgs = { + id: string; + ip: string; + mask: string; + gateway?: string; + nodes: { [ip: string]: string }; + nodeIp: string; +}; + +type DeployVolumesArgs = { + [path: string]: { + storage: { + /** @example 7000m */ + size: string; + errors?: "panic"; + }; + }; +}; + export class Deploy extends Command { - constructor(args?: Record) { + constructor(args?: DeployArgs) { super("deploy", args); } } diff --git a/src/golem-network/golem-network.ts b/src/golem-network/golem-network.ts index aa7750617..5a35f01d4 100644 --- a/src/golem-network/golem-network.ts +++ b/src/golem-network/golem-network.ts @@ -35,7 +35,7 @@ import { DataTransferProtocol } from "../shared/types"; import { NetworkApiAdapter } from "../shared/yagna/adapters/network-api-adapter"; import { IProposalRepository } from "../market/proposal"; import { Subscription } from "rxjs"; -import { GolemConfigError } from "../shared/error/golem-error"; +import { GolemConfigError, GolemUserError } from "../shared/error/golem-error"; /** * Instance of an object or a factory function that you can call `new` on. @@ -158,6 +158,13 @@ export interface OneOfOptions { signalOrTimeout?: number | AbortSignal; setup?: ExeUnitOptions["setup"]; teardown?: ExeUnitOptions["teardown"]; + + /** + * Define additional volumes ot be mounted when the activity is deployed + * + * @experimental The Provider has to run yagna 0.17.x or newer and offer `vm` runtime 0.5.x or newer + */ + volumes?: ExeUnitOptions["volumes"]; } export interface ManyOfOptions { @@ -165,6 +172,13 @@ export interface ManyOfOptions { poolSize: PoolSize; setup?: ExeUnitOptions["setup"]; teardown?: ExeUnitOptions["teardown"]; + + /** + * Define additional volumes ot be mounted when the activity is deployed + * + * @experimental The Provider has to run yagna 0.17.x or newer and offer `vm` runtime 0.5.x or newer + */ + volumes?: ExeUnitOptions["volumes"]; } /** @@ -423,7 +437,12 @@ export class GolemNetwork { * @param options.setup - an optional function that is called as soon as the exe unit is ready * @param options.teardown - an optional function that is called before the exe unit is destroyed */ - async oneOf({ order, setup, teardown, signalOrTimeout }: OneOfOptions): Promise { + async oneOf({ order, setup, teardown, signalOrTimeout, volumes }: OneOfOptions): Promise { + this.validateSettings({ + order, + volumes, + }); + const { signal, cleanup: cleanupAbortSignals } = anyAbortSignal( createAbortSignalFromTimeout(signalOrTimeout), this.abortController.signal, @@ -458,6 +477,7 @@ export class GolemNetwork { .releaseAllocation(allocation) .catch((err) => this.logger.error("Error while releasing allocation", err)); }; + try { const proposalPool = new DraftOfferProposalPool({ logger: this.logger, @@ -492,7 +512,7 @@ export class GolemNetwork { payment: order.payment, activity: order.activity, networkNode, - exeUnit: { setup, teardown }, + exeUnit: { setup, teardown, volumes }, }); // We managed to create the activity, no need to look for more agreement candidates @@ -551,7 +571,12 @@ export class GolemNetwork { * @param options.setup - an optional function that is called as soon as the exe unit is ready * @param options.teardown - an optional function that is called before the exe unit is destroyed */ - public async manyOf({ poolSize, order, setup, teardown }: ManyOfOptions): Promise { + public async manyOf({ poolSize, order, setup, teardown, volumes }: ManyOfOptions): Promise { + this.validateSettings({ + order, + volumes, + }); + const signal = this.abortController.signal; let allocation: Allocation | undefined = undefined; let resourceRentalPool: ResourceRentalPool | undefined = undefined; @@ -605,7 +630,7 @@ export class GolemNetwork { resourceRentalOptions: { activity: order.activity, payment: order.payment, - exeUnit: { setup, teardown }, + exeUnit: { setup, teardown, volumes }, }, agreementOptions: { expirationSec: rentSeconds, @@ -668,4 +693,23 @@ export class GolemNetwork { return new NullStorageProvider(); } } + + /** + * A helper method used to check if the user provided settings and settings are reasonable + * @param settings + * @private + */ + private validateSettings(settings: { volumes?: ExeUnitOptions["volumes"]; order: MarketOrderSpec }) { + // Rule: If user specifies volumes and the min storage size, then the min storage has to be at least of the largest volume size + if (settings.volumes && settings.order.demand.workload?.minStorageGib !== undefined) { + const largestVolumeSizeGib = Math.max(...Object.values(settings.volumes).map((spec) => spec.sizeGib)); + if (settings.order.demand.workload.minStorageGib < largestVolumeSizeGib) { + throw new GolemUserError("Your minStorageGib requirement is below your expected largest volume size."); + } + } + // Rule: Require minStorageGib settings for volume users to ensure that they will get suitable providers from the market + if (settings.volumes && settings.order.demand.workload?.minStorageGib === undefined) { + throw new GolemUserError("You have specified volumes but did not specify a minStorageGib requirement."); + } + } } diff --git a/src/network/node.ts b/src/network/node.ts index ceb6a91ae..3a09152bd 100644 --- a/src/network/node.ts +++ b/src/network/node.ts @@ -1,4 +1,5 @@ import { NetworkInfo } from "./network"; +import { DeployArgs } from "../activity/script/command"; /** * Describes a node in a VPN, mapping a Golem node id to an IP address @@ -13,10 +14,10 @@ export class NetworkNode { /** * Generate a dictionary of arguments that are required for the appropriate - *`Deploy` command of an exescript in order to pass the network configuration to the runtime + *`Deploy` command of an exe-script in order to pass the network configuration to the runtime * on the provider's end. */ - getNetworkConfig() { + getNetworkDeploymentArg(): Pick { return { net: [ { diff --git a/src/resource-rental/resource-rental.ts b/src/resource-rental/resource-rental.ts index ad1c08646..38b927e5f 100644 --- a/src/resource-rental/resource-rental.ts +++ b/src/resource-rental/resource-rental.ts @@ -24,7 +24,7 @@ export interface ResourceRentalEvents { } export interface ResourceRentalOptions { - exeUnit?: Pick; + exeUnit?: Pick; activity?: ExecutionOptions; payment?: Partial; networkNode?: NetworkNode; From 331dc17222570498acc11835e0a5e63b7826c78e Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 19 Nov 2024 14:50:18 +0100 Subject: [PATCH 3/9] feat(plugins): introduced golem-network plugin api --- README.md | 1 + docs/PLUGINS.md | 139 +++++++++++++++++++++++++++++ src/golem-network/golem-network.ts | 30 +++++++ src/golem-network/index.ts | 1 + src/golem-network/plugin.ts | 38 ++++++++ 5 files changed, 209 insertions(+) create mode 100644 docs/PLUGINS.md create mode 100644 src/golem-network/plugin.ts diff --git a/README.md b/README.md index ac0c1cd58..49d4fc865 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ distributed, computational loads through Golem Network. disposal. - [Usage documentation](./docs/USAGE.md) - Explore supported usage and implementation patterns. - [Feature documentation](./docs/FEATURES.md) - Description of interesting features that we've prepared. +- [Plugin documentation](./docs/PLUGINS.md) - Learn how to write plugins that can enhance `GolemNetwork` user's experience by introducing code reusability and modularity. ## Installation diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md new file mode 100644 index 000000000..693867617 --- /dev/null +++ b/docs/PLUGINS.md @@ -0,0 +1,139 @@ +# Golem Network Plugins + + + +- [Golem Network Plugins](#golem-network-plugins) + - [Why do we need plugins?](#why-do-we-need-plugins) + - [Requestor script maintainability](#requestor-script-maintainability) + - [Opening the ecosystem for extensions](#opening-the-ecosystem-for-extensions) + - [Example plugins](#example-plugins) + - [Provider tracker](#provider-tracker) + - [Check GLM price before starting (asynchronous plugin)](#check-glm-price-before-starting-asynchronous-plugin) + - [Plugin lifecycle and cleanup](#plugin-lifecycle-and-cleanup) + - [Synchronous and asynchronous plugins](#synchronous-and-asynchronous-plugins) + + +Welcome to the Golem Network Plugins documentation! Here we aim to provide friendly and comprehensive guidance for +developers interested in creating reusable and generic modules for the Golem Network. + +## Why do we need plugins? + +### Requestor script maintainability + +As detailed in our [concepts](./CONCEPTS.md) guide, the SDK models the intricate domain of the Golem Network by defining +the `GolemNetwork` class, which is built from various subdomains of the project. + +If you've written a few `golem-js` scripts, you might have noticed your scripts growing quickly as you add logic for +market, activity, or payment events. This can make your main requestor script bulky and difficult to maintain. + +Golem Plugins offer a solution to this problem by providing a simple interface for attaching different types of logic to +your `GolemNetwork` instance. This allows you to break down your large scripts into smaller, more manageable modules and +use `GolemNetwork.use` to integrate them into your main script seamlessly. + +### Opening the ecosystem for extensions + +We warmly invite other developers to [contribute](./CONTRIBUTING.md) to our ecosystem. We recognize that creating core +SDK components requires considerable effort and dedication. + +To make contributions more accessible, we're introducing a new pathway for developers familiar with `golem-js` to create +their `GolemNetwork` plugins and share them via NPM. Let us know about your plugins so we can feature them in our +documentation. + +## Example plugins + +### Provider tracker + +Let's say you want to track unique providers on the network for statistical purposes. Here's an example plugin: + +```ts +import { GolemNetwork, GolemPluginInitializer } from "@golem-sdk/golem-js"; + +/** + * Example plugin that tracks unique provider ID/name pairs on the market + */ +const providerTracker: GolemPluginInitializer = (glm) => { + const seenProviders: { id: string; name: string }[] = []; + + glm.market.events.on("offerProposalReceived", (event) => { + const { id, name } = event.offerProposal.provider; + const providerInfo = { id, name }; + if (!seenProviders.includes(providerInfo)) { + seenProviders.push(providerInfo); + console.log("Saw new provider %s named %s", id, name); + } + }); + + // Return a cleanup function that will be executed during the `disconnect` + return () => { + console.log("Provider tracker found a total of %d providers", seenProviders.length); + }; +}; +``` + +You can connect this plugin to your main script as follows: + +```ts +const glm = new GolemNetwork(); + +// Register the plugin that will be initialized during `connect` call +glm.use(providerTracker); +``` + +#### Check GLM price before starting (asynchronous plugin) + +If you want to avoid running your requestor script when the GLM price exceeds a certain USD value, you can capture this +policy with a reusable plugin: + +```ts +import { GolemNetwork, GolemPluginInitializer } from "@golem-sdk/golem-js"; + +const checkGlmPriceBeforeStarting: GolemPluginInitializer<{ + maxPrice: number; +}> = async (_glm, opts) => { + // Call an exchange to get the quotes + const response = await fetch("https://api.coinpaprika.com/v1/tickers/glm-golem"); + + if (!response.ok) { + throw new Error("Failed to fetch GLM price"); + } else { + // Execute your logic + const data = await response.json(); + const price = parseFloat(data.quotes.USD.price); + + console.log("=== GLM Price ==="); + console.log("GLM price is", price); + console.log("=== GLM Price ==="); + + if (price > opts.maxPrice) { + // Throwing inside the plugin will make `connect` throw, and then prevent + // execution of the rest of the script + throw new Error("GLM price is too high, won't compute today :O"); + } + } +}; +``` + +Here's how to use the plugin: + +```ts +const glm = new GolemNetwork(); + +glm.use(checkGlmPriceBeforeStarting, { + maxPrice: 0.5, +}); +``` + +## Plugin lifecycle and cleanup + +When you register plugins using `GolemNetwork.use`, they are initialized during the `GolemNetwork.connect` call. If any +plugin throws an error during initialization, the entire `connect` method will throw an error. + +Each plugin can return a cleanup function, which will be executed during `GolemNetwork.disconnect`. This is particularly +useful for plugins that allocate resources, use timers, or open database connections. + +## Synchronous and asynchronous plugins + +The SDK supports both synchronous and asynchronous plugins. You can register all of them using the `GolemNetwork.use` +method, and they will be initialized sequentially in the order they were registered. + +We hope you find this guide helpful and enjoy contributing to the Golem Network! Happy coding! diff --git a/src/golem-network/golem-network.ts b/src/golem-network/golem-network.ts index 5a35f01d4..26ed7f27e 100644 --- a/src/golem-network/golem-network.ts +++ b/src/golem-network/golem-network.ts @@ -36,6 +36,7 @@ import { NetworkApiAdapter } from "../shared/yagna/adapters/network-api-adapter" import { IProposalRepository } from "../market/proposal"; import { Subscription } from "rxjs"; import { GolemConfigError, GolemUserError } from "../shared/error/golem-error"; +import { GolemPluginInitializer, GolemPluginOptions, GolemPluginRegistration } from "./plugin"; /** * Instance of an object or a factory function that you can call `new` on. @@ -236,6 +237,8 @@ export class GolemNetwork { */ private cleanupTasks: (() => Promise | void)[] = []; + private registeredPlugins: GolemPluginRegistration[] = []; + constructor(options: Partial = {}) { const optDefaults: GolemNetworkOptions = { dataTransferProtocol: "ws", @@ -334,6 +337,7 @@ export class GolemNetwork { await this.yagna.connect(); await this.services.paymentApi.connect(); await this.storageProvider.init(); + await this.connectPlugins(); this.events.emit("connected"); this.hasConnection = true; } catch (err) { @@ -673,6 +677,21 @@ export class GolemNetwork { return await this.network.removeNetwork(network); } + public use(pluginCallback: GolemPluginInitializer): void; + public use( + pluginCallback: GolemPluginInitializer, + pluginOptions: TPOptions, + ): void; + public use( + pluginCallback: GolemPluginInitializer, + pluginOptions?: TPOptions, + ): void { + this.registeredPlugins.push({ + initializer: pluginCallback, + options: pluginOptions, + }); + } + private createStorageProvider(): StorageProvider { if (typeof this.options.dataTransferProtocol === "string") { switch (this.options.dataTransferProtocol) { @@ -694,6 +713,17 @@ export class GolemNetwork { } } + private async connectPlugins() { + this.logger.debug("Started plugin initialization"); + for (const plugin of this.registeredPlugins) { + const cleanup = await plugin.initializer(this, plugin.options); + if (cleanup) { + this.cleanupTasks.push(cleanup); + } + } + this.logger.debug("Finished plugin initialization"); + } + /** * A helper method used to check if the user provided settings and settings are reasonable * @param settings diff --git a/src/golem-network/index.ts b/src/golem-network/index.ts index 2a17939a9..13cf43d54 100644 --- a/src/golem-network/index.ts +++ b/src/golem-network/index.ts @@ -1 +1,2 @@ export * from "./golem-network"; +export { GolemPluginInitializer, GolemPluginOptions, GolemPluginDisconnect } from "./plugin"; diff --git a/src/golem-network/plugin.ts b/src/golem-network/plugin.ts new file mode 100644 index 000000000..3652f7234 --- /dev/null +++ b/src/golem-network/plugin.ts @@ -0,0 +1,38 @@ +import { GolemNetwork } from "./golem-network"; + +/** + * Represents a generic cleanup task function that will be executed when the plugin lifetime reaches its end + */ +export type GolemPluginDisconnect = () => Promise | void; + +/** + * Generic type for plugin options + * + * Plugin options are optional by design and plugin developers should use this type when they + * want to enforce type safety on their plugin usage + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type GolemPluginOptions = Record | undefined; + +/** + * A generic plugin registration/connect function + * + * Golem plugins are initialized during {@link GolemNetwork.connect} + * + * A plugin initializer may return a cleanup function which will be called udring {@link GolemNetwork.disconnect} + */ +export type GolemPluginInitializer = ( + glm: GolemNetwork, + options: T, +) => void | GolemPluginDisconnect | Promise; + +/** + * Internal data structure that allows deferring plugin initialization to the `connect` call + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type GolemPluginRegistration = { + /** Plugin initialization function */ + initializer: GolemPluginInitializer; + /** Options to pass to the initialization function when it's executed */ + options?: T; +}; From 7b77bd31fa661da27cf45ce321542a395f89a28b Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 19 Nov 2024 17:51:56 +0100 Subject: [PATCH 4/9] docs(plugins): updated plugin related documentation --- docs/PLUGINS.md | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md index 693867617..849ed6951 100644 --- a/docs/PLUGINS.md +++ b/docs/PLUGINS.md @@ -1,18 +1,5 @@ # Golem Network Plugins - - -- [Golem Network Plugins](#golem-network-plugins) - - [Why do we need plugins?](#why-do-we-need-plugins) - - [Requestor script maintainability](#requestor-script-maintainability) - - [Opening the ecosystem for extensions](#opening-the-ecosystem-for-extensions) - - [Example plugins](#example-plugins) - - [Provider tracker](#provider-tracker) - - [Check GLM price before starting (asynchronous plugin)](#check-glm-price-before-starting-asynchronous-plugin) - - [Plugin lifecycle and cleanup](#plugin-lifecycle-and-cleanup) - - [Synchronous and asynchronous plugins](#synchronous-and-asynchronous-plugins) - - Welcome to the Golem Network Plugins documentation! Here we aim to provide friendly and comprehensive guidance for developers interested in creating reusable and generic modules for the Golem Network. @@ -36,8 +23,7 @@ We warmly invite other developers to [contribute](./CONTRIBUTING.md) to our ecos SDK components requires considerable effort and dedication. To make contributions more accessible, we're introducing a new pathway for developers familiar with `golem-js` to create -their `GolemNetwork` plugins and share them via NPM. Let us know about your plugins so we can feature them in our -documentation. +their `GolemNetwork` plugins and share them via NPM. ## Example plugins @@ -136,4 +122,14 @@ useful for plugins that allocate resources, use timers, or open database connect The SDK supports both synchronous and asynchronous plugins. You can register all of them using the `GolemNetwork.use` method, and they will be initialized sequentially in the order they were registered. -We hope you find this guide helpful and enjoy contributing to the Golem Network! Happy coding! +## Dear developers! + +### Become a Golem Network Creator + +We hope you find this guide helpful and enjoy contributing to the Golem Network. Happy coding! + +### Community developed plugins + +Here's the list of plugins developed by Golem's Community. + +> Let us know about your plugins so we can feature them in our documentation. From 6046ffb42923b373aa9304349bed69656d8f67b5 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 20 Nov 2024 13:58:45 +0100 Subject: [PATCH 5/9] docs: fixed typo --- src/golem-network/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/golem-network/plugin.ts b/src/golem-network/plugin.ts index 3652f7234..f5f2bdf09 100644 --- a/src/golem-network/plugin.ts +++ b/src/golem-network/plugin.ts @@ -19,7 +19,7 @@ export type GolemPluginOptions = Record | undefined; * * Golem plugins are initialized during {@link GolemNetwork.connect} * - * A plugin initializer may return a cleanup function which will be called udring {@link GolemNetwork.disconnect} + * A plugin initializer may return a cleanup function which will be called during {@link GolemNetwork.disconnect} */ export type GolemPluginInitializer = ( glm: GolemNetwork, From a65e95583d0cd1b9f4351c76c1602c936d827ad1 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 20 Nov 2024 14:18:21 +0100 Subject: [PATCH 6/9] build: changed supported node versions, added node 22 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f33e38773..6fd56925f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: matrix: # Make sure you're addressing it to the minor version, as sometimes macos was picking 20.9 while others 20.10 # and that caused issues with rollup - node-version: [18.19.x, 20.10.x] + node-version: [18.20.x, 20.18.x, 22.x] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a706ee586..466012624 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,7 @@ jobs: matrix: # Make sure you're addressing it to the minor version, as sometimes macos was picking 20.9 while others 20.10 # and that caused issues with rollup - node-version: [18.19.x, 20.10.x] + node-version: [18.20.x, 20.18.x, 22.x] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} From f0d76e9561cf553ac1cafda2f0bd08e530fdef2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:02:53 +0000 Subject: [PATCH 7/9] build(deps): bump cross-spawn from 7.0.3 to 7.0.6 Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7df1a1568..ee5f003a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6637,9 +6637,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", From 8ed6c7971123f3f8e376ed01f398f35e54a54e2b Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Thu, 21 Nov 2024 10:37:45 +0100 Subject: [PATCH 8/9] build: updated rollup and switched from 'assert' to 'with' import attribute --- package-lock.json | 181 +++++++++++++++++++++++++++++----------------- rollup.config.mjs | 2 +- 2 files changed, 115 insertions(+), 68 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7df1a1568..680644a24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3028,205 +3028,249 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", - "integrity": "sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.27.3.tgz", + "integrity": "sha512-EzxVSkIvCFxUd4Mgm4xR9YXrcp976qVaHnqom/Tgm+vU79k4vV4eYTjmRvGfeoW8m9LVcsAy/lGjcgVegKEhLQ==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.0.tgz", - "integrity": "sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.27.3.tgz", + "integrity": "sha512-LJc5pDf1wjlt9o/Giaw9Ofl+k/vLUaYsE2zeQGH85giX2F+wn/Cg8b3c5CDP3qmVmeO5NzwVUzQQxwZvC2eQKw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz", - "integrity": "sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.3.tgz", + "integrity": "sha512-OuRysZ1Mt7wpWJ+aYKblVbJWtVn3Cy52h8nLuNSzTqSesYw1EuN6wKp5NW/4eSre3mp12gqFRXOKTcN3AI3LqA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.0.tgz", - "integrity": "sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.27.3.tgz", + "integrity": "sha512-xW//zjJMlJs2sOrCmXdB4d0uiilZsOdlGQIC/jjmMWT47lkLLoB1nsNhPUcnoqyi5YR6I4h+FjBpILxbEy8JRg==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" ] }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.27.3.tgz", + "integrity": "sha512-58E0tIcwZ+12nK1WiLzHOD8I0d0kdrY/+o7yFVPRHuVGY3twBwzwDdTIBGRxLmyjciMYl1B/U515GJy+yn46qw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.27.3.tgz", + "integrity": "sha512-78fohrpcVwTLxg1ZzBMlwEimoAJmY6B+5TsyAZ3Vok7YabRBUvjYTsRXPTjGEvv/mfgVBepbW28OlMEz4w8wGA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.0.tgz", - "integrity": "sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.27.3.tgz", + "integrity": "sha512-h2Ay79YFXyQi+QZKo3ISZDyKaVD7uUvukEHTOft7kh00WF9mxAaxZsNs3o/eukbeKuH35jBvQqrT61fzKfAB/Q==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.0.tgz", - "integrity": "sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.27.3.tgz", + "integrity": "sha512-Sv2GWmrJfRY57urktVLQ0VKZjNZGogVtASAgosDZ1aUB+ykPxSi3X1nWORL5Jk0sTIIwQiPH7iE3BMi9zGWfkg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.0.tgz", - "integrity": "sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.27.3.tgz", + "integrity": "sha512-FPoJBLsPW2bDNWjSrwNuTPUt30VnfM8GPGRoLCYKZpPx0xiIEdFip3dH6CqgoT0RnoGXptaNziM0WlKgBc+OWQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.0.tgz", - "integrity": "sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.27.3.tgz", + "integrity": "sha512-TKxiOvBorYq4sUpA0JT+Fkh+l+G9DScnG5Dqx7wiiqVMiRSkzTclP35pE6eQQYjP4Gc8yEkJGea6rz4qyWhp3g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.0.tgz", - "integrity": "sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.27.3.tgz", + "integrity": "sha512-v2M/mPvVUKVOKITa0oCFksnQQ/TqGrT+yD0184/cWHIu0LoIuYHwox0Pm3ccXEz8cEQDLk6FPKd1CCm+PlsISw==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.0.tgz", - "integrity": "sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.27.3.tgz", + "integrity": "sha512-LdrI4Yocb1a/tFVkzmOE5WyYRgEBOyEhWYJe4gsDWDiwnjYKjNs7PS6SGlTDB7maOHF4kxevsuNBl2iOcj3b4A==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.0.tgz", - "integrity": "sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.27.3.tgz", + "integrity": "sha512-d4wVu6SXij/jyiwPvI6C4KxdGzuZOvJ6y9VfrcleHTwo68fl8vZC5ZYHsCVPUi4tndCfMlFniWgwonQ5CUpQcA==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", - "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.3.tgz", + "integrity": "sha512-/6bn6pp1fsCGEY5n3yajmzZQAh+mW4QPItbiWxs69zskBzJuheb3tNynEjL+mKOsUSFK11X4LYF2BwwXnzWleA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz", - "integrity": "sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.3.tgz", + "integrity": "sha512-nBXOfJds8OzUT1qUreT/en3eyOXd2EH5b0wr2bVB5999qHdGKkzGzIyKYaKj02lXk6wpN71ltLIaQpu58YFBoQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.0.tgz", - "integrity": "sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.27.3.tgz", + "integrity": "sha512-ogfbEVQgIZOz5WPWXF2HVb6En+kWzScuxJo/WdQTqEgeyGkaa2ui5sQav9Zkr7bnNCLK48uxmmK0TySm22eiuw==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.0.tgz", - "integrity": "sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.27.3.tgz", + "integrity": "sha512-ecE36ZBMLINqiTtSNQ1vzWc5pXLQHlf/oqGp/bSbi7iedcjcNb6QbCBNG73Euyy2C+l/fn8qKWEwxr+0SSfs3w==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz", - "integrity": "sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.27.3.tgz", + "integrity": "sha512-vliZLrDmYKyaUoMzEbMTg2JkerfBjn03KmAw9CykO0Zzkzoyd7o3iZNam/TpyWNjNT+Cz2iO3P9Smv2wgrR+Eg==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -17531,10 +17575,11 @@ } }, "node_modules/rollup": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", - "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", + "version": "4.27.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.27.3.tgz", + "integrity": "sha512-SLsCOnlmGt9VoZ9Ek8yBK8tAdmPHeppkw+Xa7yDlCEhDTvwYei03JlWo1fdc7YTfLZ4tD8riJCUyAgTbszk1fQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -17546,22 +17591,24 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.24.0", - "@rollup/rollup-android-arm64": "4.24.0", - "@rollup/rollup-darwin-arm64": "4.24.0", - "@rollup/rollup-darwin-x64": "4.24.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.24.0", - "@rollup/rollup-linux-arm-musleabihf": "4.24.0", - "@rollup/rollup-linux-arm64-gnu": "4.24.0", - "@rollup/rollup-linux-arm64-musl": "4.24.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.24.0", - "@rollup/rollup-linux-riscv64-gnu": "4.24.0", - "@rollup/rollup-linux-s390x-gnu": "4.24.0", - "@rollup/rollup-linux-x64-gnu": "4.24.0", - "@rollup/rollup-linux-x64-musl": "4.24.0", - "@rollup/rollup-win32-arm64-msvc": "4.24.0", - "@rollup/rollup-win32-ia32-msvc": "4.24.0", - "@rollup/rollup-win32-x64-msvc": "4.24.0", + "@rollup/rollup-android-arm-eabi": "4.27.3", + "@rollup/rollup-android-arm64": "4.27.3", + "@rollup/rollup-darwin-arm64": "4.27.3", + "@rollup/rollup-darwin-x64": "4.27.3", + "@rollup/rollup-freebsd-arm64": "4.27.3", + "@rollup/rollup-freebsd-x64": "4.27.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.27.3", + "@rollup/rollup-linux-arm-musleabihf": "4.27.3", + "@rollup/rollup-linux-arm64-gnu": "4.27.3", + "@rollup/rollup-linux-arm64-musl": "4.27.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.27.3", + "@rollup/rollup-linux-riscv64-gnu": "4.27.3", + "@rollup/rollup-linux-s390x-gnu": "4.27.3", + "@rollup/rollup-linux-x64-gnu": "4.27.3", + "@rollup/rollup-linux-x64-musl": "4.27.3", + "@rollup/rollup-win32-arm64-msvc": "4.27.3", + "@rollup/rollup-win32-ia32-msvc": "4.27.3", + "@rollup/rollup-win32-x64-msvc": "4.27.3", "fsevents": "~2.3.2" } }, diff --git a/rollup.config.mjs b/rollup.config.mjs index 0e94c9cc6..ab32bf874 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -3,7 +3,7 @@ import commonjs from "@rollup/plugin-commonjs"; import terser from "@rollup/plugin-terser"; import typescript from "@rollup/plugin-typescript"; import nodePolyfills from "rollup-plugin-polyfill-node"; -import pkg from "./package.json" assert { type: "json" }; +import pkg from "./package.json" with { type: "json" }; import ignore from "rollup-plugin-ignore"; import filesize from "rollup-plugin-filesize"; import fs from "node:fs"; From 9ebda3f05a69f939c35cdce5b087e5ab8dfe5d32 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Thu, 21 Nov 2024 14:38:46 +0100 Subject: [PATCH 9/9] build: use node 22 on requestor in docker --- tests/docker/Requestor.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/docker/Requestor.Dockerfile b/tests/docker/Requestor.Dockerfile index 8c7f8d05a..7ae6646fa 100644 --- a/tests/docker/Requestor.Dockerfile +++ b/tests/docker/Requestor.Dockerfile @@ -1,7 +1,7 @@ ARG UBUNTU_VERSION=22.04 ARG YA_CORE_REQUESTOR_VERSION=v0.15.2 -FROM node:18.18.2 +FROM node:22 ARG YA_CORE_REQUESTOR_VERSION ARG YA_DIR_INSTALLER=/ya-installer ARG YA_DIR_BIN=/usr/bin