Skip to content

Commit

Permalink
chore(js): migrate to pnpm
Browse files Browse the repository at this point in the history
Signed-off-by: Berend Sliedrecht <sliedrecht@berend.io>
  • Loading branch information
berendsliedrecht committed May 10, 2024
1 parent 81a925b commit 1636421
Show file tree
Hide file tree
Showing 117 changed files with 14,365 additions and 7,878 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ jobs:
with:
node-version: 18.x

- uses: pnpm/action-setup@v4
with:
version: 8

- name: Fetch library artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -351,26 +355,26 @@ jobs:
pip install setuptools wheel twine auditwheel
- name: Install dependencies
run: yarn install
run: pnpm install

- name: Build
run: yarn build
run: pnpm build

- name: Lint
run: yarn lint
run: pnpm lint

- name: Check format
run: yarn check-format
run: pnpm check-format

- name: Check types
run: yarn check-types
run: pnpm check-types

- name: Run tests
if: ${{ matrix.architecture != 'linux-aarch64' }}
env:
# binary is downloaded to root of repository
LIB_ARIES_ASKAR_PATH: ../../../
run: yarn test
LIB_ARIES_ASKAR_PATH: ../../
run: pnpm test

- name: Set NPM config
if: |
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions wrappers/javascript/.eslintignore

This file was deleted.

98 changes: 0 additions & 98 deletions wrappers/javascript/.eslintrc.js

This file was deleted.

71 changes: 71 additions & 0 deletions wrappers/javascript/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
root: true

parser: '@typescript-eslint/parser'

plugins:
- '@typescript-eslint'
- prettier
- import

parserOptions:
tsconfigRootDir: .
project:
- './tsconfig.eslint.json'
- './packages/**/tsconfig.json'

extends:
- eslint:recommended
- plugin:@typescript-eslint/strict
- plugin:@typescript-eslint/stylistic
- plugin:prettier/recommended

ignorePatterns:
- '**/build/**'
- '**/node_modules/**'

rules:
'@typescript-eslint/consistent-type-definitions': off
'@typescript-eslint/no-extraneous-class': off
'@typescript-eslint/no-use-before-define':
- error
- functions: false
classes: false
variables: true
'@typescript-eslint/explicit-member-accessibility': error
no-console: error
'@typescript-eslint/consistent-type-imports': error
import/newline-after-import:
- error
- count: 1
import/order:
- error
- groups:
- type
- - builtin
- external
- parent
- sibling
- index
alphabetize:
order: asc
newlines-between: always
'@typescript-eslint/no-non-null-assertion': error
import/no-extraneous-dependencies:
- error
- devDependencies: false

overrides:
- files: 'tests'
env:
jest: true
node: true

- files:
- '**/scripts/**'
- '**/*.config.js'
env:
node: true
rules:
no-undef: off
no-console: off
'@typescript-eslint/no-var-requires': off
4 changes: 0 additions & 4 deletions wrappers/javascript/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ android.iml
# node.js
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
.yarn
.yarnrc

# BUCK
buck-out/
Expand Down
14 changes: 0 additions & 14 deletions wrappers/javascript/aries-askar-nodejs/jest.config.ts

This file was deleted.

6 changes: 0 additions & 6 deletions wrappers/javascript/aries-askar-nodejs/tsconfig.json

This file was deleted.

18 changes: 0 additions & 18 deletions wrappers/javascript/aries-askar-react-native/babel.config.js

This file was deleted.

6 changes: 0 additions & 6 deletions wrappers/javascript/aries-askar-react-native/tsconfig.json

This file was deleted.

7 changes: 0 additions & 7 deletions wrappers/javascript/aries-askar-shared/tsconfig.build.json

This file was deleted.

3 changes: 0 additions & 3 deletions wrappers/javascript/aries-askar-shared/tsconfig.json

This file was deleted.

19 changes: 0 additions & 19 deletions wrappers/javascript/jest.config.base.ts

This file was deleted.

25 changes: 17 additions & 8 deletions wrappers/javascript/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import type { Config } from '@jest/types'
import type { JestConfigWithTsJest } from 'ts-jest'

import base from './jest.config.base'

const config: Config.InitialOptions = {
...base,
roots: ['<rootDir>'],
projects: ['<rootDir>/*/jest.config.ts'],
const config: JestConfigWithTsJest = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
isolatedModules: true,
},
],
},
moduleNameMapper: {
'@hyperledger/aries-askar-shared': '<rootDir>/packages/aries-askar-shared/src',
},
}

export default config
module.exports = config
8 changes: 7 additions & 1 deletion wrappers/javascript/lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.2.1",
"npmClient": "yarn"
"npmClient": "pnpm",
"command": {
"version": {
"allowBranch": "main"
}
}
}
Loading

0 comments on commit 1636421

Please sign in to comment.