Skip to content

Commit

Permalink
chore: add a new app for test
Browse files Browse the repository at this point in the history
  • Loading branch information
kasir-barati committed May 16, 2024
1 parent 8466003 commit 485f4b1
Show file tree
Hide file tree
Showing 16 changed files with 1,151 additions and 0 deletions.
34 changes: 34 additions & 0 deletions apps/my-new-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": [
"plugin:@nx/react-typescript",
"next",
"next/core-web-vitals",
"../../.eslintrc.json"
],
"ignorePatterns": ["!**/*", ".next/**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@next/next/no-html-link-for-pages": [
"error",
"apps/my-new-app/pages"
]
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
}
}
]
}
6 changes: 6 additions & 0 deletions apps/my-new-app/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
declare module '*.svg' {
const content: any;
export const ReactComponent: any;
export default content;
}
11 changes: 11 additions & 0 deletions apps/my-new-app/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'my-new-app',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/apps/my-new-app',
};
5 changes: 5 additions & 0 deletions apps/my-new-app/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
22 changes: 22 additions & 0 deletions apps/my-new-app/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//@ts-check

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { composePlugins, withNx } = require('@nx/next');

/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
// Set this to true if you would like to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
};

const plugins = [
// Add more Next.js plugins to this list if needed.
withNx,
];

module.exports = composePlugins(...plugins)(nextConfig);
9 changes: 9 additions & 0 deletions apps/my-new-app/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "my-new-app",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/my-new-app",
"projectType": "application",
"tags": [],
"// targets": "to see all targets run: nx show project my-new-app --web",
"targets": {}
}
Empty file added apps/my-new-app/public/.gitkeep
Empty file.
Binary file added apps/my-new-app/public/favicon.ico
Binary file not shown.
11 changes: 11 additions & 0 deletions apps/my-new-app/specs/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import { render } from '@testing-library/react';

import Page from '../src/app/page';

describe('Page', () => {
it('should render successfully', () => {
const { baseElement } = render(<Page />);
expect(baseElement).toBeTruthy();
});
});
3 changes: 3 additions & 0 deletions apps/my-new-app/src/app/api/hello/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export async function GET(request: Request) {
return new Response('Hello, from API!');
}
Loading

0 comments on commit 485f4b1

Please sign in to comment.