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

Add apps/styleguide as lerna package #44

Merged
merged 10 commits into from
Jan 20, 2025
Merged
31 changes: 31 additions & 0 deletions apps/styleguide/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
// automatically extends root eslint-config (which extends @shiftcode/eslint-config-recommended for TS)
extends: ['@shiftcode/eslint-config-recommended/ng-config'],
ignorePatterns: ['src/assets/**/*'],
overrides: [
{
plugins: ['@shiftcode/rules'],
files: ['*.ts'],
rules: {
'import/no-extraneous-dependencies': ['error', { packageDir: '../..' }],
'import/no-internal-modules': [
'error',
{
allow: ['rxjs/*'],
},
],
},
},
],
parserOptions: {
project: ['./tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
ecmaVersion: 'latest',
sourceType: 'module',
env: {
browser: true,
node: true,
es6: true,
},
},
}
8 changes: 8 additions & 0 deletions apps/styleguide/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"*.{ts,html}":
- npm run prettier:staged
- npm run lint:staged
src/**/*.scss:
- npm run prettier:staged
# sort package.json keys
./package.json:
- sort-package-json
11 changes: 11 additions & 0 deletions apps/styleguide/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@shiftcode/styleguide",
"private": true,
"scripts": {
"lint": "npm run lint:ci -- --fix",
"lint:ci": "eslint ./src",
"lint:staged": "eslint --fix",
"prettier": "prettier --write --config ../../.prettierrc.yml 'src/**/*.{ts,html,scss}'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml"
}
}
1 change: 1 addition & 0 deletions apps/styleguide/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ bootstrapApplication(AppComponent, {
provideNavigationClassHandler('sg-navigating'),
provideSgConfig(),
],
// eslint-disable-next-line no-console
}).catch((err) => console.error(err))
1 change: 1 addition & 0 deletions apps/styleguide/src/routes/sg-rx/sg-rx.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line max-classes-per-file
import { JsonPipe } from '@angular/common'
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'
import { AutoFocusDirective, RxIfDirective, RxLetDirective } from '@shiftcode/ngx-components'
Expand Down
20 changes: 20 additions & 0 deletions apps/styleguide/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.app.json",
"compilerOptions": {
"paths": {
"@shiftcode/ngx-core": [
"../libs/core/src/public-api.ts"
],
"@shiftcode/ngx-components": [
"../libs/components/src/public-api.ts"
],
"@shiftcode/ngx-aws": [
"../libs/aws/src/public-api.ts"
]
}
},
"include": [
"**/*.ts"
],
"exclude": []
}
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"useNx": false,
"packages": [
"libs/*"
"libs/*",
"apps/*"
],
"version": "independent",
"command": {
Expand Down
9 changes: 5 additions & 4 deletions libs/aws/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "@shiftcode/ngx-aws",
"version": "7.0.0-pr23.2",
"version": "7.0.0-pr43.2",
"repository": "https://github.com/shiftcode/sc-ng-commons-public",
"license": "MIT",
"author": "shiftcode GmbH <[email protected]>",
"sideEffects": false,
"scripts": {
"lint": "eslint ./src --fix",
"lint:ci": "npm run lint:lib",
"lint:lib": "eslint ./src",
"lint": "npm run lint:src -- --fix && npm run lint:test -- --fix",
"lint:ci": "npm run lint:src && npm run lint:test",
"lint:src": "eslint ./src",
"lint:staged": "eslint --fix",
"lint:test": "eslint ./test --no-error-on-unmatched-pattern",
"prettier": "prettier --write --config ../../.prettierrc.yml 'src/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml"
},
Expand Down
10 changes: 5 additions & 5 deletions libs/components/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@shiftcode/ngx-components",
"version": "7.0.0-pr23.2",
"version": "7.0.0-pr43.2",
"repository": "https://github.com/shiftcode/sc-ng-commons-public",
"license": "MIT",
"author": "shiftcode GmbH <[email protected]>",
"sideEffects": false,
"scripts": {
"lint:ci": "npm run lint:lib",
"lint:lib": "eslint ./src",
"lint:src": "eslint ./src --fix",
"lint": "npm run lint:src -- --fix && npm run lint:test -- --fix",
"lint:ci": "npm run lint:src && npm run lint:test",
"lint:src": "eslint ./src",
"lint:staged": "eslint --fix",
"lint:test": "eslint ./test",
"lint:test": "eslint ./test --no-error-on-unmatched-pattern",
"prettier": "prettier --write --config ../../.prettierrc.yml 'src/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml"
},
Expand Down
12 changes: 6 additions & 6 deletions libs/core/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@shiftcode/ngx-core",
"version": "7.0.0-pr23.2",
"version": "7.0.0-pr43.2",
"repository": "https://github.com/shiftcode/sc-ng-commons-public",
"license": "MIT",
"author": "shiftcode GmbH <[email protected]>",
"sideEffects": false,
"scripts": {
"lint": "npm run lint:lib -- --fix && npm run lint:test -- --fix",
"lint:ci": "npm run lint:lib && npm run lint:test",
"lint:lib": "eslint ./src",
"lint:lib:print-config": "eslint --print-config ./src/public-api.ts > ____eslint-config.json",
"lint": "npm run lint:src -- --fix && npm run lint:test -- --fix",
"lint:ci": "npm run lint:src && npm run lint:test",
"lint:src": "eslint ./src",
"lint:src:print-config": "eslint --print-config ./src/public-api.ts > ____eslint-config.json",
"lint:staged": "eslint --fix",
"lint:test": "eslint ./test",
"lint:test": "eslint ./test --no-error-on-unmatched-pattern",
"prettier": "prettier --write --config ../../.prettierrc.yml 'src/**/*.ts'",
"prettier:staged": "prettier --write --config ../../.prettierrc.yml"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"scripts": {
"build:ci": "ng build core && ng build aws && ng build components",
"build:styleguide": "ng build styleguide",
"copy-version": "lerna exec --stream -- ts-node --project \\$LERNA_ROOT_PATH/scripts/ts/tsconfig.json \\$LERNA_ROOT_PATH/scripts/ts/copy-version.ts",
"copy-version": "lerna exec --ignore @shiftcode/styleguide --stream -- ts-node --project \\$LERNA_ROOT_PATH/scripts/ts/tsconfig.json \\$LERNA_ROOT_PATH/scripts/ts/copy-version.ts",
"lint": "lerna run lint --stream",
"lint:ci": "lerna run lint:ci --stream",
"prepare": "husky",
"prepublishOnly": "lerna exec --stream -- ts-node --project \\$LERNA_ROOT_PATH/scripts/ts/tsconfig.json \\$LERNA_ROOT_PATH/scripts/ts/copy-version.ts",
"prepublishOnly": "lerna exec --ignore @shiftcode/styleguide --stream -- ts-node --project \\$LERNA_ROOT_PATH/scripts/ts/tsconfig.json \\$LERNA_ROOT_PATH/scripts/ts/copy-version.ts",
"prettier:all": "lerna run prettier --stream",
"start": "ng serve",
"test": "ng test",
Expand Down
Loading