Skip to content

Commit

Permalink
Set up lerna and add test infrastructure (#72)
Browse files Browse the repository at this point in the history
* Update README.md

* initial read for all libraries

* init lerna & test package

* setting process env

* post test and es build

* add rollup config each package

* update workflow to build with lerna, rollup config update

* deleting package lock

* test with version 16 and 17

* test:integrated first

* workflow update

* update gen code

* - fixes a bug where request options would override handler options

* - fixes file name casing to avoid failing unit testss compilation

* add setup doc,disable browser tests for failing cases

* install npm latest for  14.x support

* install npm latest for  14.x support

* version update, lerna npmclient, test in 16.x

* dependabot yml update, mocha global

* updating retry redirect handler tests

* setting publish version and publish command

* adds support for decoding query parameters names (#87)

* - adds support for mapping query parameter names

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

* - adds parameters name decoding middleware

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

* - fixes test data

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

* - updates unit test for PR feedback

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

* - adds an integration test for parameters encoding

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

* - fixes query parameters unit test after middleware move

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

* - adds missing exports for parameters middleware

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

* - fixes factory tests after the addition of prameters names decoding middleware

Signed-off-by: Vincent Biret <vibiret@microsoft.com>

Co-authored-by: Vincent Biret <vibiret@microsoft.com>
Co-authored-by: Vincent Biret <vincentbiret@hotmail.com>
  • Loading branch information
3 people authored Apr 19, 2022
1 parent 05e785c commit e89ce33
Show file tree
Hide file tree
Showing 211 changed files with 17,116 additions and 23,489 deletions.
42 changes: 41 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,68 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"

- package-ecosystem: npm
directory: "/packages/abstractions"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"

- package-ecosystem: npm
directory: "/packages/authentication/azure"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"

- package-ecosystem: npm
directory: "/packages/serialization/json"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"

- package-ecosystem: npm
directory: "/packages/serialization/text"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"

- package-ecosystem: npm
directory: "/packages/http/fetch"
schedule:
interval: daily
open-pull-requests-limit: 10
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"

- package-ecosystem: npm
directory: "/packages/test"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
# Prefix all commit messages with "npm"
prefix: "auto dependabot"
51 changes: 0 additions & 51 deletions .github/workflows/authentication-azure-publish.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
# Pipeline for the first npm publish for abstractions.

name: Build and publish Kiota abstractions package

name: Build and test all the Kiota packages
on:
workflow_dispatch:
push:
branches: [ main ]
paths: ['packages/abstractions/**', '.github/workflows/**']
pull_request:
paths: ['packages/abstractions/**', '.github/workflows/**']

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/abstractions
environment:
name: build_test
strategy:
matrix:
node-version: [14.x, 16.x, 17.x]
node-version: [ 16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
working-directory: packages/abstractions

- run: yarn install --frozen-lockfile
- run: yarn global add mocha@6.2.3
- run: yarn run build
- run: lerna run test:integrated
env:
TENANT_ID: ${{secrets.tenant_id}}
CLIENT_ID: ${{secrets.client_id}}
CLIENT_SECRET: ${{secrets.client_secret}}
- run: lerna run test --parallel

publish-npm:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'auto dependabot')}}
needs: build
environment:
name: production_feed
Expand All @@ -44,8 +45,10 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish --access public
- run: yarn install --frozen-lockfile
- run: yarn global add mocha@6.2.3
- run: yarn run build
- run: lerna version prerelease --preid=preview --yes
- run: lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
52 changes: 0 additions & 52 deletions .github/workflows/http-fetch-publish.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/serialization-json-publish.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/serialization-text-publish.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
dist/
5 changes: 5 additions & 0 deletions docs/lerna-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Steps to install and run the project

Run the following commands from the root of the project:
- `yarn install` - installs dependencies for all the packages in this repository
- `yarn run build` - compiles all the packages in the project. The typescript `project references` feature is used to transpile the projects in the correct order and allow automatic detection of local changes.
11 changes: 11 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"packages": [
"packages/test",
"packages/abstractions",
"packages/http/*",
"packages/serialization/json/",
"packages/serialization/text/"
],
"npmClient": "yarn",
"version": "independent"
}
Loading

0 comments on commit e89ce33

Please sign in to comment.