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

Commit

Permalink
refactor(nxext): refactor packages
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikPieper committed Apr 19, 2024
1 parent 1ff5540 commit ff79b58
Show file tree
Hide file tree
Showing 63 changed files with 430 additions and 580 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ jobs:
# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
- run: pnpm install --no-frozen-lockfile
- uses: nrwl/nx-set-shas@v4
- uses:
nrwl/nx-set-shas@v3
# This line is needed for nx affected to work when CI is running on a PR
- run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' }}
#- uses: nrwl/nx-set-shas@v4
#- run: pnpm exec nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"

- run: pnpm exec nx-cloud record -- nx format:check
- run: pnpm exec nx affected -t lint test build
#- run: pnpm exec nx-cloud record -- nx format:check
- run: pnpm exec nx affected -t lint test build e2e
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
/build

/.nx/cache


pnpm-lock.yaml
2 changes: 1 addition & 1 deletion docs/docs/ionic-angular/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Skip formatting files.

#### standalone

Default: `false`
Default: `true`

Type: `boolean`

Expand Down
1 change: 1 addition & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const nxPreset = require('@nx/jest/preset').default;

module.exports = {
...nxPreset,
testTimeout: 500000,
Expand Down
1 change: 0 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"!{projectRoot}/eslint.config.js"
]
},
"nxCloudAccessToken": "NTlhMGE3ZTYtYjk5OC00Mzc5LWE2ZTAtNzE4ODEzNDY5MjlmfHJlYWQ=",
"parallel": 1,
"pluginsConfig": {
"@nx/js": {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@nx/cypress": "18.3.1",
"@nx/devkit": "18.3.1",
"@nx/eslint": "18.3.1",
"@nx/webpack": "18.3.1",
"@nx/eslint-plugin": "18.3.1",
"@nx/jest": "18.3.1",
"@nx/js": "18.3.1",
Expand Down Expand Up @@ -128,10 +129,10 @@
},
"lint-staged": {
"nx.json": [
"yarn format --uncommitted"
"pnpm format --uncommitted"
],
"*.{js,json,css,scss,md,ts,html,graphql}": [
"yarn format --uncommitted"
"pnpm format --uncommitted"
]
},
"config": {
Expand Down
10 changes: 4 additions & 6 deletions packages/capacitor/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"name": "@nxext/capacitor",
"version": "18.0.4",
"version": "18.0.0",
"description": "An Nx plugin for developing cross-platform applications using Capacitor",
"author": {
"name": "Devin Shoemaker",
"email": "[email protected]"
},
"homepage": "https://nxext.github.io/nx-extensions-ionic/docs/capacitor/getting-started.html",
"repository": {
"type": "git",
Expand All @@ -28,5 +24,7 @@
"ignore": "^5.3.1",
"tslib": "^2.3.0"
},
"peerDependencies": {}
"peerDependencies": {
"@nx/web": "^18.3.0"
}
}
7 changes: 7 additions & 0 deletions packages/capacitor/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
export {
createNodes,
PlaywrightPluginOptions,
createDependencies,
} from './src/plugins/plugin';
*/
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ export async function capacitorProjectGenerator(
}

export default capacitorProjectGenerator;
export const capacitorProjectSchematic = convertNxGenerator(
capacitorProjectGenerator
);
5 changes: 5 additions & 0 deletions packages/capacitor/src/plugins/plugin.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
xdescribe('Plugin', () => {
beforeEach(() => {});

it('', async () => {});
});
Empty file.
2 changes: 1 addition & 1 deletion packages/capacitor/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const capacitorVersion = '^5.0.3';
export const capacitorVersion = '^6.0.0';
7 changes: 1 addition & 6 deletions packages/ionic-angular/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ module.exports = {
preset: '../../jest.preset.js',
globals: {},
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
'^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/ionic-angular',
Expand Down
13 changes: 8 additions & 5 deletions packages/ionic-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@nxext/ionic-angular",
"version": "18.0.4",
"version": "18.0.0",
"description": "An Nx plugin for developing Ionic React applications and libraries",
"author": {
"name": "Devin Shoemaker",
"email": "[email protected]"
"name": "Dominik Pieper",
"email": "[email protected]"
},
"homepage": "https://nxext.github.io/nx-extensions-ionic/docs/ionic-angular/overview.html",
"repository": {
Expand All @@ -25,7 +25,7 @@
"schematics": "./generators.json",
"builders": "./executors.json",
"dependencies": {
"@nxext/capacitor": "^18.0.4",
"@nxext/capacitor": "18.0.0",
"@nx/devkit": "18.3.1",
"@nx/eslint": "18.3.1",
"@nx/angular": "18.3.1",
Expand All @@ -34,5 +34,8 @@
"typescript": "5.4.5",
"tslib": "^2.3.0"
},
"peerDependencies": {}
"peerDependencies": {
"@nx/angular": "^18.3.0",
"@nx/eslint": "^18.3.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { TestBed } from '@angular/core/testing';

import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}).compileComponents();
});

it('should create the app', () => {
TestBed.overrideComponent(AppComponent, {
add: {
imports: [RouterTestingModule]
}
});
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

});
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { Component } from '@angular/core';
import {IonicModule} from '@ionic/angular';
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';

@Component({
selector: '<%= prefix %>-root',
selector: 'app-root',
templateUrl: 'app.component.html',
standalone: true,
imports: [IonicModule],
template: `
<ion-app>
<ion-router-outlet></ion-router-outlet>
</ion-app>
`,
styles: `

`
imports: [IonApp, IonRouterOutlet],
})
export class AppComponent {
constructor() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,19 @@
* For more information on global stylesheets, visit the documentation:
* https://ionicframework.com/docs/layout/global-stylesheets
*/

/* Core CSS required for Ionic components to work properly */
@import "@ionic/angular/css/core.css";

/* Basic CSS for apps built with Ionic */
@import "@ionic/angular/css/normalize.css";
@import "@ionic/angular/css/structure.css";
@import "@ionic/angular/css/typography.css";
@import "@ionic/angular/css/display.css";

/* Optional CSS utils that can be commented out */
@import "@ionic/angular/css/padding.css";
@import "@ionic/angular/css/float-elements.css";
@import "@ionic/angular/css/text-alignment.css";
@import "@ionic/angular/css/text-transformation.css";
@import "@ionic/angular/css/flex-utils.css";
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,11 @@
--ion-card-background: #1e1e1e;
}
}

html {
/*
* For more information on dynamic font scaling, visit the documentation:
* https://ionicframework.com/docs/layout/dynamic-font-scaling
*/
--ion-dynamic-font: var(--ion-default-dynamic-font);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
it('should create the app', () => {
TestBed.overrideComponent(AppComponent, {
add: {
imports: [RouterTestingModule]
}
});
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import {Component} from '@angular/core';
import {CommonModule} from '@angular/common';
import {IonicModule} from '@ionic/angular';
import { Component } from '@angular/core';
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';

@Component({
selector: '<%= prefix %>-root',
templateUrl: 'app.component.html',
standalone: true,
imports: [CommonModule, IonicModule],
template: `
<ion-app>
<ion-router-outlet></ion-router-outlet>
</ion-app>
`,
styles: ``
imports: [IonApp, IonRouterOutlet],
})

export class AppComponent {}
export class AppComponent {
constructor() {}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { ApplicationConfig, importProvidersFrom } from '@angular/core';
import { provideRouter } from '@angular/router';
import { ApplicationConfig } from '@angular/core';
import { RouteReuseStrategy, provideRouter } from '@angular/router';
import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular/standalone';

import { appRoutes } from './app.routes';
import {IonicModule} from '@ionic/angular';

export const appConfig: ApplicationConfig = {
providers: [
provideRouter(appRoutes),
importProvidersFrom(
IonicModule.forRoot()
)

{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
provideIonicAngular(),
provideRouter(appRoutes)
],
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { NgModule } from '@angular/core';
import {Routes} from '@angular/router';
import { Routes } from '@angular/router';

export const appRoutes: Routes = [
{
path: '',
loadChildren: () => import('./tabs/tabs.routes').then(r => r.routes)
}
loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
},
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div id="container">
<strong>{{ name }}</strong>
<p>
Explore
<a
target="_blank"
rel="noopener noreferrer"
href="https://ionicframework.com/docs/components"
>UI Components</a
>
</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#container {
text-align: center;

position: absolute;
left: 0;
right: 0;
top: 50%;
transform: translateY(-50%);
}

#container strong {
font-size: 20px;
line-height: 26px;
}

#container p {
font-size: 16px;
line-height: 22px;

color: #8c8c8c;

margin: 0;
}

#container a {
text-decoration: none;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';

import { ExploreContainerComponent } from './explore-container.component';

Expand All @@ -8,11 +7,6 @@ describe('ExploreContainerComponent', () => {
let fixture: ComponentFixture<ExploreContainerComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ExploreContainerComponent],
imports: [IonicModule.forRoot()]
}).compileComponents();

fixture = TestBed.createComponent(ExploreContainerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
Loading

0 comments on commit ff79b58

Please sign in to comment.