Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Jan 28, 2024
1 parent fa701c6 commit 6d469a5
Show file tree
Hide file tree
Showing 33 changed files with 117 additions and 187 deletions.
4 changes: 2 additions & 2 deletions .autorc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ plugins:
- ./scripts/auto-before-commit-changelog-plugin.js
- - omit-release-notes
- username:
- coqbot
- coqbot
- - omit-commits
- username:
- coqbot
- coqbot

prereleaseBranches:
- next
Expand Down
6 changes: 3 additions & 3 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ checks:
enabled: false

exclude_patterns:
- "**/test/"
- "**/*.d.ts"
- ".yarn/"
- '**/test/'
- '**/*.d.ts'
- '.yarn/'
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ reports
yarn-error.log
.env
.npmrc
.turbo
scripts
.yarn
.nx
.husky
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ plugins:
- jest-extended

rules:
"@typescript-eslint/dot-notation": error
'@typescript-eslint/dot-notation': error
no-shadow: off
import/no-default-export: off
import/prefer-default-export: off
Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/1-bug.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "🐞 Bug report"
name: '🐞 Bug report'
labels: bug
about: Something is not working as it should
---
Expand Down Expand Up @@ -33,5 +33,6 @@ logs, and code as it's very hard to read otherwise.) -->
<!-- *(Any possible suggestions on how to fix this problem)* -->

**Checklist**

- [ ] I have checked that this is not a duplicate issue.
- [ ] I have read the documentation.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/2-feature-proposal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "🚀 Feature request"
name: '🚀 Feature request'
labels: feature
about: Suggest an idea
---
Expand All @@ -13,5 +13,6 @@ about: Suggest an idea
<!-- *(Outline how you plan to implement this feature if you have one)* -->

**Checklist**

- [ ] I have checked that this is not a duplicate issue.
- [ ] I have read the documentation.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/3-question.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "❓ Question"
name: '❓ Question'
labels: question
about: Something is unclear or needs to be discussed
---
Expand All @@ -11,5 +11,6 @@ about: Something is unclear or needs to be discussed
<!-- *(Brief description of your question here)*-->

**Checklist**

- [ ] I have checked that this is not a duplicate issue.
- [ ] I have read the documentation.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/4-technical-debt.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ logs, and code as it's very hard to read otherwise.) -->
<!-- *(Any possible suggestions on how to improve this code)* -->

**Checklist**

- [ ] I have checked that this is not a duplicate issue.
- [ ] I have read the documentation.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test:unit:setup:
stage: setup
image: alpine/curl
needs:
- install
- install
script:
- mkdir -p tmp/codeclimate
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/codeclimate/cc-test-reporter
Expand All @@ -144,7 +144,7 @@ test:live:setup:
stage: setup
image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
needs:
- install
- install
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: on_success
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ coverage
dist
package.json
yarn.lock
.yarn
.nx
.husky
CHANGELOG.md
/.nx/cache
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</a>
</p>


>A typed [GitLab](https://gitlab.com/gitlab-org/gitlab/) SDK for Browser, Node.js, Deno and CLI usage.
> A typed [GitLab](https://gitlab.com/gitlab-org/gitlab/) SDK for Browser, Node.js, Deno and CLI usage.
## Table of Contents

- [Features](#features)
- [Packages](#packages)
- [Usage](./packages/rest/README.md#usage)
Expand All @@ -56,18 +56,21 @@
- [Changelog](./CHANGELOG.md)

## Features

- **Complete** - All features of Gitlab's exposed APIs are covered up to version [16.0](https://docs.gitlab.com/16.0/ee/api/api_resources.html). See [here](./packages/core/README.md#supported-apis) for the full list.
- **Universal** - Works in all modern browsers, [Node.js](https://nodejs.org/), and [Deno](https://deno.land/) and supports [CLI](https://www.npmjs.com/package/@gitbeaker/cli) usage.
- **Tested** - All libraries have > 80% test coverage.
- **Typed** - All libraries have extensive TypeScript declarations.

## Packages

- :wrench: [**@gitbeaker/requester-utils**](https://www.npmjs.com/package/@gitbeaker/requester-utils) - Utilities for the underlying HTTP request functionality.
- :scroll: [**@gitbeaker/core**](https://www.npmjs.com/package/@gitbeaker/core) - The core API detailing all the Gitlab resource support.
- :computer: [**@gitbeaker/rest**](https://www.npmjs.com/package/@gitbeaker/rest) - The Node.js, Deno and Modern Browser wrapper around the gitbeaker core API, using native fetch. This is the primary library for consumption.
- :pager: [**@gitbeaker/cli**](https://www.npmjs.com/package/@gitbeaker/cli) - The CLI Wrapper around the @gitbeaker/rest distribution.

## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
Expand Down
10 changes: 5 additions & 5 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ Since everything builds off fetch support, applying a poly fill will allow for N
2. Set the following in your entry point:

```js
const semver = require('semver')
const semver = require('semver');

if ( semver.lt(process.version, '20.0.0') ) {
global.fetch = require('node-fetch')
if (semver.lt(process.version, '20.0.0')) {
global.fetch = require('node-fetch');
}
```

Expand All @@ -47,9 +47,9 @@ if ( semver.lt(process.version, '20.0.0') ) {
This is caused by the internal undici fetch implementation's dispatcher [defaults](https://github.com/nodejs/undici/issues/1373) for the headers and body timeout when performing a request. In the future we will support modifying these properties in a more defined way, but for now, once can override this by setting the global symbol at the beginning of your script:

```js
import { Agent } from 'undici'
import { Agent } from 'undici';

globalThis[Symbol.for("undici.globalDispatcher.1")] = new Agent({
globalThis[Symbol.for('undici.globalDispatcher.1')] = new Agent({
headersTimeout: 0,
bodyTimeout: 0,
});
Expand Down
1 change: 0 additions & 1 deletion docs/TESTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Testing is a work-in-progress right now but here is the start.

**Unit Tests**
Expand Down
7 changes: 5 additions & 2 deletions jest.config.base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ export default {
coverageDirectory: 'coverage',
collectCoverage: true,
coverageReporters: ['lcov', 'text', 'text-summary', 'cobertura'],
reporters: ['default', ['jest-junit', { outputDirectory: 'reports', outputName: 'nodejs_junit.xml' }]],
reporters: [
'default',
['jest-junit', { outputDirectory: 'reports', outputName: 'nodejs_junit.xml' }],
],
moduleNameMapper: {
'^@gitbeaker/(.*)$': '<rootDir>/../$1/src'
'^@gitbeaker/(.*)$': '<rootDir>/../$1/src',
},
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest',
Expand Down
10 changes: 3 additions & 7 deletions lint-staged.config.base.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export default {
"**/*.{ts,js,json,md,yml}": [
"prettier --write"
],
"**/*.{ts,js}": [
"eslint --fix"
]
}
'**/*.{ts,js,json,md,yml}': ['prettier --write'],
'**/*.{ts,js}': ['eslint --fix'],
};
53 changes: 8 additions & 45 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,24 @@
{
"targetDefaults": {
"test:unit": {
"outputs": [
"{projectRoot}/coverage",
"{projectRoot}/reports"
],
"outputs": ["{projectRoot}/coverage", "{projectRoot}/reports"],
"cache": true
},
"test:integration": {
"outputs": [
"{projectRoot}/coverage",
"{projectRoot}/reports"
],
"outputs": ["{projectRoot}/coverage", "{projectRoot}/reports"],
"cache": true
},
"build": {
"dependsOn": [
"^build"
],
"outputs": [
"{projectRoot}/dist"
],
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"],
"cache": true
},
"test:types": {
"dependsOn": [
"build"
],
"dependsOn": ["build"],
"cache": true
},
"test:e2e": {
"dependsOn": [
"build"
],
"cache": true
},
"test:e2e:browser": {
"dependsOn": [
"build"
],
"cache": true
},
"test:e2e:nodejs": {
"dependsOn": [
"build"
],
"dependsOn": ["build"],
"cache": true
},
"lint": {
Expand All @@ -58,23 +32,12 @@
},
"format:fix": {
"cache": true
},
"test:integration:browser": {
"cache": true
},
"test:integration:nodejs": {
"cache": true
}
},
"defaultBase": "main",
"namedInputs": {
"default": [
"{projectRoot}/**/*",
"sharedGlobals"
],
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": [
"default"
]
"production": ["default"]
}
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
},
"scripts": {
"build": "nx run-many --target=build",
"clean": "npx rimraf --glob '**/{tmp,dist,node_modules,coverage,reports}'",
"lint": "nx run-many --target=lint",
"lint:fix": "nx run-many --target=lint:fix",
"format": "nx run-many --target=format",
"format:fix": "nx run-many --target=format:fix",
"clean": "yarn dlx rimraf --glob '**/{tmp,dist,node_modules,coverage,reports}'",
"format:docs": "prettier './**/(*.json|*.yml|*.md|*.(c|m)js|*.(c|m)ts)' --ignore-path ./.prettierignore --check",
"format:docs:fix": "yarn format:docs --write",
"format:src": "prettier '**/{src,test,scripts}/**/*.ts' --ignore-path ./.prettierignore --check",
"format:src:fix": "yarn format:src --write",
"format": "yarn format:src && yarn format:docs",
"format:fix": "yarn format:src:fix && yarn format:docs:fix",
"test:types": "nx run-many --target=test:types",
"test:unit": "nx run-many --target=test:unit",
"test:integration": "nx run-many --target=test:integration",
"test:integration:browser": "nx run-many --target=test:integration:browser",
"test:integration:nodejs": "nx run-many --target=test:integration:nodejs",
"test:e2e": "nx run-many --target=test:e2e",
"test:e2e:browser": "nx run-many --target=test:e2e:browser",
"test:e2e:nodejs": "nx run-many --target=test:e2e:nodejs",
"release:next": "auto next",
"release:canary": "auto canary",
"release": "auto shipit",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
displayName: 'Gitbeaker CLI',
testTimeout: 10000,
moduleNameMapper: {
"@gitbeaker/core/map.json": '<rootDir>/test/__mocks__/map.json',
'@gitbeaker/core/map.json': '<rootDir>/test/__mocks__/map.json',
...base.moduleNameMapper,
}
},
};
2 changes: 1 addition & 1 deletion packages/cli/lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from '../../lint-staged.config.base.mjs'
export { default } from '../../lint-staged.config.base.mjs';
13 changes: 2 additions & 11 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,8 @@
"build": "tsup src/index.ts --format esm --treeshake --target node18",
"test:unit": "jest --maxWorkers=50% test/unit",
"test:e2e": "jest --maxWorkers=50% test/e2e",
"format:docs": "prettier './(*.json|*.yml|*.md|*.(c|m)js|*.(c|m)ts)' --ignore-path ../../.prettierignore --check",
"format:docs:fix": "yarn format:docs --write",
"format:src": "prettier '{src,test}/**/*.ts' --ignore-path ../../.prettierignore",
"format:src:fix": "yarn format:src --write",
"format": "yarn format:src && yarn format:docs",
"format:fix": "yarn format:src:fix && yarn format:docs:fix",
"lint": "eslint '{src,test}/**/*.ts'",
"lint:fix": "yarn lint --fix",
"release:rc": "auto next",
"release:canary": "auto canary",
"release": "auto shipit"
"lint": "eslint '**/{src,test,scripts}/**/*.ts'",
"lint:fix": "yarn lint --fix"
},
"dependencies": {
"@gitbeaker/core": "^39.33.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"paths": {
"@gitbeaker/core/map.json": ["../core/dist/map.json"],
"@gitbeaker/*": ["../*/src"]
}
"@gitbeaker/*": ["../*/src"],
},
},
"include": ["./**/*.ts"]
"include": ["./**/*.ts"],
}
2 changes: 1 addition & 1 deletion packages/core/lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from '../../lint-staged.config.base.mjs'
export { default } from '../../lint-staged.config.base.mjs';
13 changes: 2 additions & 11 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,8 @@
"test:types": "tsc",
"test:integration": "jest --maxWorkers=50% test/integration",
"test:unit": "jest --maxWorkers=50% test/unit",
"format:docs": "prettier './(*.json|*.yml|*.md|*.(c|m)js|*.(c|m)ts)' --ignore-path ../../.prettierignore --check",
"format:docs:fix": "yarn format:docs --write",
"format:src": "prettier '{src,test}/**/*.ts' --ignore-path ../../.prettierignore",
"format:src:fix": "yarn format:src --write",
"format": "yarn format:src && yarn format:docs",
"format:fix": "yarn format:src:fix && yarn format:docs:fix",
"lint": "eslint '{src,test,scripts}/**/*.ts'",
"lint:fix": "yarn lint --fix",
"release:rc": "auto next",
"release:canary": "auto canary",
"release": "auto shipit"
"lint": "eslint '**/{src,test,scripts}/**/*.ts'",
"lint:fix": "yarn lint --fix"
},
"dependencies": {
"@gitbeaker/requester-utils": "^39.33.0",
Expand Down
Loading

0 comments on commit 6d469a5

Please sign in to comment.