-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebase on Master add Preconstruct Cli Tool (#96)
* Update generated SDKs (#68) * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK Co-authored-by: Auto Mation <automation@commercetools.com> * chore(release): releasing component - @commercetools/history-sdk@1.15.0 - @commercetools/importapi-sdk@1.15.0 - @commercetools/ml-sdk@1.15.0 - @commercetools/platform-sdk@1.15.0 * Update generated SDKs (#82) * TASK: Updating Platform SDK * Adding Generated Request builder unit tests (#83) * improvement: Adding Generated unit tests of Request builders * Update generated SDKs (#84) * TASK: Updating Platform SDK * Adding unit test for the request builders * chore(release): releasing component - @commercetools/history-sdk@1.16.0 - @commercetools/importapi-sdk@1.16.0 - @commercetools/ml-sdk@1.16.0 - @commercetools/platform-sdk@1.16.0 * Update generated SDKs (#86) * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK * TASK: Updating Platform SDK Co-authored-by: Auto Mation <automation@commercetools.com> * chore(release): releasing component - @commercetools/history-sdk@1.17.0 - @commercetools/importapi-sdk@1.17.0 - @commercetools/ml-sdk@1.17.0 - @commercetools/platform-sdk@1.17.0 * chore: setup changesets and release workflow (#91) * chore: setup changesets and release workflow * docs: update readmes * chore(ci): use yarn cache * Version Packages (#92) * ci(changesets): version packages * chore: regenerate lockfile * fix(ci): build platform-sdk before running tests Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com> * Update generated SDKs (#94) * TASK: Updating Platform SDK * TASK: Updating Platform SDK * Create metal-bees-type.md Co-authored-by: Auto Mation <automation@commercetools.com> Co-authored-by: Jens Schulze <jens.schulze@commercetools.com> * Improve monorepo setup and tooling (#93) * chore: improve monorepo setup and tools to develop and build packages * chore(ci): use node 14 * docs: add contributing and update readme * docs: changeset * fix: command * chore(ci): also build packages * feat(sdk-client): build the typescript sdk-client * feat(sdk-middleware-auth): build out the sdk middleware auth * feat(middleware-http): add the http middleware for the clent-sdk * feat(typescript-client-sdk): build typescript sdk client - add typescript client - add auth middleware - add http middleware - include test coverage report * chore(test): increase the timeout for time consuming tests in ml package * Chore(client-sdk): Refactor SDK Dependencies (#80) * chore(client-sdk): refactor as dependencies into a single client package * chore(middleware): abstract all middleware builder functions - refactor code to abstract the auth middleware - refactor code to abstract the http middleware - write test for the new refactored code * chore(tests): debug tests to isolate issues causing circleci to fail * debugging circleci * debugging circleci error * debugging circleci error * debugging circleci errors * chore(tsconfig): use existing tsconfig.json configurations from existing (history) package * fix OOM issue on cicleci * chore(sdk-client): refactor entire all middleware package into sdk-client package - add a builder class - add all sdk-middleware - remove unwanted comments and code blocks * chore(auth-middlewares): add other authentication middlewares methods to the build class * refactor middleware order and auth methods * refactor(ClientBuilder): rename ApiRootBuilder to ClientBuilder refactor ClientBuilder to return the client only * rewrite tests to conform with new ClientBuilder class * chore(client-builder): remove the private identifier from the withMiddleware method. Co-authored-by: Jens Schulze <jenschude@gmail.com> * fix(usr-agent): fix user agent to conform with the new format (#87) * chore(preconstruct): rebase the develop on master branch and include preconstruct Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Auto Mation <automation@commercetools.com> Co-authored-by: Michele George <michele.george@commercetools.de> Co-authored-by: Michele George <30607195+MicheleRezk@users.noreply.github.com> Co-authored-by: Nicola Molinari <nicola.molinari@commercetools.com> Co-authored-by: CT Release Bot <24736072+ct-release-bot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jens Schulze <jens.schulze@commercetools.com> Co-authored-by: Jens Schulze <jenschude@gmail.com>
- Loading branch information
1 parent
606c28e
commit 4d668b2
Showing
472 changed files
with
29,182 additions
and
1,478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@commercetools/history-sdk': minor | ||
'@commercetools/importapi-sdk': minor | ||
'@commercetools/ml-sdk': minor | ||
'@commercetools/platform-sdk': minor | ||
--- | ||
|
||
Update development tooling and monorepo setup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json", | ||
"changelog": [ | ||
"@changesets/changelog-github", | ||
{ | ||
"repo": "commercetools/commercetools-sdk-typescript" | ||
} | ||
], | ||
"commit": false, | ||
"linked": [["@commercetools/*"]], | ||
"access": "restricted", | ||
"baseBranch": "master" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@commercetools/history-sdk": patch | ||
"@commercetools/importapi-sdk": patch | ||
"@commercetools/ml-sdk": patch | ||
"@commercetools/platform-sdk": minor | ||
--- | ||
|
||
Update generated SDKs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# Pass a personal access token (using our `ct-release-bot` account) to be able to trigger | ||
# other workflows | ||
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token | ||
# https://github.saobby.my.eu.orgmunity/t/action-does-not-trigger-another-on-push-tag-action/17148/8 | ||
token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | ||
|
||
- name: Read .nvmrc | ||
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | ||
id: nvm | ||
|
||
- name: Setup Node (uses version in .nvmrc) | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '${{ steps.nvm.outputs.NVMRC }}' | ||
|
||
- name: Get yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Creating .npmrc | ||
run: | | ||
cat << EOF > "$HOME/.npmrc" | ||
email=npmjs@commercetools.com | ||
//registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
EOF | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Building packages | ||
run: yarn build | ||
|
||
- name: Create Release Pull Request or Publish to npm | ||
id: changesets | ||
uses: changesets/action@master | ||
with: | ||
publish: yarn changeset publish | ||
version: yarn changeset:version-and-format | ||
commit: 'ci(changesets): version packages' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ logs | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
yarn.lock* | ||
|
||
# Env files | ||
*.env | ||
# Dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Contributing | ||
|
||
Hi, thanks for taking an interest in contributing to the **TypeScript SDK** repository. We welcome any kind of contribution, from reporting issues or idea to submitting pull requests for bug fixes, improvements, new features, etc. | ||
|
||
Please take a moment to review this document in order to make the contribution process straightforward and effective for everyone involved. | ||
|
||
## Core ideas | ||
|
||
The repository primarily contains SDK packages in TypeScript generated from the commercetools platform API reference. | ||
|
||
## Repository structure | ||
|
||
This repository is managed as a monorepo, meaning it contains multiple (sub)packages located in the [`packages`](./packages) directory. | ||
|
||
``` | ||
packages/ | ||
... | ||
``` | ||
|
||
### Development tools | ||
|
||
At commercetools we use the following development tools: | ||
|
||
#### Yarn | ||
|
||
We use [Yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces/) to manage dependencies between multiple packages. | ||
|
||
#### Jest | ||
|
||
We use [Jest](https://jestjs.io/) as the main framework for testing. Additionally, we take advantage of the Jest runners to run other tasks such as ESLint. | ||
|
||
#### Prettier | ||
|
||
We rely on [Prettier](https://prettier.io/) to consistently format our code. | ||
|
||
#### TypeScript | ||
|
||
We prefer to implement our UI components using [TypeScript](https://www.typescriptlang.org/). This has the benefit of provide packages with type declarations, thus a better developer experience, but also to have the codebase more maintainable and less error-prone. | ||
|
||
#### Preconstruct | ||
|
||
We rely on [Preconstruct](https://preconstruct.tools/) to build the packages. | ||
|
||
#### Commitlint | ||
|
||
Commit messages should follow a [conventional commit format](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional). | ||
|
||
## Opening an Issue | ||
|
||
In general, it's a good idea to open an issue first, no matter if it's a bug report, a new feature, etc. Doing so allows maintainers and other contributors to be aware of the context when an associated pull request is provided. It also gives a chance to provide early feedback and suggestions on what the pull request should focus on and what the expectations, avoiding unnecessary work during a pull request. | ||
|
||
## Submitting a Pull Request | ||
|
||
Good pull requests, such as patches, improvements, and new features, are a fantastic help. They should remain focused in scope and avoid containing unrelated commits. | ||
|
||
If possible, please try to provide a [related issue first](#opening-an-issue), where the topic is discussed and agreed upon before starting to work on that. This is helpful for both you and the maintainers to be familiar with the changes beforehand. | ||
|
||
## Getting started | ||
|
||
1. Clone the repository. | ||
2. Run `yarn` in the root folder to install the dependencies. | ||
|
||
Some useful commands to work with the repository: | ||
|
||
- `yarn test` and `yarn test --watch` | ||
- `yarn typecheck` | ||
- `yarn build` | ||
|
||
## Adding changesets | ||
|
||
commercetools sdk-typescript uses [changesets](https://github.com/atlassian/changesets) to do versioning and creating changelogs. | ||
|
||
As a contributor you need to add a changeset by running `yarn changeset`. | ||
The command will prompt to select the packages that should be bumped, their associated semver bump types and some markdown which will be inserted into the changelogs. | ||
|
||
When opening a Pull Request, a `changeset-bot` checks that the Pull Request contains a changeset. A changeset is **NOT required**, as things like documentation or other changes in the repository itself generally don't need a changeset. | ||
|
||
## Releasing packages | ||
|
||
commercetools sdk-typescript uses [changesets](https://github.com/atlassian/changesets) to do versioning and publishing a release. | ||
|
||
A [Changesets release GitHub Action](https://github.com/changesets/action) opens a `Version Packages` Pull Request whenever there are some changesets that have not been released yet. | ||
|
||
When the `Version Packages` Pull Request gets merged, the Changesets release GitHub Action will automatically trigger the release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* @type {import('@babel/core').TransformOptions} | ||
*/ | ||
module.exports = { | ||
presets: ['@babel/env', '@babel/preset-typescript'], | ||
plugins: ['@babel/proposal-class-properties'], | ||
} |
Oops, something went wrong.