Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 2f4eea2

Browse files
committed
Add README content
[changelog:added]
1 parent a99c6e8 commit 2f4eea2

File tree

6 files changed

+946
-863
lines changed

6 files changed

+946
-863
lines changed

README.md

Lines changed: 85 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,103 @@ Run npm scripts to compile or test your JavaScript project
1212

1313
# What it's useful for
1414

15+
Run npm scripts with different versions of Node.js and npm in a consistent container environment.
16+
When your tests pass, you can immediately publish the package to the npmjs.com Registry.
17+
18+
- Set up this skill with multiple configuration to run your tests on different versions of Node.js
19+
- Decide to publish your packages consistently from a centralized configuration
20+
- Own the container environment and install tools needed for your build and test
21+
1522
# Before you get started
1623

1724
Connect and configure this integration:
1825

1926
- **GitHub**
20-
- **Slack**
27+
- **npmjs.com Registry**
28+
- **Slack or Microsoft Teams**
2129

2230
The **GitHub** integration must be configured in order to use this skill. At least one repository must be selected.
23-
We recommend that you configure the **Slack** integration.
31+
If you want to publish a npm package to npmjs.com, you need to connect an **npmjs.com Registry**. We recommend
32+
that you configure the **Slack** or **Microsoft Teams** integration.
2433

2534
# How to configure
2635

27-
1. **Step 1**
36+
1. **Configure npm scripts to run**
37+
38+
Provide the name of the npm scripts from the project's `package.json` scripts section.
39+
The order in which the scripts are specified is the order in which they will get executed.
40+
If one script fails, the execution stops.
41+
42+
1. **Define Node.js version**
43+
44+
Provide a valid Node.js version or alias as used by [nvm](https://github.com/nvm-sh/nvm#usage).
45+
46+
1. **Decide if the package should be published after running the scripts**
47+
48+
When checked, the skill will run `npm publish` after successful execution of the configured
49+
scripts.
50+
51+
1. **Define package access**
52+
53+
`npm publish` allows to publish packages with `public` or `restricted` access.
54+
55+
1. **Create additional npm distribution tags**
56+
57+
Specify additional [distribution tags](https://docs.npmjs.com/adding-dist-tags-to-packages)
58+
like `next` or `stable` for the published version of the package.
59+
60+
1. **Tag the Git commit on successful execution**
61+
62+
Tag the Git commit with the version of the packcage that was just published.
63+
64+
1. **Specify an optional bash command**
65+
66+
In case your npm scripts need different tools - like databases - you can use this parameter
67+
to install such tools. Provide a command that can in a Ubuntu 20.04 LTS container.
68+
69+
Here's is an example on how to install MongoDB and start it:
70+
71+
```bash
72+
apt-get update \
73+
&& apt-get install -y wget libcurl4 openssl tar \
74+
&& wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz \
75+
&& tar -zxvf mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz \
76+
&& cp mongodb-linux-x86_64-ubuntu1804-4.2.8/bin/* /usr/local/bin/ \
77+
&& rm -rf mongodb-linux-x86_64-ubuntu1804-4.2.8* \
78+
&& mkdir -p /var/lib/mongo \
79+
&& mkdir -p /var/log/mongodb \
80+
&& mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
81+
```
82+
83+
1. **Enable file caching for faster execution times**
84+
85+
You can speed up executions times by enabling file caching for certain artifacts — for example, dependencies —
86+
by providing glob patterns of files you'd like to cache between executions.
87+
88+
Note that only files within the `/atm/home` directory can be cached.
89+
90+
Caching the npm dependency cache could be accomplished with the following pattern:
91+
92+
`.npm/**`
93+
94+
1. **Determine repository scope**
95+
96+
By default, this skill will be enabled for all repositories in all
97+
organizations you have connected.
98+
99+
To restrict the organizations or specific repositories on which the skill
100+
will run, you can explicitly choose organization(s) and repositories.
101+
102+
# How to build and publish your npm projects
103+
104+
1. **Configure at least the npm scripts to run**
105+
106+
1. **Make some pushes to your configured repositories**
28107
29-
2. **Don't risk letting sensitive secrets and credential sit in your code base for the taking!**
108+
1. **Enjoy automatic and consistent execution of npm scripts on every push**
30109
31-
To create feature requests or bug reports, create an [issue in the repository for this skill](https://github.com/atomist-skills/npm-skill/issues).
32-
See the [code](https://github.com/atomist-skills/npm-skill) for the skill.
110+
To create feature requests or bug reports, create an [issue in the repository for this skill](https://github.com/atomist-skills/npm-build-skill/issues).
111+
See the [code](https://github.com/atomist-skills/npm-build-skill) for the skill.
33112
34113
<!---atomist-skill-readme:end--->
35114

lib/configuration.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
*/
1616

1717
export interface Configuration {
18-
version: string;
19-
scripts: string[];
20-
publish: boolean;
21-
access: string;
22-
tag: string[];
23-
gitTag: boolean;
24-
command: string;
25-
docker_cache: string[];
18+
version: string;
19+
scripts: string[];
20+
publish: boolean;
21+
access: string;
22+
tag: string[];
23+
gitTag: boolean;
24+
command: string;
25+
docker_cache: string[];
2626
}

0 commit comments

Comments
 (0)