Skip to content

Commit 21f970d

Browse files
Merge pull request #1076 from JupiterOne/INT-10745-1
INT-10745: mirate SDK to NPM
2 parents e4d3dbe + b902ae1 commit 21f970d

File tree

30 files changed

+17866
-10987
lines changed

30 files changed

+17866
-10987
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ jobs:
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version: ${{ matrix.node-version }}
30-
cache: yarn
30+
cache: npm
3131
registry-url: https://registry.npmjs.org
3232

3333
- name: Install dependencies
34-
run: yarn --frozen-lockfile
34+
run: npm ci --include=optional
3535
env:
3636
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
3737

3838
- name: Run tests
39-
run: yarn test:ci
39+
run: npm run test:ci
4040

4141
- name: Run build
42-
run: yarn build:dist
42+
run: npm run build:dist
4343

4444
# Publishing is done in a separate job to allow
4545
# for all matrix builds to complete.
@@ -60,7 +60,7 @@ jobs:
6060
uses: actions/setup-node@v4
6161
with:
6262
node-version: 18.x
63-
cache: yarn
63+
cache: npm
6464
registry-url: https://registry.npmjs.org
6565

6666
# Fetch tags and describe the commit before the merge commit
@@ -83,5 +83,5 @@ jobs:
8383
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
8484
run: |
8585
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
86-
yarn --frozen-lock-file
87-
yarn lerna publish from-package --no-verify-access --yes
86+
npm ci
87+
npm exec lerna publish from-package --no-verify-access --yes

.huskyrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
hooks: {
33
'pre-commit': 'lint-staged',
4-
'pre-push': 'yarn prepush',
4+
'pre-push': 'npm run prepush',
55
},
66
};

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ details about how to develop integrations with this SDK.
4646

4747
To get started with development:
4848

49-
1. Install dependencies using `yarn`
50-
1. Run `yarn build`
49+
1. Install dependencies using `npm install`
50+
1. Run `npm run build`
5151

5252
This project utilizes TypeScript project references for incremental builds. To
53-
prepare all of the packages, run `yarn build`. If you are making a changes
54-
across multiple packages, it is recommended you run `yarn build --watch` to
55-
automatically compile changes as you work.
53+
prepare all of the packages, run `npm run build`. If you are making a changes
54+
across multiple packages, it is recommended you run `npm run build -- --watch`
55+
to automatically compile changes as you work.
5656

5757
### Linking packages
5858

@@ -62,12 +62,12 @@ when changes are made.
6262

6363
Steps to automatically build and link:
6464

65-
- Run `yarn build` or `yarn build --watch` in _this_ project from a terminal and
66-
wait for initial build to complete.
65+
- Run `npm run build` or `npm run build --watch` in _this_ project from a
66+
terminal and wait for initial build to complete.
6767

68-
- Run `yarn link` in the package that you want to link.
68+
- Run `npm link` in the package that you want to link.
6969

70-
- In a separate terminal, run `yarn link @jupiterone/<package to link>` in the
70+
- In a separate terminal, run `npm link @jupiterone/<package to link>` in the
7171
integration project. You can now use the integration SDK CLI in the other
7272
project and it will use the latest code on your filesystem.
7373

@@ -80,15 +80,15 @@ to move to). Don't forget to update the `CHANGELOG.md` file!
8080
```shell
8181
git checkout -b release-<major>.<minor>.<patch>
8282
git push -u origin release-<major>.<minor>.<patch>
83-
yarn lerna version <major>.<minor>.<patch>
83+
npm exec lerna version <major>.<minor>.<patch>
8484
```
8585

8686
Note the `git checkout`/`git push` is required because Lerna will expect that
8787
you've already created a remote branch before bumping, tagging, and pushing the
8888
local changes to remote.
8989

9090
❕Make sure to have committed all your changes before running
91-
`yarn lerna version` since it will commit the version update and tag that
91+
`npm exec lerna version` since it will commit the version update and tag that
9292
commit. Rebasing or amending lerna's commit will cause the tag to point to a
9393
different commit.
9494

docs/integrations/development_guide.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ You'll need:
4141
[fnm](https://github.com/Schniz/fnm) and
4242
[nvm](https://github.com/nvm-sh/nvm) are great choices.
4343

44-
- yarn
45-
```sh
46-
npm install --global yarn
47-
```
48-
4944
### **Setup**
5045

5146
**Through the GitHub CLI**
@@ -55,20 +50,20 @@ gh repo create graph-$INTEGRATION_NAME --public \
5550
--clone \
5651
--template=https://github.com/jupiterone/integration-template
5752
cd graph-$INTEGRATION_NAME
58-
yarn install
53+
npm install
5954
```
6055

6156
**Through the GitHub UI**
6257

6358
1. Use the
6459
[**integration-template**](https://github.com/JupiterOne/integration-template)
6560
to create a new repository
66-
2. Clone your repository and run `yarn install`
61+
2. Clone your repository and run `npm install`
6762

6863
```sh
6964
git clone https://github.com/$USERNAME/$REPO_NAME`
7065
cd $REPO_NAME
71-
yarn install
66+
npm install
7267
```
7368

7469
That's it! Your project is ready for development!
@@ -362,7 +357,7 @@ We'll also need to add an HTTP client to make requests. I'll use `node-fetch`,
362357
but the choice of client is up to you.
363358
364359
```sh
365-
yarn add node-fetch
360+
npm install node-fetch
366361
```
367362
368363
Now we can add the `getAccount` method to our client.
@@ -706,7 +701,7 @@ And that's it! We have a working `executionHandler`.
706701
We've now:
707702
708703
- ✅ Created a new integration project
709-
- ✅ Installed dependencies with `yarn install`
704+
- ✅ Installed dependencies with `npm install`
710705
- ✅ Created our `instanceConfigFields`
711706
- ✅ Setup a `.env` file
712707
- ✅ Created our `validateInvocation`
@@ -716,10 +711,10 @@ We've now:
716711
We are now ready to run our integration! We can collect data using:
717712
718713
```sh
719-
yarn start
714+
npm run start
720715
```
721716
722717
You can see the collected data in the `.j1-integration` and you can visualize
723-
the results with `yarn graph`.
718+
the results with `npm run graph`.
724719
725720
[//]: # 'TODO add references to other more advanced docs'

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"npmClient": "yarn",
2+
"npmClient": "npm",
33
"packages": [
44
"packages/integration-sdk-*",
55
"packages/cli"

0 commit comments

Comments
 (0)