mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
cleanup unused content
This commit is contained in:
parent
1495ad02cf
commit
4f3316f758
@ -1,95 +0,0 @@
|
|||||||
/**
|
|
||||||
* This file decorates the Angular CLI with the Nx CLI to enable features such as computation caching
|
|
||||||
* and faster execution of tasks.
|
|
||||||
*
|
|
||||||
* It does this by:
|
|
||||||
*
|
|
||||||
* - Patching the Angular CLI to warn you in case you accidentally use the undecorated ng command.
|
|
||||||
* - Symlinking the ng to nx command, so all commands run through the Nx CLI
|
|
||||||
* - Updating the package.json postinstall script to give you control over this script
|
|
||||||
*
|
|
||||||
* The Nx CLI decorates the Angular CLI, so the Nx CLI is fully compatible with it.
|
|
||||||
* Every command you run should work the same when using the Nx CLI, except faster.
|
|
||||||
*
|
|
||||||
* Because of symlinking you can still type `ng build/test/lint` in the terminal. The ng command, in this case,
|
|
||||||
* will point to nx, which will perform optimizations before invoking ng. So the Angular CLI is always invoked.
|
|
||||||
* The Nx CLI simply does some optimizations before invoking the Angular CLI.
|
|
||||||
*
|
|
||||||
* To opt out of this patch:
|
|
||||||
* - Replace occurrences of nx with ng in your package.json
|
|
||||||
* - Remove the script from your postinstall script in your package.json
|
|
||||||
* - Delete and reinstall your node_modules
|
|
||||||
*/
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const os = require("os");
|
|
||||||
const cp = require("child_process");
|
|
||||||
const isWindows = os.platform() === "win32";
|
|
||||||
const output = require('nx/src/utils/output').output;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Paths to files being patched
|
|
||||||
*/
|
|
||||||
const angularCLIInitPath = "node_modules/@angular/cli/lib/cli/index.js";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Patch index.js to warn you if you invoke the undecorated Angular CLI.
|
|
||||||
*/
|
|
||||||
function patchAngularCLI(initPath) {
|
|
||||||
const angularCLIInit = fs.readFileSync(initPath, "utf-8").toString();
|
|
||||||
|
|
||||||
if (!angularCLIInit.includes("NX_CLI_SET")) {
|
|
||||||
fs.writeFileSync(
|
|
||||||
initPath,
|
|
||||||
`
|
|
||||||
if (!process.env['NX_CLI_SET']) {
|
|
||||||
const { output } = require('@nrwl/workspace');
|
|
||||||
output.warn({ title: 'The Angular CLI was invoked instead of the Nx CLI. Use "npx ng [command]" or "nx [command]" instead.' });
|
|
||||||
}
|
|
||||||
${angularCLIInit}
|
|
||||||
`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Symlink of ng to nx, so you can keep using `ng build/test/lint` and still
|
|
||||||
* invoke the Nx CLI and get the benefits of computation caching.
|
|
||||||
*/
|
|
||||||
function symlinkNgCLItoNxCLI() {
|
|
||||||
try {
|
|
||||||
const ngPath = "./node_modules/.bin/ng";
|
|
||||||
const nxPath = "./node_modules/.bin/nx";
|
|
||||||
if (isWindows) {
|
|
||||||
/**
|
|
||||||
* This is the most reliable way to create symlink-like behavior on Windows.
|
|
||||||
* Such that it works in all shells and works with npx.
|
|
||||||
*/
|
|
||||||
["", ".cmd", ".ps1"].forEach(ext => {
|
|
||||||
fs.writeFileSync(ngPath + ext, fs.readFileSync(nxPath + ext));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// If unix-based, symlink
|
|
||||||
cp.execSync(`ln -sf ./nx ${ngPath}`);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
output.error({
|
|
||||||
title:
|
|
||||||
"Unable to create a symlink from the Angular CLI to the Nx CLI:" +
|
|
||||||
e.message
|
|
||||||
});
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
symlinkNgCLItoNxCLI();
|
|
||||||
patchAngularCLI(angularCLIInitPath);
|
|
||||||
output.log({
|
|
||||||
title: "Angular CLI has been decorated to enable computation caching."
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
output.error({
|
|
||||||
title: "Decoration of the Angular CLI did not complete successfully"
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
const rootMain = require('../../../.storybook/main');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...rootMain,
|
|
||||||
core: { ...rootMain.core, builder: 'webpack5' },
|
|
||||||
stories: [
|
|
||||||
...rootMain.stories,
|
|
||||||
'../../core/**/*.stories.@(js|jsx|ts|tsx)',
|
|
||||||
'../../content-services/**/*.stories.@(js|jsx|ts|tsx)',
|
|
||||||
'../../process-services-cloud/**/*.stories.@(js|jsx|ts|tsx)'
|
|
||||||
],
|
|
||||||
staticDirs: [
|
|
||||||
...rootMain.staticDirs,
|
|
||||||
{ from: '../../core/src/lib/i18n', to: 'assets/adf-core/i18n' },
|
|
||||||
{ from: '../../core/src/lib/assets/images', to: 'assets/images' },
|
|
||||||
{ from: '../../content-services/src/lib/i18n', to: 'assets/adf-content-services/i18n' },
|
|
||||||
{ from: '../../process-services-cloud/src/lib/i18n', to: 'assets/adf-process-services-cloud/i18n' },
|
|
||||||
],
|
|
||||||
addons: [...rootMain.addons ]
|
|
||||||
};
|
|
@ -1,6 +0,0 @@
|
|||||||
import { addons } from '@storybook/addons';
|
|
||||||
import alfrescoTheme from '../../../.storybook/alfrescoTheme';
|
|
||||||
|
|
||||||
addons.setConfig({
|
|
||||||
theme: alfrescoTheme,
|
|
||||||
});
|
|
@ -1,4 +0,0 @@
|
|||||||
export const parameters = {
|
|
||||||
docs: { inlineStories: true },
|
|
||||||
controls: { expanded: true }
|
|
||||||
};
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"emitDecoratorMetadata": true
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
"exclude": ["../**/*.spec.ts", "../../core/**/*.spec.ts", "../../content-services/**/*.spec.ts", "../../process-services-cloud/**/*.spec.ts" ],
|
|
||||||
"include": ["../src/**/*", "*.js", "../../core/**/*", "../../content-services/**/*", "../../process-services-cloud/**/*"]
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
# Alfresco Stories Library
|
|
||||||
|
|
||||||
Contains a Storybook stories from **Core**, **Content Services** and **Process Services cloud** libraries to gather them in one place.
|
|
||||||
|
|
||||||
<!-- markdown-toc start - Don't edit this section. npm run toc to generate it-->
|
|
||||||
|
|
||||||
<!-- toc -->
|
|
||||||
|
|
||||||
- [Storybook](#storybook)
|
|
||||||
- [License](#license)
|
|
||||||
|
|
||||||
<!-- tocstop -->
|
|
||||||
|
|
||||||
<!-- markdown-toc end -->
|
|
||||||
|
|
||||||
## Storybook
|
|
||||||
|
|
||||||
In case you would like to aggregate all the stories across libraries use
|
|
||||||
```
|
|
||||||
nx run stories:storybook
|
|
||||||
```
|
|
||||||
And navigate to `http://localhost:4400/`.
|
|
||||||
|
|
||||||
To create a Storybook stories library build use
|
|
||||||
|
|
||||||
```
|
|
||||||
nx run stories:build-storybook
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
[Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE)
|
|
@ -1,17 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"files": [],
|
|
||||||
"include": [],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.lib.json"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../dist/out-tsc",
|
|
||||||
"target": "es2015",
|
|
||||||
"declaration": true,
|
|
||||||
"declarationMap": true,
|
|
||||||
"inlineSources": true,
|
|
||||||
"types": [],
|
|
||||||
"lib": ["dom", "es2018"]
|
|
||||||
},
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"skipTemplateCodegen": true,
|
|
||||||
"strictMetadataEmit": true,
|
|
||||||
"enableResourceInlining": true
|
|
||||||
},
|
|
||||||
"exclude": [],
|
|
||||||
"include": ["**/*.ts"]
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user