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

refactor(core): base structure for @lucca/prisme library and split setup #3151

Draft
wants to merge 8 commits into
base: rc
Choose a base branch
from
Next Next commit
feat(split): base structure setup for new prisme lib
  • Loading branch information
Supamiu committed Oct 21, 2024
commit 41402d55ec029c618437fbbf6284a7d2bf95b2ae
254 changes: 162 additions & 92 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,94 +1,164 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "npm",
"schematicCollections": [
"@angular-eslint/schematics"
],
"analytics": false
},
"schematics": {
"@schematics/angular:component": {
"changeDetection": "OnPush",
"viewEncapsulation": "None",
"skipTests": true,
"standalone": true,
"style": "scss"
}
},
"newProjectRoot": "packages/ng",
"projects": {
"ng": {
"root": "./",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "packages/ng/ng-package.json",
"tsConfig": "packages/ng/tsconfig.lib.prod.json"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"packages/**/*.ts",
"packages/**/*.html"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"browserTarget": "ng:build",
"compodoc": true,
"compodocArgs": [
"-p",
"./tsconfig.compodoc-json.json",
"-e",
"json",
"-d",
".storybook"
],
"port": 6006,
"styles": [
".storybook/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"packages/ng/styles",
"node_modules"
]
}
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "ng:build",
"compodoc": true,
"compodocArgs": [
"-p",
"./tsconfig.compodoc-json.json",
"-e",
"json",
"-d",
".storybook"
],
"styles": [
".storybook/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"packages/ng/styles",
"node_modules"
]
}
}
}
}
}
}
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "npm",
"schematicCollections": [
"@angular-eslint/schematics"
],
"analytics": false
},
"schematics": {
"@schematics/angular:component": {
"changeDetection": "OnPush",
"viewEncapsulation": "None",
"skipTests": true,
"standalone": true,
"style": "scss"
}
},
"newProjectRoot": "packages/ng",
"projects": {
"ng": {
"root": "./",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "packages/ng/ng-package.json",
"tsConfig": "packages/ng/tsconfig.lib.prod.json"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"packages/**/*.ts",
"packages/**/*.html"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"browserTarget": "ng:build",
"compodoc": true,
"compodocArgs": [
"-p",
"./tsconfig.compodoc-json.json",
"-e",
"json",
"-d",
".storybook"
],
"port": 6006,
"styles": [
".storybook/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"packages/ng/styles",
"node_modules"
]
}
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "ng:build",
"compodoc": true,
"compodocArgs": [
"-p",
"./tsconfig.compodoc-json.json",
"-e",
"json",
"-d",
".storybook"
],
"styles": [
".storybook/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"packages/ng/styles",
"node_modules"
]
}
}
}
}
},
"prisme": {
"root": "./",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "packages/prisme/ng-package.json",
"tsConfig": "packages/prisme/tsconfig.lib.prod.json"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"packages/**/*.ts",
"packages/**/*.html"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"browserTarget": "ng:build",
"compodoc": true,
"compodocArgs": [
"-p",
"./tsconfig.compodoc-json.json",
"-e",
"json",
"-d",
".storybook"
],
"port": 6006,
"styles": [
".storybook/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules"
]
}
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "ng:build",
"compodoc": true,
"compodocArgs": [
"-p",
"./tsconfig.compodoc-json.json",
"-e",
"json",
"-d",
".storybook"
],
"styles": [
".storybook/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"packages/ng/styles",
"node_modules"
]
}
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lucca-front",
"description": "a library of useful components for web developpement",
"description": "a library of useful components for web development",
"repository": {
"type": "git",
"url": "git+https://github.com/LuccaSA/lucca-front.git"
Expand All @@ -23,7 +23,7 @@
],
"scripts": {
"build": "npm run build:ng && npm run build:remaining",
"build:ng": "ng run ng:build",
"build:ng": "ng run prisme:build && ng run ng:build",
"build:remaining": "node build.js",
"start": "ng run ng:storybook",
"jenkins-test": "jest --no-cache --runInBand",
Expand Down
2 changes: 1 addition & 1 deletion packages/ng/button/public-api.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './button.component';
export * from '@lucca/prisme/button';
27 changes: 17 additions & 10 deletions packages/ng/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false,
"paths": {
"@lucca-front/ng/*": ["dist/ng/*", "dist/ng"]
}
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false,
"paths": {
"@lucca-front/ng/*": [
"dist/ng/*",
"dist/ng"
],
"@lucca/prisme/*": [
"dist/prisme/*",
"dist/prisme"
]
}
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IconComponent } from '@lucca-front/ng/icon';

@Component({
// eslint-disable-next-line @angular-eslint/component-selector
selector: 'button[luButton],a[luButton]',
selector: 'button[prButton],a[prButton],button[luButton],a[luButton]',
standalone: true,
providers: [LuClass],
template: '<ng-content></ng-content>',
Expand Down
7 changes: 7 additions & 0 deletions packages/prisme/button/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"lib": {
"entryFile": "public-api.ts",
"styleIncludePaths": ["../styles"]
}
}
1 change: 1 addition & 0 deletions packages/prisme/button/public-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './button.component';
8 changes: 8 additions & 0 deletions packages/prisme/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/prisme",
"deleteDestPath": true,
"lib": {
"entryFile": "public_api.ts"
}
}
31 changes: 31 additions & 0 deletions packages/prisme/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@lucca/prisme",
"version": "0.0.0",
"description": "Design system made by @lucca",
"repository": {
"type": "git",
"url": "git+https://github.com/LuccaSA/lucca-front.git"
},
"license": "MIT",
"public": true,
"keywords": [
"lucca",
"angular",
"prisme"
],
"author": "Guilde Front Lucca <guilde-front@lucca.fr>",
"peerDependencies": {
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/cdk": "^18.0.0",
"@lucca-front/icons": "*",
"@lucca-front/scss": "*",
"@types/dompurify": "^3.0.0",
"isomorphic-dompurify": "^2.11.0",
"date-fns": "^3.6.0",
"rxjs": "^7.8.0"
},
"bugs": {
"url": "https://github.com/LuccaSA/lucca-front/issues"
}
}
1 change: 1 addition & 0 deletions packages/prisme/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
17 changes: 17 additions & 0 deletions packages/prisme/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": false,
"outDir": "../build",
"rootDirs": ["."],
"skipLibCheck": true
},
"angularCompilerOptions": {
"preserveSymlinks": true,
"annotateForClosureCompiler": false,
"strictMetadataEmit": true,
"skipTemplateCodegen": true
}
}
4 changes: 4 additions & 0 deletions packages/prisme/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"files": ["./public_api.ts"]
}
Loading