Upgrading NX and start fixing styles

This commit is contained in:
Vito Albano
2023-11-14 01:10:57 +00:00
committed by VitoAlbano
parent 8e6f8025ff
commit cc1adb757a
50 changed files with 1429 additions and 232 deletions

View File

@@ -1,16 +1,13 @@
const rootMain = require('../../../.storybook/main');
module.exports = {
...rootMain,
core: { ...rootMain.core, builder: 'webpack5' },
stories: [
...rootMain.stories,
'../src/lib/**/*.stories.@(js|jsx|ts|tsx)'
],
staticDirs: [
...rootMain.staticDirs,
{ from: '../../core/src/lib/i18n', to: 'assets/adf-core/i18n' },
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-process-services-cloud/i18n' }
],
addons: [...rootMain.addons ]
...rootMain,
core: { ...rootMain.core, builder: 'webpack5' },
stories: [...rootMain.stories, '../src/lib/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: [
...rootMain.staticDirs,
{ from: '../../core/src/lib/i18n', to: 'assets/adf-core/i18n' },
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-process-services-cloud/i18n' }
],
addons: ['@storybook/addon-essentials', ...rootMain.addons]
};

View File

@@ -0,0 +1,121 @@
{
"name": "process-services-cloud",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "lib/process-services-cloud/src",
"projectType": "library",
"prefix": "adf-cloud",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "lib/process-services-cloud/tsconfig.lib.json",
"project": "lib/process-services-cloud/ng-package.json"
},
"configurations": {
"production": {
"project": "lib/process-services-cloud/ng-package.json",
"tsConfig": "lib/process-services-cloud/tsconfig.lib.prod.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@angular-devkit/build-angular:karma",
"options": {
"main": "lib/process-services-cloud/src/test.ts",
"tsConfig": "lib/process-services-cloud/tsconfig.spec.json",
"karmaConfig": "lib/process-services-cloud/karma.conf.js",
"sourceMap": true,
"codeCoverage": true,
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["lib/process-services-cloud/**/*.ts", "lib/process-services-cloud/**/*.html"]
}
},
"storybook": {
"executor": "@storybook/angular:start-storybook",
"options": {
"port": 4400,
"browserTarget": "process-services-cloud:storybook",
"configDir": "lib/process-services-cloud/.storybook",
"compodoc": false,
"styles": [
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
"node_modules/pdfjs-dist/web/pdf_viewer.css"
],
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"build-storybook": {
"executor": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "process-services-cloud:build-storybook",
"configDir": "lib/process-services-cloud/.storybook",
"outputDir": "dist/storybook/process-services-cloud",
"compodoc": false,
"styles": [
"demo-shell/src/styles.scss",
"demo-shell/src/custom-style-dev.scss",
"node_modules/cropperjs/dist/cropper.min.css",
"node_modules/pdfjs-dist/web/pdf_viewer.css"
],
"stylePreprocessorOptions": {
"includePaths": ["lib", "lib/core/src/lib"]
}
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"e2e-playwright": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npx playwright test --config='e2e-playwright/playwright.config.ts'"
}
]
}
},
"stylelint": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "npx stylelint lib/process-services-cloud/**/*.scss --config stylelint-config.json"
}
]
}
},
"npm-publish": {
"executor": "nx:run-commands",
"dependsOn": ["build"],
"options": {
"cwd": "dist/libs/process-services-cloud",
"commands": [
{
"command": "npm publish --tag {args.tag}",
"forwardAllArgs": true
}
]
}
}
}
}

View File

@@ -20,21 +20,9 @@
import 'zone.js';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(), {
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: true }
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
});

View File

@@ -14,6 +14,8 @@
"@alfresco/adf-content-services/*": ["../../../dist/libs/content-services/*"],
"@alfresco/js-api": ["../../../dist/libs/js-api"],
"@alfresco/js-api/*": ["../../../dist/libs/js-api/*"]
}
},
"target": "ES2022",
"useDefineForClassFields": false
}
}

View File

@@ -1,7 +1,9 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
"declarationMap": false,
"target": "ES2022",
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"compilationMode": "partial"

View File

@@ -1,7 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc"
"outDir": "../../dist/out-tsc",
"target": "ES2022",
"useDefineForClassFields": false
},
"files": ["src/test.ts"],
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]