Skip to content

Commit

Permalink
feat: Update plugin to minimum Nx v16.8.1 (#205)
Browse files Browse the repository at this point in the history
* Update to Nx 16.8.1

* e2e tests updated to use new as-provided/derived project generators

* Use new bundler option for buildable libs

* e2e test updates for Nx 16.8.1

* fix function schema

* Revert lint test change

* nx command run extra logs & checks

* More lock file checks

* nx command differs based on package manager

* Support `projectNameAndRootFormat` option for functions & apps

* Start to make e2e test more manageable

* Move test logger to own module

* Use barrel export for test utils

* Unpack more e2e test modules

* Rename utils -> test-imports

* e2e comments

* Start split of e2e tests

* Modules for each test suite now

* Pre-configure e2e nx.json for `derived` layout

* Disable the dodgy reset for builds again

As well as the lockfile changed error, I'm now getting e2e errors where Nx says it cant find projects. Beyond annoying now.

* Delete workspace.json.old

* Finally! Setting CI for e2e makes tests pass

Seems the Nx Daemon is unhelpful in e2e tests

* Cleanup a couple of comments

* Rename e2e test files

* Update minimum Nx versions to 16.8.1

* Fix e2e tests check for package lock file
  • Loading branch information
simondotm authored Apr 1, 2024
1 parent 3b3bdae commit cafd479
Show file tree
Hide file tree
Showing 38 changed files with 2,434 additions and 1,984 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![npm](https://img.shields.io/npm/dw/@simondotm/nx-firebase.svg)

A plugin for [Nx](https://nx.dev) v16.1.1+ that provides support for Firebase projects in an Nx monorepo workspace.
A plugin for [Nx](https://nx.dev) v16.8.1+ that provides support for Firebase projects in an Nx monorepo workspace.

See [CHANGELOG](https://github.com/simondotm/nx-firebase/blob/main/CHANGELOG.md) for release notes.

Expand Down
5 changes: 3 additions & 2 deletions e2e/compat/src/app/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { defaultCwd } from './utils/cwd'

// this is the package manager that will be used for the test Nx workspace
export const PACKAGE_MANAGER = 'pnpm'
export type PackageManager = 'npm' | 'yarn' | 'pnpm'
export const PACKAGE_MANAGER: PackageManager = 'pnpm'

// const CACHE_DIR = `${defaultCwd}/node_modules/.cache/nx-firebase`
export const CACHE_DIR = `${defaultCwd}/.nx-firebase`
// const CACHE_DIR = `${defaultCwd}/../.nx-firebase`
// const CACHE_DIR = `${defaultCwd}/../.nx-firebase`
4 changes: 3 additions & 1 deletion e2e/compat/src/app/utils/exec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PACKAGE_MANAGER } from '../config'
import { info } from './log'
import { log } from './log'
import { exec } from 'child_process'
Expand Down Expand Up @@ -46,7 +47,8 @@ export async function customExec(
}

export async function runNxCommandAsync(command: string, dir?: string) {
const cmd = `npx nx ${command} --verbose`
const exec = PACKAGE_MANAGER === 'npm' ? 'npx' : 'pnpm exec'
const cmd = `${exec} nx ${command} --verbose`
const result = await customExec(cmd, dir)
return result
}
Loading

0 comments on commit cafd479

Please sign in to comment.