Skip to content

Commit 9c61f02

Browse files
committed
📝 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.
1 parent d721ce6 commit 9c61f02

1 file changed

Lines changed: 59 additions & 48 deletions

File tree

.ci/templates/README.hbs

Lines changed: 59 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,92 @@
1-
# 🚀 Introduction
1+
# 🚀 NetSuite SuiteScript Project Template: Module Testing & CI/CD Integration
22

3-
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
44

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.
96

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.
118

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
1310

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.
1527

1628
## 🎉 Getting Started
1729

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`.
3338

3439
## 🧐 Notable Files
3540

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.
4147

4248
## 🔨 Scripts
4349

44-
Use `npm run <script>` to execute various commands for the project
50+
Use `npm run <script>` to execute various project commands:
4551
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 change based `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.
56+
- `npm run generate-manifests --headbranch=main --sourcebranch=dev` - Generate change-based `deploy.xml` & `manifest.xml`.
5157
5258
### ✅ Running Tests
5359
54-
- `npm run test` -- Uses Jest to run test files in `./__tests__` directory
55-
- `npm run test-ci` -- Uses Jest to run test files in `./__tests__` directory in CI mode creating junit report with it
56-
- `npm run test --watch=watch` -- Runs Jest tests in watch mode
57-
- `npm run view-coverage` -- Runs Jest tests and opens coverage report in browser window
60+
- `npm run test` - Run Jest tests in `./__tests__`.
61+
- `npm run test-ci` - Run Jest tests in CI mode, creating junit reports.
62+
- `npm run test --watch=watch` - Run Jest tests in watch mode.
63+
- `npm run view-coverage` - Run tests and open coverage report.
5864
5965
#### Wallaby.js
6066
6167
[![Wallaby.js](https://img.shields.io/badge/wallaby.js-powered-blue.svg?style=flat&logo=github)](https://wallabyjs.com/oss/)
6268
63-
This repository contributors are welcome to use
64-
[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.
6770
6871
## 👷 CI/CD
6972
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.
7182
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.
7484
75-
{{CONTRIBUTORS}}
7685
7786
## 📝 Documentation
7887
88+
Comprehensive project documentation is available, detailing setup, configuration, and usage instructions.
89+
7990
{{>main}}
8091
81-
Happy Coding! 🥳
92+
Happy Coding! 🥳

0 commit comments

Comments
 (0)