cc to projects

This commit is contained in:
Rinat Arsaev 2022-08-19 19:14:43 +03:00
parent 516f21ab0b
commit bbbe4e0860
1211 changed files with 140 additions and 89 deletions

View File

@ -1,4 +1,5 @@
const rules = require('./tools/eslint-config/rules');
const path = require('path');
const baseTsRules = {
parserOptions: {
@ -28,13 +29,16 @@ const lenientTsRules = {
'@typescript-eslint/no-unsafe-argument': 'warn',
};
const CONTROL_CENTER_DIR = 'projects/control-center/src';
const NG_CORE_DIR = 'projects/ng-core/src';
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
overrides: [
{
...baseTsRules,
files: ['*.ts'],
files: [path.join(CONTROL_CENTER_DIR, '**/*.ts')],
rules: {
...baseTsRules.rules,
...lenientTsRules,
@ -43,7 +47,10 @@ module.exports = {
{
...baseTsRules,
// TODO: add fixed directories
files: ['**/src/app/core/**/*.ts', '**/projects/**/*.ts'],
files: [
path.join(CONTROL_CENTER_DIR, 'app/core/**/*.ts'),
path.join(NG_CORE_DIR, '**/*.ts'),
],
},
{
...baseTsRules,

4
.gitignore vendored
View File

@ -46,7 +46,5 @@ Thumbs.db
# Angular
.angular
# Env and configs
# Env
.env
/src/assets/appConfig.json
/src/assets/authConfig.json

View File

@ -13,8 +13,8 @@
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"root": "projects/control-center",
"sourceRoot": "projects/control-center/src",
"prefix": "cc",
"architect": {
"build": {
@ -41,14 +41,14 @@
"@vality/thrift-ts"
],
"outputPath": "dist/control-center",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"index": "projects/control-center/src/index.html",
"main": "projects/control-center/src/main.ts",
"polyfills": "projects/control-center/src/polyfills.ts",
"tsConfig": "projects/control-center/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets",
"projects/control-center/src/favicon.ico",
"projects/control-center/src/assets",
{
"glob": "**/*",
"input": "./node_modules/monaco-editor/min/vs",
@ -56,9 +56,9 @@
}
],
"styles": [
"src/app/styles/core.scss",
"projects/control-center/src/app/styles/core.scss",
{
"input": "src/app/styles/themes/light.scss",
"input": "projects/control-center/src/app/styles/themes/light.scss",
"bundleName": "light-theme",
"inject": false
}
@ -81,8 +81,8 @@
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
"replace": "projects/control-center/src/environments/environment.ts",
"with": "projects/control-center/src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
@ -110,17 +110,23 @@
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "control-center:build"
}
},
"test": {
"builder": "ngx-build-plus:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"main": "projects/control-center/src/test.ts",
"polyfills": "projects/control-center/src/polyfills.ts",
"tsConfig": "projects/control-center/tsconfig.spec.json",
"karmaConfig": "projects/control-center/karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets",
"projects/control-center/src/favicon.ico",
"projects/control-center/src/assets",
{
"glob": "**/*",
"input": "./node_modules/monaco-editor/min/vs",
@ -128,9 +134,9 @@
}
],
"styles": [
"src/app/styles/core.scss",
"projects/control-center/src/app/styles/core.scss",
{
"input": "src/app/styles/themes/light.scss",
"input": "projects/control-center/src/app/styles/themes/light.scss",
"bundleName": "light-theme",
"inject": false
}

View File

@ -7,18 +7,17 @@
"start": "concurrently -n LIB,APP -c magenta,cyan npm:dev-libs \"sleep 0.5 && npm run dev\"",
"dev": "ng serve --proxy-config proxy.conf.js --port 4200",
"dev-libs": "ng build ng-core --watch",
"build-app": "ng build --extra-webpack-config webpack.extra.js",
"build-app": "ng build control-center --extra-webpack-config webpack.extra.js",
"build-libs": "ng build ng-core",
"build": "npm run build-libs && npm run build-app",
"test": "ng test",
"lint": "eslint \"src/**/*.{ts,js,html}\" --max-warnings 1033",
"lint": "eslint \"projects/control-center/src/**/*.{ts,js,html}\" --max-warnings 1030",
"lint-fix": "npm run lint -- --fix",
"lint-errors": "npm run lint -- --quiet",
"lint-libs": "eslint \"projects/**/*.{ts,js,html}\" --max-warnings 0",
"lint-libs": "eslint \"projects/ng-core/**/*.{ts,js,html}\" --max-warnings 0",
"lint-libs-fix": "npm run lint -- --fix",
"prettier-preset": "prettier \"**/*.{html,js,ts,css,scss,md,json,prettierrc,svg,huskyrc,yml,yaml}\"",
"prettier": "npm run prettier-preset -- --list-different",
"prettier-fix": "npm run prettier-preset -- --write",
"prettier": "prettier . --list-different",
"prettier-fix": "prettier . --write",
"fix": "concurrently -n LIB,APP -c magenta,cyan npm:lint-libs-fix npm:lint-fix && npm run prettier-fix"
},
"dependencies": {

View File

@ -2,11 +2,15 @@
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.

3
projects/control-center/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Configs
/src/assets/appConfig.json
/src/assets/authConfig.json

View File

@ -0,0 +1,41 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true, // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, '../../coverage/control-center'),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};

Some files were not shown because too many files have changed in this diff Show More