diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index 0d83b0b1..00000000 --- a/.codecov.yml +++ /dev/null @@ -1,21 +0,0 @@ -codecov: - max_report_age: off - -comment: false - -coverage: - precision: 2 - round: down - status: - project: - default: - threshold: 0.2 - if_not_found: success - patch: - default: - enabled: no - if_not_found: success - changes: - default: - enabled: no - if_not_found: success diff --git a/.commitlintrc.yml b/.commitlintrc.yml new file mode 100644 index 00000000..c7059727 --- /dev/null +++ b/.commitlintrc.yml @@ -0,0 +1,12 @@ +extends: + - '@commitlint/config-lerna-scopes' + - '@commitlint/config-conventional' +rules: + subject-case: + - 0 + - always + - 'sentence-case' + header-case: + - 0 + - always + - 'sentence-case' diff --git a/.eslintrc.yml b/.eslintrc.yml index c440d70e..ed4cb1b0 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -12,9 +12,12 @@ extends: parser: '@typescript-eslint/parser' -parserOptions: - project: tsconfig.eslint.json - sourceType: module +ignorePatterns: + - node_modules/ + - dist/ + - '**/rollup.config.js' + - '**/scripts/*.ts' + - '*d.ts' plugins: - '@typescript-eslint' @@ -24,18 +27,18 @@ rules: import/no-default-export: error import/prefer-default-export: off '@typescript-eslint/explicit-function-return-type': off - -overrides: - - files: - - 'test/**/*.ts' - rules: - import/no-unresolved: 0 + import/no-extraneous-dependencies: + - error + - devDependencies: + - '**/test/**/*.ts' + import/extensions: + - error + - never + - json: always settings: import/resolver: node: extensions: - .js - - .jsx - .ts - - .tsx diff --git a/.github/ASSETS/header.svg b/.github/ASSETS/header.svg new file mode 100644 index 00000000..b7fd2339 --- /dev/null +++ b/.github/ASSETS/header.svg @@ -0,0 +1,11 @@ + diff --git a/.github/ASSETS/logo.svg b/.github/ASSETS/logo.svg new file mode 100644 index 00000000..12b441e4 --- /dev/null +++ b/.github/ASSETS/logo.svg @@ -0,0 +1,10 @@ + diff --git a/.github/ASSETS/thumbnail.png b/.github/ASSETS/thumbnail.png new file mode 100644 index 00000000..c884d720 Binary files /dev/null and b/.github/ASSETS/thumbnail.png differ diff --git a/.gitignore b/.gitignore index ae8bc167..b93e97ff 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ coverage .rpt2_cache .idea .DS_Store -temp +yarn-error.log \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..a8e0bbe3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,127 @@ +default: + image: node:lts-alpine + +# Cache modules in between jobs +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - packages/gitbeaker-core/node_modules/ + - packages/gitbeaker-cli/node_modules/ + - packages/gitbeaker-browser/node_modules/ + - packages/gitbeaker-node/node_modules/ + - packages/gitbeaker-requester-utils/node_modules/ + - node_modules/ + +stages: + - install + - build + - lint + - test + - release + +#Link and Install all required dependancies +install: + image: node:lts + stage: install + script: + - yarn + +# Build core (cjs, es, and browser) and cli packages +# Uses work around to allow for linking of the cli packages +build: + stage: build + script: + - yarn build + artifacts: + paths: + - packages/gitbeaker-core/dist/ + - packages/gitbeaker-cli/dist/ + - packages/gitbeaker-browser/dist/ + - packages/gitbeaker-node/dist/ + - packages/gitbeaker-requester-utils/dist/ + +# Lint all code, tests and supporting documentation (README, CHANGELOG etc) +lint:src: + stage: lint + script: yarn lint + +lint:docs: + stage: lint + script: yarn lint:doc + +# Test packages and builds +test:core:unit: + stage: test + script: yarn jest core/test/unit && yarn codecov -F core + +test:node:unit: + stage: test + script: yarn jest node/test/unit && yarn codecov -F node + +test:browser:unit: + stage: test + script: yarn jest browser/test/unit && yarn codecov -F browser + +test:utils:unit: + stage: test + script: yarn jest utils/test/unit && yarn codecov -F utils + +# test:core:integration: &integration +# image: +# name: docker/compose:latest +# entrypoint: ['/bin/sh', '-c'] +# variables: +# DOCKER_HOST: tcp://docker:2375 +# GITLAB_URL: http://docker:8080 +# services: +# - docker:dind +# stage: test +# before_script: +# # Install docker compose +# - apk add --no-cache nodejs yarn git + +# # Spin up container +# - cd scripts +# - docker-compose -f docker-compose.yml up -d + +# # Verify Gitlab instance is up and running +# - node probe.js + +# # Get the personal token +# - export PERSONAL_ACCESS_TOKEN=$(docker exec -i gitlab sh -c 'gitlab-rails r /mnt/init.rb') + +# - cd .. +# - echo $PERSONAL_ACCESS_TOKEN +# - echo $GITLAB_URL +# - echo $CODECOV_TOKEN +# script: yarn jest core/test/integration --runInBand && yarn codecov -F core + +# test:cli:integration: +# <<: *integration +# script: yarn jest core/test/integration --runInBand && yarn codecov + +# test:cli:integration:dist: +# <<: *integration +# script: yarn jest core/test/integration --runInBand && yarn codecov + +# test:core:integration:dist-cjs: +# <<: *integration +# script: yarn jest core/test/integration --runInBand --moduleNameMapper="{dist:dist/index.es.js}" + +# test:core:integration:dist-es +# <<: *integration +# script: yarn jest core/test/integration --runInBand --moduleNameMapper="{dist:dist/index.es.js}" + +# test:core:integration:browser: +# <<: *integration +# script: npm run test:integration -- --scope=core --moduleNameMapper="{dist:dist/index.umd.js}" && codecov + +# Release +release: + only: + refs: + - master + stage: release + before_script: + - apk add --no-cache git + script: yarn release diff --git a/.huskyrc.yml b/.huskyrc.yml index 121c224e..ff38f4d7 100644 --- a/.huskyrc.yml +++ b/.huskyrc.yml @@ -1,2 +1,3 @@ hooks: pre-commit: 'lint-staged' + commit-msg: 'commitlint -E HUSKY_GIT_PARAMS' diff --git a/.lintstagedrc.yml b/.lintstagedrc.yml index edbb7d0b..6c67790c 100644 --- a/.lintstagedrc.yml +++ b/.lintstagedrc.yml @@ -1,7 +1,4 @@ -'*.{ts, !(generate).ts}': +'*.{ts,js,json,md,yml}': - 'prettier --write' +'*.{ts,js}': - 'eslint --fix' - - 'git add' -'*.{json, md, yml, js}': - - 'prettier --write' - - 'git add' diff --git a/.releaserc.yml b/.releaserc.yml index e93d0556..7fe3cdd3 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -1,9 +1,15 @@ tagFormat: '${version}' -verifyConditions: +plugins: + - '@semantic-release/commit-analyzer' + - '@semantic-release/release-notes-generator' - '@semantic-release/changelog' - - '@semantic-release/npm' - - '@semantic-release/git' -prepare: - - '@semantic-release/changelog' - - '@semantic-release/npm' - - '@semantic-release/git' + - - 'semantic-release-npmx' + - access: 'public' + - '@semantic-release/github' + - - '@semantic-release/git' + - message: "chore: Release 🚀 ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + assets: + - 'CHANGELOG.md' + - '*.lock' + - - '**/package.json' + - '!**/node_modules/**/package.json' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e24e7c76..00000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -language: node_js - -stages: - - lint - - test - - release - -notifications: - email: false - -env: - - GITLAB_URL=http://localhost:8080 - -jobs: - include: - - stage: lint - node_js: node - script: - - npm run lint - - prettier --check './*.json' './*.yml' - - - &test-unit - stage: test - name: Unit Test LFS - node_js: lts/* - before_script: - - npm run build - - npm link - script: - - npm run test:unit - - - <<: *test-unit - name: Unit Test Latest - node_js: node - script: - - npm run test:unit -- --coverage - after_success: - - npm run coverage - - - &test-integration - stage: test - name: Integration Test LFS - node_js: lts/* - before_script: - - cd test/docker/ - - # Spin up container - - docker-compose -f docker-compose.test.yml up -d - - # Verify Gitlab instance is up and running - - node test_readiness.js - - # Get the personal token - - export PERSONAL_ACCESS_TOKEN=$(docker exec -it gitlab bash -lc 'printf "%q" "$(gitlab-rails r /tmp/init_data.rb)"') - - # Display configuration - - echo $PERSONAL_ACCESS_TOKEN - - # Build library - - npm run build - - npm link - script: - - npm run test:integration - - - <<: *test-integration - name: Integration Test Latest - node_js: node - script: - - npm run test:integration -- --coverage - after_success: - - npm run coverage - - - stage: release - node_js: node - before_script: - - npm run build - script: - - npm run release diff --git a/CHANGELOG.md b/CHANGELOG.md index 19c7227d..23961145 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,86 +1,73 @@ ## [14.2.2](https://github.com/jdalrymple/node-gitlab/compare/14.2.1...14.2.2) (2020-01-30) - ### Bug Fixes -* Incorrect request method in MergeRequests.approvalState() method ([#586](https://github.com/jdalrymple/node-gitlab/issues/586)) ([cb5f822](https://github.com/jdalrymple/node-gitlab/commit/cb5f8228ca1f64cc55b79e1ef475c3d49568267a)) +- Incorrect request method in MergeRequests.approvalState() method ([#586](https://github.com/jdalrymple/node-gitlab/issues/586)) ([cb5f822](https://github.com/jdalrymple/node-gitlab/commit/cb5f8228ca1f64cc55b79e1ef475c3d49568267a)) ## [14.2.1](https://github.com/jdalrymple/node-gitlab/compare/14.2.0...14.2.1) (2020-01-20) - ### Bug Fixes -* added file extension for dummy file name in project import ([#561](https://github.com/jdalrymple/node-gitlab/issues/561)) ([f45cb68](https://github.com/jdalrymple/node-gitlab/commit/f45cb68498b54a2ad1ab1371589d0152d76adf11)), closes [/gitlab.com/gitlab-org/gitlab-foss/issues/50944#note_101737263](https://github.com//gitlab.com/gitlab-org/gitlab-foss/issues/50944/issues/note_101737263) +- added file extension for dummy file name in project import ([#561](https://github.com/jdalrymple/node-gitlab/issues/561)) ([f45cb68](https://github.com/jdalrymple/node-gitlab/commit/f45cb68498b54a2ad1ab1371589d0152d76adf11)), closes [/gitlab.com/gitlab-org/gitlab-foss/issues/50944#note_101737263](https://github.com//gitlab.com/gitlab-org/gitlab-foss/issues/50944/issues/note_101737263) # [14.2.0](https://github.com/jdalrymple/node-gitlab/compare/14.1.1...14.2.0) (2020-01-17) - ### Features -* Adding support for merge_requests in the Deployments API ([911078b](https://github.com/jdalrymple/node-gitlab/commit/911078bba30145a98ba051e672963dbbe8816a6a)), closes [#554](https://github.com/jdalrymple/node-gitlab/issues/554) +- Adding support for merge_requests in the Deployments API ([911078b](https://github.com/jdalrymple/node-gitlab/commit/911078bba30145a98ba051e672963dbbe8816a6a)), closes [#554](https://github.com/jdalrymple/node-gitlab/issues/554) ## [14.1.1](https://github.com/jdalrymple/node-gitlab/compare/14.1.0...14.1.1) (2020-01-03) - ### Bug Fixes -* resourceDiscussions.editNote add content params, and allowed discussionId to accept a string type ([#524](https://github.com/jdalrymple/node-gitlab/issues/524)) ([22d916a](https://github.com/jdalrymple/node-gitlab/commit/22d916a05fdf2f4361fa2e9d17fdd8784ed6bfb3)) +- resourceDiscussions.editNote add content params, and allowed discussionId to accept a string type ([#524](https://github.com/jdalrymple/node-gitlab/issues/524)) ([22d916a](https://github.com/jdalrymple/node-gitlab/commit/22d916a05fdf2f4361fa2e9d17fdd8784ed6bfb3)) # [14.1.0](https://github.com/jdalrymple/node-gitlab/compare/14.0.1...14.1.0) (2019-12-30) - ### Bug Fixes -* make ResourceMembers.all/show delivery correct options params ([#521](https://github.com/jdalrymple/node-gitlab/issues/521)) ([505b407](https://github.com/jdalrymple/node-gitlab/commit/505b4072f3441440fd4903089d83d000e701e84c)), closes [#518](https://github.com/jdalrymple/node-gitlab/issues/518) - +- make ResourceMembers.all/show delivery correct options params ([#521](https://github.com/jdalrymple/node-gitlab/issues/521)) ([505b407](https://github.com/jdalrymple/node-gitlab/commit/505b4072f3441440fd4903089d83d000e701e84c)), closes [#518](https://github.com/jdalrymple/node-gitlab/issues/518) ### Features -* Added support for the Vulnerability Findings API ([#517](https://github.com/jdalrymple/node-gitlab/issues/517)) ([497bf94](https://github.com/jdalrymple/node-gitlab/commit/497bf948d97d58dbe0bc2f57c47c92d646a29790)) +- Added support for the Vulnerability Findings API ([#517](https://github.com/jdalrymple/node-gitlab/issues/517)) ([497bf94](https://github.com/jdalrymple/node-gitlab/commit/497bf948d97d58dbe0bc2f57c47c92d646a29790)) ## [14.0.1](https://github.com/jdalrymple/node-gitlab/compare/14.0.0...14.0.1) (2019-12-23) - ### Bug Fixes -* Adding back functionality for rejectUnauthorized http option ([#502](https://github.com/jdalrymple/node-gitlab/issues/502)) ([0f17bed](https://github.com/jdalrymple/node-gitlab/commit/0f17bedc0b6ec82793d5f7e6f9c3f53b030a642e)) +- Adding back functionality for rejectUnauthorized http option ([#502](https://github.com/jdalrymple/node-gitlab/issues/502)) ([0f17bed](https://github.com/jdalrymple/node-gitlab/commit/0f17bedc0b6ec82793d5f7e6f9c3f53b030a642e)) # [14.0.0](https://github.com/jdalrymple/node-gitlab/compare/13.0.0...14.0.0) (2019-12-21) - ### Bug Fixes -* Typing on GPGKey method arguments was missing ([#514](https://github.com/jdalrymple/node-gitlab/issues/514)) ([234c9a7](https://github.com/jdalrymple/node-gitlab/commit/234c9a75db9be752e6d4febee171e3b44be6a30a)) -* Typing on Group and Project variable keys was incorrect [#512](https://github.com/jdalrymple/node-gitlab/issues/512) ([#515](https://github.com/jdalrymple/node-gitlab/issues/515)) ([c7afca5](https://github.com/jdalrymple/node-gitlab/commit/c7afca523160ac19707d0207b9892a81b799e645)) - +- Typing on GPGKey method arguments was missing ([#514](https://github.com/jdalrymple/node-gitlab/issues/514)) ([234c9a7](https://github.com/jdalrymple/node-gitlab/commit/234c9a75db9be752e6d4febee171e3b44be6a30a)) +- Typing on Group and Project variable keys was incorrect [#512](https://github.com/jdalrymple/node-gitlab/issues/512) ([#515](https://github.com/jdalrymple/node-gitlab/issues/515)) ([c7afca5](https://github.com/jdalrymple/node-gitlab/commit/c7afca523160ac19707d0207b9892a81b799e645)) ### BREAKING CHANGES -* The title property is not required for the add method. +- The title property is not required for the add method. # [13.0.0](https://github.com/jdalrymple/node-gitlab/compare/12.1.0...13.0.0) (2019-12-09) - ### Features -* Adding ability to get a singular member of a project or group, including inheritedMemebrs ([#508](https://github.com/jdalrymple/node-gitlab/issues/508)) ([807171c](https://github.com/jdalrymple/node-gitlab/commit/807171c3ff29977e8f6f5faa9603c550334c2192)), closes [#507](https://github.com/jdalrymple/node-gitlab/issues/507) - +- Adding ability to get a singular member of a project or group, including inheritedMemebrs ([#508](https://github.com/jdalrymple/node-gitlab/issues/508)) ([807171c](https://github.com/jdalrymple/node-gitlab/commit/807171c3ff29977e8f6f5faa9603c550334c2192)), closes [#507](https://github.com/jdalrymple/node-gitlab/issues/507) ### BREAKING CHANGES -* Updated the Members.all function to have the inheritedMembers option to be in the optional object. +- Updated the Members.all function to have the inheritedMembers option to be in the optional object. # [12.1.0](https://github.com/jdalrymple/node-gitlab/compare/12.0.1...12.1.0) (2019-12-05) - ### Bug Fixes -* Removing required options object in a few of the API methods ([#505](https://github.com/jdalrymple/node-gitlab/issues/505)) ([b709ef6](https://github.com/jdalrymple/node-gitlab/commit/b709ef6716d15368c8775d77e5eb0cf22d6369a7)) - +- Removing required options object in a few of the API methods ([#505](https://github.com/jdalrymple/node-gitlab/issues/505)) ([b709ef6](https://github.com/jdalrymple/node-gitlab/commit/b709ef6716d15368c8775d77e5eb0cf22d6369a7)) ### Features -* Add Group/File schemas ([#506](https://github.com/jdalrymple/node-gitlab/issues/506)) ([f467816](https://github.com/jdalrymple/node-gitlab/commit/f467816070bffcd3776e5dc3e6074c92bf6d644e)) +- Add Group/File schemas ([#506](https://github.com/jdalrymple/node-gitlab/issues/506)) ([f467816](https://github.com/jdalrymple/node-gitlab/commit/f467816070bffcd3776e5dc3e6074c92bf6d644e)) ## [12.0.1](https://github.com/jdalrymple/node-gitlab/compare/12.0.0...12.0.1) (2019-11-27) diff --git a/LICENSE.md b/LICENSE.md index 70d5c069..3b8b9fbb 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,7 +1,7 @@ # The MIT License Copyright (c) -**2019 Justin Dalrymple** +**2020 Justin Dalrymple** Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7a3b3e33..91f1a569 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,48 @@ -[](https://www.npmjs.com/package/gitlab) -[](https://www.npmjs.com/package/gitlab) -[](https://david-dm.org/jdalrymple/node-gitlab) -[](https://david-dm.org/jdalrymple/node-gitlab?type=dev) -[](https://greenkeeper.io/) -[](https://codeclimate.com/github/jdalrymple/node-gitlab) -[](https://travis-ci.org/jdalrymple/node-gitlab) -[](https://codecov.io/gh/jdalrymple/node-gitlab) -[](https://github.com/semantic-release/semantic-release) -[](http://commitizen.github.io/cz-cli/) -[](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg) -[](https://packagephobia.now.sh/result?p=gitlab) -[](https://github.com/jdalrymple/node-gitlab/blob/master/LICENSE.md) - -# node-gitlab +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+