Skip to content

Commit

Permalink
chore: update library to 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
seriouslag committed Apr 11, 2024
1 parent 59dd525 commit b541dfb
Show file tree
Hide file tree
Showing 51 changed files with 14,566 additions and 13,559 deletions.
8 changes: 4 additions & 4 deletions .azure/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ steps:
inputs:
versionSpec: '14.x'
checkLatest: true
- script: yarn install
- script: npm ci
displayName: 'Install dependencies'
- script: yarn lint
- script: npm run lint
displayName: 'Lint code'
- script: yarn test:coverage
- script: npm run test:coverage
displayName: 'Run tests and collect coverage'
- script: yarn build
- script: npm run build
displayName: 'Build project'
- task: PublishCodeCoverageResults@1
inputs:
Expand Down
8 changes: 7 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
dist
coverage
out
build
*.log
**/dist
**/node_modules
**/node_modules
**/out
**/build
53 changes: 1 addition & 52 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,10 @@ module.exports = {
},
plugins: [
'@typescript-eslint',
'prettier',
],
rules: {
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'semi-spacing': [
'error',
{
'before': false,
},
],
'no-trailing-spaces': 2,
'space-before-function-paren': [2, 'always'],
'spaced-comment': ['error', 'always'],
'space-in-parens': ['error', 'never'],
'switch-colon-spacing': ['error'],
'no-unused-vars': 0,
'comma-dangle': ['error', 'only-multiline'],
'arrow-parens': ['error', 'always'],
'complexity': ['error', 15],
eqeqeq: ['error', 'always'],
'no-var': 2,
Expand All @@ -46,41 +30,6 @@ module.exports = {
'prefer-rest-params': 2,
'prefer-arrow-callback': 2,
'no-const-assign': 2,
'no-tabs': 2,
'no-multiple-empty-lines': 2,
'eol-last': ['error', 'always'],
'key-spacing': [
'error',
{
'align': {
beforeColon: false,
afterColon: true,
on: 'value',
mode: 'minimum',
},
},
],
'keyword-spacing': [
'error',
{
before: true,
after: true,
},
],
'max-len': [
0,
{
tabWidth: 2,
code: 120,
comments: 200,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreTemplateLiterals: true,
ignoreStrings: true,
ignoreRegExpLiterals: true,
},
],
'comma-spacing': ['warn', { before: false, after: true }],
'no-multi-spaces': 2,
},
};
49 changes: 31 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,42 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
name: Checkout
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
name: Setup Node
with:
node-version: "14"
node-version: "20"
check-latest: true
cache: "yarn"
- run: yarn install
cache: "npm"
- run: npm ci
name: Install
- run: yarn test:unit
- run: npm run test:unit
name: Test
- run: yarn lint
- run: npm run lint
name: Lint
- run: yarn build
- run: npm run build
name: Build
- uses: JS-DevTools/npm-publish@v1
name: Publish to npm
with:
token: ${{ secrets.NPMJS_TOKEN }}
registry: https://registry.npmjs.org/
- uses: JS-DevTools/npm-publish@v1
name: Publish to GitHub
with:
token: ${{ secrets.GH_TOKEN }}
registry: https://npm.pkg.github.com
# - uses: JS-DevTools/npm-publish@v3
# name: Publish to npm
# with:
# token: ${{ secrets.NPMJS_TOKEN }}
# registry: https://registry.npmjs.org/
# - uses: JS-DevTools/npm-publish@v3
# name: Publish to GitHub
# with:
# token: ${{ secrets.GH_TOKEN }}
# registry: https://npm.pkg.github.com
- name: Set git identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Publish
run: HUSKY_SKIP_HOOKS=1 npx lerna publish --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}

29 changes: 29 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
node_modules/
dist/
coverage/
build/
temp/
out/
generated/
.nx/
*.log
*.lock
*.swp
*.swo
*.swn
*.tgz
*.tar.gz
*.tar
*.zip
*.rar
.env
.env*
*.yml
*.yaml
*.json
*.map
*.tsbuildinfo
*.js.map
translations/
intl/
static/
7 changes: 7 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import("prettier").Config} */
const config = {
singleQuote: true,
jsxSingleQuote: true,
};

export default config;
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"type": "node",
"request": "launch",
"name": "Jest Current file",
"runtimeArgs": [
Expand Down
Binary file removed .yarn/install-state.gz
Binary file not shown.
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

41 changes: 18 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,61 @@
# Contributing
# @seriouslag/httpclient

## Development
The monorepo for the `@seriouslag/httpclient` package.

## Contributing

### Requirements

*Node*: Check that node is installed with version 14.x or greater. Node's version can be checked with
_Node_: Check that node is installed with version 14.x or greater. Node's version can be checked with

```bash
# Check node version
node -v
```

*Yarn*: Make sure that yarn 1 is globally installed with version ^1.22.10. To check global yarn version CD outside of project folder and run command:
```bash
# Check yarn version
yarn -v
```

```bash
# Install yarn globably using npm
npm install -g yarn
```

### Setup

```bash
# Installs all dependencies
yarn install
npm install
```

### Build

```bash
yarn build
npm run build
```

### Testing

```bash
# Runs all unit tests
yarn test:unit
npm run test
```

```bash
# Runs all unit tests and builds a coverage report. Results are found in ./coverage folder.
yarn test:coverage
npm run test:coverage
```

### Linting

```bash
# Lints all JS/TS files
yarn lint
npm run lint
```

```bash
# Lints and attemps to fix common linting errors in JS/TS files
yarn lint:fix
# Lints and attempts to fix common linting errors in JS/TS files
npm run lint:fix
```

### Commiting code

Always work from a new branch off of main or fork this repo.

> Rebase often! This will help avoid merge large merge conflicts later.
>
>
> ```bash
> git fetch origin main
> git checkout origin main
Expand All @@ -77,6 +72,6 @@ Keep PRs small so they are easier to get through review.
This repository comes with a `.vscode/launch.json` file.\
This can be used to run [debugging sesions using vscode](https://code.visualstudio.com/docs/editor/debugging).
***
---
[README](./README.md)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2021 Landon Gavin
Copyright 2024 Landon Gavin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
3 changes: 3 additions & 0 deletions jest-setup.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
// abortcontroller polyfill is needed for node envs less than 15.0
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
import jestMock from 'jest-fetch-mock';

jestMock.enableMocks();
9 changes: 7 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"$schema": "http://json.schemastore.org/lerna",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"npmClient": "npm",
"changelogPreset": "angular",
"command": {
"version": {
"createRelease": "gitlab",
"conventionalCommits": true,
"allowBranch": ["master"],
"message": "chore(release): publish"
},
"publish": {
"ignoreChanges": [
"*.md",
Expand Down
Loading

0 comments on commit b541dfb

Please sign in to comment.