Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: scripts section #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions docs/cli/scripts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Scripts
---

<head>
<title>Stencil-Cli Introduction</title>
</head>
<p>

## Stencil CLI and Scripts

This section provides additional background on how to use npm scripts to manage the build and execution process of a Stencil application.

A Stencil application is a **standard** TypeScript application that needs to be compiled to JavaScript before it can be executed. There are various ways to accomplish the compilation step, and developers/teams are free to choose a way that works best for them. With that in mind, Stencil provides a set of tools out-of-the-box that seek to do the following:

This goal is accomplished through a combination of a locally installed TypeScript compiler and `package.json` scripts. We describe how these technologies work together below. This should help you understand what's happening at each step of the build/execute process, and how to customize that behavior if necessary.

### Linking

To link a local package, use the following npm command:

```bash
$ npm link
```

This is useful when you are developing multiple packages locally and want to test them together.
Comment on lines +20 to +26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify npm link usage.

The section on linking local packages is clear. Consider adding an example to demonstrate how npm link can be used in a practical scenario, which will enhance understanding for new developers.

Tools
Markdownlint

23-23: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)


### Build

You can build your Stencil application using the following npm command:

#### **Note : make sure to keep dependencies in-check and update the required packages**

```bash
$ npm run build
```

This command will compile the TypeScript code to JavaScript, ensuring that the application is ready to be executed.

### Execution

To start your Stencil application, use the following npm command:

```bash
$ npm run start
```

This command will execute the compiled application.
Comment on lines +42 to +48
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardize command documentation.

For consistency, avoid using the dollar sign before commands unless you are showing output. This adheres to Markdownlint suggestions and improves readability.

- $ npm run start
+ npm run start
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
To start your Stencil application, use the following npm command:
```bash
$ npm run start
```
This command will execute the compiled application.
To start your Stencil application, use the following npm command:
```bash
npm run start
```
This command will execute the compiled application.
Tools
Markdownlint

45-45: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)


#### Package Scripts

Running the above commands at the OS command level ensures that the build and execute processes are managed as project dependencies in `package.json`. This way, all members of your organization can be assured of running the same version of the commands. By following this **recommended** usage, you can fully customize the behavior of these scripts via their options and/or customize the `tsc` compiler options files (e.g., `tsconfig.json`) as needed.

For most developers/teams, it is recommended to utilize the package scripts for building and executing their Nest projects.</p>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline at the end of the file.

Files should end with a single newline character to comply with POSIX standards and facilitate proper processing by Unix/Linux utilities.

+ \n
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
For most developers/teams, it is recommended to utilize the package scripts for building and executing their Nest projects.</p>
For most developers/teams, it is recommended to utilize the package scripts for building and executing their Nest projects.</p>
Tools
Markdownlint

54-54: null
Files should end with a single newline character

(MD047, single-trailing-newline)

6 changes: 3 additions & 3 deletions docs/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ To quickly get started with Stencil, follow these simple steps:
4. Set up the environment:

```bash
docker compose up setup
docker compose up -d
docker-compose up setup
docker-compose up -d
```

5. Check the status of containers:

```bash
docker compose logs
docker-compose logs
```

For detailed information on features, development setup, and testing procedures, refer to the comprehensive documentation.
Expand Down
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = {
type: 'category',
label: 'CLI',
collapsed: false,
items: ['cli/introduction', 'cli/installation'],
items: ['cli/introduction', 'cli/installation' , 'cli/scripts'],
},
{
type: 'category',
Expand Down