Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx boundaries non project npm #311

Open
wants to merge 2 commits into
base: master
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions libs/products/home-page/src/lib/products-home-page.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

import { SharedProductStateModule } from '@nx-example/shared/product/state';

import { HomePageComponent } from './home-page/home-page.component';

import { NonProjectComponent } from '../../../../shared/product/components/non-project';
import { ProjectComponent } from '../../../../shared/product/components/project';
// import { ProjectComponent } from '@nx-example/shared/product/component';

@NgModule({
imports: [
CommonModule,
Expand All @@ -19,7 +22,7 @@ import { HomePageComponent } from './home-page/home-page.component';
},
]),
],
declarations: [HomePageComponent],
declarations: [HomePageComponent, NonProjectComponent, ProjectComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class ProductsHomePageModule {}
1 change: 1 addition & 0 deletions libs/shared/product/components/non-project/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { NonProjectComponent } from './non-project.component';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="non-project">NOT A PROJECT!</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NonProjectComponent } from './non-project.component';

describe('BreadcrumbsComponent', () => {
let comp: NonProjectComponent;

beforeEach(() => {
comp = new NonProjectComponent();
});

it('instantiates successfully', () => {
expect(comp).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

@Component({
standalone: true,
selector: 'non-project',
templateUrl: './non-project.component.html',
styleUrls: ['./non-project.component.css'],
imports: [CommonModule, RouterModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class NonProjectComponent {}
11 changes: 11 additions & 0 deletions libs/shared/product/components/project/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
transform: {
'^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
coverageDirectory: '../../../coverage/libs/shared/product/components/project',
globals: {},
displayName: 'shared-product-component',
preset: '../../../../../jest.preset.js',
};
29 changes: 29 additions & 0 deletions libs/shared/product/components/project/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "shared-product-component",
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/shared/product/component/project/src",
"projectType": "library",
"generators": {},
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/shared/product/component/project/src/**/*.ts",
"libs/shared/product/component/project/src/**/*.html"
]
},
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"options": {
"jestConfig": "libs/shared/product/component/project/jest.config.ts"
},
"outputs": [
"{workspaceRoot}/coverage/libs/shared/product/component/project"
]
}
},
"tags": ["scope:shared", "type:ui"]
}
1 change: 1 addition & 0 deletions libs/shared/product/components/project/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ProjectComponent } from './project.component';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="project">PROJECT!</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ProjectComponent } from './project.component';

describe('BreadcrumbsComponent', () => {
let comp: ProjectComponent;

beforeEach(() => {
comp = new ProjectComponent();
});

it('instantiates successfully', () => {
expect(comp).toBeTruthy();
});
});
13 changes: 13 additions & 0 deletions libs/shared/product/components/project/src/project.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

@Component({
standalone: true,
selector: 'project',
templateUrl: './project.component.html',
styleUrls: ['./project.component.css'],
imports: [CommonModule, RouterModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class ProjectComponent {}
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@ngrx/entity": "16.0.0",
"@ngrx/router-store": "16.0.0",
"@ngrx/store": "16.0.0",
"@nx/angular": "17.1.0-rc.0",
"@nx/angular": "17.1.3",
"document-register-element": "1.13.1",
"normalize.css": "^8.0.1",
"react": "18.2.0",
Expand All @@ -69,14 +69,14 @@
"@babel/core": "^7.14.5",
"@babel/preset-react": "^7.14.5",
"@ngrx/store-devtools": "16.0.0",
"@nx/cypress": "17.1.0-rc.0",
"@nx/devkit": "17.1.0-rc.0",
"@nx/eslint-plugin": "17.1.0-rc.0",
"@nx/jest": "17.1.0-rc.0",
"@nx/js": "17.1.0-rc.0",
"@nx/react": "17.1.0-rc.0",
"@nx/web": "17.1.0-rc.0",
"@nx/workspace": "17.1.0-rc.0",
"@nx/cypress": "17.1.3",
"@nx/devkit": "17.1.3",
"@nx/eslint-plugin": "17.1.3",
"@nx/jest": "17.1.3",
"@nx/js": "17.1.3",
"@nx/react": "17.1.3",
"@nx/web": "17.1.3",
"@nx/workspace": "17.1.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@schematics/angular": "17.0.0",
"@svgr/webpack": "^6.1.2",
Expand All @@ -103,9 +103,9 @@
"inquirer-autocomplete-prompt": "^1.0.1",
"jest": "29.4.3",
"jest-environment-jsdom": "29.4.3",
"jest-preset-angular": "13.1.3",
"jest-preset-angular": "13.1.4",
"netlify": "^2.4.8",
"nx": "17.1.0-rc.0",
"nx": "17.1.3",
"prettier": "2.6.2",
"react-refresh": "^0.10.0",
"style-loader": "^3.3.0",
Expand All @@ -117,6 +117,7 @@
"url-loader": "^4.1.1",
"webpack": "^5.75.0",
"webpack-merge": "^5.8.0",
"@nx/eslint": "17.1.0-rc.0"
"@nx/eslint": "17.1.3"
}
}

3 changes: 3 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"@nx-example/shared/e2e-utils": ["libs/shared/e2e-utils/src/index.ts"],
"@nx-example/shared/header": ["libs/shared/header/src/index.ts"],
"@nx-example/shared/jsxify": ["libs/shared/jsxify/src/index.ts"],
"@nx-example/shared/product/component": [
"libs/shared/product/components/project/src/index.ts"
],
"@nx-example/shared/product/data": [
"libs/shared/product/data/src/index.ts"
],
Expand Down