-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New (additional) methods: * `createMany()` * `refreshMany()` * `updateMany()` * `deleteMany()` * `request` parameter will now accept an array of requests (to `forkJoin()` them) in: * `createMany()` * `readMany()` * `refreshMany()` * `updateMany()` * `deleteMany()` Requests with suffix `*many` will run in parallel (using `forkJoin()`). If you need to run them differently, you can use regular methods with the [creation operator](https://rxjs.dev/guide/operators#creation-operators-1) of your choice. * A function can be used as a value for the `comparator` field in configuration options or as an argument for `setComparator()` method; * New method for override: `postInit()` - will be called in the next microtask after `constructor()`. You can override and use it to call the methods declared in the subclass and still don't bother about `constructor()` overriding; * `getTrackByFieldFn()` helper will not use fields with empty values; * Jest has been configured to run tests in this repo - pull requests are welcome!
- Loading branch information
Showing
34 changed files
with
26,527 additions
and
10,870 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
legacy-peer-deps = true | ||
strict-peer-dependencies = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,6 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"version": 2, | ||
"projects": { | ||
"ngx-collection": { | ||
"projectType": "library", | ||
"root": "projects/ngx-collection", | ||
"sourceRoot": "projects/ngx-collection/src", | ||
"prefix": "lib", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:ng-packagr", | ||
"options": { | ||
"project": "projects/ngx-collection/ng-package.json" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"tsConfig": "projects/ngx-collection/tsconfig.lib.prod.json" | ||
}, | ||
"development": { | ||
"tsConfig": "projects/ngx-collection/tsconfig.lib.json" | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
} | ||
} | ||
} | ||
|
||
"ngx-collection": "libs/ngx-collection" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* This file decorates the Angular CLI with the Nx CLI to enable features such as computation caching | ||
* and faster execution of tasks. | ||
* | ||
* It does this by: | ||
* | ||
* - Patching the Angular CLI to warn you in case you accidentally use the undecorated ng command. | ||
* - Symlinking the ng to nx command, so all commands run through the Nx CLI | ||
* - Updating the package.json postinstall script to give you control over this script | ||
* | ||
* The Nx CLI decorates the Angular CLI, so the Nx CLI is fully compatible with it. | ||
* Every command you run should work the same when using the Nx CLI, except faster. | ||
* | ||
* Because of symlinking you can still type `ng build/test/lint` in the terminal. The ng command, in this case, | ||
* will point to nx, which will perform optimizations before invoking ng. So the Angular CLI is always invoked. | ||
* The Nx CLI simply does some optimizations before invoking the Angular CLI. | ||
* | ||
* To opt out of this patch: | ||
* - Replace occurrences of nx with ng in your package.json | ||
* - Remove the script from your postinstall script in your package.json | ||
* - Delete and reinstall your node_modules | ||
*/ | ||
|
||
const fs = require('fs'); | ||
const os = require('os'); | ||
const cp = require('child_process'); | ||
const isWindows = os.platform() === 'win32'; | ||
let output; | ||
try { | ||
output = require('@nrwl/workspace').output; | ||
} catch (e) { | ||
console.warn('Angular CLI could not be decorated to enable computation caching. Please ensure @nrwl/workspace is installed.'); | ||
process.exit(0); | ||
} | ||
|
||
/** | ||
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still | ||
* invoke the Nx CLI and get the benefits of computation caching. | ||
*/ | ||
function symlinkNgCLItoNxCLI() { | ||
try { | ||
const ngPath = './node_modules/.bin/ng'; | ||
const nxPath = './node_modules/.bin/nx'; | ||
if (isWindows) { | ||
/** | ||
* This is the most reliable way to create symlink-like behavior on Windows. | ||
* Such that it works in all shells and works with npx. | ||
*/ | ||
['', '.cmd', '.ps1'].forEach(ext => { | ||
if (fs.existsSync(nxPath + ext)) fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext)); | ||
}); | ||
} else { | ||
// If unix-based, symlink | ||
cp.execSync(`ln -sf ./nx ${ngPath}`); | ||
} | ||
} | ||
catch(e) { | ||
output.error({ title: 'Unable to create a symlink from the Angular CLI to the Nx CLI:' + e.message }); | ||
throw e; | ||
} | ||
} | ||
|
||
try { | ||
symlinkNgCLItoNxCLI(); | ||
require('nx/src/adapter/decorate-cli').decorateCli(); | ||
output.log({ title: 'Angular CLI has been decorated to enable computation caching.' }); | ||
} catch(e) { | ||
output.error({ title: 'Decoration of the Angular CLI did not complete successfully' }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { getJestProjects } from '@nrwl/jest'; | ||
|
||
export default { | ||
projects: getJestProjects() | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const nxPreset = require('@nrwl/jest/preset').default; | ||
|
||
module.exports = {...nxPreset} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'ngx-collection', | ||
preset: '../../jest.preset.js', | ||
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
stringifyContentPathRegex: '\\.(html|svg)$', | ||
}, | ||
}, | ||
transform: { | ||
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular', | ||
}, | ||
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], | ||
snapshotSerializers: [ | ||
'jest-preset-angular/build/serializers/no-ng-attributes', | ||
'jest-preset-angular/build/serializers/ng-snapshot', | ||
'jest-preset-angular/build/serializers/html-comment', | ||
], | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.