Skip to content

Commit

Permalink
feat: update to Angular v15 and add standalone api support via `pro…
Browse files Browse the repository at this point in the history
…videNgcCookieConsent()`

BREAKING CHANGE: Angular `v15` is now the minimal version to use the library

If you're using new Angular Standalone API, you can now leverage `provideNgcCookieConsent(config)`
(instead of `NgcCookieConsentModule.forRoot(config)`) to configure your (ng)module-less application

Closes #132
  • Loading branch information
tinesoft committed Jan 9, 2024
1 parent 977f993 commit e34b18a
Show file tree
Hide file tree
Showing 122 changed files with 22,187 additions and 37,735 deletions.
51 changes: 51 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "NgxCookieConsentDevContainer",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-18-bullseye",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
}
},

"mounts": [
"source=ngx-cookieconsent-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
4211
],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm i",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"mhutchie.git-graph",
"eamodio.gitlens",
"usernamehw.errorlens",
"nrwl.angular-console",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"firsttris.vscode-jest-runner",
"anweber.reveal-button"
],
"settings":{
"debug.javascript.autoAttachFilter": "onlyWithFlag",
"dotfiles.repository": "https://github.com/tinesoft/dotfiles"
}
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
20 changes: 15 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches:
- develop
pull_request:

jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.3
with:
number-of-agents: 3
init-commands: |
npx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3
parallel-commands: |
npx nx-cloud record -- npx nx format:check
parallel-commands-on-agents: |
npx nx affected --target=lint --parallel=3
npx nx affected --target=test --parallel=3 --ci --code-coverage
npx nx affected --target=build --parallel=3
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.3
with:
number-of-agents: 3
2 changes: 1 addition & 1 deletion .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm ci
npx nx deploy ngx-cookieconsent-demo
npx nx deploy demo
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
/dist
/tmp
/out-tsc
/bin

# dependencies
/node_modules
.pnpm-store

# IDEs and editors
/.idea
Expand All @@ -26,6 +28,7 @@

# misc
/.angular/cache
/.nx/cache
/.sass-cache
/connect.lock
/coverage
Expand All @@ -34,6 +37,7 @@ npm-debug.log
yarn-error.log
testem.log
/typings
v8-compile-cache-0

# System Files
.DS_Store
Expand Down
6 changes: 3 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
npx --no -- commitlint --edit "$1"
6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx nx affected:test --parallel
#npx nx affected --target test --parallel
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

/dist
/coverage

/.nx/cache
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"singleQuote": true
}
}
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"recommendations": [
"angular.ng-template",
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner"
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
]
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,9 @@ Every Nx plugin relies on the underlying Nx Workspace/DevKit it runs on. This ta

| Library Version | Angular version
| -------------- | --------------------
| `>=v4.x.1` | `>=v14.x.x`
| `v3.0.1` | `>=v12.x.x`
| `>=v5.0.0` | `>=v15.x.x`
| `>=v4.0.1` | `>=v14.x.x`
| `v3.0.1` | `>=v12.x.x`
| `>=v2.2.3` | `>=v6.x.x`
| `v1.1.0` | `<v6.x.x`

Expand Down
Loading

0 comments on commit e34b18a

Please sign in to comment.