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

refactor(nxext): refactor packages #31

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
pull_request:

permissions:
Expand All @@ -18,24 +18,34 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
# Cache node_modules
- uses: actions/setup-node@v3
run_install: false

- uses: actions/setup-node@v4
with:
node-version: 18
check-latest: true
cache: 'pnpm'

- uses: actions/cache@v4
with:
lookup-only: true
path: '**/node_modules'
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}

# 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

# 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' }}

#- 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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
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
2 changes: 1 addition & 1 deletion e2e/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function createTestProject() {
});

execSync(
`npx --yes create-nx-workspace@latest ${projectName} --preset empty --nxCloud skip --no-interactive`,
`npx --yes create-nx-workspace@latest ${projectName} --preset ts --nxCloud skip --no-interactive`,
{
cwd: dirname(projectDirectory),
stdio: 'inherit',
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
48 changes: 25 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,36 @@
"private": true,
"packageManager": "[email protected]",
"devDependencies": {
"@angular-devkit/core": "17.3.5",
"@angular-devkit/schematics": "17.3.4",
"@angular-devkit/core": "17.3.8",
"@angular-devkit/schematics": "17.3.8",
"@eslint/eslintrc": "^2.1.1",
"@eslint/js": "8.49.0",
"@nuxt/kit": "3.10.3",
"@nx/angular": "18.3.1",
"@nx/cypress": "18.3.1",
"@nx/devkit": "18.3.1",
"@nx/eslint": "18.3.1",
"@nx/eslint-plugin": "18.3.1",
"@nx/jest": "18.3.1",
"@nx/js": "18.3.1",
"@nx/node": "18.3.1",
"@nx/playwright": "18.3.1",
"@nx/plugin": "18.3.1",
"@nx/react": "18.3.1",
"@nx/storybook": "18.3.1",
"@nx/vite": "18.3.1",
"@nx/web": "18.3.1",
"@nx/workspace": "18.3.1",
"@nx/angular": "18.3.5",
"@nx/cypress": "18.3.5",
"@nx/devkit": "18.3.5",
"@nx/eslint": "18.3.5",
"@nx/webpack": "18.3.5",
"@nx/eslint-plugin": "18.3.5",
"@nx/jest": "18.3.5",
"@nx/js": "18.3.5",
"@nx/node": "18.3.5",
"@nx/playwright": "18.3.5",
"@nx/plugin": "18.3.5",
"@nx/react": "18.3.5",
"@nx/storybook": "18.3.5",
"@nx/vite": "18.3.5",
"@nx/web": "18.3.5",
"@nx/workspace": "18.3.5",
"@nxext/svelte": "^18.0.0",
"@phenomnomnominal/tsquery": "~5.0.1",
"@schematics/angular": "17.3.4",
"@schematics/angular": "17.3.8",
"@stencil/core": "3.4.0",
"@swc-node/register": "1.8.0",
"@swc/cli": "0.1.62",
"@swc/core": "^1.3.85",
"@swc/jest": "^0.2.20",
"@swc/core": "~1.4.13",
"@swc/helpers": "~0.5.2",
"@swc/jest": "~0.2.20",
"@types/glob": "^8.1.0",
"@types/globrex": "^0.1.2",
"@types/is-ci": "^3.0.1",
Expand Down Expand Up @@ -107,7 +109,7 @@
"jsonc-parser": "^3.2.1",
"kill-port": "^2.0.1",
"lint-staged": "13.2.3",
"nx": "18.3.1",
"nx": "18.3.5",
"nx-cloud": "^18.0.0",
"prettier": "2.7.1",
"pretty-quick": "^3.1.3",
Expand All @@ -128,10 +130,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
15 changes: 6 additions & 9 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 @@ -22,11 +18,12 @@
"schematics": "./generators.json",
"builders": "./executors.json",
"dependencies": {
"@nx/devkit": "18.3.1",
"nx": "18.3.1",
"@nx/web": "18.3.1",
"ignore": "^5.3.1",
"tslib": "^2.3.0"
},
"peerDependencies": {}
"peerDependencies": {
"@nx/devkit": ">=18.0.0",
"@nx/web": ">=18.0.0",
"nx": ">=18.0.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
21 changes: 11 additions & 10 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,14 +25,15 @@
"schematics": "./generators.json",
"builders": "./executors.json",
"dependencies": {
"@nxext/capacitor": "^18.0.4",
"@nx/devkit": "18.3.1",
"@nx/eslint": "18.3.1",
"@nx/angular": "18.3.1",
"@nx/js": "18.3.1",
"@nxext/capacitor": "18.0.0",
"@phenomnomnominal/tsquery": "~5.0.1",
"typescript": "5.4.5",
"tslib": "^2.3.0"
},
"peerDependencies": {}
"peerDependencies": {
"@nx/angular": ">=18.0.0",
"@nx/devkit": ">=18.0.0",
"@nx/eslint": ">=18.0.0",
"@nx/js": ">=18.0.0",
"typescript": "*"
}
}
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() {}
}
Loading
Loading