[AAE-5674] Library for tooling in adf-cli (#7270)

* [AAE-5674] Library for tooling in adf-core

* Changes done as per PR comments

* Changes done as per comments
This commit is contained in:
Sushmitha V 2021-10-05 16:50:50 +05:30 committed by GitHub
parent dbc014d076
commit e34247c01e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 0 deletions

24
lib/cli/tooling/dotenv.ts Normal file
View File

@ -0,0 +1,24 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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.
*/
export function dotenv() {
return require('dotenv-expand')(require('dotenv'));
}
export function dotenvConfig(params?: any) {
return require('dotenv-expand')(require('dotenv').config(params));
}

18
lib/cli/tooling/index.ts Normal file
View File

@ -0,0 +1,18 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* 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.
*/
export * from './dotenv';

View File

@ -0,0 +1,11 @@
{
"ngPackage": {
"lib": {
"entryFile": "./index.ts",
"flatModuleFile": "adf-cli-tooling"
}
},
"peerDependencies": {
"dotenv-expand": "^5.1.0"
}
}

5
package-lock.json generated
View File

@ -41345,6 +41345,11 @@
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
"dev": true
},
"dotenv-expand": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
"integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA=="
},
"duplexify": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",

View File

@ -97,6 +97,7 @@
"classlist.js": "1.1.20150312",
"cropperjs": "1.5.12",
"custom-event-polyfill": "^1.0.7",
"dotenv-expand": "^5.1.0",
"minimatch": "^3.0.4",
"minimatch-browser": "1.0.0",
"moment-es6": "^1.0.0",