From dcfdfec49ef54faf00be01a04d1dfc79577bfbb0 Mon Sep 17 00:00:00 2001 From: nx-migrate-bot Date: Tue, 27 Jan 2026 03:01:15 +0000 Subject: [PATCH] build: update nx to version 22.4.2 Automated update by nx-migrate action Updated from 22.3.3 to 22.4.2 --- e2e/src/nx-supabase.spec.ts | 642 +++++++++++++++----------------- npm-e2e/src/npm-install.spec.ts | 299 ++++++--------- package-lock.json | 280 +++++++++----- package.json | 16 +- 4 files changed, 605 insertions(+), 632 deletions(-) diff --git a/e2e/src/nx-supabase.spec.ts b/e2e/src/nx-supabase.spec.ts index 43f490f..c078ba7 100644 --- a/e2e/src/nx-supabase.spec.ts +++ b/e2e/src/nx-supabase.spec.ts @@ -1,13 +1,10 @@ import { execSync, spawn } from 'child_process'; import { join, dirname } from 'path'; import { mkdirSync, rmSync, existsSync } from 'fs'; - describe('@gridatek/nx-supabase', () => { let projectDirectory: string; - beforeAll(() => { projectDirectory = createTestProject(); - // The plugin has been built and published to a local registry in the jest globalSetup // Use nx add to install the plugin and run the init generator (tests the real user flow) execSync(`npx nx add @gridatek/nx-supabase@e2e`, { @@ -16,7 +13,6 @@ describe('@gridatek/nx-supabase', () => { env: process.env, }); }); - afterAll(() => { if (projectDirectory) { // Cleanup the test project @@ -26,7 +22,6 @@ describe('@gridatek/nx-supabase', () => { }); } }); - it('should be installed', () => { // npm ls will fail if the package is not installed properly execSync('npm ls @gridatek/nx-supabase', { @@ -34,53 +29,39 @@ describe('@gridatek/nx-supabase', () => { stdio: 'inherit', }); }); - describe('init generator (via nx add)', () => { it('should have added supabase CLI to devDependencies', () => { // The init generator should have already run via nx add in beforeAll // Verify package.json was updated const packageJsonPath = join(projectDirectory, 'package.json'); expect(existsSync(packageJsonPath)).toBe(true); - const packageJson = require(packageJsonPath); expect(packageJson.devDependencies['supabase']).toBeDefined(); expect(packageJson.devDependencies['supabase']).toBe('^2.65.6'); }); }); - describe('project generator', () => { it('should create a Supabase project with default local environment', () => { const projectName = 'my-supabase'; - - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Verify project structure was created const projectPath = join(projectDirectory, projectName); expect(existsSync(projectPath)).toBe(true); - // Verify default environment directories exist expect(existsSync(join(projectPath, 'production'))).toBe(true); expect(existsSync(join(projectPath, 'local'))).toBe(true); - // Verify README exists expect(existsSync(join(projectPath, 'README.md'))).toBe(true); - // Verify .gitignore exists expect(existsSync(join(projectPath, '.gitignore'))).toBe(true); - // Verify .generated directory exists expect(existsSync(join(projectPath, '.generated'))).toBe(true); - // Verify project.json was created (targets are inferred by the plugin at runtime) expect(existsSync(join(projectPath, 'project.json'))).toBe(true); - // Verify that inferred targets are available using nx show project const showProjectOutput = execSync( `npx nx show project ${projectName} --json`, @@ -97,10 +78,8 @@ describe('@gridatek/nx-supabase', () => { expect(projectConfig.targets.stop).toBeDefined(); expect(projectConfig.targets['run-command']).toBeDefined(); }); - it('should create a project with additional environments', () => { const projectName = 'multi-env-project'; - execSync( `npx nx g @gridatek/nx-supabase:project ${projectName} --environments=staging`, { @@ -109,21 +88,16 @@ describe('@gridatek/nx-supabase', () => { env: process.env, } ); - const projectPath = join(projectDirectory, projectName); - // Verify production and local are always created expect(existsSync(join(projectPath, 'production'))).toBe(true); expect(existsSync(join(projectPath, 'local'))).toBe(true); - // Verify additional environment (staging) was created expect(existsSync(join(projectPath, 'staging'))).toBe(true); }); - it('should create project in custom directory', () => { const projectName = 'custom-dir-project'; const directory = 'apps/custom-dir-project'; - execSync( `npx nx g @gridatek/nx-supabase:project ${projectName} --directory=${directory}`, { @@ -132,212 +106,151 @@ describe('@gridatek/nx-supabase', () => { env: process.env, } ); - const projectPath = join(projectDirectory, directory); expect(existsSync(projectPath)).toBe(true); expect(existsSync(join(projectPath, 'production'))).toBe(true); }); - }); - describe('build executor', () => { it('should build default and environment-specific files', () => { const projectName = 'build-test-project'; - // Create a project (production and local are created by default) - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); const projectPath = join(projectDirectory, projectName); - // Run the build executor - execSync( - `npx nx run ${projectName}:build`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx run ${projectName}:build`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Verify .generated directories were created for all environments - expect(existsSync(join(projectPath, '.generated', 'local', 'supabase'))).toBe(true); - expect(existsSync(join(projectPath, '.generated', 'production', 'supabase'))).toBe(true); - + expect( + existsSync(join(projectPath, '.generated', 'local', 'supabase')) + ).toBe(true); + expect( + existsSync(join(projectPath, '.generated', 'production', 'supabase')) + ).toBe(true); // Verify config.toml files exist - expect(existsSync(join(projectPath, '.generated', 'local', 'supabase', 'config.toml'))).toBe(true); - expect(existsSync(join(projectPath, '.generated', 'production', 'supabase', 'config.toml'))).toBe(true); + expect( + existsSync( + join(projectPath, '.generated', 'local', 'supabase', 'config.toml') + ) + ).toBe(true); + expect( + existsSync( + join( + projectPath, + '.generated', + 'production', + 'supabase', + 'config.toml' + ) + ) + ).toBe(true); }); }); - // Only run start/stop tests in CI environment - (process.env.CI ? describe : describe.skip)('start and stop executors', () => { - it('should start and stop Supabase using convenient shortcuts', async () => { - const projectName = 'start-stop-test-project'; - - // Create a project (production and local are created by default) - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { + (process.env.CI ? describe : describe.skip)( + 'start and stop executors', + () => { + it('should start and stop Supabase using convenient shortcuts', async () => { + const projectName = 'start-stop-test-project'; + // Create a project (production and local are created by default) + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { cwd: projectDirectory, stdio: 'inherit', env: process.env, - } - ); - - const projectPath = join(projectDirectory, projectName); - - // Start Supabase in background (detached process) - // The start target automatically runs build first - const startProcess = spawn( - 'npx', - ['nx', 'run', `${projectName}:start`], - { - cwd: projectDirectory, - stdio: 'ignore', // Detach from stdio - shell: true, - detached: true, - env: process.env, - } - ); - - // Detach the process so it runs independently - startProcess.unref(); - - try { - // Wait for Supabase to be ready (poll status) - // In CI, Docker image pulls can take several minutes - let isReady = false; - const maxAttempts = 60; // 60 attempts * 5 seconds = 5 minutes max - const pollInterval = 5000; // 5 seconds - - console.log(`Waiting for Supabase to start (max ${maxAttempts * pollInterval / 1000} seconds)...`); - - for (let i = 0; i < maxAttempts; i++) { - await new Promise(resolve => setTimeout(resolve, pollInterval)); - - try { - // Check if Supabase is running using status command - execSync( - `npx nx run ${projectName}:run-command --command="supabase status"`, - { - cwd: projectDirectory, - stdio: 'ignore', - env: process.env, - } - ); - console.log(`Supabase started successfully after ${(i + 1) * pollInterval / 1000} seconds`); - isReady = true; - break; - } catch (error) { - // Status check failed, Supabase not ready yet - if ((i + 1) % 6 === 0) { - // Log progress every 30 seconds - console.log(`Still waiting... (${(i + 1) * pollInterval / 1000}s elapsed)`); - } - continue; - } - } - - if (!isReady) { - throw new Error(`Supabase failed to start within ${maxAttempts * pollInterval / 1000} seconds`); - } - - // Verify .generated directory was created - expect(existsSync(join(projectPath, '.generated', 'local', 'supabase', 'config.toml'))).toBe(true); - - // Successfully started, now stop it using the convenient shortcut - execSync( - `npx nx run ${projectName}:stop`, + }); + const projectPath = join(projectDirectory, projectName); + // Start Supabase in background (detached process) + // The start target automatically runs build first + const startProcess = spawn( + 'npx', + ['nx', 'run', `${projectName}:start`], { cwd: projectDirectory, - stdio: 'inherit', + stdio: 'ignore', // Detach from stdio + shell: true, + detached: true, env: process.env, } ); - - // Verify Supabase stopped (status should fail) - let hasStopped = false; + // Detach the process so it runs independently + startProcess.unref(); try { - execSync( - `npx nx run ${projectName}:run-command --command="supabase status"`, - { - cwd: projectDirectory, - stdio: 'ignore', - env: process.env, - } + // Wait for Supabase to be ready (poll status) + // In CI, Docker image pulls can take several minutes + let isReady = false; + const maxAttempts = 60; // 60 attempts * 5 seconds = 5 minutes max + const pollInterval = 5000; // 5 seconds + console.log( + `Waiting for Supabase to start (max ${ + (maxAttempts * pollInterval) / 1000 + } seconds)...` ); - } catch (error) { - // Status check failed, meaning Supabase is stopped - hasStopped = true; - } - - expect(hasStopped).toBe(true); - } finally { - // Cleanup: ensure Supabase is stopped even if test fails - try { - execSync( - `npx nx run ${projectName}:stop`, - { - cwd: projectDirectory, - stdio: 'ignore', - env: process.env, + for (let i = 0; i < maxAttempts; i++) { + await new Promise((resolve) => setTimeout(resolve, pollInterval)); + try { + // Check if Supabase is running using status command + execSync( + `npx nx run ${projectName}:run-command --command="supabase status"`, + { + cwd: projectDirectory, + stdio: 'ignore', + env: process.env, + } + ); + console.log( + `Supabase started successfully after ${ + ((i + 1) * pollInterval) / 1000 + } seconds` + ); + isReady = true; + break; + } catch (error) { + // Status check failed, Supabase not ready yet + if ((i + 1) % 6 === 0) { + // Log progress every 30 seconds + console.log( + `Still waiting... (${ + ((i + 1) * pollInterval) / 1000 + }s elapsed)` + ); + } + continue; } - ); - } catch (error) { - // Ignore errors during cleanup - } - } - }, 360000); // 6 minute timeout for this test (5 min for start + 1 min buffer) - - // TODO: Fix flaky test - Docker prune conflicts cause intermittent failures - it.skip('should reset database successfully', async () => { - const projectName = 'db-reset-test-project'; - - // Create a project - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - - const projectPath = join(projectDirectory, projectName); - - // Start Supabase in background - const startProcess = spawn( - 'npx', - ['nx', 'run', `${projectName}:start`], - { - cwd: projectDirectory, - stdio: 'ignore', - shell: true, - detached: true, - env: process.env, - } - ); - - startProcess.unref(); - - try { - // Wait for Supabase to be ready - let isReady = false; - const maxAttempts = 60; - const pollInterval = 5000; - - console.log(`Waiting for Supabase to start for db reset test...`); - - for (let i = 0; i < maxAttempts; i++) { - await new Promise(resolve => setTimeout(resolve, pollInterval)); - + } + if (!isReady) { + throw new Error( + `Supabase failed to start within ${ + (maxAttempts * pollInterval) / 1000 + } seconds` + ); + } + // Verify .generated directory was created + expect( + existsSync( + join( + projectPath, + '.generated', + 'local', + 'supabase', + 'config.toml' + ) + ) + ).toBe(true); + // Successfully started, now stop it using the convenient shortcut + execSync(`npx nx run ${projectName}:stop`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); + // Verify Supabase stopped (status should fail) + let hasStopped = false; try { execSync( `npx nx run ${projectName}:run-command --command="supabase status"`, @@ -347,42 +260,36 @@ describe('@gridatek/nx-supabase', () => { env: process.env, } ); - console.log(`Supabase started successfully for db reset test after ${(i + 1) * pollInterval / 1000} seconds`); - isReady = true; - break; } catch (error) { - if ((i + 1) % 6 === 0) { - console.log(`Still waiting... (${(i + 1) * pollInterval / 1000}s elapsed)`); - } - continue; + // Status check failed, meaning Supabase is stopped + hasStopped = true; } - } - - if (!isReady) { - throw new Error(`Supabase failed to start within ${maxAttempts * pollInterval / 1000} seconds`); - } - - // Stop Supabase to create a migration - console.log('Stopping Supabase to create migration...'); - execSync( - `npx nx run ${projectName}:stop`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, + expect(hasStopped).toBe(true); + } finally { + // Cleanup: ensure Supabase is stopped even if test fails + try { + execSync(`npx nx run ${projectName}:stop`, { + cwd: projectDirectory, + stdio: 'ignore', + env: process.env, + }); + } catch (error) { + // Ignore errors during cleanup } - ); - - // Create a migration file - const fs = require('fs'); - const migrationsDir = join(projectPath, 'local', 'migrations'); - fs.mkdirSync(migrationsDir, { recursive: true }); - const migrationFile = join(migrationsDir, '20240101000000_create_users_table.sql'); - fs.writeFileSync(migrationFile, 'CREATE TABLE users (id serial PRIMARY KEY, name text);'); - - // Restart Supabase (will run migrations) - console.log('Restarting Supabase with migration...'); - const restartProcess = spawn( + } + }, 360000); // 6 minute timeout for this test (5 min for start + 1 min buffer) + // TODO: Fix flaky test - Docker prune conflicts cause intermittent failures + it.skip('should reset database successfully', async () => { + const projectName = 'db-reset-test-project'; + // Create a project + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); + const projectPath = join(projectDirectory, projectName); + // Start Supabase in background + const startProcess = spawn( 'npx', ['nx', 'run', `${projectName}:start`], { @@ -393,109 +300,181 @@ describe('@gridatek/nx-supabase', () => { env: process.env, } ); - restartProcess.unref(); - - // Wait for Supabase to be ready again - isReady = false; - for (let i = 0; i < maxAttempts; i++) { - await new Promise(resolve => setTimeout(resolve, pollInterval)); - try { - execSync( - `npx nx run ${projectName}:run-command --command="supabase status"`, - { - cwd: projectDirectory, - stdio: 'ignore', - env: process.env, + startProcess.unref(); + try { + // Wait for Supabase to be ready + let isReady = false; + const maxAttempts = 60; + const pollInterval = 5000; + console.log(`Waiting for Supabase to start for db reset test...`); + for (let i = 0; i < maxAttempts; i++) { + await new Promise((resolve) => setTimeout(resolve, pollInterval)); + try { + execSync( + `npx nx run ${projectName}:run-command --command="supabase status"`, + { + cwd: projectDirectory, + stdio: 'ignore', + env: process.env, + } + ); + console.log( + `Supabase started successfully for db reset test after ${ + ((i + 1) * pollInterval) / 1000 + } seconds` + ); + isReady = true; + break; + } catch (error) { + if ((i + 1) % 6 === 0) { + console.log( + `Still waiting... (${ + ((i + 1) * pollInterval) / 1000 + }s elapsed)` + ); } - ); - console.log(`Supabase restarted after ${(i + 1) * pollInterval / 1000} seconds`); - isReady = true; - break; - } catch (error) { - continue; - } - } - - if (!isReady) { - throw new Error('Supabase failed to restart'); - } - - // Explicitly apply migrations to ensure the new table is created - console.log('Applying migrations - this ensures the new table is created...'); - execSync( - `npx nx run ${projectName}:run-command --command="supabase migration up"`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - - // Verify migrated table exists - console.log('Verifying migrated table exists...'); - const usersTableBefore = execSync( - `docker exec -i supabase_db_${projectName}-local psql -U postgres -d postgres -t -c "SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename = 'users';"`, - { - cwd: projectDirectory, - encoding: 'utf-8', - env: process.env, + continue; + } } - ); - expect(usersTableBefore.trim()).toBe('users'); - - // Test db reset command - console.log('Testing db reset...'); - execSync( - `npx nx run ${projectName}:run-command --command="supabase db reset"`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, + if (!isReady) { + throw new Error( + `Supabase failed to start within ${ + (maxAttempts * pollInterval) / 1000 + } seconds` + ); } - ); - - // Verify Supabase is still running after reset - execSync( - `npx nx run ${projectName}:run-command --command="supabase status"`, - { + // Stop Supabase to create a migration + console.log('Stopping Supabase to create migration...'); + execSync(`npx nx run ${projectName}:stop`, { cwd: projectDirectory, stdio: 'inherit', env: process.env, + }); + // Create a migration file + const fs = require('fs'); + const migrationsDir = join(projectPath, 'local', 'migrations'); + fs.mkdirSync(migrationsDir, { recursive: true }); + const migrationFile = join( + migrationsDir, + '20240101000000_create_users_table.sql' + ); + fs.writeFileSync( + migrationFile, + 'CREATE TABLE users (id serial PRIMARY KEY, name text);' + ); + // Restart Supabase (will run migrations) + console.log('Restarting Supabase with migration...'); + const restartProcess = spawn( + 'npx', + ['nx', 'run', `${projectName}:start`], + { + cwd: projectDirectory, + stdio: 'ignore', + shell: true, + detached: true, + env: process.env, + } + ); + restartProcess.unref(); + // Wait for Supabase to be ready again + isReady = false; + for (let i = 0; i < maxAttempts; i++) { + await new Promise((resolve) => setTimeout(resolve, pollInterval)); + try { + execSync( + `npx nx run ${projectName}:run-command --command="supabase status"`, + { + cwd: projectDirectory, + stdio: 'ignore', + env: process.env, + } + ); + console.log( + `Supabase restarted after ${ + ((i + 1) * pollInterval) / 1000 + } seconds` + ); + isReady = true; + break; + } catch (error) { + continue; + } } - ); - - // Verify migrated table still exists (reset re-runs migrations) - console.log('Verifying migrated table still exists after reset...'); - const usersTableAfter = execSync( - `docker exec -i supabase_db_${projectName}-local psql -U postgres -d postgres -t -c "SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename = 'users';"`, - { - cwd: projectDirectory, - encoding: 'utf-8', - env: process.env, + if (!isReady) { + throw new Error('Supabase failed to restart'); } - ); - expect(usersTableAfter.trim()).toBe('users'); - - console.log('Database reset successful - migrations re-run correctly!'); - } finally { - // Cleanup: ensure Supabase is stopped - try { + // Explicitly apply migrations to ensure the new table is created + console.log( + 'Applying migrations - this ensures the new table is created...' + ); execSync( - `npx nx run ${projectName}:stop`, + `npx nx run ${projectName}:run-command --command="supabase migration up"`, { cwd: projectDirectory, - stdio: 'ignore', + stdio: 'inherit', + env: process.env, + } + ); + // Verify migrated table exists + console.log('Verifying migrated table exists...'); + const usersTableBefore = execSync( + `docker exec -i supabase_db_${projectName}-local psql -U postgres -d postgres -t -c "SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename = 'users';"`, + { + cwd: projectDirectory, + encoding: 'utf-8', env: process.env, } ); - } catch (error) { - // Ignore errors during cleanup + expect(usersTableBefore.trim()).toBe('users'); + // Test db reset command + console.log('Testing db reset...'); + execSync( + `npx nx run ${projectName}:run-command --command="supabase db reset"`, + { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + } + ); + // Verify Supabase is still running after reset + execSync( + `npx nx run ${projectName}:run-command --command="supabase status"`, + { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + } + ); + // Verify migrated table still exists (reset re-runs migrations) + console.log('Verifying migrated table still exists after reset...'); + const usersTableAfter = execSync( + `docker exec -i supabase_db_${projectName}-local psql -U postgres -d postgres -t -c "SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename = 'users';"`, + { + cwd: projectDirectory, + encoding: 'utf-8', + env: process.env, + } + ); + expect(usersTableAfter.trim()).toBe('users'); + console.log( + 'Database reset successful - migrations re-run correctly!' + ); + } finally { + // Cleanup: ensure Supabase is stopped + try { + execSync(`npx nx run ${projectName}:stop`, { + cwd: projectDirectory, + stdio: 'ignore', + env: process.env, + }); + } catch (error) { + // Ignore errors during cleanup + } } - } - }, 360000); // 6 minute timeout - }); + }, 360000); // 6 minute timeout + } + ); }); - /** * Creates a test project with create-nx-workspace and installs the plugin * @returns The directory where the test project was created @@ -503,7 +482,6 @@ describe('@gridatek/nx-supabase', () => { function createTestProject() { const projectName = 'test-project'; const projectDirectory = join(process.cwd(), 'tmp', projectName); - // Ensure projectDirectory is empty rmSync(projectDirectory, { recursive: true, @@ -512,7 +490,6 @@ function createTestProject() { mkdirSync(dirname(projectDirectory), { recursive: true, }); - execSync( `npx create-nx-workspace@latest ${projectName} --preset apps --nxCloud=skip --no-interactive`, { @@ -522,6 +499,5 @@ function createTestProject() { } ); console.log(`Created test project in "${projectDirectory}"`); - return projectDirectory; } diff --git a/npm-e2e/src/npm-install.spec.ts b/npm-e2e/src/npm-install.spec.ts index 55097fd..8280903 100644 --- a/npm-e2e/src/npm-install.spec.ts +++ b/npm-e2e/src/npm-install.spec.ts @@ -1,13 +1,10 @@ import { execSync } from 'child_process'; import { join, dirname } from 'path'; import { mkdirSync, rmSync, existsSync, readFileSync } from 'fs'; - describe('@gridatek/nx-supabase npm installation', () => { let projectDirectory: string; - beforeAll(() => { projectDirectory = createTestProject(); - // Install the plugin from npm using nx add // This tests the real user flow of installing from npm execSync(`npx nx add @gridatek/nx-supabase`, { @@ -16,7 +13,6 @@ describe('@gridatek/nx-supabase npm installation', () => { env: process.env, }); }); - afterAll(() => { if (projectDirectory) { // Cleanup the test project @@ -26,7 +22,6 @@ describe('@gridatek/nx-supabase npm installation', () => { }); } }); - it('should be installed from npm', () => { // npm ls will fail if the package is not installed properly execSync('npm ls @gridatek/nx-supabase', { @@ -34,53 +29,39 @@ describe('@gridatek/nx-supabase npm installation', () => { stdio: 'inherit', }); }); - describe('init generator (via nx add)', () => { it('should have added supabase CLI to devDependencies', () => { // The init generator should have already run via nx add in beforeAll // Verify package.json was updated const packageJsonPath = join(projectDirectory, 'package.json'); expect(existsSync(packageJsonPath)).toBe(true); - const packageJson = require(packageJsonPath); expect(packageJson.devDependencies['supabase']).toBeDefined(); expect(packageJson.devDependencies['supabase']).toBe('^2.65.6'); }); }); - describe('project generator', () => { it('should create a Supabase project with default configuration', () => { const projectName = 'test-supabase-project'; - - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Verify project structure was created const projectPath = join(projectDirectory, projectName); expect(existsSync(projectPath)).toBe(true); - // Verify default environment directories exist expect(existsSync(join(projectPath, 'production'))).toBe(true); expect(existsSync(join(projectPath, 'local'))).toBe(true); - // Verify README exists expect(existsSync(join(projectPath, 'README.md'))).toBe(true); - // Verify .gitignore exists expect(existsSync(join(projectPath, '.gitignore'))).toBe(true); - // Verify .generated directory exists expect(existsSync(join(projectPath, '.generated'))).toBe(true); - // Verify project.json was created (targets are inferred by the plugin at runtime) expect(existsSync(join(projectPath, 'project.json'))).toBe(true); - // Verify that inferred targets are available using nx show project const showProjectOutput = execSync( `npx nx show project ${projectName} --json`, @@ -97,10 +78,8 @@ describe('@gridatek/nx-supabase npm installation', () => { expect(projectConfig.targets.stop).toBeDefined(); expect(projectConfig.targets['run-command']).toBeDefined(); }); - it('should create a project with additional environments', () => { const projectName = 'multi-env-npm-project'; - execSync( `npx nx g @gridatek/nx-supabase:project ${projectName} --environments=staging,development`, { @@ -109,22 +88,17 @@ describe('@gridatek/nx-supabase npm installation', () => { env: process.env, } ); - const projectPath = join(projectDirectory, projectName); - // Verify production and local are always created expect(existsSync(join(projectPath, 'production'))).toBe(true); expect(existsSync(join(projectPath, 'local'))).toBe(true); - // Verify additional environments were created expect(existsSync(join(projectPath, 'staging'))).toBe(true); expect(existsSync(join(projectPath, 'development'))).toBe(true); }); - it('should create project in custom directory', () => { const projectName = 'custom-dir-project'; const directory = 'apps/backend/custom-dir-project'; - execSync( `npx nx g @gridatek/nx-supabase:project ${projectName} --directory=${directory}`, { @@ -133,111 +107,97 @@ describe('@gridatek/nx-supabase npm installation', () => { env: process.env, } ); - const projectPath = join(projectDirectory, directory); expect(existsSync(projectPath)).toBe(true); expect(existsSync(join(projectPath, 'production'))).toBe(true); expect(existsSync(join(projectPath, 'local'))).toBe(true); expect(existsSync(join(projectPath, 'project.json'))).toBe(true); }); - it('should create multiple projects in the same workspace', () => { const projectName1 = 'database-api'; const projectName2 = 'database-web'; - // Create first project - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName1}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName1}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Create second project - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName2}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName2}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Verify both projects exist const projectPath1 = join(projectDirectory, projectName1); const projectPath2 = join(projectDirectory, projectName2); - expect(existsSync(projectPath1)).toBe(true); expect(existsSync(projectPath2)).toBe(true); - // Verify both have their own config - expect(existsSync(join(projectPath1, 'production', 'config.toml'))).toBe(true); - expect(existsSync(join(projectPath2, 'production', 'config.toml'))).toBe(true); + expect(existsSync(join(projectPath1, 'production', 'config.toml'))).toBe( + true + ); + expect(existsSync(join(projectPath2, 'production', 'config.toml'))).toBe( + true + ); }); }); - describe('build executor', () => { it('should build configuration files for all environments', () => { const projectName = 'build-npm-test'; - // Create a project - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); const projectPath = join(projectDirectory, projectName); - // Run the build executor - execSync( - `npx nx run ${projectName}:build`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx run ${projectName}:build`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Verify .generated directories were created for all environments - expect(existsSync(join(projectPath, '.generated', 'local', 'supabase'))).toBe(true); - expect(existsSync(join(projectPath, '.generated', 'production', 'supabase'))).toBe(true); - + expect( + existsSync(join(projectPath, '.generated', 'local', 'supabase')) + ).toBe(true); + expect( + existsSync(join(projectPath, '.generated', 'production', 'supabase')) + ).toBe(true); // Verify config.toml files exist - expect(existsSync(join(projectPath, '.generated', 'local', 'supabase', 'config.toml'))).toBe(true); - expect(existsSync(join(projectPath, '.generated', 'production', 'supabase', 'config.toml'))).toBe(true); + expect( + existsSync( + join(projectPath, '.generated', 'local', 'supabase', 'config.toml') + ) + ).toBe(true); + expect( + existsSync( + join( + projectPath, + '.generated', + 'production', + 'supabase', + 'config.toml' + ) + ) + ).toBe(true); }); - }); - describe('run-command executor', () => { it('should execute supabase commands', () => { const projectName = 'run-command-test'; - - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Build the project first to generate config files - execSync( - `npx nx run ${projectName}:build`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx run ${projectName}:build`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Run supabase --version command const output = execSync( `npx nx run ${projectName}:run-command --command="supabase --version"`, @@ -247,64 +207,43 @@ describe('@gridatek/nx-supabase npm installation', () => { env: process.env, } ); - // Verify command executed and returned version expect(output).toContain('supabase'); }); }); - describe('Nx integration', () => { it('should be detectable by nx show project command', () => { const projectName = 'nx-show-test'; - - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Run nx show project command - const output = execSync( - `npx nx show project ${projectName} --json`, - { - cwd: projectDirectory, - encoding: 'utf-8', - env: process.env, - } - ); - + const output = execSync(`npx nx show project ${projectName} --json`, { + cwd: projectDirectory, + encoding: 'utf-8', + env: process.env, + }); const projectInfo = JSON.parse(output); expect(projectInfo.name).toBe(projectName); expect(projectInfo.targets).toBeDefined(); expect(projectInfo.targets.build).toBeDefined(); }); - it('should work with nx run-many', () => { const projectName1 = 'run-many-test-1'; const projectName2 = 'run-many-test-2'; - // Create two projects - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName1}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName2}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName1}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName2}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Run build on both projects execSync( `npx nx run-many -t build --projects=${projectName1},${projectName2}`, @@ -314,76 +253,59 @@ describe('@gridatek/nx-supabase npm installation', () => { env: process.env, } ); - // Verify both were built const projectPath1 = join(projectDirectory, projectName1); const projectPath2 = join(projectDirectory, projectName2); - - expect(existsSync(join(projectPath1, '.generated', 'local', 'supabase', 'config.toml'))).toBe(true); - expect(existsSync(join(projectPath2, '.generated', 'local', 'supabase', 'config.toml'))).toBe(true); + expect( + existsSync( + join(projectPath1, '.generated', 'local', 'supabase', 'config.toml') + ) + ).toBe(true); + expect( + existsSync( + join(projectPath2, '.generated', 'local', 'supabase', 'config.toml') + ) + ).toBe(true); }); }); - describe('generated files validation', () => { it('should generate valid config.toml files', () => { const projectName = 'config-validation'; - - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); const projectPath = join(projectDirectory, projectName); - // Run build - execSync( - `npx nx run ${projectName}:build`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx run ${projectName}:build`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); // Verify config.toml contains expected sections const localConfig = readFileSync( join(projectPath, '.generated', 'local', 'supabase', 'config.toml'), 'utf-8' ); - expect(localConfig).toContain('[api]'); expect(localConfig).toContain('[db]'); expect(localConfig).toContain('[studio]'); }); - it('should generate proper .gitignore content', () => { const projectName = 'gitignore-test'; - - execSync( - `npx nx g @gridatek/nx-supabase:project ${projectName}`, - { - cwd: projectDirectory, - stdio: 'inherit', - env: process.env, - } - ); - + execSync(`npx nx g @gridatek/nx-supabase:project ${projectName}`, { + cwd: projectDirectory, + stdio: 'inherit', + env: process.env, + }); const projectPath = join(projectDirectory, projectName); - const gitignore = readFileSync( - join(projectPath, '.gitignore'), - 'utf-8' - ); - + const gitignore = readFileSync(join(projectPath, '.gitignore'), 'utf-8'); // Verify .generated is ignored expect(gitignore).toContain('.generated'); }); }); }); - /** * Creates a test project with create-nx-workspace * @returns The directory where the test project was created @@ -391,7 +313,6 @@ describe('@gridatek/nx-supabase npm installation', () => { function createTestProject() { const projectName = 'npm-test-project'; const projectDirectory = join(process.cwd(), 'tmp', 'npm-e2e', projectName); - // Ensure projectDirectory is empty rmSync(projectDirectory, { recursive: true, @@ -400,7 +321,6 @@ function createTestProject() { mkdirSync(dirname(projectDirectory), { recursive: true, }); - execSync( `npx create-nx-workspace@latest ${projectName} --preset apps --nxCloud=skip --no-interactive`, { @@ -410,6 +330,5 @@ function createTestProject() { } ); console.log(`Created test project in "${projectDirectory}"`); - return projectDirectory; } diff --git a/package-lock.json b/package-lock.json index b16497b..d53d175 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,16 +13,16 @@ "e2e" ], "dependencies": { - "@nx/devkit": "22.3.3" + "@nx/devkit": "22.4.2" }, "devDependencies": { "@eslint/js": "^9.8.0", - "@nx/eslint": "22.3.3", - "@nx/eslint-plugin": "22.3.3", - "@nx/jest": "22.3.3", - "@nx/js": "22.3.3", - "@nx/plugin": "22.3.3", - "@nx/vitest": "22.3.3", + "@nx/eslint": "22.4.2", + "@nx/eslint-plugin": "22.4.2", + "@nx/jest": "22.4.2", + "@nx/js": "22.4.2", + "@nx/plugin": "22.4.2", + "@nx/vitest": "22.4.2", "@swc-node/register": "~1.9.1", "@swc/cli": "~0.6.0", "@swc/core": "~1.5.7", @@ -38,7 +38,7 @@ "jest-util": "^30.0.2", "jsdom": "~22.1.0", "jsonc-eslint-parser": "^2.1.0", - "nx": "22.3.3", + "nx": "22.4.2", "prettier": "^2.6.2", "ts-jest": "^29.4.0", "ts-node": "10.9.1", @@ -2907,6 +2907,27 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -3850,15 +3871,15 @@ } }, "node_modules/@nx/devkit": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/devkit/-/devkit-22.3.3.tgz", - "integrity": "sha512-/hxcdhE+QDalsWEbJurHtZh9aY27taHeImbCVJnogwv85H3RbAE+0YuKXGInutfLszAs7phwzli71yq+d2P45Q==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/devkit/-/devkit-22.4.2.tgz", + "integrity": "sha512-ULInRB5YMcUfYdJRCoxrdAhshAv8on5LPVHRvUpk7RmirtLNTDSOL9q83pJD3ChFmwPYwEITPMOwvzm9ku6m7A==", "license": "MIT", "dependencies": { "@zkochan/js-yaml": "0.0.7", "ejs": "^3.1.7", "enquirer": "~2.3.6", - "minimatch": "9.0.3", + "minimatch": "10.1.1", "semver": "^7.6.3", "tslib": "^2.3.0", "yargs-parser": "21.1.1" @@ -3867,15 +3888,30 @@ "nx": ">= 21 <= 23 || ^22.0.0-0" } }, + "node_modules/@nx/devkit/node_modules/minimatch": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", + "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@nx/eslint": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/eslint/-/eslint-22.3.3.tgz", - "integrity": "sha512-iG/LvrYf2CFAm2A0kfmRU4VeCTAN5PjUw8xc6oD1zfQ/KTmE/gFG2P1aJBo2mTIyzk9k8ZI0dqIhPLdl/AAtxg==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/eslint/-/eslint-22.4.2.tgz", + "integrity": "sha512-LYyt47WSSK/v4JKpYvfVBQWufQeGoiWHFcTK7Y+eq42sDKu3nzO8eA4x06/1bX7whURbZ06lNkL/PmJj0wzc7A==", "dev": true, "license": "MIT", "dependencies": { - "@nx/devkit": "22.3.3", - "@nx/js": "22.3.3", + "@nx/devkit": "22.4.2", + "@nx/js": "22.4.2", "semver": "^7.6.3", "tslib": "^2.3.0", "typescript": "~5.9.2" @@ -3891,15 +3927,15 @@ } }, "node_modules/@nx/eslint-plugin": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/eslint-plugin/-/eslint-plugin-22.3.3.tgz", - "integrity": "sha512-UGAqvYUlKGupBUsO9ppEzYkai1VrrFrUkzHPOVUu5JM4zYGN30ruoO+j3K5OXu5jQLGCmOVfAQD3jzqT2balmw==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/eslint-plugin/-/eslint-plugin-22.4.2.tgz", + "integrity": "sha512-+IP9vpRCSICLZzXdQbxGddamXYV/0JYv6p7gGJjtnJ7i30kwlGCAPaOK4pRupgCWIGWXoHTks5nNHkmLJOylrQ==", "dev": true, "license": "MIT", "dependencies": { - "@nx/devkit": "22.3.3", - "@nx/js": "22.3.3", - "@phenomnomnominal/tsquery": "~5.0.1", + "@nx/devkit": "22.4.2", + "@nx/js": "22.4.2", + "@phenomnomnominal/tsquery": "~6.1.4", "@typescript-eslint/type-utils": "^8.0.0", "@typescript-eslint/utils": "^8.0.0", "chalk": "^4.1.0", @@ -3933,22 +3969,22 @@ } }, "node_modules/@nx/jest": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/jest/-/jest-22.3.3.tgz", - "integrity": "sha512-BC+5E6oAM6h9x67UCtpsapfLRTwqVLtoG39f5tVZNVZ4a1spdMh0tPHRPtu2hSlsHHtaYsmTvjz5L+N7UguAtA==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/jest/-/jest-22.4.2.tgz", + "integrity": "sha512-f+YvMvGDO/Pf7/i394wj3gfUvKY7iaYor4NRd5VeydqEyUSxK9aUbFwRXye6+CHyOdIvnTd7ZEt5AQO1g9RfKw==", "dev": true, "license": "MIT", "dependencies": { "@jest/reporters": "^30.0.2", "@jest/test-result": "^30.0.2", - "@nx/devkit": "22.3.3", - "@nx/js": "22.3.3", - "@phenomnomnominal/tsquery": "~5.0.1", + "@nx/devkit": "22.4.2", + "@nx/js": "22.4.2", + "@phenomnomnominal/tsquery": "~6.1.4", "identity-obj-proxy": "3.0.0", "jest-config": "^30.0.2", "jest-resolve": "^30.0.2", "jest-util": "^30.0.2", - "minimatch": "9.0.3", + "minimatch": "10.1.1", "picocolors": "^1.1.0", "resolve.exports": "2.0.3", "semver": "^7.6.3", @@ -3956,10 +3992,26 @@ "yargs-parser": "21.1.1" } }, + "node_modules/@nx/jest/node_modules/minimatch": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", + "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@nx/js": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/js/-/js-22.3.3.tgz", - "integrity": "sha512-L3MOb8cLc2TIg2R3hGC9FLlcuVqlqST/fztmOihw9wS3lo52E4v2gP/BpYGfRh/u9r6Ekm6LF03Or+VwYzPuzA==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/js/-/js-22.4.2.tgz", + "integrity": "sha512-XIvxII4hKxAp039yRYbtnNXODOXUln+El3UKFwzR6BDnVDfYLZKSkTZW0OJz/d3Zr6tqyD5hs3pl7o1MTY9fpg==", "dev": true, "license": "MIT", "dependencies": { @@ -3970,8 +4022,8 @@ "@babel/preset-env": "^7.23.2", "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", - "@nx/devkit": "22.3.3", - "@nx/workspace": "22.3.3", + "@nx/devkit": "22.4.2", + "@nx/workspace": "22.4.2", "@zkochan/js-yaml": "0.0.7", "babel-plugin-const-enum": "^1.0.1", "babel-plugin-macros": "^3.1.0", @@ -4000,9 +4052,9 @@ } }, "node_modules/@nx/nx-darwin-arm64": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-22.3.3.tgz", - "integrity": "sha512-zBAGFGLal09CxhQkdMpOVwcwa9Y01aFm88jTTn35s/DdIWsfngmPzz0t4mG7u2D05q7TJfGQ31pIf5GkNUjo6g==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-22.4.2.tgz", + "integrity": "sha512-l/NLbzB7UnE/YnHuFXrMtpchDZaKCXMrcAgleOkxWotqiQ/Fs5hOJ5xFvAbzX1FF/2MHOKXqeBVPfq0y0Vbj4A==", "cpu": [ "arm64" ], @@ -4013,9 +4065,9 @@ ] }, "node_modules/@nx/nx-darwin-x64": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-22.3.3.tgz", - "integrity": "sha512-6ZQ6rMqH8NY4Jz+Gc89D5bIH2NxZb5S/vaA4yJ9RrqAfl4QWchNFD5na+aRivSd+UdsYLPKKl6qohet5SE6vOg==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-22.4.2.tgz", + "integrity": "sha512-H6Vf3VX49wQqxSps2zg5Xym+qjJCkGzCRkD9jPyzBfnUnuMc44tyOYBpO9kdSurq8SYXOu/HP/oFg5EVRiRCQg==", "cpu": [ "x64" ], @@ -4026,9 +4078,9 @@ ] }, "node_modules/@nx/nx-freebsd-x64": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-22.3.3.tgz", - "integrity": "sha512-J/PP5pIOQtR7ZzrFwP6d6h0yfY7r9EravG2m940GsgzGbtZGYIDqnh5Wdt+4uBWPH8VpdNOwFqH0afELtJA3MA==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-22.4.2.tgz", + "integrity": "sha512-sNpGYjoOo+cDNLZ6mUK2P6rPN0p55pEyKh5lD7M0p1+DfeDls83NwHuS6apmayo9eUH/JDFFWgIY6Q8Q2uo0Iw==", "cpu": [ "x64" ], @@ -4039,9 +4091,9 @@ ] }, "node_modules/@nx/nx-linux-arm-gnueabihf": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-22.3.3.tgz", - "integrity": "sha512-/zn0altzM15S7qAgXMaB41vHkEn18HyTVUvRrjmmwaVqk9WfmDmqOQlGWoJ6XCbpvKQ8bh14RyhR9LGw1JJkNA==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-22.4.2.tgz", + "integrity": "sha512-KyjYmhPvJmBzB7bpqjyEWytCi6RwX1Hjly6HU2NjD6dDUg50Gq5qQr5hA+eTBNwxsdOKOB+uCe2+jVw+GZ5vwg==", "cpu": [ "arm" ], @@ -4052,9 +4104,9 @@ ] }, "node_modules/@nx/nx-linux-arm64-gnu": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-22.3.3.tgz", - "integrity": "sha512-NmPeCexWIZHW9RM3lDdFENN9C3WtlQ5L4RSNFESIjreS921rgePhulsszYdGnHdcnKPYlBBJnX/NxVsfioBbnQ==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-22.4.2.tgz", + "integrity": "sha512-jc7vB/iIHOrA3wg7nch4wBRpPtxuytmgsL1Qf1Ue1LB+PPZSlxYxwujO5YtfcwoB78vnBqt6wPTjx4nyvLcCOQ==", "cpu": [ "arm64" ], @@ -4065,9 +4117,9 @@ ] }, "node_modules/@nx/nx-linux-arm64-musl": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-22.3.3.tgz", - "integrity": "sha512-K02U88Q0dpvCfmSXXvY7KbYQSa1m+mkYeqDBRHp11yHk1GoIqaHp8oEWda7FV4gsriNExPSS5tX1/QGVoLZrCw==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-22.4.2.tgz", + "integrity": "sha512-7m1u/McVDer4m+c6LDSdxuW2nIani2IeMV4Lvf2LjK5SrDcnqw47CybMeykaarREuY3UQgda04qXPSHWTKUwXg==", "cpu": [ "arm64" ], @@ -4078,9 +4130,9 @@ ] }, "node_modules/@nx/nx-linux-x64-gnu": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-22.3.3.tgz", - "integrity": "sha512-04TEbvgwRaB9ifr39YwJmWh3RuXb4Ry4m84SOJyjNXAfPrepcWgfIQn1VL2ul1Ybq+P023dLO9ME8uqFh6j1YQ==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-22.4.2.tgz", + "integrity": "sha512-IBpm9dE0EdKR7SPZsC12beCk6/iSgSKCQnX5x3c+3cJSxP4Nld9s2TIfTLph1vtjNrgZUrrMO/3KFovzw1szoQ==", "cpu": [ "x64" ], @@ -4091,9 +4143,9 @@ ] }, "node_modules/@nx/nx-linux-x64-musl": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-22.3.3.tgz", - "integrity": "sha512-uxBXx5q+S5OGatbYDxnamsKXRKlYn+Eq1nrCAHaf8rIfRoHlDiRV2PqtWuF+O2pxR5FWKpvr+/sZtt9rAf7KMw==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-22.4.2.tgz", + "integrity": "sha512-OmXbuSH1SMq2zSwV5lyXP1a4MFDvllZUFbdas7FVr2+gA6vT2xjUVpHiZpb7c0aoTX5X/558L3ic/+JNbDNZyg==", "cpu": [ "x64" ], @@ -4104,9 +4156,9 @@ ] }, "node_modules/@nx/nx-win32-arm64-msvc": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-22.3.3.tgz", - "integrity": "sha512-aOwlfD6ZA1K6hjZtbhBSp7s1yi3sHbMpLCa4stXzfhCCpKUv46HU/EdiWdE1N8AsyNFemPZFq81k1VTowcACdg==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-22.4.2.tgz", + "integrity": "sha512-bnoJ+dOtaAoAn/m7rhClZyMxXu7OcN8oan0TMTM5PvE8qMhLEvwU88l4LC769b/hRvuuVXUGCYKHGC92LQrtJA==", "cpu": [ "arm64" ], @@ -4117,9 +4169,9 @@ ] }, "node_modules/@nx/nx-win32-x64-msvc": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-22.3.3.tgz", - "integrity": "sha512-EDR8BtqeDvVNQ+kPwnfeSfmerYetitU3tDkxOMIybjKJDh69U2JwTB8n9ARwNaZQbNk7sCGNRUSZFTbAAUKvuQ==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-22.4.2.tgz", + "integrity": "sha512-3JtK1Zty6U/Wc2qDqMPJoYcRk/GrySp8fixe407g1S8ZkKmYMoCyDJAo8mQSu21i3Mkhvwloeoo97yR5//NaqA==", "cpu": [ "x64" ], @@ -4130,29 +4182,29 @@ ] }, "node_modules/@nx/plugin": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/plugin/-/plugin-22.3.3.tgz", - "integrity": "sha512-Nlf74Q3eTMW8MyjOIG1WFZf4eGBTlhIz6S2jknpNhSzobLd0RGzrOroXsmVCgtZJOTtyFH32AqAobmdcyeKWpw==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/plugin/-/plugin-22.4.2.tgz", + "integrity": "sha512-4wP8fz9/xfl2eg6J//fhj3Qa4lP+s21Aq+ydkLjkW4ZLVPWvaixoyRVXs63enZKL+7kA8hIsy+FU98hpkWMFWA==", "dev": true, "license": "MIT", "dependencies": { - "@nx/devkit": "22.3.3", - "@nx/eslint": "22.3.3", - "@nx/jest": "22.3.3", - "@nx/js": "22.3.3", + "@nx/devkit": "22.4.2", + "@nx/eslint": "22.4.2", + "@nx/jest": "22.4.2", + "@nx/js": "22.4.2", "tslib": "^2.3.0" } }, "node_modules/@nx/vitest": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/vitest/-/vitest-22.3.3.tgz", - "integrity": "sha512-9BNwWadIfT5EAnEPXLM0n/ucuJ7IQyn+QRMUkUBt6wmms9f0OKMtLpiFxHIMrnQDf0eEk845jo21j7Og2cCZyA==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/vitest/-/vitest-22.4.2.tgz", + "integrity": "sha512-7jhgblP7ssl3zaTX3M2LXR/VMWaSkiUcedV61TgLQXW4364onbQWqNny8xdpS/CJevrejTgFzQkniJ9DHlBprQ==", "dev": true, "license": "MIT", "dependencies": { - "@nx/devkit": "22.3.3", - "@nx/js": "22.3.3", - "@phenomnomnominal/tsquery": "~5.0.1", + "@nx/devkit": "22.4.2", + "@nx/js": "22.4.2", + "@phenomnomnominal/tsquery": "~6.1.4", "semver": "^7.6.3", "tslib": "^2.3.0" }, @@ -4170,17 +4222,17 @@ } }, "node_modules/@nx/workspace": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/@nx/workspace/-/workspace-22.3.3.tgz", - "integrity": "sha512-A7Qd1Yi/hp/VPvig6tV+JmlYVSA4WhckNkP1giYZoESpGLxRlpwINpd5ii3oafOlglUdEZ8AiS3X+RUg9QmCAQ==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/@nx/workspace/-/workspace-22.4.2.tgz", + "integrity": "sha512-T5jjewWuKDHQil95ABWWH1YDZe774dlbEPdZPEXDGXHePgu4kaTrI2C4mD3SxyXo1j4AaBAMUzSMNyHTEU0VUQ==", "dev": true, "license": "MIT", "dependencies": { - "@nx/devkit": "22.3.3", + "@nx/devkit": "22.4.2", "@zkochan/js-yaml": "0.0.7", "chalk": "^4.1.0", "enquirer": "~2.3.6", - "nx": "22.3.3", + "nx": "22.4.2", "picomatch": "4.0.2", "semver": "^7.6.3", "tslib": "^2.3.0", @@ -4188,13 +4240,14 @@ } }, "node_modules/@phenomnomnominal/tsquery": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-5.0.1.tgz", - "integrity": "sha512-3nVv+e2FQwsW8Aw6qTU6f+1rfcJ3hrcnvH/mu9i8YhxO+9sqbOfpL8m6PbET5+xKOlz/VSbp0RoYWYCtIsnmuA==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-6.1.4.tgz", + "integrity": "sha512-3tHlGy/fxjJCHqIV8nelAzbRTNkCUY+k7lqBGKNuQz99H2OKGRt6oU+U2SZs6LYrbOe8mxMFl6kq6gzHapFRkw==", "dev": true, "license": "MIT", "dependencies": { - "esquery": "^1.4.0" + "@types/esquery": "^1.5.0", + "esquery": "^1.5.0" }, "peerDependencies": { "typescript": "^3 || ^4 || ^5" @@ -5096,6 +5149,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/esquery": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/esquery/-/esquery-1.5.4.tgz", + "integrity": "sha512-yYO4Q8H+KJHKW1rEeSzHxcZi90durqYgWVfnh5K6ZADVBjBv2e1NEveYX5yT2bffgN7RqzH3k9930m+i2yBoMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -12451,9 +12514,9 @@ "license": "MIT" }, "node_modules/nx": { - "version": "22.3.3", - "resolved": "https://registry.npmjs.org/nx/-/nx-22.3.3.tgz", - "integrity": "sha512-pOxtKWUfvf0oD8Geqs8D89Q2xpstRTaSY+F6Ut/Wd0GnEjUjO32SS1ymAM6WggGPHDZN4qpNrd5cfIxQmAbRLg==", + "version": "22.4.2", + "resolved": "https://registry.npmjs.org/nx/-/nx-22.4.2.tgz", + "integrity": "sha512-AlL79ED96d3gG0QtIQ+KXZwZAu/2O8PL/5rcLHxPMoF5Ag31e3krHWoFg3nESJKkFzgOYFilyWHZYPdZc7dSzw==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -12476,7 +12539,7 @@ "jest-diff": "^30.0.2", "jsonc-parser": "3.2.0", "lines-and-columns": "2.0.3", - "minimatch": "9.0.3", + "minimatch": "10.1.1", "node-machine-id": "1.1.12", "npm-run-path": "^4.0.1", "open": "^8.4.0", @@ -12498,16 +12561,16 @@ "nx-cloud": "bin/nx-cloud.js" }, "optionalDependencies": { - "@nx/nx-darwin-arm64": "22.3.3", - "@nx/nx-darwin-x64": "22.3.3", - "@nx/nx-freebsd-x64": "22.3.3", - "@nx/nx-linux-arm-gnueabihf": "22.3.3", - "@nx/nx-linux-arm64-gnu": "22.3.3", - "@nx/nx-linux-arm64-musl": "22.3.3", - "@nx/nx-linux-x64-gnu": "22.3.3", - "@nx/nx-linux-x64-musl": "22.3.3", - "@nx/nx-win32-arm64-msvc": "22.3.3", - "@nx/nx-win32-x64-msvc": "22.3.3" + "@nx/nx-darwin-arm64": "22.4.2", + "@nx/nx-darwin-x64": "22.4.2", + "@nx/nx-freebsd-x64": "22.4.2", + "@nx/nx-linux-arm-gnueabihf": "22.4.2", + "@nx/nx-linux-arm64-gnu": "22.4.2", + "@nx/nx-linux-arm64-musl": "22.4.2", + "@nx/nx-linux-x64-gnu": "22.4.2", + "@nx/nx-linux-x64-musl": "22.4.2", + "@nx/nx-win32-arm64-msvc": "22.4.2", + "@nx/nx-win32-x64-msvc": "22.4.2" }, "peerDependencies": { "@swc-node/register": "^1.8.0", @@ -12531,6 +12594,21 @@ "node": ">= 4" } }, + "node_modules/nx/node_modules/minimatch": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", + "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", diff --git a/package.json b/package.json index 0e855df..7260db1 100644 --- a/package.json +++ b/package.json @@ -6,12 +6,12 @@ "private": true, "devDependencies": { "@eslint/js": "^9.8.0", - "@nx/eslint": "22.3.3", - "@nx/eslint-plugin": "22.3.3", - "@nx/jest": "22.3.3", - "@nx/js": "22.3.3", - "@nx/plugin": "22.3.3", - "@nx/vitest": "22.3.3", + "@nx/eslint": "22.4.2", + "@nx/eslint-plugin": "22.4.2", + "@nx/jest": "22.4.2", + "@nx/js": "22.4.2", + "@nx/plugin": "22.4.2", + "@nx/vitest": "22.4.2", "@swc-node/register": "~1.9.1", "@swc/cli": "~0.6.0", "@swc/core": "~1.5.7", @@ -27,7 +27,7 @@ "jest-util": "^30.0.2", "jsdom": "~22.1.0", "jsonc-eslint-parser": "^2.1.0", - "nx": "22.3.3", + "nx": "22.4.2", "prettier": "^2.6.2", "ts-jest": "^29.4.0", "ts-node": "10.9.1", @@ -43,7 +43,7 @@ "e2e" ], "dependencies": { - "@nx/devkit": "22.3.3" + "@nx/devkit": "22.4.2" }, "nx": { "includedScripts": [],