diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 04b0b54..253690e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,14 +2,13 @@ name: 'E2E Tests' on: push: - branches: [v3.x-bundle] + branches: [v3.x] + paths-ignore: + - '**/*.md' + pull_request: + branches: [v3.x] paths-ignore: - '**/*.md' - # pull_request: - # branches: [ main ] - # paths-ignore: - # - '**/*.md' - env: pnpm_version: 8 @@ -18,7 +17,8 @@ env: RESOURCE_IDENTIFIER_NODE18_LINUX_X64: ${{ secrets.RESOURCE_IDENTIFIER_NODE18_LINUX_X64 }} RESOURCE_IDENTIFIER_NODE18_WIN_X64: ${{ secrets.RESOURCE_IDENTIFIER_NODE18_WIN_X64 }} - + RESOURCE_IDENTIFIER_BUN_LINUX_X64: ${{ secrets.RESOURCE_IDENTIFIER_BUN_LINUX_X64 }} + RESOURCE_IDENTIFIER_BUN_WIN_X64: ${{ secrets.RESOURCE_IDENTIFIER_BUN_WIN_X64 }} jobs: get-matrix: diff --git a/examples/with-bun/nammatham.config.mjs b/examples/with-bun/nammatham.config.mjs index fafb5c8..a3b3da8 100644 --- a/examples/with-bun/nammatham.config.mjs +++ b/examples/with-bun/nammatham.config.mjs @@ -5,22 +5,6 @@ const nammathamConfig = { runtime: 'bun', hostConfig: { version: '2.0', - extensionBundle: { - id: 'Microsoft.Azure.Functions.ExtensionBundle', - version: '[3.15.0, 4.0.0)', - }, - extensions: { - http: { - routePrefix: 'api', - }, - }, - customHandler: { - description: { - defaultExecutablePath: '../node_modules/.bin/tsx', - arguments: ['watch', '../src/main.ts'], - }, - enableForwardingHttpRequest: true, - }, logging: { applicationInsights: { samplingSettings: { diff --git a/examples/with-bun/package.json b/examples/with-bun/package.json index c599eac..b8a7234 100644 --- a/examples/with-bun/package.json +++ b/examples/with-bun/package.json @@ -20,4 +20,4 @@ "tsx": "^4.9.1", "typescript": "^5.4.5" } -} \ No newline at end of file +} diff --git a/examples/with-node/nammatham.config.mjs b/examples/with-node/nammatham.config.mjs index 4123e63..90fd4a6 100644 --- a/examples/with-node/nammatham.config.mjs +++ b/examples/with-node/nammatham.config.mjs @@ -3,31 +3,8 @@ /** @type {import('nammatham').NammathamConfigs} */ const nammathamConfig = { runtime: 'node', - // buildOption: { - // target: { - // arch: 'x64', - // platform: 'linux', - // runtime: 'node18', - // }, - // }, hostConfig: { version: '2.0', - extensionBundle: { - id: 'Microsoft.Azure.Functions.ExtensionBundle', - version: '[3.15.0, 4.0.0)', - }, - extensions: { - http: { - routePrefix: 'api', - }, - }, - // customHandler: { - // description: { - // defaultExecutablePath: '../node_modules/.bin/tsx', - // arguments: ['watch', '../src/main.ts'], - // }, - // enableForwardingHttpRequest: true, - // }, logging: { applicationInsights: { samplingSettings: { diff --git a/examples/with-node/package.json b/examples/with-node/package.json index e769608..6c005a4 100644 --- a/examples/with-node/package.json +++ b/examples/with-node/package.json @@ -21,4 +21,4 @@ "tsx": "^4.9.1", "typescript": "^5.4.5" } -} \ No newline at end of file +} diff --git a/infra/azure-functions/README.md b/infra/azure-functions/README.md index ee658b7..fc032d4 100644 --- a/infra/azure-functions/README.md +++ b/infra/azure-functions/README.md @@ -1,5 +1,102 @@ ## Setup Infra ``` -az ad sp create-for-rbac --display-name "nammatham-github-actions-e2e-tests" --role "Contributor" --scopes "/subscriptions/29523625-6fa5-4d9a-86bc-da000544be7d/resourceGroups/rg-nammatham-nmt-e2e-node18-linux-x64-f04f60dfb53e02" --json-auth +az ad sp create-for-rbac --display-name "nammatham-github-actions-e2e-tests" --role "Contributor" --scopes "/subscriptions/29523625-6fa5-4d9a-86bc-da000544be7d/resourceGroups/rg-nammatham-nmt-e2e-node18-linux-x64-xxxxxxxxxxxxxx" --json-auth +``` + +## How to add new Azure Functions to the project + +### 1. Add more config in `src/config.ts` + +For example: + +```ts +export const infraConfigs = createInfraConfig( + { + // .... + // ^ the above is the existing infra config + 'bun-linux-x64': process.env.RESOURCE_IDENTIFIER_BUN_LINUX_X64, + }, + [ + { + platform: 'linux', + arch: 'x64', + runtime: 'bun', + mode: 'create', + isDeployable: true, + }, + ] +); +``` + +### 2. Add more `RESOURCE_IDENTIFIER_BUN_LINUX_X64` in the `.env` file +using this: https://codebeautify.org/generate-random-hexadecimal-numbers + +```env +RESOURCE_IDENTIFIER_BUN_LINUX_X64=6a2026b8a8736f +``` + +### 3. Run Plan + +```sh +pnpm plan +``` + +the result will be + +``` +Running in plan mode: true +┌───┬──────────┬───────┬─────────┬─────────┬──────────────┬────────────────────┬────────┐ +│ │ platform │ arch │ runtime │ version │ isDeployable │ resourceIdentifier │ mode │ +├───┼──────────┼───────┼─────────┼─────────┼──────────────┼────────────────────┼────────┤ +│ 0 │ linux │ x64 │ node │ 18 │ true │ c95a3623a9a936 │ │ +│ 1 │ win │ x64 │ node │ 18 │ true │ 61abf3b30d9327 │ │ +│ 2 │ macos │ arm64 │ node │ 18 │ false │ undefined │ │ +│ 3 │ linux │ x64 │ bun │ │ true │ 21a4f3b0855015 │ create │ +└───┴──────────┴───────┴─────────┴─────────┴──────────────┴────────────────────┴────────┘ +Skipping infra config with target node18-linux-x64 +Skipping infra config with target node18-win-x64 +Skipping infra config with target node18-macos-arm64 +``` + +### 3. Run Apply + +```sh +pnpm apply +``` + +### 4. Setup Github Actions & Secrets + +add more env in `.github/workflows/e2e.yml` + +```yml +env: + # ... + # ^ the above is the existing env + RESOURCE_IDENTIFIER_BUN_LINUX_X64: ${{ secrets.RESOURCE_IDENTIFIER_BUN_LINUX_X64 }} +``` + +then use the resource identifier in the github secret `RESOURCE_IDENTIFIER_BUN_LINUX_X64`, from step 2 (`6a2026b8a8736f`). + +### 5. Change infra mode config in `src/config.ts`, by remove the `mode: 'create'` + +For example: + +```ts +export const infraConfigs = createInfraConfig( + { + // .... + // ^ the above is the existing infra config + 'bun-linux-x64': process.env.RESOURCE_IDENTIFIER_BUN_LINUX_X64, + }, + [ + { + platform: 'linux', + arch: 'x64', + runtime: 'bun', + // mode: 'create', + isDeployable: true, + }, + ] +); ``` \ No newline at end of file diff --git a/infra/azure-functions/package.json b/infra/azure-functions/package.json index 72cca9b..dd202e0 100644 --- a/infra/azure-functions/package.json +++ b/infra/azure-functions/package.json @@ -6,7 +6,7 @@ "test-os": "tsx src/test-os.ts", "apply": "bun run src/main.ts", "plan": "PLAN_MODE=true bun run src/main.ts", - "test": "bun test", + "test": "bun test --timeout 120000", "github-actions": "bun run src/github-actions.ts", "lint": "tsc --noEmit && eslint ./src && prettier -c src", "lint:fix": "eslint --fix ./src && prettier -w src" @@ -24,4 +24,4 @@ "engines": { "bun": "^1.1.0" } -} \ No newline at end of file +} diff --git a/infra/azure-functions/src/azure-command.ts b/infra/azure-functions/src/azure-command.ts index 0a26c04..5ad57c3 100644 --- a/infra/azure-functions/src/azure-command.ts +++ b/infra/azure-functions/src/azure-command.ts @@ -50,12 +50,29 @@ export async function createFunctionApp(infraConfig: InfraEnvConfig, options: In await $`az functionapp create --name ${resourceName.prefix} --storage-account ${resourceName.shortPrefix} --consumption-plan-location ${location} --resource-group ${resourceGroup} --os-type ${osType} --runtime custom --functions-version ${functionsVersion}`; console.log(`Set Function Key for ${resourceName.prefix} `); - await $`az functionapp keys set --name ${resourceName.prefix} --resource-group ${resourceGroup} --key-name github_actions --key-value ${process.env.AZURE_FUNCTIONS_API_KEY}`; + await $`az functionapp keys set --name ${resourceName.prefix} --resource-group ${resourceGroup} --key-name github_actions --key-type functionKeys --key-value ${process.env.AZURE_FUNCTIONS_API_KEY}`; console.log('Function app created'); console.log('-'.repeat(80)); } +export async function assignRoleAssignment(infraConfig: InfraEnvConfig, options: InfraOptions) { + const resourceName = getResourceName(infraConfig); + console.log('-'.repeat(80)); + + if (options.isPlanMode) { + console.log('Plan mode enabled, skipping resource creation'); + return; + } + console.log('Assigning role assignment'); + + const resourceGroup = `rg-nammatham-${resourceName.prefix}`; + const role = 'Contributor'; + const assignee = process.env.AZURE_APPLICATION_ID; + const scope = `/subscriptions/${process.env.AZURE_SUBSCRIPTION_ID}/resourceGroups/${resourceGroup}`; + await $`az role assignment create --role ${role} --assignee ${assignee} --scope ${scope}`; +} + export async function destroyFunctionApp(infraConfig: InfraEnvConfig, options: InfraOptions) { console.log('-'.repeat(80)); const resourceName = getResourceName(infraConfig); diff --git a/infra/azure-functions/src/config.ts b/infra/azure-functions/src/config.ts index 90979aa..edb0293 100644 --- a/infra/azure-functions/src/config.ts +++ b/infra/azure-functions/src/config.ts @@ -4,51 +4,49 @@ export const infraConfigs = createInfraConfig( { 'node18-linux-x64': process.env.RESOURCE_IDENTIFIER_NODE18_LINUX_X64, 'node18-win-x64': process.env.RESOURCE_IDENTIFIER_NODE18_WIN_X64, + 'bun-linux-x64': process.env.RESOURCE_IDENTIFIER_BUN_LINUX_X64, + 'bun-win-x64': process.env.RESOURCE_IDENTIFIER_BUN_WIN_X64, }, [ // --- Node 18 --- { platform: 'linux', arch: 'x64', - runtime: 'node18', + runtime: 'node', + version: 18, isDeployable: true, }, { platform: 'win', arch: 'x64', - runtime: 'node18', + runtime: 'node', + version: 18, isDeployable: true, }, { platform: 'macos', arch: 'arm64', - runtime: 'node18', + runtime: 'node', + version: 18, }, // --- Bun ---- - // { - // platform: 'linux', - // arch: 'x64', - // runtime: 'bun', - // }, - // { - // platform: 'linux', - // arch: 'arm64', - // runtime: 'bun', - // }, - // { - // platform: 'win', - // arch: 'x64', - // runtime: 'bun', - // }, - // { - // platform: 'win', - // arch: 'x64', - // runtime: 'node18', - // }, - // { - // platform: 'macos', - // arch: 'x64', - // runtime: 'bun', - // }, + { + platform: 'linux', + arch: 'x64', + runtime: 'bun', + isDeployable: true, + }, + { + platform: 'win', + arch: 'x64', + runtime: 'bun', + isDeployable: true, + }, + { + platform: 'macos', + arch: 'x64', + runtime: 'bun', + isDeployable: false, + }, ] ); diff --git a/infra/azure-functions/src/main.ts b/infra/azure-functions/src/main.ts index d1cd989..8374538 100644 --- a/infra/azure-functions/src/main.ts +++ b/infra/azure-functions/src/main.ts @@ -1,6 +1,6 @@ import { toTarget } from './utils'; import { infraConfigs } from './config'; -import { createFunctionApp, destroyFunctionApp } from './azure-command'; +import { assignRoleAssignment, createFunctionApp, destroyFunctionApp } from './azure-command'; const isPlanMode = process.env.PLAN_MODE === 'true'; @@ -15,6 +15,7 @@ for (const infraConfig of infraConfigs) { } if (infraConfig.mode === 'create') { await createFunctionApp(infraConfig, { isPlanMode }); + await assignRoleAssignment(infraConfig, { isPlanMode }); } else if (infraConfig.mode === 'destroy') { await destroyFunctionApp(infraConfig, { isPlanMode }); } else { diff --git a/infra/azure-functions/src/types.ts b/infra/azure-functions/src/types.ts index 082d67d..4e6e03a 100644 --- a/infra/azure-functions/src/types.ts +++ b/infra/azure-functions/src/types.ts @@ -1,6 +1,10 @@ import type { TargetOptions } from 'nammatham'; export interface InfraEnvConfig extends TargetOptions { + /** + * Runtime + */ + runtime?: 'bun' | 'node'; /** * Each infra config will be tested for build of specific target options * Some infra configs may not be deployable, so we can skip them diff --git a/infra/azure-functions/src/utils.ts b/infra/azure-functions/src/utils.ts index 5682845..f18d19a 100644 --- a/infra/azure-functions/src/utils.ts +++ b/infra/azure-functions/src/utils.ts @@ -1,7 +1,7 @@ import type { InfraEnvConfig } from './types'; export function toTarget(infraConfig: InfraEnvConfig): string { - return `${infraConfig.runtime}-${infraConfig.platform}-${infraConfig.arch}`; + return `${infraConfig.runtime}${infraConfig.version ?? ''}-${infraConfig.platform}-${infraConfig.arch}`; } export function fallbackResourceIdentifier(infraConfig: InfraEnvConfig): string { diff --git a/migrations.json b/migrations.json new file mode 100644 index 0000000..588737c --- /dev/null +++ b/migrations.json @@ -0,0 +1,100 @@ +{ + "migrations": [ + { + "cli": "nx", + "version": "16.0.0-beta.0", + "description": "Remove @nrwl/cli.", + "implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli", + "package": "nx", + "name": "16.0.0-remove-nrwl-cli" + }, + { + "cli": "nx", + "version": "16.0.0-beta.9", + "description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.", + "implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens", + "package": "nx", + "name": "16.0.0-tokens-for-depends-on" + }, + { + "cli": "nx", + "version": "16.0.0-beta.0", + "description": "Replace @nrwl/nx-cloud with nx-cloud", + "implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner", + "package": "nx", + "name": "16.0.0-update-nx-cloud-runner" + }, + { + "cli": "nx", + "version": "16.2.0-beta.0", + "description": "Remove outputPath from run commands", + "implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path", + "package": "nx", + "name": "16.2.0-remove-output-path-from-run-commands" + }, + { + "cli": "nx", + "version": "16.6.0-beta.6", + "description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed", + "implementation": "./src/migrations/update-15-0-0/prefix-outputs", + "package": "nx", + "name": "16.6.0-prefix-outputs" + }, + { + "cli": "nx", + "version": "16.8.0-beta.3", + "description": "Escape $ in env variables", + "implementation": "./src/migrations/update-16-8-0/escape-dollar-sign-env-variables", + "x-repair-skip": true, + "package": "nx", + "name": "16.8.0-escape-dollar-sign-env" + }, + { + "cli": "nx", + "version": "17.0.0-beta.1", + "description": "Updates the default cache directory to .nx/cache", + "implementation": "./src/migrations/update-17-0-0/move-cache-directory", + "package": "nx", + "name": "17.0.0-move-cache-directory" + }, + { + "cli": "nx", + "version": "17.0.0-beta.3", + "description": "Use minimal config for tasksRunnerOptions", + "implementation": "./src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options", + "package": "nx", + "name": "17.0.0-use-minimal-config-for-tasks-runner-options" + }, + { + "version": "17.0.0-rc.1", + "description": "Migration for v17.0.0-rc.1", + "implementation": "./src/migrations/update-17-0-0/rm-default-collection-npm-scope", + "package": "nx", + "name": "rm-default-collection-npm-scope" + }, + { + "cli": "nx", + "version": "17.3.0-beta.6", + "description": "Updates the nx wrapper.", + "implementation": "./src/migrations/update-17-3-0/update-nxw", + "package": "nx", + "name": "17.3.0-update-nx-wrapper" + }, + { + "cli": "nx", + "version": "18.0.0-beta.2", + "description": "Updates nx.json to disabled adding plugins when generating projects in an existing Nx workspace", + "implementation": "./src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces", + "x-repair-skip": true, + "package": "nx", + "name": "18.0.0-disable-adding-plugins-for-existing-workspaces" + }, + { + "version": "18.1.0-beta.3", + "description": "Moves affected.defaultBase to defaultBase in `nx.json`", + "implementation": "./src/migrations/update-17-2-0/move-default-base", + "package": "nx", + "name": "move-default-base-to-nx-json-root" + } + ] +} diff --git a/nx.json b/nx.json index 6148c16..aae7666 100644 --- a/nx.json +++ b/nx.json @@ -1,17 +1,12 @@ { - "$schema": "./node_modules/nx/schemas/nx-schema.json", - "tasksRunnerOptions": { - "default": { - "runner": "nx/tasks-runners/default", - "options": { - "cacheableOperations": ["build"] - } - } - }, - "targetDefaults": { - "build": { - "dependsOn": ["^build"] - } + "$schema": "./node_modules/nx/schemas/nx-schema.json", + "targetDefaults": { + "build": { + "dependsOn": [ + "^build" + ], + "cache": true } - } - \ No newline at end of file + }, + "useInferencePlugins": false +} diff --git a/package.json b/package.json index 699d125..fc37c36 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,11 @@ "eslint": "^8.36.0", "eslint-plugin-perfectionist": "^2.5.0", "eslint-plugin-unused-imports": "^3.0.0", - "execa": "^8.0.1", + "execa": "^ 9.0.2", "fs-extra": "^11.2.0", "nodemon": "^2.0.20", "npm-run-all": "^4.1.5", - "nx": "^15.6.1", + "nx": "19.0.2", "prettier": "^2.8.3", "supertest": "^7.0.0", "tsup": "^8.0.1", @@ -58,4 +58,4 @@ "publishConfig": { "registry": "https://registry.npmjs.org/" } -} \ No newline at end of file +} diff --git a/packages/main/package.json b/packages/main/package.json index cb85a10..fa4d953 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -59,4 +59,4 @@ "@types/debug": "^4.1.12", "@types/lodash.merge": "^4.6.9" } -} \ No newline at end of file +} diff --git a/packages/main/src/command/build/build.ts b/packages/main/src/command/build/build.ts index f4942fa..db7a763 100644 --- a/packages/main/src/command/build/build.ts +++ b/packages/main/src/command/build/build.ts @@ -1,82 +1,17 @@ -import type { BuildOptions as EsbuildOptions } from 'esbuild'; - import fs from 'node:fs'; import path from 'node:path'; import { system } from 'pkg-fetch'; -import { exec as pkgExec } from 'pkg'; -import { build as esbuild } from 'esbuild'; import type { NammathamConfigs } from '../nammatham-config'; +import type { TargetBunOptions, TargetOptions } from './types'; import { createDebugger } from '../utils'; -import { constructHostConfig } from '../config'; +import { buildExecutableBun } from './bun'; import { findNearestPackageData } from '../packages'; +import { buildExecutableNodeJs, buildNodeJs } from './nodejs'; +import { constructHostConfig, constructLocalSettings } from '../config'; -const debug = createDebugger('nammatham:build'); - -export interface TargetOptions { - /** - * The target platform for the build. - */ - platform: 'linux' | 'win' | 'macos'; - /** - * The target architecture for the build. - */ - arch: 'x64' | 'arm64'; - /** - * The target node.js or bun version. - * - * For node.js, only support version 18 due to minimum version of Nammatham Framework. - */ - runtime: 'bun' | 'node18'; -} - -export interface BuildOptions { - /** - * The entry file for the build. If not specified, it will use the main file from the package.json. - */ - entryFile?: string; - /** - * Specify the target for the build. - * - * If not specified, it will build for the host platform. - * Accept the following values: - * - `host`: Build for the host platform. - * - An object that specifies the target platform, architecture, and runtime. - * - * @default undefined (build for the host platform) - */ - target?: TargetOptions; - /** - * esbuild options, using for build and bundle the code, especially for Node.js runtime. - */ - esbuildOptions?: EsbuildOptions; - /** - * Node.js toolchain options, using for build and package the code. - * - * @default { dev: 'tsx', bundle: 'esbuild', package: 'pkg' } - */ - nodeToolChain?: { - /** - * The development tool to use for the Node.js runtime. - * `tsx` support watch mode for TypeScript. - */ - dev?: 'tsx'; - /** - * The bundler tool to bundle the code, before package the code into a single executable file. - */ - bundle?: 'esbuild'; - /** - * The package tool to package the code into a single executable file. - * `pkg` internally used for build the executable file. the `pkg` package is marked as deprecated. - * - * TODO: Support node.js [Single executable applications](https://nodejs.org/api/single-executable-applications.html) method - * - * @default 'pkg' - */ - package?: 'pkg'; - }; -} +export const debug = createDebugger('nammatham:build'); /** * Hard code the function.json for the SimpleHttpTrigger @@ -99,22 +34,45 @@ export function hardCodeFunctionJson() { }; } -export async function build(options: NammathamConfigs): Promise { - const targetPath = path.resolve(options.buildPath ?? '.nmt', 'dist'); - fs.mkdirSync(targetPath, { recursive: true }); - await fs.promises.writeFile(path.join(targetPath, 'host.json'), constructHostConfig(options), 'utf-8'); - if (options.runtime === 'node') { +/** + * Build the runtime based on the configuration + */ +export async function buildRuntime(config: NammathamConfigs) { + if (config.runtime === 'node') { debug?.(`Building for Node.js runtime`); - const result = await buildNodeJs(options); - await buildExecutable(options, result); + debug?.(`Host Node.js Version: ${getHostTarget().version}`); + const result = await buildNodeJs(config); + await buildExecutableNodeJs(config, result); debug?.(`Build for Node.js completed`); - } else if (options.runtime === 'bun') { + } else if (config.runtime === 'bun') { debug?.(`Building for Bun runtime`); - // Bun.write(path.resolve(targetPath, 'bun.txt'), `Hello Bun with Node.js`); + await buildExecutableBun(config); + } else { + throw new Error(`Unsupported runtime: ${config.runtime}`); + } +} + +export async function build(config: NammathamConfigs): Promise { + const targetPath = path.resolve(config.buildPath ?? '.nmt', 'dist'); + fs.mkdirSync(targetPath, { recursive: true }); + await fs.promises.writeFile(path.join(targetPath, 'host.json'), constructHostConfig(config), 'utf-8'); + await fs.promises.writeFile(path.join(targetPath, 'local.settings.json'), constructLocalSettings(), 'utf-8'); + + if (config.buildOptions?.disabled) { + debug?.(`Build process disabled`); + console.log(`The build process is disabled, you need to manage the build process manually.`); + console.log(`Please build the code manually and create a single-executable file on the target path: ${targetPath}`); + console.log( + `The file should be: "${getExecutablePath( + getHostTarget() + )}" (Same value from host.json at customHandler.description.defaultExecutablePath)` + ); + console.log(`The other Azure Functions configurations will be managed by the framework.`); } else { - throw new Error(`Unsupported runtime: ${options.runtime}`); + await buildRuntime(config); } // Hard code, fix later + // TODO: Please remove all `function.json` files before generating the new one const functionPath = path.join(targetPath, 'SimpleHttpTrigger'); fs.mkdirSync(functionPath, { recursive: true }); await fs.promises.writeFile( @@ -124,109 +82,41 @@ export async function build(options: NammathamConfigs): Promise { ); } -/** - * When publish into Azure Functions, the package.json will not be included in the final package. - * So, it needs to specify the output file manually wheather it is ESM or CommonJS. for example `main.mjs` or `main.cjs` - * - * I don't sure which version of node.js installed in Azure Functions, so I will use `es2020` as the target. - * Using target `es2021` will use `||=` operator which is not supported in Node.js. - * - * Azure Functions node runtime on Custom Handler is using Node.js 16.x - * - * The hono-node-server support the target node.js version 18.x and above - * - * - */ -export interface BuildNodeJsResult { - filePath: string; - distDirectory: string; -} - -export async function buildNodeJs(options: NammathamConfigs): Promise { - if (options.buildOption?.nodeToolChain?.bundle !== 'esbuild') { - throw new Error(`Unsupported bundler: ${options.buildOption?.nodeToolChain?.bundle}`); - } - const workingDir = process.cwd(); - const pkg = findNearestPackageData(workingDir); - const isESM = pkg?.data.type === 'module'; - debug?.(`Running in Module Type: ${isESM ? 'ESM' : 'CommonJS'}`); - - const entryFile = options.buildOption?.entryFile ?? pkg?.data.main ?? 'main.ts'; - debug?.(`Bundling code from ${entryFile}`); - - const distDirectory = path.resolve(workingDir, options.buildPath ?? '.nmt', 'dist'); - const outfile = path.resolve(distDirectory, 'main.js'); - debug?.(`Bundling code to ${outfile}`); - - await esbuild({ - absWorkingDir: workingDir, - entryPoints: [entryFile], - bundle: true, - outfile, - platform: 'node', - target: 'es2020', - sourcemap: 'inline', - /** - * Due to limitation of `pkg` package, the output file must be CommonJS - */ - format: 'cjs', - ...options.buildOption?.esbuildOptions, - } as EsbuildOptions); - debug?.(`Code bundled completed`); - return { filePath: outfile, distDirectory }; -} - /** * @ref github.com/vercel/pkg/lib/index.ts */ export function getHostTarget(): TargetOptions { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const nodeVersion = process.version.match(/^v(\d+)/)![1]; - debug?.(`Host Node.js Version: ${nodeVersion}`); return { platform: process.platform === 'win32' ? 'win' : process.platform === 'darwin' ? 'macos' : 'linux', arch: system.hostArch as TargetOptions['arch'], - /** - * The pkg version 5.8.1 only support node.js version 18.x and below. - */ - runtime: 'node18', + version: parseInt(nodeVersion), }; } -/** - * Build the executable file for Azure Functions, need to be bundled first - * - * This function use `pkg` internally to build the executable file. the `pkg` package is marked as deprecated. - * However, the `pkg` package is still the best option to build the executable file for Azure Functions. - * You can read the official statement from the `pkg` package [here](https://github.com/vercel/pkg) - * - * Another official option is using [Single executable applications](https://nodejs.org/api/single-executable-applications.html) since node.js 21.x - * But it's too complicated to use, and the `pkg` is still the best option. - * @ref See how to build the with node.js https://dev.to/chad_r_stewart/compile-a-single-executable-from-your-node-app-with-nodejs-20-and-esbuild-210j - */ -export async function buildExecutable(options: NammathamConfigs, result: BuildNodeJsResult): Promise { - if (options.buildOption?.nodeToolChain?.package !== 'pkg') { - throw new Error(`Unsupported package tool: ${options.buildOption?.nodeToolChain?.package}`); - } - const target = options.buildOption?.target; - if (!target) { - throw new Error(`Target should be set at the default configuration when the cli loaded`); - } - debug?.(`Building executable for target: ${target.runtime}-${target.platform}-${target.arch}`); - if (target.runtime === 'bun') { - throw new Error(`Conflict target build runtime: ${target.runtime} with ${options.runtime}`); - } - const targetString = `${target.runtime}-${target.platform}-${target.arch}`; - const executablePath = target.platform === 'win' ? 'main.exe' : 'main'; - const pkgArgs = [ - result.filePath, - '--target', - targetString, - '--output', - path.join(result.distDirectory, executablePath), - ]; - debug?.(`Building executable using pkg with args: ${pkgArgs.join(' ')}`); - await pkgExec(pkgArgs); - debug?.(`Executable built completed`); +export function getPackageInfo(config: NammathamConfigs): { + entryFile: string; + isESM: boolean; +} { + const workingDir = process.cwd(); + const pkg = findNearestPackageData(workingDir); + const isESM = pkg?.data.type === 'module'; + debug?.(`Running in Module Type: ${isESM ? 'ESM' : 'CommonJS'}`); + + return { + entryFile: config.buildOptions?.entryFile ?? pkg?.data.main ?? 'main.ts', + isESM, + }; +} + +export function getExecutablePath( + target: NonNullable['target'] | TargetBunOptions +): string { + return target?.platform === 'win' || target?.platform === 'windows' ? 'main.exe' : 'main'; +} + +export function getDistDirectory(options: NammathamConfigs): string { + return path.resolve(process.cwd(), options.buildPath ?? '.nmt', 'dist'); } diff --git a/packages/main/src/command/build/bun.ts b/packages/main/src/command/build/bun.ts new file mode 100644 index 0000000..0846958 --- /dev/null +++ b/packages/main/src/command/build/bun.ts @@ -0,0 +1,71 @@ +import { $ } from 'execa'; +import path from 'node:path'; + +import type { NammathamConfigs } from '../nammatham-config'; +import type { TargetBunOptions, TargetOptions } from './types'; + +import { debug, getDistDirectory, getExecutablePath, getPackageInfo } from './build'; + +/** + * Call bun as a sub-process to build the executable file, for preventing the bundle with tsup + */ + +export async function buildExecutableBun(config: NammathamConfigs) { + debug?.(`Building for Bun runtime`); + + const target = getHostTargetBun(config.buildOptions?.target); + const runtime = config.runtime; + + debug?.(`Building executable for target: ${runtime}-${target.platform}-${target.arch}`); + + const targetString = `${runtime}-${target.platform}-${target.arch}`; + + debug?.(`Building executable using bun with args: ${targetString}`); + const bunVersion = await getBunVersion(); + debug?.(`Using Bun version: ${JSON.stringify(bunVersion)}`); + + const { entryFile } = getPackageInfo(config); + + // bun build --compile --target=bun-linux-x64 ./index.ts --outfile myapp + const executablePath = getExecutablePath(target); + const distDirectory = getDistDirectory(config); + const outFile = path.join(distDirectory, executablePath); + const buildOutput = await $`bun build --compile --target=${targetString} ${entryFile} --outfile ${outFile}`; + debug?.(`Bun build output`); + debug?.(buildOutput.stdout); + debug?.(`Bun build completed`); +} + +export async function getBunVersion() { + try { + const { stdout } = await $`bun -v`; + const version = stdout.trim(); + return version; + } catch (error) { + console.error('Error getting bun version or bun is not installed.'); + process.exit(1); + } +} + +/** + * Convert to bun cli format + * note: if no .exe extension is provided, Bun will automatically add it for Windows executables + * Ref: https://bun.sh/docs/bundler/executables + */ +export function getHostTargetBun(baseTarget?: TargetOptions): TargetBunOptions { + if (!baseTarget) { + throw new Error(`Target should be set at the default configuration when the cli loaded`); + } + let platform: TargetBunOptions['platform'] = baseTarget.platform as TargetBunOptions['platform']; + if (baseTarget.platform === 'win') { + platform = 'windows'; + } else if (baseTarget.platform === 'macos') { + platform = 'darwin'; + } + + return { + // runtime: baseTarget.runtime, + platform, + arch: baseTarget.arch, + }; +} diff --git a/packages/main/src/command/build/index.ts b/packages/main/src/command/build/index.ts index 555cb3e..95d7b30 100644 --- a/packages/main/src/command/build/index.ts +++ b/packages/main/src/command/build/index.ts @@ -1 +1,2 @@ export * from './build'; +export * from './types'; diff --git a/packages/main/src/command/build/nodejs.ts b/packages/main/src/command/build/nodejs.ts new file mode 100644 index 0000000..b7b92ef --- /dev/null +++ b/packages/main/src/command/build/nodejs.ts @@ -0,0 +1,99 @@ +import type { BuildOptions as EsbuildOptions } from 'esbuild'; + +import path from 'node:path'; +import { exec as pkgExec } from 'pkg'; +import { build as esbuild } from 'esbuild'; + +import type { NammathamConfigs } from '../nammatham-config'; + +import { debug, getDistDirectory, getExecutablePath, getPackageInfo } from './build'; + +/** + * When publish into Azure Functions, the package.json will not be included in the final package. + * So, it needs to specify the output file manually wheather it is ESM or CommonJS. for example `main.mjs` or `main.cjs` + * + * I don't sure which version of node.js installed in Azure Functions, so I will use `es2020` as the target. + * Using target `es2021` will use `||=` operator which is not supported in Node.js. + * + * Azure Functions node runtime on Custom Handler is using Node.js 16.x + * + * The hono-node-server support the target node.js version 18.x and above + * + * + */ +export interface BuildNodeJsResult { + filePath: string; + distDirectory: string; +} + +export async function buildNodeJs(options: NammathamConfigs): Promise { + if (options.buildOptions?.nodeToolChain?.bundle !== 'esbuild') { + throw new Error(`Unsupported bundler: ${options.buildOptions?.nodeToolChain?.bundle}`); + } + const workingDir = process.cwd(); + const { entryFile } = getPackageInfo(options); + debug?.(`Bundling code from ${entryFile}`); + + const distDirectory = getDistDirectory(options); + const outfile = path.resolve(distDirectory, 'main.js'); + debug?.(`Bundling code to ${outfile}`); + + await esbuild({ + absWorkingDir: workingDir, + entryPoints: [entryFile], + bundle: true, + outfile, + platform: 'node', + target: 'es2020', + sourcemap: 'inline', + /** + * Due to limitation of `pkg` package, the output file must be CommonJS + */ + format: 'cjs', + ...options.buildOptions?.esbuildOptions, + } as EsbuildOptions); + debug?.(`Code bundled completed`); + return { filePath: outfile, distDirectory }; +} + +/** + * Build the executable file for Azure Functions, need to be bundled first + * + * This function use `pkg` internally to build the executable file. the `pkg` package is marked as deprecated. + * However, the `pkg` package is still the best option to build the executable file for Azure Functions. + * You can read the official statement from the `pkg` package [here](https://github.com/vercel/pkg) + * + * Another official option is using [Single executable applications](https://nodejs.org/api/single-executable-applications.html) since node.js 21.x + * But it's too complicated to use, and the `pkg` is still the best option. + * @ref See how to build the with node.js https://dev.to/chad_r_stewart/compile-a-single-executable-from-your-node-app-with-nodejs-20-and-esbuild-210j + */ +export async function buildExecutableNodeJs(options: NammathamConfigs, result: BuildNodeJsResult): Promise { + if (options.buildOptions?.nodeToolChain?.package !== 'pkg') { + throw new Error(`(buildExecutableNodeJs) Unsupported package tool: ${options.buildOptions?.nodeToolChain?.package}`); + } + const target = options.buildOptions?.target; + if(options.runtime !== 'node'){ + throw new Error(`(buildExecutableNodeJs) Unsupported runtime: ${options.runtime}`); + } + const nodeVersion = options.buildOptions?.nodeToolChain?.version; + if(nodeVersion !== 18){ + throw new Error(`(buildExecutableNodeJs) Only support node.js version 18 due to minimum version of Nammatham Framework.`); + } + const runtime = options.runtime + nodeVersion; + if (!target) { + throw new Error(`(buildExecutableNodeJs) Target should be set at the default configuration when the cli loaded`); + } + debug?.(`Building executable for target: ${runtime}-${target.platform}-${target.arch}`); + const targetString = `${runtime}-${target.platform}-${target.arch}`; + const executablePath = getExecutablePath(target); + const pkgArgs = [ + result.filePath, + '--target', + targetString, + '--output', + path.join(result.distDirectory, executablePath), + ]; + debug?.(`Building executable using pkg with args: ${pkgArgs.join(' ')}`); + await pkgExec(pkgArgs); + debug?.(`Executable built completed`); +} diff --git a/packages/main/src/command/build/types.ts b/packages/main/src/command/build/types.ts new file mode 100644 index 0000000..d52aa8a --- /dev/null +++ b/packages/main/src/command/build/types.ts @@ -0,0 +1,104 @@ +import type { BuildOptions as EsbuildOptions } from 'esbuild'; + +export interface TargetBaseOptions { + /** + * The target architecture for the build. + */ + arch: 'x64' | 'arm64'; + /** + * The target node.js or bun version. + * + * For node.js, only support version 18 due to minimum version of Nammatham Framework. + */ + version?: number; + + /** + * @see https://bun.sh/docs/bundler/executables + * + * The build options for bun, On x64 platforms, Bun uses SIMD optimizations which require a modern CPU supporting AVX2 instructions. + * The -baseline build of Bun is for older CPUs that don't support these optimizations. + * + * TODO: Support the options for bun later + */ + // options?: 'baseline' | 'modern'; +} + +/** + * Using only for bun cli + * @see https://bun.sh/docs/bundler/executables + */ +export interface TargetBunOptions extends TargetBaseOptions { + /** + * The target platform for the build. + */ + platform: 'linux' | 'windows' | 'darwin'; +} + +/** + * Use for nammatham config options, and pkg build options + */ + +export interface TargetOptions extends TargetBaseOptions { + /** + * The target platform for the build. + */ + platform: 'linux' | 'win' | 'macos'; +} + +export interface BuildOptions { + /** + * Disable the build process. This is useful when you want to disable the build process for a specific environment. + * You need to manage the build process manually, however, the other Azure Functions configurations will be managed by the framework. + * For example, `function.json`, `local.settings.json`, and `host.json` will be managed by the framework. + * + * @default false + */ + disabled?: boolean; + /** + * The entry file for the build. If not specified, it will use the main file from the package.json. + */ + entryFile?: string; + /** + * Specify the target for the build. + * + * If not specified, it will build for the host platform. + * Accept the following values: + * - `host`: Build for the host platform. + * - An object that specifies the target platform, architecture, and runtime. + */ + target?: Omit; + /** + * esbuild options, using for build and bundle the code, especially for Node.js runtime. + */ + esbuildOptions?: EsbuildOptions; + /** + * Node.js toolchain options, using for build and package the code. + * + * @default { dev: 'tsx', bundle: 'esbuild', package: 'pkg' } + */ + nodeToolChain?: { + /** + * The development tool to use for the Node.js runtime. + * `tsx` support watch mode for TypeScript. + */ + dev?: 'tsx'; + /** + * The bundler tool to bundle the code, before package the code into a single executable file. + */ + bundle?: 'esbuild'; + /** + * The package tool to package the code into a single executable file. + * `pkg` internally used for build the executable file. the `pkg` package is marked as deprecated. + * + * TODO: Support node.js [Single executable applications](https://nodejs.org/api/single-executable-applications.html) method + * + * @default 'pkg' + */ + package?: 'pkg'; + /** + * For node.js, only support version 18 due to minimum version of Nammatham Framework. + * However, `pkg` version 5.8.1 only support node.js version 18.x and below. + */ + version?: 18; + }; +} diff --git a/packages/main/src/command/config-loader/types/host-config.ts b/packages/main/src/command/config-loader/types/host-config.ts index 31c152d..1c750ee 100644 --- a/packages/main/src/command/config-loader/types/host-config.ts +++ b/packages/main/src/command/config-loader/types/host-config.ts @@ -17,7 +17,16 @@ export interface HostConfigV2 { /** Contains configurations for various extensions used within the function app. */ extensions?: Extensions; customHandler?: CustomHandler; - /** Defines the extension bundle to use with the function app. */ + /** + * Defines the extension bundle to use with the function app. + * The default value using [v4.x of the Azure Functions extension bundle](https://github.com/Azure/azure-functions-extension-bundles/blob/v4.x/src/Microsoft.Azure.Functions.ExtensionBundle/extensions.json). + * + * + * @ref https://github.com/Azure/azure-functions-extension-bundles + * @ref https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#extension-bundles + * + * @default { id: 'Microsoft.Azure.Functions.ExtensionBundle', version: '[4.0.0, 5.0.0)'} + **/ extensionBundle?: ExtensionBundle; /** A list of functions to load, if not all functions should be loaded. */ functions?: string[]; @@ -145,8 +154,36 @@ export interface Description { workingDirectory?: string; } +/** + * Extension Bundle + * @ref https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#extension-bundles + */ export interface ExtensionBundle { + /** + * The namespace for Microsoft Azure Functions extension bundles. + * + * @ref https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#extension-bundles + * @default 'Microsoft.Azure.Functions.ExtensionBundle' + */ id?: string; + /** + * The version range of the bundle to install. The Functions runtime always picks the maximum permissible version defined by the version range or interval. + * For example, a version value range of `[4.0.0, 5.0.0)` allows all bundle versions from `4.0.0` up to but not including `5.0.0`. For more information, + * see the [interval notation for specifying version ranges](https://learn.microsoft.com/en-us/nuget/reference/package-versioning#version-ranges). + * + * The following table lists the currently available version ranges of the default `Microsoft.Azure.Functions.ExtensionBundle` bundles and links to the extensions they include. + * + * ```md + * | Bundle version | Version in host.json | + |----------------|----------------------| + | 1.x | [1.*, 2.0.0) | + | 2.x | [2.*, 3.0.0) | + | 3.x | [3.3.0, 4.0.0) | + | 4.x | [4.0.0, 5.0.0) | + ``` + * @ref https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#extension-bundles + * @default '[4.0.0, 5.0.0)' + */ version?: string; } diff --git a/packages/main/src/command/config/config-writer.ts b/packages/main/src/command/config/config-writer.ts index b32ef47..7632339 100644 --- a/packages/main/src/command/config/config-writer.ts +++ b/packages/main/src/command/config/config-writer.ts @@ -4,6 +4,8 @@ import path from 'node:path'; import type { EnvVariables } from './load-env-vars'; import type { LocalSettings, NammathamConfigs } from '../config-loader'; +import { getExecutablePath } from '../build'; + export async function writeConfig(config: NammathamConfigs, envVars: EnvVariables, tmpPath = '') { const targetPath = path.resolve(config.buildPath ?? './nmt', tmpPath); await Promise.all([ @@ -17,7 +19,7 @@ export function constructHostConfig(config: NammathamConfigs): string { { customHandler: { description: { - defaultExecutablePath: config.buildOption?.target?.platform === 'win' ? 'main.exe' : 'main', + defaultExecutablePath: getExecutablePath(config.buildOptions?.target), }, enableForwardingHttpRequest: true, }, @@ -28,14 +30,14 @@ export function constructHostConfig(config: NammathamConfigs): string { ); } -function constructLocalSettings(envVars: EnvVariables): string { +export function constructLocalSettings(envVars?: EnvVariables): string { return JSON.stringify( { IsEncrypted: false, Values: { ...envVars, FUNCTIONS_WORKER_RUNTIME: 'custom', - AzureWebJobsStorage: envVars.AzureWebJobsStorage ?? 'UseDevelopmentStorage=true', + AzureWebJobsStorage: envVars?.AzureWebJobsStorage ?? 'UseDevelopmentStorage=true', }, } satisfies LocalSettings, null, diff --git a/packages/main/src/command/nammatham-config.ts b/packages/main/src/command/nammatham-config.ts index e777eb6..0636a83 100644 --- a/packages/main/src/command/nammatham-config.ts +++ b/packages/main/src/command/nammatham-config.ts @@ -10,6 +10,13 @@ export interface NammathamConfigs { * @default '.nmt' */ buildPath?: string; + /** + * The route prefix for the HTTP trigger functions. + * TODO: the config will read from `Nammatham` class that define in the code first, if not found then it will use this config. + * + * @default 'api' + */ + routePrefix?: string; /** * Azure Functions Host.json Configuration * @@ -35,7 +42,7 @@ export interface NammathamConfigs { /** * Build options including build, bundle, and package a single executable file. */ - buildOption?: BuildOptions; + buildOptions?: BuildOptions; /** * The runtime environment for the Azure Functions. * @@ -44,15 +51,31 @@ export interface NammathamConfigs { runtime?: 'node' | 'bun'; } +const defaultRoutePrefix = 'api'; export const defaultNammathamConfigs: NammathamConfigs = { buildPath: '.nmt', runtime: 'bun', - buildOption: { + routePrefix: defaultRoutePrefix, + hostConfig: { + version: '2.0', + extensionBundle: { + id: 'Microsoft.Azure.Functions.ExtensionBundle', + version: '[4.0.0, 5.0.0)', + }, + extensions: { + http: { + routePrefix: defaultRoutePrefix, + }, + }, + }, + buildOptions: { + disabled: false, target: getHostTarget(), nodeToolChain: { dev: 'tsx', bundle: 'esbuild', package: 'pkg', + version: 18, }, }, }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6d59f45..cb6795a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,8 +39,8 @@ importers: specifier: ^3.0.0 version: 3.0.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.56.0) execa: - specifier: ^8.0.1 - version: 8.0.1 + specifier: ^ 9.0.2 + version: 9.0.2 fs-extra: specifier: ^11.2.0 version: 11.2.0 @@ -51,8 +51,8 @@ importers: specifier: ^4.1.5 version: 4.1.5 nx: - specifier: ^15.6.1 - version: 15.9.7 + specifier: 19.0.2 + version: 19.0.2 prettier: specifier: ^2.8.3 version: 2.8.8 @@ -903,18 +903,20 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.16.0 - /@nrwl/cli@15.9.7: - resolution: {integrity: sha512-1jtHBDuJzA57My5nLzYiM372mJW0NY6rFKxlWt5a0RLsAZdPTHsd8lE3Gs9XinGC1jhXbruWmhhnKyYtZvX/zA==} + /@nrwl/tao@19.0.2: + resolution: {integrity: sha512-VLU0Ptqq9+R5Ugb4d7ANb/pzZ8Rh+ExNcyg5MVNNrrgrM8ghLOu2/qPoatWyXLZg+cfKr6bH7/c0rWBtPcc69Q==} + hasBin: true dependencies: - nx: 15.9.7 + nx: 19.0.2 + tslib: 2.6.2 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' - debug dev: true - /@nrwl/nx-darwin-arm64@15.9.7: - resolution: {integrity: sha512-aBUgnhlkrgC0vu0fK6eb9Vob7eFnkuknrK+YzTjmLrrZwj7FGNAeyGXSlyo1dVokIzjVKjJg2saZZ0WQbfuCJw==} + /@nx/nx-darwin-arm64@19.0.2: + resolution: {integrity: sha512-JVOz6kNaypyK7Bi/l//BZ6F8i70UXlnQBdnacBM8nZH2oAQ7OIj1foZEw7ANnDvKpUJB2staJ9ZwPc/KzXwr5A==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -922,8 +924,8 @@ packages: dev: true optional: true - /@nrwl/nx-darwin-x64@15.9.7: - resolution: {integrity: sha512-L+elVa34jhGf1cmn38Z0sotQatmLovxoASCIw5r1CBZZeJ5Tg7Y9nOwjRiDixZxNN56hPKXm6xl9EKlVHVeKlg==} + /@nx/nx-darwin-x64@19.0.2: + resolution: {integrity: sha512-qfj3AJ/RCbEps+Evbycrf1qUQk/zkwX5NT80dgK/r9eGBbo3qOA3VLa1z0PtaaJaYhZxZkjhwXOqhqAjDNN8bw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -931,8 +933,17 @@ packages: dev: true optional: true - /@nrwl/nx-linux-arm-gnueabihf@15.9.7: - resolution: {integrity: sha512-pqmfqqEUGFu6PmmHKyXyUw1Al0Ki8PSaR0+ndgCAb1qrekVDGDfznJfaqxN0JSLeolPD6+PFtLyXNr9ZyPFlFg==} + /@nx/nx-freebsd-x64@19.0.2: + resolution: {integrity: sha512-Fe+SQ4ug2RbKQ6saLhntsaOhf0aeoLQ/nJCc6h0TYPIs43go5gFSLFa2xnCOIo90dSL6/0z1r8VsZGSQQHiXMg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@nx/nx-linux-arm-gnueabihf@19.0.2: + resolution: {integrity: sha512-0IW/gYZo5toGjjrqKL4SqV2twfkVDfMpx6M4BxwJlYEzzl+gtF0VrWfhVU3r4p2YZV8yW3cmH9SNChB6YZgQmA==} engines: {node: '>= 10'} cpu: [arm] os: [linux] @@ -940,8 +951,8 @@ packages: dev: true optional: true - /@nrwl/nx-linux-arm64-gnu@15.9.7: - resolution: {integrity: sha512-NYOa/eRrqmM+In5g3M0rrPVIS9Z+q6fvwXJYf/KrjOHqqan/KL+2TOfroA30UhcBrwghZvib7O++7gZ2hzwOnA==} + /@nx/nx-linux-arm64-gnu@19.0.2: + resolution: {integrity: sha512-+u5Y7XYf0M/KOnDz+iS6DnaGfwvEFsMJipzv337Mbc2qP2sxBR4pM8hEKcQeqII71as0Xo0sZzmyxXjJvG7bzw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -949,8 +960,8 @@ packages: dev: true optional: true - /@nrwl/nx-linux-arm64-musl@15.9.7: - resolution: {integrity: sha512-zyStqjEcmbvLbejdTOrLUSEdhnxNtdQXlmOuymznCzYUEGRv+4f7OAepD3yRoR0a/57SSORZmmGQB7XHZoYZJA==} + /@nx/nx-linux-arm64-musl@19.0.2: + resolution: {integrity: sha512-hmQ6evq9S5a/svQOwpRF5Zcu114A9jpeDKEBysFmbdV1eTFkrxlnvSCs/xXOeYOe/QS8Ijl50d7+1zkOE2HVMA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -958,8 +969,8 @@ packages: dev: true optional: true - /@nrwl/nx-linux-x64-gnu@15.9.7: - resolution: {integrity: sha512-saNK5i2A8pKO3Il+Ejk/KStTApUpWgCxjeUz9G+T8A+QHeDloZYH2c7pU/P3jA9QoNeKwjVO9wYQllPL9loeVg==} + /@nx/nx-linux-x64-gnu@19.0.2: + resolution: {integrity: sha512-zVcAotU7qlunsvg7I3oGp50f6ha44FeU6ITA+CHD0A/wqD11ZpVP0qsqMLawCGiKhNafQmUvkXMEFJ1dUX5aWw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -967,8 +978,8 @@ packages: dev: true optional: true - /@nrwl/nx-linux-x64-musl@15.9.7: - resolution: {integrity: sha512-extIUThYN94m4Vj4iZggt6hhMZWQSukBCo8pp91JHnDcryBg7SnYmnikwtY1ZAFyyRiNFBLCKNIDFGkKkSrZ9Q==} + /@nx/nx-linux-x64-musl@19.0.2: + resolution: {integrity: sha512-72hT2V9IQNMIrC7sBzllrHEnoJOhuPxKXJTUYzz4v/Y11t1ziTHflGXO9nJOpydh8vA+91dPVrDM5mWr6IEPzg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -976,8 +987,8 @@ packages: dev: true optional: true - /@nrwl/nx-win32-arm64-msvc@15.9.7: - resolution: {integrity: sha512-GSQ54hJ5AAnKZb4KP4cmBnJ1oC4ILxnrG1mekxeM65c1RtWg9NpBwZ8E0gU3xNrTv8ZNsBeKi/9UhXBxhsIh8A==} + /@nx/nx-win32-arm64-msvc@19.0.2: + resolution: {integrity: sha512-aTxQBtUrusAm535DRnHxgM9AXnPYkhzr+eUSjrPUPTu2N3cuckq6JWfpxtjVCMcPfOR+pOC9luG3+bWmO32TQQ==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -985,8 +996,8 @@ packages: dev: true optional: true - /@nrwl/nx-win32-x64-msvc@15.9.7: - resolution: {integrity: sha512-x6URof79RPd8AlapVbPefUD3ynJZpmah3tYaYZ9xZRMXojVtEHV8Qh5vysKXQ1rNYJiiB8Ah6evSKWLbAH60tw==} + /@nx/nx-win32-x64-msvc@19.0.2: + resolution: {integrity: sha512-lgxgj+ilhL9StCLzRxU+EB1n944bMjwbU3CxvYW2TYa+380UXVMUACjbLyzONQPeJPIm9azaVQNKnf5+c+nnBQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -994,26 +1005,6 @@ packages: dev: true optional: true - /@nrwl/tao@15.9.7: - resolution: {integrity: sha512-OBnHNvQf3vBH0qh9YnvBQQWyyFZ+PWguF6dJ8+1vyQYlrLVk/XZ8nJ4ukWFb+QfPv/O8VBmqaofaOI9aFC4yTw==} - hasBin: true - dependencies: - nx: 15.9.7 - transitivePeerDependencies: - - '@swc-node/register' - - '@swc/core' - - debug - dev: true - - /@parcel/watcher@2.0.4: - resolution: {integrity: sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==} - engines: {node: '>= 10.0.0'} - requiresBuild: true - dependencies: - node-addon-api: 3.2.1 - node-gyp-build: 4.8.0 - dev: true - /@pkgjs/parseargs@0.11.0: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -1125,10 +1116,19 @@ packages: dev: true optional: true + /@sec-ant/readable-stream@0.4.1: + resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + dev: true + /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true + /@sindresorhus/merge-streams@4.0.0: + resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} + engines: {node: '>=18'} + dev: true + /@types/bun@1.1.1: resolution: {integrity: sha512-lUe9rLMhgDCViciZtgDj5CMl2u7uTq/IP149kSZH/Si6FWkCioximABFf+baRQgbm8QlH4bzT0qJRteQFNqeGA==} dependencies: @@ -1883,6 +1883,7 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + dev: false /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} @@ -1893,6 +1894,11 @@ packages: wrap-ansi: 7.0.0 dev: true + /clone@1.0.4: + resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} + engines: {node: '>=0.8'} + dev: true + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -2015,6 +2021,12 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true + /defaults@1.0.4: + resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + dependencies: + clone: 1.0.4 + dev: true + /define-data-property@1.1.1: resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} engines: {node: '>= 0.4'} @@ -2082,9 +2094,14 @@ packages: esutils: 2.0.3 dev: true - /dotenv@10.0.0: - resolution: {integrity: sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==} - engines: {node: '>=10'} + /dotenv-expand@10.0.0: + resolution: {integrity: sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==} + engines: {node: '>=12'} + dev: true + + /dotenv@16.3.2: + resolution: {integrity: sha512-HTlk5nmhkm8F6JcdXvHIzaorzCoziNQT9mGxLPVXW8wJF1TiGSL60ZGB4gHWabHOaMmWmhvk2/lPHfnBiT78AQ==} + engines: {node: '>=12'} dev: true /dotenv@16.4.5: @@ -2478,6 +2495,24 @@ packages: signal-exit: 4.1.0 strip-final-newline: 3.0.0 + /execa@9.0.2: + resolution: {integrity: sha512-oO281GF7ksH/Ogv1xyDf1prvFta/6/XkGKxRUvA3IB2MU1rCJGlFs86HRZhdooow1ISkR0Np0rOxUCIJVw36Rg==} + engines: {node: '>=18'} + dependencies: + '@sindresorhus/merge-streams': 4.0.0 + cross-spawn: 7.0.3 + figures: 6.1.0 + get-stream: 9.0.1 + human-signals: 7.0.0 + is-plain-obj: 4.1.0 + is-stream: 4.0.1 + npm-run-path: 5.2.0 + pretty-ms: 9.0.0 + signal-exit: 4.1.0 + strip-final-newline: 4.0.0 + yoctocolors: 2.0.0 + dev: true + /expand-template@2.0.3: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} @@ -2496,17 +2531,6 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-glob@3.2.7: - resolution: {integrity: sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==} - engines: {node: '>=8'} - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - dev: true - /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} @@ -2546,6 +2570,13 @@ packages: escape-string-regexp: 1.0.5 dev: true + /figures@6.1.0: + resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} + engines: {node: '>=18'} + dependencies: + is-unicode-supported: 2.0.0 + dev: true + /file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -2721,6 +2752,14 @@ packages: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} + /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: true + /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} @@ -2924,6 +2963,11 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} + /human-signals@7.0.0: + resolution: {integrity: sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==} + engines: {node: '>=18.18.0'} + dev: true + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -3068,6 +3112,11 @@ packages: dependencies: is-extglob: 2.1.1 + /is-interactive@1.0.0: + resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} + engines: {node: '>=8'} + dev: true + /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} @@ -3089,6 +3138,11 @@ packages: engines: {node: '>=8'} dev: true + /is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + dev: true + /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -3112,6 +3166,11 @@ packages: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /is-stream@4.0.1: + resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} + engines: {node: '>=18'} + dev: true + /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} @@ -3133,6 +3192,16 @@ packages: which-typed-array: 1.1.13 dev: true + /is-unicode-supported@0.1.0: + resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} + engines: {node: '>=10'} + dev: true + + /is-unicode-supported@2.0.0: + resolution: {integrity: sha512-FRdAyx5lusK1iHG0TWpVtk9+1i+GjrzRffhDg4ovQ7mcidMQ6mj+MhKPmvh7Xwyv5gIS06ns49CA7Sqg7lC22Q==} + engines: {node: '>=18'} + dev: true + /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: @@ -3199,6 +3268,21 @@ packages: '@pkgjs/parseargs': 0.11.0 dev: true + /jest-diff@29.7.0: + resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.7.0 + dev: true + + /jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + /joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} @@ -3331,6 +3415,14 @@ packages: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} dev: true + /log-symbols@4.1.0: + resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} + engines: {node: '>=10'} + dependencies: + chalk: 4.1.2 + is-unicode-supported: 0.1.0 + dev: true + /loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -3433,12 +3525,6 @@ packages: engines: {node: '>=10'} dev: false - /minimatch@3.0.5: - resolution: {integrity: sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==} - dependencies: - brace-expansion: 1.1.11 - dev: true - /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -3534,10 +3620,6 @@ packages: semver: 7.5.4 dev: false - /node-addon-api@3.2.1: - resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} - dev: true - /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -3550,9 +3632,8 @@ packages: whatwg-url: 5.0.0 dev: false - /node-gyp-build@4.8.0: - resolution: {integrity: sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==} - hasBin: true + /node-machine-id@1.1.12: + resolution: {integrity: sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==} dev: true /nodemon@2.0.22: @@ -3622,22 +3703,20 @@ packages: dependencies: path-key: 4.0.0 - /nx@15.9.7: - resolution: {integrity: sha512-1qlEeDjX9OKZEryC8i4bA+twNg+lB5RKrozlNwWx/lLJHqWPUfvUTvxh+uxlPYL9KzVReQjUuxMLFMsHNqWUrA==} + /nx@19.0.2: + resolution: {integrity: sha512-59BSYa/Qp8nA764T7Cg7tSisFYBws9zSAMPm0YspCSPndoUy86Mjtg62bEqkHN0MWo6W4MxwOHuB0XSBvQ5DdA==} hasBin: true requiresBuild: true peerDependencies: - '@swc-node/register': ^1.4.2 - '@swc/core': ^1.2.173 + '@swc-node/register': ^1.8.0 + '@swc/core': ^1.3.85 peerDependenciesMeta: '@swc-node/register': optional: true '@swc/core': optional: true dependencies: - '@nrwl/cli': 15.9.7 - '@nrwl/tao': 15.9.7 - '@parcel/watcher': 2.0.4 + '@nrwl/tao': 19.0.2 '@yarnpkg/lockfile': 1.1.0 '@yarnpkg/parsers': 3.0.0-rc.46 '@zkochan/js-yaml': 0.0.6 @@ -3645,21 +3724,23 @@ packages: chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 - cliui: 7.0.4 - dotenv: 10.0.0 + cliui: 8.0.1 + dotenv: 16.3.2 + dotenv-expand: 10.0.0 enquirer: 2.3.6 - fast-glob: 3.2.7 figures: 3.2.0 flat: 5.0.2 fs-extra: 11.2.0 - glob: 7.1.4 ignore: 5.3.0 + jest-diff: 29.7.0 js-yaml: 4.1.0 jsonc-parser: 3.2.0 lines-and-columns: 2.0.4 - minimatch: 3.0.5 + minimatch: 9.0.3 + node-machine-id: 1.1.12 npm-run-path: 4.0.1 open: 8.4.2 + ora: 5.3.0 semver: 7.5.4 string-width: 4.2.3 strong-log-transformer: 2.1.0 @@ -3667,19 +3748,19 @@ packages: tmp: 0.2.1 tsconfig-paths: 4.2.0 tslib: 2.6.2 - v8-compile-cache: 2.3.0 yargs: 17.7.2 yargs-parser: 21.1.1 optionalDependencies: - '@nrwl/nx-darwin-arm64': 15.9.7 - '@nrwl/nx-darwin-x64': 15.9.7 - '@nrwl/nx-linux-arm-gnueabihf': 15.9.7 - '@nrwl/nx-linux-arm64-gnu': 15.9.7 - '@nrwl/nx-linux-arm64-musl': 15.9.7 - '@nrwl/nx-linux-x64-gnu': 15.9.7 - '@nrwl/nx-linux-x64-musl': 15.9.7 - '@nrwl/nx-win32-arm64-msvc': 15.9.7 - '@nrwl/nx-win32-x64-msvc': 15.9.7 + '@nx/nx-darwin-arm64': 19.0.2 + '@nx/nx-darwin-x64': 19.0.2 + '@nx/nx-freebsd-x64': 19.0.2 + '@nx/nx-linux-arm-gnueabihf': 19.0.2 + '@nx/nx-linux-arm64-gnu': 19.0.2 + '@nx/nx-linux-arm64-musl': 19.0.2 + '@nx/nx-linux-x64-gnu': 19.0.2 + '@nx/nx-linux-x64-musl': 19.0.2 + '@nx/nx-win32-arm64-msvc': 19.0.2 + '@nx/nx-win32-x64-msvc': 19.0.2 transitivePeerDependencies: - debug dev: true @@ -3752,6 +3833,20 @@ packages: type-check: 0.4.0 dev: true + /ora@5.3.0: + resolution: {integrity: sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==} + engines: {node: '>=10'} + dependencies: + bl: 4.1.0 + chalk: 4.1.2 + cli-cursor: 3.1.0 + cli-spinners: 2.9.2 + is-interactive: 1.0.0 + log-symbols: 4.1.0 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + dev: true + /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} @@ -3798,6 +3893,11 @@ packages: json-parse-better-errors: 1.0.2 dev: true + /parse-ms@4.0.0: + resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} + engines: {node: '>=18'} + dev: true + /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -4058,6 +4158,13 @@ packages: react-is: 18.2.0 dev: true + /pretty-ms@9.0.0: + resolution: {integrity: sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==} + engines: {node: '>=18'} + dependencies: + parse-ms: 4.0.0 + dev: true + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: false @@ -4594,6 +4701,11 @@ packages: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} + /strip-final-newline@4.0.0: + resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} + engines: {node: '>=18'} + dev: true + /strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -5025,10 +5137,6 @@ packages: hasBin: true dev: false - /v8-compile-cache@2.3.0: - resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} - dev: true - /v8-to-istanbul@9.2.0: resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} engines: {node: '>=10.12.0'} @@ -5159,6 +5267,12 @@ packages: - terser dev: true + /wcwidth@1.0.1: + resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + dependencies: + defaults: 1.0.4 + dev: true + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: false @@ -5312,3 +5426,8 @@ packages: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} dev: true + + /yoctocolors@2.0.0: + resolution: {integrity: sha512-esbDnt0Z1zI1KgvOZU90hJbL6BkoUbrP9yy7ArNZ6TmxBxydMJTYMf9FZjmwwcA8ZgEQzriQ3hwZ0NYXhlFo8Q==} + engines: {node: '>=18'} + dev: true