Skip to content

Commit

Permalink
[NIFI-12940] - Migrate to Nx (#8574)
Browse files Browse the repository at this point in the history
* [NIFI-12940] - Migrate to Nx

* Set initial focus in the extension creation dialog to the filter input.

This closes #8574
  • Loading branch information
rfellows committed Mar 27, 2024
1 parent 8e0b83b commit a3dda5e
Show file tree
Hide file tree
Showing 11 changed files with 25,044 additions and 21,564 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@
<execution>
<id>lint</id>
<goals>
<goal>npm</goal>
<goal>npx</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run lint</arguments>
<arguments>nx lint</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
Expand All @@ -169,11 +169,11 @@
<execution>
<id>unit-tests</id>
<goals>
<goal>npm</goal>
<goal>npx</goal>
</goals>
<phase>test</phase>
<configuration>
<arguments>run test</arguments>
<arguments>nx test</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
Expand All @@ -184,11 +184,11 @@
<execution>
<id>package-web-ui</id>
<goals>
<goal>npm</goal>
<goal>npx</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run build</arguments>
<arguments>nx build</arguments>
<workingDirectory>${frontend.working.dir}</workingDirectory>
</configuration>
</execution>
Expand All @@ -209,6 +209,8 @@
<exclude>src/main/nifi/.prettierrc</exclude>
<exclude>src/main/nifi/.prettierignore</exclude>
<exclude>src/main/nifi/dist/**/*</exclude>
<exclude>src/main/nifi/.angular/**/*</exclude>
<exclude>src/main/nifi/.nx/**/*</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ testem.log
# System files
.DS_Store
Thumbs.db


.nx/cache
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ npm-debug.log

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
# NiFi

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.2.0.
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>

## General Info

### Nx

If you are unfamiliar Nx, you can learn more at https://nx.dev/getting-started/intro. They provide many solid resources to get you up to speed.

_From Nx:_

> We created Nx because developers struggle to configure, maintain and especially integrate various tools and frameworks.
> Setting up a system that works well for a handful of developers and at the same time, easily scales up to an entire organization is hard.
> This includes setting up low-level build tooling, configuring fast CI, and keeping your codebase healthy, up-to-date, and maintainable.
## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
Run `npx nx serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
Run `npx nx generate <generator> <<generator args>>`.

Or better yet, have a look at the [Nx documentation on integrating with IDEs](https://nx.dev/features/integrate-with-editors)

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
Run `npx nx build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via Jest
Run `npx nx test` to execute the unit tests via Jest

## Running end-to-end tests
## Linting the codebase

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
Run `npx nx lint` to execute lint

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
To get more help on the Nx CLI use `npx nx --help`.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"build": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"test": {
"cache": true,
"inputs": ["default", "^production"]
},
"lint": {
"cache": true,
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
}
},
"defaultBase": "dev",
"namedInputs": {
"sharedGlobals": [],
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/eslint.config.js",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s",
"!{projectRoot}/test-setup.[jt]s"
]
},
"plugins": [
{
"plugin": "@nx/jest/plugin",
"options": {
"targetName": "test"
}
}
]
}

0 comments on commit a3dda5e

Please sign in to comment.