Skip to content

Commit

Permalink
add app
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmojicatech committed Apr 7, 2024
1 parent 9b29daf commit 47c66e5
Show file tree
Hide file tree
Showing 42 changed files with 3,551 additions and 185 deletions.
10 changes: 10 additions & 0 deletions apps/modeling-book-tracker-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
}
]
}
10 changes: 10 additions & 0 deletions apps/modeling-book-tracker-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset';

import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
...nxE2EPreset(__filename, { cypressDir: 'src' }),
baseUrl: 'http://localhost:4200',
},
});
29 changes: 29 additions & 0 deletions apps/modeling-book-tracker-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "modeling-book-tracker-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/modeling-book-tracker-e2e/src",
"tags": [],
"implicitDependencies": ["modeling-book-tracker"],
"targets": {
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/modeling-book-tracker-e2e/cypress.config.ts",
"testingType": "e2e",
"devServerTarget": "modeling-book-tracker:serve"
},
"configurations": {
"production": {
"devServerTarget": "modeling-book-tracker:serve:production"
},
"ci": {
"devServerTarget": "modeling-book-tracker:serve-static"
}
}
},
"lint": {
"executor": "@nx/eslint:lint"
}
}
}
13 changes: 13 additions & 0 deletions apps/modeling-book-tracker-e2e/src/e2e/app.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getGreeting } from '../support/app.po';

describe('app-blank', () => {
beforeEach(() => cy.visit('/'));

it('should display welcome message', () => {
// Custom command example, see `../support/commands.ts` file
cy.login('my-email@something.com', 'myPassword');

// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Tab 1');
});
});
5 changes: 5 additions & 0 deletions apps/modeling-book-tracker-e2e/src/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
1 change: 1 addition & 0 deletions apps/modeling-book-tracker-e2e/src/support/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const getGreeting = () => cy.get('strong');
35 changes: 35 additions & 0 deletions apps/modeling-book-tracker-e2e/src/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/// <reference types="cypress" />

// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************

// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
login(email: string, password: string): void;
}
}

// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
});
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
17 changes: 17 additions & 0 deletions apps/modeling-book-tracker-e2e/src/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.ts using ES2015 syntax:
import './commands';
20 changes: 20 additions & 0 deletions apps/modeling-book-tracker-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["cypress", "node"],
"sourceMap": false
},
"include": [
"**/*.ts",
"**/*.js",
"cypress.config.ts",
"**/*.cy.ts",
"**/*.cy.tsx",
"**/*.cy.js",
"**/*.cy.jsx",
"**/*.d.ts"
]
}
11 changes: 11 additions & 0 deletions apps/modeling-book-tracker/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic"
}
]
],
"plugins": []
}
18 changes: 18 additions & 0 deletions apps/modeling-book-tracker/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
1 change: 1 addition & 0 deletions apps/modeling-book-tracker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
13 changes: 13 additions & 0 deletions apps/modeling-book-tracker/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
appId: 'io.ionic.starter',
appName: 'modeling-book-tracker',
webDir: '../../dist/apps/modeling-book-tracker',
bundledWebRuntime: false,
server: {
androidScheme: 'https',
},
};

export default config;
7 changes: 7 additions & 0 deletions apps/modeling-book-tracker/ionic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "modeling-book-tracker",
"integrations": {
"capacitor": {}
},
"type": "react"
}
19 changes: 19 additions & 0 deletions apps/modeling-book-tracker/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as path from 'path';

/* eslint-disable */
export default {
displayName: 'modeling-book-tracker',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': [
'babel-jest',
{ configFile: path.resolve(__dirname, '.babelrc') },
],
},
transformIgnorePatterns: [
'node_modules/(?!(@ionic/react|@ionic/react-router|@ionic/core|@stencil/core|ionicons)/)',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/modeling-book-tracker',
};
8 changes: 8 additions & 0 deletions apps/modeling-book-tracker/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "modeling-book-tracker",
"devDependencies": {
"@capacitor/cli": "^5.0.3",
"@capacitor/ios": "../../node_modules/@capacitor/ios",
"@capacitor/android": "../../node_modules/@capacitor/android"
}
}
Loading

0 comments on commit 47c66e5

Please sign in to comment.