You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📝 Refactor readme.hbs for Comprehensive Project Overview
- Revise introduction to emphasize module testing and CI/CD integration.
- Highlight NS 2023.2 alignment and compatibility with NetSuite-Cust-Jest-Stubs-Template.
- Detail Azure Pipeline workflows for different deployment scenarios.
- Maintain existing formatting style for readability and consistency.
This project is meant to serve as a baseline template project for getting tests implemented easier in to your NetSuite SuiteCloud projects. This project demonstrates how to create and use:
3
+
## 🚀 Introduction
4
4
5
-
- Custom NetSuite modules
6
-
- Test modules using Jest
7
-
- Import your custom stubs package for Jest test
8
-
- Integrate continuos integration/deployment pipelines for your project
5
+
Welcome to the NetSuite SuiteScript Project Template - a cutting-edge solution tailored for module testing and CI/CD integration within the NetSuite ecosystem. This project is meticulously aligned with **NS 2023.2**, ensuring up-to-date compatibility and performance.
9
6
10
-
This is currently based on **NS 2022.2**
7
+
Designed to work seamlessly with the [NetSuite-Cust-Jest-Stubs-Template](https://github.com/devnetkc/NetSuite-Cust-Jest-Stubs-Template), this template stands as a pivotal tool for NetSuite developers. It facilitates the creation, testing, and deployment of custom SuiteScript modules, promoting efficiency and reliability in the development process.
11
8
12
-
This project pairs with the [NetSuite-Cust-Jest-Stubs-Template](https://github.com/devnetkc/NetSuite-Cust-Jest-Stubs-Template) tutorial/template npm package project.
9
+
### Core Features
13
10
14
-
Using the directory path `/SuiteScript/...`, we can provide aliases locally for these modules while still being available in NetSuite -- as the root directory for SuiteScript files in NetSuite is `/SuiteScripts/`.
11
+
- **SuiteScript Module Development:** Crafted specifically for SuiteScript, it acts as an essential starting point for scripting, adhering to NetSuite's best practices and standards.
12
+
- **Automated Module Testing:** Integrating Jest for automated testing, it ensures your SuiteScript modules function flawlessly, enhancing code reliability.
13
+
- **Custom Stub Integration:** Allows for the integration of custom Jest stubs, simulating NetSuite's API for isolated testing.
14
+
- **CI/CD Integration:** Comes with pre-configured Azure Pipeline configurations, automating the integration and deployment processes.
15
+
- **Documentation Generation:** Utilizes JSDoc comments and Markdown for automatic, detailed documentation of SuiteScript modules.
16
+
17
+
Local aliases for SuiteScript modules are effectively managed using the `/SuiteScript/...` path, ensuring compatibility with the NetSuite SuiteScript root directory `/SuiteScripts/`. This feature simplifies the management of scripts and aligns with NetSuite's directory structure.
18
+
19
+
### Targeted Use Cases
20
+
21
+
- **NetSuite SuiteScript Developers:** Ideal for crafting and managing custom scripts within NetSuite.
22
+
- **Quality Assurance and Testing:** Ensures rigorous testing routines for NetSuite customizations.
23
+
- **CI/CD Pipeline Integration:** Seamlessly integrates SuiteScript development into CI/CD workflows.
24
+
- **Documentation and Maintenance:** Automates documentation for easy maintenance and understanding of scripts.
25
+
26
+
Leverage this template to elevate your SuiteScript development workflow, ensuring robust, well-tested, and efficiently integrated scripts within your NetSuite environment.
15
27
16
28
## 🎉 Getting Started
17
29
18
-
1. Open [`./package.json`](./package.json) and customize the project configuration
19
-
2. Add your own `ExcludeStubs` path aliases to [`jest.config.js`](./jest.config.js)
20
-
3. Create a local environment variable `NPM_TOKEN` using your NPM token for the value _(Note: this variable name can be changed within the [`.npmrc`](./.npmrc) file)_
21
-
4. Run `npm i` to install the project dependencies
22
-
5. Run `npm run generate-manifests` to create local deploy.xml and manifest files **Required files to use SuiteCloud tools**
23
-
6. Setup SuiteCloud account details
24
-
- CLI _(Note: update `$()` variables with your own values)_
25
-
```JS
26
-
npm run setup-server --sourcebranch=$(SOURCEBRANCH) --headbranch=$(HEADBRANCH) --account=$(ACCOUNT) --authid=$(AUTHID) --tokenid=$(TOKENID) --tokensecret=$(TOKENSECRET)
27
-
```
28
-
- VSCode
29
-
- Open command pallet
30
-
- MacOS:`CMD + SHIFT + p`
31
-
- Win: `CTRL + SHIFT + p`
32
-
- Select & Run `SuiteCloud: Set Up Account`
30
+
1. Open [`./package.json`](./package.json) and customize the project configuration.
31
+
2. Add your `ExcludeStubs` path aliases to [`jest.config.js`](./jest.config.js).
32
+
3. Create a local environment variable `NPM_TOKEN` using your NPM token (variable name can be changed in [`.npmrc`](./.npmrc)).
33
+
4. Run `npm i` to install project dependencies.
34
+
5. Run `npm run generate-manifests` to create `deploy.xml` and `manifest.xml`, essential for SuiteCloud tools.
35
+
6. Setup SuiteCloud account details:
36
+
- CLI (update `$()` variables with your values): `npm run setup-server --sourcebranch=$(SOURCEBRANCH) --headbranch=$(HEADBRANCH) --account=$(ACCOUNT) --authid=$(AUTHID) --tokenid=$(TOKENID) --tokensecret=$(TOKENSECRET)`
37
+
- VSCode: Open command pallet (`CMD + SHIFT + p` on MacOS, `CTRL + SHIFT + p` on Windows), then select & run `SuiteCloud: Set Up Account`.
33
38
34
39
## 🧐 Notable Files
35
40
36
-
- [`manifest.tpl.xml`](./ci/templates/manifest.tpl.xml) -- Used to create SuiteCloud project manifest (**Project Name Change Required**)
37
-
- [`README.hbs`](./.ci/templates/README.hbs) -- Base template file the project README.md is generated from
38
-
- [`npmrc`](./.npmrc) -- NPM environment token loader file for publishing project _(Note: the variable name `NPM_TOKEN` can be changed for multiple tokens)_
39
-
- [`docsMD.config`](./.ci/config/docsMD.config.js) -- Wiki MD generator from JSDoc notations
40
-
- [`jsDocsConf.json`](./.ci/config/jsDocsConf.json) -- JSDocs configuration file. **Important:** For hosted documentation, especially when using `azure-pipelines-docs.yml`, update the `base_url` in this file from `localhost` to your documentation's hosted URL.
41
+
- [`manifest.tpl.xml`](./ci/templates/manifest.tpl.xml) - Template for SuiteCloud project manifest. (Project Name Change Required)
42
+
- [`README.hbs`](./.ci/templates/README.hbs) - Base template for generating project README.md.
43
+
- [`npmrc`](./.npmrc) - NPM environment token loader for publishing (variable name `NPM_TOKEN` can be changed).
44
+
- [`docsMD.config`](./.ci/config/docsMD.config.js) - Generator for Markdown documentation from JSDoc notations.
45
+
- [`jsDocsConf.json`](./.ci/config/jsDocsConf.json) - Configuration for JSDoc generation. Update `base_url` from `localhost` for hosted documentation.
46
+
- New scripts like `flattenObjectPath.sh`, `rmDependents.sh`, and `web.config.private` for improved project management.
41
47
42
48
## 🔨 Scripts
43
49
44
-
Use `npm run <script>` to execute various commands for the project
50
+
Use `npm run <script>` to execute various project commands:
45
51
46
-
- `npm run test` -- Uses Jest to run tests (see [Running Tests](#-running-tests) for more details.)
47
-
- `npm run docs` -- Generates project documentation based on JSDoc notations (Configure with [docsMD.config](./.ci/config/docsMD.config.js) && [jsDocsConf.json](./.ci/config/jsDocsConf.json)) *(Note: also updates contributor list)*
48
-
- `npm run open-docs` -- Opens documentation in browser for viewing
49
-
- `npm run generate-manifests` -- Generates empty `deploy.xml` &&`manifest.xml`in local project to satisfy SDF as being a SuiteCloud project
50
-
- `npm run generate-manifests --headbranch=main --sourcebranch=dev` -- Generates changebased `deploy.xml` &&`manifest.xml` in local project based on source and head branch differences _(Note: script files referenced in changed Object files will be included in deploy.xml files if they exist, even if there was no changes made to them)_
52
+
- `npm run test` - Run tests using Jest. (See [Running Tests](#-running-tests) for details.)
53
+
- `npm run docs` - Generate project documentation from JSDoc notations (configure with [docsMD.config](./.ci/config/docsMD.config.js) & [jsDocsConf.json](./.ci/config/jsDocsConf.json)).
54
+
- `npm run open-docs` - Open documentation in a browser for viewing.
55
+
- `npm run generate-manifests` - Generate `deploy.xml` & `manifest.xml`for SuiteCloud.
[Wallaby.js OSS License](https://wallabyjs.com/oss/) to get
65
-
test results immediately as you type, and see the results in
66
-
your editor right next to your code.
69
+
Repository contributors can use the [Wallaby.js OSS License](https://wallabyjs.com/oss/) for immediate test results.
67
70
68
71
## 👷 CI/CD
69
72
70
-
Azure yaml pipeline files are provided in [`.ci/workflows`](./.ci/workflows).
73
+
Azure yaml pipeline files in [`.ci/workflows`](./.ci/workflows) are designed to automate and streamline the CI/CD processes for different deployment scenarios:
74
+
75
+
- [`azure-pipelines-docs.yml`](./.ci/workflows/azure-pipelines-docs.yml): Generates project documentation based on JSDoc comments, commits the changes, and pushes them back to the current PR or branch. This ensures that the documentation is always up-to-date with the codebase.
76
+
- [`azure-pipelines-build-deploy.yml`](./.ci/workflows/azure-pipelines-build-deploy.yml): Executes Jest tests, generates a change-based `deploy.xml`, updates manifest dependencies, and uses the SuiteCloud CLI to deploy the project to NetSuite. This pipeline ensures that only tested and verified changes are deployed.
77
+
- [`azure-pipelines-build-prod.yml`](./.ci/workflows/azure-pipelines-build-prod.yml): Tailored for production environment deployments. It validates production pull requests and creates a release for the main branch.
78
+
- [`azure-pipelines-build-sb.yml`](./.ci/workflows/azure-pipelines-build-sb.yml): Focused on deployments to a Sandbox 1 environment. It facilitates testing and validation in a sandbox before changes are moved to production.
79
+
- [`azure-pipelines-build-sb2.yml`](./.ci/workflows/azure-pipelines-build-sb2.yml): Similar to `azure-pipelines-build-sb.yml` but targets a Sandbox 2 environment, providing an additional layer of testing or for separate feature testing.
80
+
- [`azure-pipelines-select-branch.yml`](./.ci/workflows/azure-pipelines-select-branch.yml): Assists in determining the source branch for a pull request, ensuring that the correct branch is used for comparisons and deployments in CI/CD processes.
81
+
- [`azure-pipelines-validate-prod-pr.yml`](./.ci/workflows/azure-pipelines-validate-prod-pr.yml): Validates pull requests against the production branch, ensuring that only approved and compliant changes are merged.
71
82
72
-
- [`azure-pipelines-docs.yml`](./.ci/workflows/azure-pipelines-docs.yml) -- Generates documentation, commits,and pushes back to current PR/branch
73
-
- [`azure-pipelines-build-deploy.yml`](./.ci/workflows/azure-pipelines-build-deploy.yml) -- Runs Jest tests, generates a change based deploy.xml, updates manifest dependencies, and uses SuiteCloud CLI to deploy projects
83
+
These pipelines collectively support a robust and flexible CI/CD process, enabling automatic testing, documentation updates, and deployment to various environments, ensuring consistency and reliability in software delivery.
74
84
75
-
{{CONTRIBUTORS}}
76
85
77
86
## 📝 Documentation
78
87
88
+
Comprehensive project documentation is available, detailing setup, configuration, and usage instructions.
0 commit comments