Skip to content

Commit 3a3d5cf

Browse files
dominicbachmanngeromegrignon
authored andcommitted
chore: modify package name from @ngneat/query to @openng/query
1 parent 1444021 commit 3a3d5cf

21 files changed

Lines changed: 136 additions & 57 deletions

File tree

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: '@openng/query'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Cache node modules
16+
uses: actions/cache@v4
17+
env:
18+
cache-name: cache-node-modules
19+
with:
20+
path: ~/.npm
21+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-build-${{ env.cache-name }}-
24+
${{ runner.os }}-build-
25+
${{ runner.os }}-
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: '22'
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm i
33+
34+
- name: Run Lint
35+
run: npm run lint:all
36+
37+
- name: Run Build
38+
run: npm run build:all
39+
40+
- name: Run tests
41+
run: npm run test:all

.github/workflows/gh-pages.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy playground to GitHub pages
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
jobs:
12+
deploy:
13+
environment:
14+
name: github-pages
15+
url: ${{ steps.deployment.outputs.page_url }}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
cache: 'npm'
23+
- name: Install and Build
24+
run: |
25+
npm i
26+
npx nx build query-playground -- --base-href /query/
27+
- name: Duplicated index.html
28+
run: |
29+
cp dist/query-playground/index.html dist/query-playground/404.html
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v2
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v1
34+
with:
35+
path: './dist/query-playground'
36+
- name: Deploy to GitHub Pages
37+
id: deployment
38+
uses: actions/deploy-pages@v1

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Get rid of granular state management, manual refetching, and async spaghetti cod
2525

2626
<hr />
2727

28-
[![@ngneat/query](https://github.com/ngneat/query/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ngneat/query/actions/workflows/ci.yml)
28+
[![@openng/query](https://github.com/openng-foundation/query/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/openng/query/actions/workflows/ci.yml)
2929
[![commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)]()
3030
[![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)]()
3131
[![coc-badge](https://img.shields.io/badge/codeof-conduct-ff69b4.svg?style=flat-square)]()
@@ -39,7 +39,7 @@ Discover the innovative approach TanStack Query takes to state management, setti
3939
## Installation
4040

4141
```
42-
npm i @ngneat/query
42+
npm i @openng/query
4343
```
4444

4545
[Stackblitz Example](https://stackblitz.com/edit/stackblitz-starters-bsrgez?file=src%2Fmain.ts)
@@ -52,7 +52,7 @@ Inject the `QueryClient` [instance](https://tanstack.com/query/v5/docs/reference
5252
function.
5353

5454
```ts
55-
import { injectQueryClient } from '@ngneat/query';
55+
import { injectQueryClient } from '@openng/query';
5656

5757
@Injectable({ providedIn: 'root' })
5858
export class TodosService {
@@ -63,7 +63,7 @@ export class TodosService {
6363
or provide `QueryClient` [instance](https://tanstack.com/query/v5/docs/reference/QueryClient) manually
6464

6565
```ts
66-
import { provideQueryClient } from '@ngneat/query';
66+
import { provideQueryClient } from '@openng/query';
6767
import { QueryClient } from '@tanstack/query-core';
6868

6969
provideQueryClient(() => new QueryClient());
@@ -72,7 +72,7 @@ provideQueryClient(() => new QueryClient());
7272
and then use with
7373

7474
```ts
75-
import { injectQueryClient } from '@ngneat/query';
75+
import { injectQueryClient } from '@openng/query';
7676

7777
...
7878
#queryClient = injectQueryClient();
@@ -85,7 +85,7 @@ import { injectQueryClient } from '@ngneat/query';
8585
Use the `injectQuery` function. Using this function is similar to the [official](https://tanstack.com/query/v5/docs/guides/queries) function.
8686

8787
```ts
88-
import { injectQuery } from '@ngneat/query';
88+
import { injectQuery } from '@openng/query';
8989

9090
@Injectable({ providedIn: 'root' })
9191
export class TodosService {
@@ -108,7 +108,7 @@ export class TodosService {
108108
> The function should run inside an injection context
109109
110110
For methods that require a `queryFn` parameter like
111-
`ensureQueryData`, `fetchQuery`, `prefetchQuery`, `fetchInfiniteQuery` and `prefetchInfiniteQuery` it's possible to use both Promises and Observables. See an example [here](https://github.com/ngneat/query/blob/main/src/app/prefetch-page/resolve.ts#L9).
111+
`ensureQueryData`, `fetchQuery`, `prefetchQuery`, `fetchInfiniteQuery` and `prefetchInfiniteQuery` it's possible to use both Promises and Observables. See an example [here](https://github.com/openng/query/blob/main/src/app/prefetch-page/resolve.ts#L9).
112112

113113
#### Component Usage - Observable
114114

@@ -165,7 +165,7 @@ export class TodosPageComponent {
165165
If you inline query options into `query`, you'll get automatic type inference. However, you might want to extract the query options into a separate function to share them between `query` and e.g. `prefetchQuery`. In that case, you'd lose type inference. To get it back, you can use `queryOptions` helper:
166166

167167
```ts
168-
import { queryOptions } from '@ngneat/query';
168+
import { queryOptions } from '@openng/query';
169169

170170
function groupOptions() {
171171
return queryOptions({
@@ -203,7 +203,7 @@ export class GroupsService {
203203
Use the `injectInfiniteQuery` function. Using this function is similar to the [official](https://tanstack.com/query/v5/docs/guides/infinite-queries) function.
204204

205205
```ts
206-
import { injectInfiniteQuery } from '@ngneat/query';
206+
import { injectInfiniteQuery } from '@openng/query';
207207

208208
@Injectable({ providedIn: 'root' })
209209
export class PostsService {
@@ -228,7 +228,7 @@ export class PostsService {
228228
Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. For this purpose, The library exports the `injectMutation`` function.
229229

230230
```ts
231-
import { injectMutation } from '@ngneat/query';
231+
import { injectMutation } from '@openng/query';
232232

233233
@Injectable({ providedIn: 'root' })
234234
export class TodosService {
@@ -310,14 +310,14 @@ export class TodosComponent {
310310
}
311311
```
312312

313-
A more in depth [example](https://github.com/ngneat/query/blob/next/src/app/mutation-page/) can be found on our playground.
313+
A more in depth [example](https://github.com/openng/query/blob/next/src/app/mutation-page/) can be found on our playground.
314314

315315
## Query Global Options
316316

317317
You can inject a default config for the underlying `@tanstack/query` instance by using the `provideQueryClientOptions({})` function.
318318

319319
```ts
320-
import { provideQueryClientOptions } from '@ngneat/query';
320+
import { provideQueryClientOptions } from '@openng/query';
321321

322322
bootstrapApplication(AppComponent, {
323323
providers: [
@@ -335,7 +335,7 @@ bootstrapApplication(AppComponent, {
335335
It accept also a function factory if you need an injection context while creating the configuration.
336336

337337
```ts
338-
import { provideQueryClientOptions } from '@ngneat/query';
338+
import { provideQueryClientOptions } from '@openng/query';
339339

340340
const withFunctionalFactory: QueryClientConfigFn = () => {
341341
const notificationService = inject(NotificationService);
@@ -367,7 +367,7 @@ It will return a new base query result that will merge the results of all the qu
367367
> **Note:** The data will only be mapped if the result is **successful** and otherwise just returned as is on **any other** state.
368368
369369
```ts
370-
import { intersectResults } from '@ngneat/query';
370+
import { intersectResults } from '@openng/query';
371371

372372
@Component({
373373
standalone: true,
@@ -506,7 +506,7 @@ const query = combineLatest([todos.result$, posts.result$]).pipe(
506506
- `createSuccessObserverResult` - Create success observer result:
507507

508508
```
509-
import { createSyncObserverResult } from '@ngneat/query';
509+
import { createSyncObserverResult } from '@openng/query';
510510
511511
result = of(createSuccessObserverResult(data))
512512
```
@@ -558,7 +558,7 @@ export class UsersPageComponent {
558558
### Observable Example
559559

560560
```ts
561-
import { injectIsFetching } from '@ngneat/query';
561+
import { injectIsFetching } from '@openng/query';
562562

563563
class TodoComponent {
564564
#isFetching = injectIsFetching();
@@ -574,7 +574,7 @@ class TodoComponent {
574574
### Signal Example
575575

576576
```ts
577-
import { injectIsFetching } from '@ngneat/query';
577+
import { injectIsFetching } from '@openng/query';
578578

579579
class TodoComponent {
580580
#isFetching = injectIsFetching();
@@ -596,7 +596,7 @@ class TodoComponent {
596596
### Observable Example
597597

598598
```ts
599-
import { injectIsMutating } from '@ngneat/query';
599+
import { injectIsMutating } from '@openng/query';
600600

601601
class TodoComponent {
602602
#isMutating = injectIsMutating();
@@ -612,7 +612,7 @@ class TodoComponent {
612612
### Signal Example
613613

614614
```ts
615-
import { injectIsMutating } from '@ngneat/query';
615+
import { injectIsMutating } from '@openng/query';
616616

617617
class TodoComponent {
618618
#isMutating = injectIsMutating();
@@ -652,7 +652,7 @@ export function provideQueryConfig(config: {
652652
### Mock Example
653653

654654
```ts
655-
import { provideQueryConfig } from '@ngneat/query';
655+
import { provideQueryConfig } from '@openng/query';
656656

657657
const queryMock = {
658658
use: () => ({
@@ -671,10 +671,10 @@ query({ ... }).result() // you can call query from your custom query mock
671671

672672
## Devtools
673673

674-
Install the `@ngneat/query-devtools` package. Lazy load and use it only in `development` environment:
674+
Install the `@openng/query-devtools` package. Lazy load and use it only in `development` environment:
675675

676676
```ts
677-
import { provideQueryDevTools } from '@ngneat/query-devtools';
677+
import { provideQueryDevTools } from '@openng/query-devtools';
678678
import { environment } from 'src/environments/environment';
679679

680680
bootstrapApplication(AppComponent, {
@@ -689,7 +689,7 @@ See all the avilable options [here](https://tanstack.com/query/v5/docs/react/dev
689689
On the Server:
690690

691691
```ts
692-
import { provideQueryClient } from '@ngneat/query';
692+
import { provideQueryClient } from '@openng/query';
693693
import { QueryClient, dehydrate } from '@tanstack/query-core';
694694
import { renderApplication } from '@angular/platform-server';
695695

@@ -715,7 +715,7 @@ Client:
715715
```ts
716716
import { importProvidersFrom } from '@angular/core';
717717
import { bootstrapApplication, BrowserModule } from '@angular/platform-browser';
718-
import { provideQueryClient } from '@ngneat/query';
718+
import { provideQueryClient } from '@openng/query';
719719
import { QueryClient, hydrate } from '@tanstack/query-core';
720720

721721
const queryClient = new QueryClient();
@@ -737,7 +737,7 @@ bootstrapApplication(AppComponent, {
737737
The `queryFn` run inside an injection context so we can do the following if we want:
738738

739739
```ts
740-
import { injectQuery } from '@ngneat/query';
740+
import { injectQuery } from '@openng/query';
741741

742742
export function getTodos() {
743743
const query = injectQuery();
@@ -787,4 +787,4 @@ export function getTodos({ injector }: { injector: Injector }) {
787787
</tr>
788788
</table>
789789

790-
Thank goes to all these wonderful [people who contributed](https://github.com/ngneat/query/graphs/contributors) ❤️
790+
Thank goes to all these wonderful [people who contributed](https://github.com/openng/query/graphs/contributors) ❤️

devtools/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# ngneat/query-devtools
1+
# openng/query-devtools
22

33
Wave your hands in the air and shout hooray because Angular Query comes with dedicated devtools! 🥳
44

55
When you begin your Angular Query journey, you'll want these devtools by your side. They help visualize all of the inner workings of Angular Query and will likely save you hours of debugging if you find yourself in a pinch!
66

7-
Install the `@ngneat/query-devtools` package. Lazy load and use it only in `development` environment:
7+
Install the `@openng/query-devtools` package. Lazy load and use it only in `development` environment:
88

99
```ts
10-
import { provideQueryDevTools } from '@ngneat/query';
10+
import { provideQueryDevTools } from '@openng/query';
1111
import { environment } from 'src/environments/environment';
1212

1313
bootstrapApplication(AppComponent, {
@@ -26,7 +26,7 @@ If you would like to lazy-load devtools in production, you can use something sim
2626
```ts
2727
import { onlineManager } from '@tanstack/query-core';
2828
import { APP_INITIALIZER } from '@angular/core';
29-
import { injectQueryClient } from '@ngneat/query';
29+
import { injectQueryClient } from '@openng/query';
3030

3131
export const appConfig: ApplicationConfig = {
3232
providers: [
@@ -49,7 +49,7 @@ function provideLazyQueryDevTools() {
4949
import('@tanstack/query-devtools').then((d) => {
5050
new d.TanstackQueryDevtools({
5151
client,
52-
queryFlavor: '@ngneat/query',
52+
queryFlavor: '@openng/query',
5353
version: '5',
5454
position: 'bottom',
5555
initialIsOpen: true,

devtools/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "@ngneat/query-devtools",
2+
"name": "@openng/query-devtools",
33
"version": "2.1.1",
4-
"description": "Developer tools to interact with and visualize the ngneat/query cache",
4+
"description": "Developer tools to interact with and visualize the openng/query cache",
55
"license": "MIT",
6-
"repository": "ngneat/query",
7-
"homepage": "https://github.com/ngneat",
6+
"repository": "openng-foundation/query",
7+
"homepage": "https://github.com/openng-foundation",
88
"funding": {
99
"type": "github",
10-
"url": "https://github.com/sponsors/ngneat"
10+
"url": "https://github.com/sponsors/openng-foundation"
1111
},
1212
"peerDependencies": {
1313
"@angular/core": ">=16.0.0 <=21.x.x",

devtools/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
makeEnvironmentProviders,
66
} from '@angular/core';
77
import { TanstackQueryDevtoolsConfig } from '@tanstack/query-devtools';
8-
import { injectQueryClient } from '@ngneat/query';
8+
import { injectQueryClient } from '@openng/query';
99

1010
export function provideQueryDevTools(
1111
devToolOptions: Partial<Omit<TanstackQueryDevtoolsConfig, 'client'>> = {},

devtools/src/lib/devtools/devtools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
export function queryDevtools({
1212
queryClient,
1313
destroyRef,
14-
queryFlavor = '@ngneat/query',
14+
queryFlavor = '@openng/query',
1515
version = '5',
1616
onlineManager = QueryCoreOnlineManager,
1717
initialIsOpen = false,

query/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "@ngneat/query",
2+
"name": "@openng/query",
33
"version": "3.4.0",
44
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Angular",
55
"license": "MIT",
6-
"repository": "ngneat/query",
7-
"homepage": "https://github.com/ngneat",
6+
"repository": "openng-foundation/query",
7+
"homepage": "https://github.com/openng-foundation",
88
"funding": {
99
"type": "github",
10-
"url": "https://github.com/sponsors/ngneat"
10+
"url": "https://github.com/sponsors/openng-foundation"
1111
},
1212
"peerDependencies": {
1313
"@tanstack/query-core": "^5.99.0",

0 commit comments

Comments
 (0)