Skip to content

Commit

Permalink
chore(angular-query): integration tests angular 16 up to 18
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoud-dv committed Jun 16, 2024
1 parent ac8f48a commit 4f569d1
Show file tree
Hide file tree
Showing 41 changed files with 9,315 additions and 1,109 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AngularCliStandalone17
# AngularCli16

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.0.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.2.14.

## Development server

Expand Down
107 changes: 107 additions & 0 deletions integrations/angular-cli-16/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"analytics": false,
"packageManager": "pnpm",
"cache": {
"enabled": false
}
},
"newProjectRoot": "projects",
"projects": {
"angular-cli-16": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"skipTests": true
},
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:interceptor": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:resolver": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/angular-cli-16",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "angular-cli-16:build:production"
},
"development": {
"browserTarget": "angular-cli-16:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular-cli-16:build"
}
}
}
}
}
}
40 changes: 40 additions & 0 deletions integrations/angular-cli-16/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "angular-cli-16",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development"
},
"private": true,
"dependencies": {
"@angular/animations": "^16.2.0",
"@angular/common": "^16.2.0",
"@angular/compiler": "^16.2.0",
"@angular/core": "^16.2.0",
"@angular/forms": "^16.2.0",
"@angular/platform-browser": "^16.2.0",
"@tanstack/angular-query-experimental": "workspace:*",
"@tanstack/angular-query-devtools-experimental": "workspace:*",
"@angular/platform-browser-dynamic": "^16.2.0",
"@angular/router": "^16.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
"dependenciesMeta": {
"@tanstack/angular-query-experimental": {
"injected": true
},
"@tanstack/angular-query-devtools-experimental": {
"injected": true
}
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.2.14",
"@angular/cli": "^16.2.14",
"@angular/compiler-cli": "^16.2.0",
"typescript": "~5.1.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental'
import { ChangeDetectionStrategy, Component } from '@angular/core'
import { CommonModule } from '@angular/common'
import { injectQuery } from '@tanstack/angular-query-experimental'

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-root',
standalone: true,
template: `
<div *ngIf="query.isPending()">Loading...</div>
<div *ngIf="query.error()">An error has occurred!</div>
Expand All @@ -15,7 +11,8 @@ import { injectQuery } from '@tanstack/angular-query-experimental'
</div>
<angular-query-devtools initialIsOpen />
`,
imports: [AngularQueryDevtools, CommonModule],
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent {
/**
Expand All @@ -25,7 +22,7 @@ export class AppComponent {
queryKey: ['test'],
queryFn: async () => {
await new Promise((r) => setTimeout(r, 1000))
return 'Success'
return 'Data'
},
}))
}
18 changes: 18 additions & 0 deletions integrations/angular-cli-16/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NgIf } from '@angular/common'
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimental'
import {
QueryClient,
provideAngularQuery,
} from '@tanstack/angular-query-experimental'

import { AppComponent } from './app.component'

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularQueryDevtools, NgIf],
providers: [provideAngularQuery(new QueryClient())],
bootstrap: [AppComponent],
})
export class AppModule {}
Binary file added integrations/angular-cli-16/src/favicon.ico
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>AngularCliStandalone17</title>
<title>AngularCli16</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
Expand Down
7 changes: 7 additions & 0 deletions integrations/angular-cli-16/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'

import { AppModule } from './app/app.module'

platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch((err) => console.error(err))
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
Expand Down
42 changes: 42 additions & 0 deletions integrations/angular-cli-17/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

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

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
27 changes: 27 additions & 0 deletions integrations/angular-cli-17/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# AngularCli17

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.8.

## 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.

## 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`.

## Build

Run `ng 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 [Karma](https://karma-runner.github.io).

## Running end-to-end tests

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.

## 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.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"analytics": false,
"packageManager": "pnpm",
"analytics": false
"cache": {
"enabled": false
}
},
"newProjectRoot": "projects",
"projects": {
"angular-cli-standalone-17": {
"angular-cli-17": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
Expand Down Expand Up @@ -44,7 +47,7 @@
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/angular-cli-standalone-17",
"outputPath": "dist/angular-cli-17",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
Expand Down Expand Up @@ -81,18 +84,18 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "angular-cli-standalone-17:build:production"
"buildTarget": "angular-cli-17:build:production"
},
"development": {
"buildTarget": "angular-cli-standalone-17:build:development"
"buildTarget": "angular-cli-17:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "angular-cli-standalone-17:build"
"buildTarget": "angular-cli-17:build"
}
}
}
Expand Down
Loading

0 comments on commit 4f569d1

Please sign in to comment.