Skip to content

Commit a693139

Browse files
authored
Merge pull request #48 from JupiterOne/PLATENG-880
Upgrade dependencies to address security vulnerabilities
2 parents ca272fc + 0d97eac commit a693139

File tree

10 files changed

+9378
-4285
lines changed

10 files changed

+9378
-4285
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,70 @@ jobs:
1111
os: [ubuntu-latest]
1212

1313
steps:
14-
- id: setup-node
15-
name: Setup Node
16-
uses: actions/setup-node@v3
14+
- name: Check out code repository source code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v4
1719
with:
1820
node-version: ${{ matrix.node-version }}
19-
20-
- name: Check out code repository source code
21-
uses: actions/checkout@v2
21+
cache: 'npm'
2222

2323
- name: Install dependencies
24-
run: yarn
24+
run: npm ci
2525

2626
- name: Run build
27-
run: yarn build
27+
run: npm run build
2828

2929
- name: Run lint
30-
run: yarn lint
30+
run: npm run lint
3131

3232
# Publishing is done in a separate job to allow
3333
# for all matrix builds to complete.
3434
release:
3535
needs: test
3636
runs-on: ubuntu-latest
3737
if: github.ref == 'refs/heads/main'
38-
strategy:
39-
fail-fast: false
40-
matrix:
41-
node: [18]
4238

4339
steps:
44-
- name: Setup Node
45-
uses: actions/setup-node@v3
46-
with:
47-
node-version: 18.x
48-
4940
- name: Check out repo
50-
uses: actions/checkout@v2
41+
uses: actions/checkout@v4
5142
with:
5243
fetch-depth: 2
5344

45+
- name: Setup Node
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: 18.x
49+
cache: 'npm'
50+
5451
- name: Check if publish needed
52+
id: publish
5553
run: |
5654
name="$(jq -r .name package.json)"
5755
npmver="$(npm show $name version || echo v0.0.0)"
5856
pkgver="$(jq -r .version package.json)"
5957
if [ "$npmver" = "$pkgver" ]
6058
then
6159
echo "Package version ($pkgver) is the same as last published NPM version ($npmver), skipping publish."
60+
echo "publish=false" >> $GITHUB_ENV
61+
echo "publish=false" >> $GITHUB_OUTPUT
6262
else
6363
echo "Package version ($pkgver) is different from latest NPM version ($npmver), publishing!"
6464
echo "publish=true" >> $GITHUB_ENV
65+
echo "publish=true" >> $GITHUB_OUTPUT
6566
fi
6667
68+
- name: Install dependencies
69+
run: npm ci
70+
71+
- name: Build
72+
run: npm run build
73+
6774
- name: Publish
68-
if: env.publish == 'true'
75+
if: steps.publish.outputs.publish == 'true'
6976
env:
7077
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
7178
run: |
7279
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
73-
yarn
74-
yarn build
7580
npm publish

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ dist/
33
coverage/
44
node_modules/
55
work/
6-
package-lock.json
76
.DS_Store
87
.idea/

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx lint-staged

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { FlatCompat } from '@eslint/eslintrc';
2+
import js from '@eslint/js';
3+
import { fileURLToPath } from 'url';
4+
import path from 'path';
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all,
13+
});
14+
15+
export default [
16+
// Global ignores (replaces .eslintignore and ignorePatterns)
17+
{
18+
ignores: [
19+
'*.js',
20+
'!eslint.config.js',
21+
'index.js',
22+
'config/**',
23+
'test/fixtures/**/*',
24+
'dist/**',
25+
'node_modules/**',
26+
],
27+
},
28+
29+
// Use FlatCompat to bridge the legacy @jupiterone/eslint-config
30+
...compat.extends('@jupiterone/eslint-config/node18'),
31+
32+
// TypeScript-specific configuration
33+
{
34+
files: ['**/*.ts', '**/*.tsx'],
35+
languageOptions: {
36+
parserOptions: {
37+
project: './tsconfig.json',
38+
tsconfigRootDir: __dirname,
39+
},
40+
},
41+
},
42+
];

0 commit comments

Comments
 (0)