Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Commit f62f3c6

Browse files
committed
refactor(nxext): refactor packages
1 parent 1ff5540 commit f62f3c6

File tree

63 files changed

+461
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+461
-601
lines changed

.github/workflows/ci.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# Cache node_modules
2525
- uses: actions/setup-node@v3
2626
with:
27-
node-version: 18
27+
node-version: 18.18
2828
cache: 'pnpm'
2929
- uses: actions/cache@v4
3030
with:
@@ -34,8 +34,13 @@ jobs:
3434
# Connect your workspace on nx.app and uncomment this to enable task distribution.
3535
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
3636
- run: pnpm install --no-frozen-lockfile
37-
- uses: nrwl/nx-set-shas@v4
37+
- uses:
38+
nrwl/nx-set-shas@v3
39+
# This line is needed for nx affected to work when CI is running on a PR
40+
- run: git branch --track main origin/main
41+
if: ${{ github.event_name == 'pull_request' }}
42+
#- uses: nrwl/nx-set-shas@v4
3843
#- run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
3944

40-
- run: pnpm exec nx-cloud record -- nx format:check
41-
- run: pnpm exec nx affected -t lint test build
45+
#- run: pnpm exec nx-cloud record -- nx format:check
46+
- run: pnpm exec nx affected -t lint test build e2e

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
/build
88

99
/.nx/cache
10+
11+
1012
pnpm-lock.yaml

docs/docs/ionic-angular/generators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Skip formatting files.
7070

7171
#### standalone
7272

73-
Default: `false`
73+
Default: `true`
7474

7575
Type: `boolean`
7676

jest.preset.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const nxPreset = require('@nx/jest/preset').default;
2+
23
module.exports = {
34
...nxPreset,
45
testTimeout: 500000,

nx.json

-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
"!{projectRoot}/eslint.config.js"
119119
]
120120
},
121-
"nxCloudAccessToken": "NTlhMGE3ZTYtYjk5OC00Mzc5LWE2ZTAtNzE4ODEzNDY5MjlmfHJlYWQ=",
122121
"parallel": 1,
123122
"pluginsConfig": {
124123
"@nx/js": {

package.json

+9-5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"@nx/cypress": "18.3.1",
5959
"@nx/devkit": "18.3.1",
6060
"@nx/eslint": "18.3.1",
61+
"@nx/webpack": "18.3.1",
6162
"@nx/eslint-plugin": "18.3.1",
6263
"@nx/jest": "18.3.1",
6364
"@nx/js": "18.3.1",
@@ -100,9 +101,12 @@
100101
"husky": "^9.0.11",
101102
"ignore": "^5.3.1",
102103
"is-ci": "^3.0.1",
103-
"jest": "29.7.0",
104-
"jest-environment-jsdom": "29.7.0",
105-
"jest-environment-node": "^29.7.0",
104+
"jest": "29.4.3",
105+
"jest-environment-jsdom": "29.4.3",
106+
"jest-environment-node": "^29.4.1",
107+
"jest-resolve": "^29.4.1",
108+
"jest-runtime": "^29.4.1",
109+
"jest-util": "^29.4.1",
106110
"jsonc-eslint-parser": "^2.3.0",
107111
"jsonc-parser": "^3.2.1",
108112
"kill-port": "^2.0.1",
@@ -128,10 +132,10 @@
128132
},
129133
"lint-staged": {
130134
"nx.json": [
131-
"yarn format --uncommitted"
135+
"pnpm format --uncommitted"
132136
],
133137
"*.{js,json,css,scss,md,ts,html,graphql}": [
134-
"yarn format --uncommitted"
138+
"pnpm format --uncommitted"
135139
]
136140
},
137141
"config": {

packages/capacitor/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"name": "@nxext/capacitor",
3-
"version": "18.0.4",
3+
"version": "18.0.0",
44
"description": "An Nx plugin for developing cross-platform applications using Capacitor",
5-
"author": {
6-
"name": "Devin Shoemaker",
7-
"email": "[email protected]"
8-
},
95
"homepage": "https://nxext.github.io/nx-extensions-ionic/docs/capacitor/getting-started.html",
106
"repository": {
117
"type": "git",
@@ -28,5 +24,7 @@
2824
"ignore": "^5.3.1",
2925
"tslib": "^2.3.0"
3026
},
31-
"peerDependencies": {}
27+
"peerDependencies": {
28+
"@nx/web": "^18.3.0"
29+
}
3230
}

packages/capacitor/plugin.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
export {
3+
createNodes,
4+
PlaywrightPluginOptions,
5+
createDependencies,
6+
} from './src/plugins/plugin';
7+
*/

packages/capacitor/src/generators/capacitor-project/generator.ts

-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,3 @@ export async function capacitorProjectGenerator(
2626
}
2727

2828
export default capacitorProjectGenerator;
29-
export const capacitorProjectSchematic = convertNxGenerator(
30-
capacitorProjectGenerator
31-
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
xdescribe('Plugin', () => {
2+
beforeEach(() => {});
3+
4+
it('', async () => {});
5+
});

packages/capacitor/src/plugins/plugin.ts

Whitespace-only changes.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const capacitorVersion = '^5.0.3';
1+
export const capacitorVersion = '^6.0.0';

packages/ionic-angular/jest.config.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ module.exports = {
44
preset: '../../jest.preset.js',
55
globals: {},
66
transform: {
7-
'^.+\\.[tj]s$': [
8-
'ts-jest',
9-
{
10-
tsconfig: '<rootDir>/tsconfig.spec.json',
11-
},
12-
],
7+
'^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
138
},
149
moduleFileExtensions: ['ts', 'js', 'html'],
1510
coverageDirectory: '../../coverage/packages/ionic-angular',

packages/ionic-angular/package.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@nxext/ionic-angular",
3-
"version": "18.0.4",
3+
"version": "18.0.0",
44
"description": "An Nx plugin for developing Ionic React applications and libraries",
55
"author": {
6-
"name": "Devin Shoemaker",
7-
"email": "[email protected]"
6+
"name": "Dominik Pieper",
7+
"email": "[email protected]"
88
},
99
"homepage": "https://nxext.github.io/nx-extensions-ionic/docs/ionic-angular/overview.html",
1010
"repository": {
@@ -25,7 +25,7 @@
2525
"schematics": "./generators.json",
2626
"builders": "./executors.json",
2727
"dependencies": {
28-
"@nxext/capacitor": "^18.0.4",
28+
"@nxext/capacitor": "18.0.0",
2929
"@nx/devkit": "18.3.1",
3030
"@nx/eslint": "18.3.1",
3131
"@nx/angular": "18.3.1",
@@ -34,5 +34,8 @@
3434
"typescript": "5.4.5",
3535
"tslib": "^2.3.0"
3636
},
37-
"peerDependencies": {}
37+
"peerDependencies": {
38+
"@nx/angular": "^18.3.0",
39+
"@nx/eslint": "^18.3.0"
40+
}
3841
}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
21
import { TestBed } from '@angular/core/testing';
3-
2+
import { RouterTestingModule } from '@angular/router/testing';
43
import { AppComponent } from './app.component';
54

65
describe('AppComponent', () => {
7-
8-
beforeEach(async () => {
9-
await TestBed.configureTestingModule({
10-
declarations: [AppComponent],
11-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
12-
}).compileComponents();
13-
});
14-
156
it('should create the app', () => {
7+
TestBed.overrideComponent(AppComponent, {
8+
add: {
9+
imports: [RouterTestingModule]
10+
}
11+
});
1612
const fixture = TestBed.createComponent(AppComponent);
1713
const app = fixture.componentInstance;
1814
expect(app).toBeTruthy();
1915
});
20-
2116
});

packages/ionic-angular/src/generators/application/files/base-standalone/src/app/app.component.ts.template

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
import { Component } from '@angular/core';
2-
import {IonicModule} from '@ionic/angular';
2+
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
33

44
@Component({
5-
selector: '<%= prefix %>-root',
5+
selector: 'app-root',
6+
templateUrl: 'app.component.html',
67
standalone: true,
7-
imports: [IonicModule],
8-
template: `
9-
<ion-app>
10-
<ion-router-outlet></ion-router-outlet>
11-
</ion-app>
12-
`,
13-
styles: `
14-
15-
`
8+
imports: [IonApp, IonRouterOutlet],
169
})
1710
export class AppComponent {
1811
constructor() {}

packages/ionic-angular/src/generators/application/files/base-standalone/src/styles.scss.template

+16
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,19 @@
88
* For more information on global stylesheets, visit the documentation:
99
* https://ionicframework.com/docs/layout/global-stylesheets
1010
*/
11+
12+
/* Core CSS required for Ionic components to work properly */
13+
@import "@ionic/angular/css/core.css";
14+
15+
/* Basic CSS for apps built with Ionic */
16+
@import "@ionic/angular/css/normalize.css";
17+
@import "@ionic/angular/css/structure.css";
18+
@import "@ionic/angular/css/typography.css";
19+
@import "@ionic/angular/css/display.css";
20+
21+
/* Optional CSS utils that can be commented out */
22+
@import "@ionic/angular/css/padding.css";
23+
@import "@ionic/angular/css/float-elements.css";
24+
@import "@ionic/angular/css/text-alignment.css";
25+
@import "@ionic/angular/css/text-transformation.css";
26+
@import "@ionic/angular/css/flex-utils.css";

packages/ionic-angular/src/generators/application/files/base-standalone/src/theme/variables.scss.template

+8
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,11 @@
234234
--ion-card-background: #1e1e1e;
235235
}
236236
}
237+
238+
html {
239+
/*
240+
* For more information on dynamic font scaling, visit the documentation:
241+
* https://ionicframework.com/docs/layout/dynamic-font-scaling
242+
*/
243+
--ion-dynamic-font: var(--ion-default-dynamic-font);
244+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { RouterTestingModule } from '@angular/router/testing';
3+
import { AppComponent } from './app.component';
4+
5+
describe('AppComponent', () => {
6+
it('should create the app', () => {
7+
TestBed.overrideComponent(AppComponent, {
8+
add: {
9+
imports: [RouterTestingModule]
10+
}
11+
});
12+
const fixture = TestBed.createComponent(AppComponent);
13+
const app = fixture.componentInstance;
14+
expect(app).toBeTruthy();
15+
});
16+
});
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
import {Component} from '@angular/core';
2-
import {CommonModule} from '@angular/common';
3-
import {IonicModule} from '@ionic/angular';
1+
import { Component } from '@angular/core';
2+
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
43

54
@Component({
65
selector: '<%= prefix %>-root',
6+
templateUrl: 'app.component.html',
77
standalone: true,
8-
imports: [CommonModule, IonicModule],
9-
template: `
10-
<ion-app>
11-
<ion-router-outlet></ion-router-outlet>
12-
</ion-app>
13-
`,
14-
styles: ``
8+
imports: [IonApp, IonRouterOutlet],
159
})
16-
17-
export class AppComponent {}
10+
export class AppComponent {
11+
constructor() {}
12+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
2-
import { provideRouter } from '@angular/router';
1+
import { ApplicationConfig } from '@angular/core';
2+
import { RouteReuseStrategy, provideRouter } from '@angular/router';
3+
import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular/standalone';
4+
35
import { appRoutes } from './app.routes';
4-
import {IonicModule} from '@ionic/angular';
56

67
export const appConfig: ApplicationConfig = {
78
providers: [
8-
provideRouter(appRoutes),
9-
importProvidersFrom(
10-
IonicModule.forRoot()
11-
)
12-
9+
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
10+
provideIonicAngular(),
11+
provideRouter(appRoutes)
1312
],
1413
};
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { NgModule } from '@angular/core';
2-
import {Routes} from '@angular/router';
1+
import { Routes } from '@angular/router';
32

43
export const appRoutes: Routes = [
54
{
65
path: '',
7-
loadChildren: () => import('./tabs/tabs.routes').then(r => r.routes)
8-
}
6+
loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
7+
},
98
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div id="container">
2+
<strong>{{ name }}</strong>
3+
<p>
4+
Explore
5+
<a
6+
target="_blank"
7+
rel="noopener noreferrer"
8+
href="https://ionicframework.com/docs/components"
9+
>UI Components</a
10+
>
11+
</p>
12+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#container {
2+
text-align: center;
3+
4+
position: absolute;
5+
left: 0;
6+
right: 0;
7+
top: 50%;
8+
transform: translateY(-50%);
9+
}
10+
11+
#container strong {
12+
font-size: 20px;
13+
line-height: 26px;
14+
}
15+
16+
#container p {
17+
font-size: 16px;
18+
line-height: 22px;
19+
20+
color: #8c8c8c;
21+
22+
margin: 0;
23+
}
24+
25+
#container a {
26+
text-decoration: none;
27+
}

0 commit comments

Comments
 (0)