Skip to content

Commit

Permalink
Merge pull request #729 from oracle/feature/PDPDEVTOOL-5146_remove_vm…
Browse files Browse the repository at this point in the history
…2_dep

Prepare release
  • Loading branch information
davidecorreu authored May 25, 2023
2 parents aa75332 + 3e108e2 commit 27fb57d
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 145 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ In this GitHub repository, the following SuiteCloud SDK tools are available:
## Release Notes & Documentation
To read the 2023.1 NetSuite's release notes and documentation, check the following sections of NetSuite's Help Center:
- Read the release notes for NetSuite 2023.1 in [SuiteCloud SDK Release Notes](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1558730192.html).
- Read the latest updates under SuiteCloud SDK in the [Help Center Weekly Updates](https://system.netsuite.com/app/help/helpcenter.nl?fid=chapter_3798389663.html).
- Read the latest updates under SuiteCloud SDK in the [Help Center Weekly Updates](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_3798389663.html).


## [Contributing](./CONTRIBUTING.md)
## Contributing
SuiteCloud SDK is an open source project. Pull Requests are currently not being accepted. See [Contributing to SuiteCloud SDK](./CONTRIBUTING.md).

## [License](./LICENSE.txt)
Expand Down
27 changes: 0 additions & 27 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,33 +109,6 @@ OTHER DEALINGS IN THE SOFTWARE.

---------

vm2
https://github.com/patriksimek/vm2

MIT License

Copyright (c) 2014-2020 Patrik Simek and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

---------

xml2js
https://github.com/Leonidas-from-XIV/node-xml2js

Expand Down
57 changes: 1 addition & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions packages/node-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following software is required to work with SuiteCloud CLI for Node.js:
- Node.js version 18.14.2 LTS
- Oracle JDK version 17

Read the full list of prerequisites in [SuiteCloud CLI for Node.js Installation Prerequisites](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1558708810.html).
Read the full list of prerequisites in [SuiteCloud CLI for Node.js Installation Prerequisites](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1558708810.html).

## Supported Versions
Although you may have access to older versions of CLI for Node.js, only the versions in this section are officially supported.
Expand Down Expand Up @@ -52,21 +52,21 @@ suitecloud <command> <option> <argument>
### Commands
| Command | Description |
| --- | --- |
|[`account:manageauth`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_157304934116.html)|Manages authentication IDs for all your projects.|
|[`account:savetoken`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159350785187.html)|Saves a TBA token that you issued previously in NetSuite.|
|[`account:setup`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156044528841.html)|Sets up an account to use with the SuiteCloud CLI for Node.js.|
|[`file:create`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_162810635242.html)|Creates SuiteScript files in the selected folder using the correct template with SuiteScript modules injected.|
|[`file:import`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156041963273.html)|Imports files from an account to your account customization project.|
|[`file:list`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156042966488.html)|Lists the files in the File Cabinet of your account.|
|[`file:upload`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159066070687.html)|Uploads files from your project to an account.|
|[`object:import`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156042181820.html)|Imports SDF custom objects from an account to your SuiteCloud project.|
|[`object:list`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156043303237.html)|Lists the SDF custom objects deployed in an account.|
|[`object:update`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156050566547.html)|Overwrites the SDF custom objects in the project with their matching objects imported from the account. In the case of custom records, custom instances can be included.|
|[`project:adddependencies`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_155981452469.html)| Adds missing dependencies to the manifest file.|
|[`project:create`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156041348327.html)|Creates a SuiteCloud project, either a SuiteApp or an account customization project (ACP).|
|[`project:deploy`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156044636320.html)|Deploys the folder containing the project.|
|[`project:package`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159550971388.html)|Generates a ZIP file from your project, respecting the structure specified in the deploy.xml file.|
|[`project:validate`](https://system.netsuite.com/app/help/helpcenter.nl?fid=section_156049843194.html)|Validates the folder containing the SuiteCloud project.|
|[`account:manageauth`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157304934116.html)|Manages authentication IDs for all your projects.|
|[`account:savetoken`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_159350785187.html)|Saves a TBA token that you issued previously in NetSuite.|
|[`account:setup`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156044528841.html)|Sets up an account to use with the SuiteCloud CLI for Node.js.|
|[`file:create`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_162810635242.html)|Creates SuiteScript files in the selected folder using the correct template with SuiteScript modules injected.|
|[`file:import`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156041963273.html)|Imports files from an account to your account customization project.|
|[`file:list`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156042966488.html)|Lists the files in the File Cabinet of your account.|
|[`file:upload`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_159066070687.html)|Uploads files from your project to an account.|
|[`object:import`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156042181820.html)|Imports SDF custom objects from an account to your SuiteCloud project.|
|[`object:list`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156043303237.html)|Lists the SDF custom objects deployed in an account.|
|[`object:update`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156050566547.html)|Overwrites the SDF custom objects in the project with their matching objects imported from the account. In the case of custom records, custom instances can be included.|
|[`project:adddependencies`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_155981452469.html)| Adds missing dependencies to the manifest file.|
|[`project:create`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156041348327.html)|Creates a SuiteCloud project, either a SuiteApp or an account customization project (ACP).|
|[`project:deploy`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156044636320.html)|Deploys the folder containing the project.|
|[`project:package`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_159550971388.html)|Generates a ZIP file from your project, respecting the structure specified in the deploy.xml file.|
|[`project:validate`](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156049843194.html)|Validates the folder containing the SuiteCloud project.|

To check the help for a specific command, run the following command:
```
Expand Down
3 changes: 1 addition & 2 deletions packages/node-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oracle/suitecloud-cli",
"version": "1.7.2",
"version": "1.7.3",
"license": "UPL-1.0",
"description": "SuiteCloud CLI for Node.js",
"keywords": [
Expand Down Expand Up @@ -30,7 +30,6 @@
"cli-spinner": "0.2.10",
"commander": "10.0.0",
"inquirer": "8.2.2",
"vm2": "3.9.17",
"xml2js": "0.5.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
'use strict';

const { NodeVM } = require('vm2');
const { lineBreak } = require('../../loggers/LoggerConstants');
const FileUtils = require('../../utils/FileUtils');
const path = require('path');
Expand Down Expand Up @@ -32,17 +31,7 @@ module.exports = class CLIConfigurationService {
}

try {
const nodeVm = new NodeVM({
console: 'inherit',
sandbox: {},
require: {
external: true,
builtin: ['*'],
root: this._executionPath,
},
});
const cliConfigFileContent = FileUtils.readAsString(cliConfigFile);
this._cliConfig = nodeVm.run(cliConfigFileContent, cliConfigFile);
this._cliConfig = require(cliConfigFile);
} catch (error) {
throw NodeTranslationService.getMessage(ERRORS.CLI_CONFIG_ERROR_LOADING_CONFIGURATION_MODULE, cliConfigFile, lineBreak, error);
}
Expand All @@ -58,10 +47,10 @@ module.exports = class CLIConfigurationService {
const defaultProjectFolder = isString(this._cliConfig.defaultProjectFolder) ? this._cliConfig.defaultProjectFolder : '';

const commandConfig = this._cliConfig && this._cliConfig.commands && this._cliConfig.commands[command];
let commandOverridenProjectFolder;
let commandOverriddenProjectFolder;
if (commandConfig && isString(commandConfig.projectFolder)) {
commandOverridenProjectFolder = commandConfig.projectFolder;
commandOverriddenProjectFolder = commandConfig.projectFolder;
}
return path.join(this._executionPath, commandOverridenProjectFolder ? commandOverridenProjectFolder : defaultProjectFolder);
return path.join(this._executionPath, commandOverriddenProjectFolder ? commandOverriddenProjectFolder : defaultProjectFolder);
}
};
5 changes: 3 additions & 2 deletions packages/node-cli/src/services/NpmInstallRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ module.exports = {
return new Promise((resolve, reject) => {
let npm = process.platform === PLATFORM_WIN ? COMMAND_NPM_WIN : COMMAND_NPM_UNIX;

const result = childProcess.spawn( npm, [NPM_ARG_INSTALL], {
const result = childProcess.spawn(npm, [NPM_ARG_INSTALL], {
cwd: projectAbsolutePath,
stdio: [process.stdin, process.stdout, process.stderr]
stdio: 'inherit',
windowsHide: true
});

result.on(NPM_RESULT_CLOSE, code => {
Expand Down
4 changes: 2 additions & 2 deletions packages/unit-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Suitecloud Unit Testing allows you to use unit testing with [Jest](https://jestj
- Provides SuiteScript 2.x stubs for SuiteScript modules.
- Allows you to create custom stubs for SuiteScript 2.x or custom modules.

For more information about the available SuitScript 2.x modules, see [SuiteScript 2.x Modules](https://nlcorp.app.netsuite.com/app/help/helpcenter.nl?fid=chapter_4220488571.html).
For more information about the available SuitScript 2.x modules, see [SuiteScript 2.x Modules](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_4220488571.html).
For more information about all the mockable stubs, see the CORE_STUBS list in [SuiteCloudJestConfiguration.js](./jest-configuration/SuiteCloudJestConfiguration.js).

## Prerequisites
Expand Down Expand Up @@ -321,7 +321,7 @@ describe('Sample test with user defined http module stub', () => {
});
```

## [Contributing](/CONTRIBUTING.md)
## Contributing
Suitecloud Unit Testing is an open source project. Pull requests are currently not being accepted. See [Contributing](/CONTRIBUTING.md) for details.

## [License](/LICENSE.txt)
Expand Down
Loading

0 comments on commit 27fb57d

Please sign in to comment.