Skip to content

Commit

Permalink
base setup (#1) 🌱 initial commit
Browse files Browse the repository at this point in the history
🌱 initial commit

* add gitignore

* initialize project

* add typescript configuration into the project

* add tslint

* add index.ts

* update readme with codestyle badge

* add codeowners to the repo

* add jsdoc dependency

* baseline with Google TypeScript Style

* update author and version info

* add frameworks for unit testing and setup base

* add pull request template

* setup code coverage f/w

* update build configuration

* update .gitignore

* add build job & workflow with updates to build

* update support for documentation

* update CI script to include publishing support

* update base command for PR template

* update licensing information

* add mocha junit reporter for CI test artifacts

* update coverage support f/w and add config file for CI

* integrate codecov tooling for the project

* update docs gen script to create markdown & versions

* update package inclusions and ignores

* update path of main & typings

* make docs.sh executable
  • Loading branch information
nitish-a-jain authored Mar 26, 2020
1 parent 0783012 commit 96853ea
Show file tree
Hide file tree
Showing 14 changed files with 4,719 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
version: 2
jobs: # a collection of steps
build: # runs not using Workflows must have a `build` job as entry point
working_directory: ~/mini-js-sdk # directory where steps will run
docker: # run the steps with Docker
- image: circleci/node:10.16.3
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run: #run lint and check for formatting
name: check
command: npm run check
- run: #compile the code
name: compile
command: npm run compile
- run: # run tests
name: test
command: npm run test
- run: # run coverage report
name: code coverage
command: npm run coverage
- run: # upload coverage report
name: upload coverage
command: bash <(curl -s https://codecov.io/bash)
- store_artifacts: # special step to save test results as as artifact
# Upload test summary for display in Artifacts
path: test-results
prefix: tests
- store_artifacts: # for display in Artifacts
path: coverage
prefix: coverage
- store_test_results: # for display in Test Summary
path: test-results
- persist_to_workspace:
root: ~/mini-js-sdk
paths:
- build/

publish-sdk:
working_directory: ~/mini-js-sdk
docker:
- image: circleci/node:10.16.3
steps:
- checkout
- attach_workspace:
at: ./
- run:
name: publish to npm
command: |
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish
- run:
name: Publish Documentation
command: |
set -e
npm run docs
if [[ ! $CIRCLE_TAG == *"-"* ]]; then
git checkout gh-pages
cp -R publishableDocs/docs/. ./docs
cp -R publishableDocs/_versions. ./_versions
git add docs _versions
git config user.name "CI Publisher"
git config user.email "[email protected]"
git commit -m "Publish documentation for $CIRCLE_TAG"
git push origin gh-pages
else
echo "Documentation not published for snapshot version"
fi
workflows:
version: 2
build-and-release:
jobs:
- build:
filters:
tags:
only: /^v.*/
branches:
only: /.*/
- release-verification:
type: approval
requires:
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- publish-sdk:
requires:
- release-verification
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# See https://help.github.com/en/articles/about-code-owners

* @Climbatize @corycaywood @minh-rakuten @ts-leojoseph-r @ts-nitish-a-jain
10 changes: 10 additions & 0 deletions .github/pull_request_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Description
Describe the changes in this pull request.
Explain your rationale of technical decisions you made (unless discussed before).

## Links
Add links to github/jira issues, design documents and other relevant resources (e.g. previous discussions, platform/tool documentation etc.)

# Checklist
- [ ] I wrote/updated tests for new/changed code
- [ ] I ran `npm run build` without issues
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Build
public/
*.tgz

# Coverage reports
coverage
coverage.*
.nyc_output/

# API keys and secrets
.env

# Dependency directory
node_modules/

# Ignore built files
build/
dist/
publishableDocs/

# Tests
test-results/

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# File System
*.DS_Store
Thumbs.db

# Editor
.vscode
jsconfig.json
/typings
.idea
*.iml

# Ignore yarn.lock
yarn.lock

#Exclude tsc generated files
js/*.map
js/ts.js
11 changes: 11 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"include": [
"src/**/*.ts"
],
"reporter": [
"text",
"lcov"
]
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[![Code Style: Google](https://img.shields.io/badge/code%20style-google-blueviolet.svg)](https://github.com/google/gts)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

# js-miniapp
Mini App SDK for JavaScript
Loading

0 comments on commit 96853ea

Please sign in to comment.