-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
orbs: | ||
node: circleci/[email protected] | ||
|
||
version: 2.1 | ||
|
||
parameters: | ||
node_version: | ||
type: string | ||
default: '16.15.1' | ||
|
||
commands: | ||
install_deps: | ||
steps: | ||
- node/install-packages: | ||
pkg-manager: yarn | ||
cache-version: v1-all | ||
cache-only-lockfile: true | ||
app-dir: ~/repo | ||
override-ci-command: yarn install --pure-lockfile --no-progress | ||
|
||
jobs: | ||
build: | ||
executor: | ||
name: node/default | ||
tag: << pipeline.parameters.node_version >> | ||
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- install_deps | ||
- run: yarn test | ||
- run: yarn type-check | ||
- run: yarn lint:ci |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
coverage/ | ||
lib/ | ||
renovate.json | ||
tsconfig.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"@shelf/eslint-config/typescript" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* text=auto | ||
*.js text eol=lf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.vscode/ | ||
.serverless/ | ||
coverage/ | ||
lib/ | ||
node_modules/ | ||
|
||
*.log | ||
junit.xml | ||
draft.js | ||
*.draft.js | ||
draft.ts | ||
*.draft.ts | ||
yarn.lock | ||
|
||
.env | ||
.DS_Store | ||
|
||
# User-specific stuff | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/**/usage.statistics.xml | ||
.idea/**/shelf | ||
|
||
# File-based project format | ||
*.iws | ||
|
||
.idea/$CACHE_FILE$ | ||
.idea/$PRODUCT_WORKSPACE_FILE$ | ||
.idea/.gitignore | ||
!.husky/_/husky.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/sh | ||
if [ -z "$husky_skip_init" ]; then | ||
debug () { | ||
if [ "$HUSKY_DEBUG" = "1" ]; then | ||
echo "husky (debug) - $1" | ||
fi | ||
} | ||
|
||
readonly hook_name="$(basename "$0")" | ||
debug "starting $hook_name..." | ||
|
||
if [ "$HUSKY" = "0" ]; then | ||
debug "HUSKY env variable is set to 0, skipping hook" | ||
exit 0 | ||
fi | ||
|
||
if [ -f ~/.huskyrc ]; then | ||
debug "sourcing ~/.huskyrc" | ||
. ~/.huskyrc | ||
fi | ||
|
||
export readonly husky_skip_init=1 | ||
sh -e "$0" "$@" | ||
exitCode="$?" | ||
|
||
if [ $exitCode != 0 ]; then | ||
echo "husky - $hook_name hook exited with code $exitCode (error)" | ||
fi | ||
|
||
exit $exitCode | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
git update-index --again |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
yarn lint-staged --shell "/bin/sh" --verbose | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
if ! command -v circleci > /dev/null 2>&1; then | ||
echo "\033[0;31m" \ | ||
"Please, install CircleCI CLI to validate config:" \ | ||
"https://circleci.com/docs/2.0/local-cli/" | ||
|
||
exit 0 | ||
fi | ||
|
||
circleci config validate |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# xxxxxx [![CircleCI](https://circleci.com/gh/shelfio/xxxxxx/tree/master.svg?style=svg)](https://circleci.com/gh/shelfio/xxxxxx/tree/master)![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) | ||
|
||
> xxxxxx description | ||
## Install | ||
|
||
``` | ||
$ yarn add @shelf/xxxxxx | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
const {getFoo} = require('@shelf/xxxxxx'); | ||
|
||
getFoo(); | ||
``` | ||
|
||
## Publish | ||
|
||
```sh | ||
$ git checkout master | ||
$ yarn version | ||
$ yarn publish | ||
$ git push origin master --tags | ||
``` | ||
|
||
## License | ||
|
||
MIT © [Shelf](https://shelf.io) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
MIT License | ||
|
||
Copyright (c) Gemshelf Inc. (shelf.io) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "@shelf/xxxxxx", | ||
"version": "0.0.0", | ||
"description": "xxxxxx", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Vlad Holubiev", | ||
"email": "[email protected]", | ||
"url": "https://shelf.io" | ||
}, | ||
"main": "lib", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"scripts": { | ||
"build": "rm -rf lib/ && yarn build:types && yarn build:code", | ||
"build:code": "babel src --out-dir lib --ignore '**/*.test.ts' --extensions '.ts' && find ./lib -name '*.test.d.ts' -delete", | ||
"build:types": "tsc --emitDeclarationOnly --declaration --isolatedModules false --declarationDir lib", | ||
"coverage": "yarn test --coverage", | ||
"lint": "yarn lint:ci --fix", | ||
"lint:ci": "eslint . --ext .js,.ts,.json", | ||
"prepack": "yarn build", | ||
"test": "TZ=UTC jest src", | ||
"type-check": "tsc --noEmit", | ||
"type-check:watch": "npm run type-check -- --watch" | ||
}, | ||
"lint-staged": { | ||
"*.{html,md,yml}": [ | ||
"prettier --write" | ||
], | ||
"*.{js,ts,json}": [ | ||
"eslint --fix" | ||
], | ||
".circleci/config.yml": [ | ||
".husky/validate-circleci-config.sh" | ||
] | ||
}, | ||
"babel": { | ||
"extends": "@shelf/babel-config/backend" | ||
}, | ||
"prettier": "@shelf/prettier-config", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/cli": "7.19.3", | ||
"@babel/core": "7.20.5", | ||
"@shelf/babel-config": "1.2.0", | ||
"@shelf/eslint-config": "2.26.0", | ||
"@shelf/prettier-config": "1.0.0", | ||
"@shelf/tsconfig": "0.0.9", | ||
"@types/jest": "29.2.4", | ||
"@types/node": "16", | ||
"eslint": "8.29.0", | ||
"husky": "8.0.2", | ||
"jest": "29.3.1", | ||
"lint-staged": "13.1.0", | ||
"prettier": "2.8.1", | ||
"typescript": "4.9.4" | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": ["config:base"], | ||
"labels": ["dependencies", "backend"], | ||
"ignoreDeps": [ | ||
"cimg/node", | ||
"@types/node" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {getFoo} from './index'; | ||
|
||
it('should return bar', () => { | ||
expect(getFoo()).toEqual('bar'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function getFoo(): string { | ||
return 'bar'; | ||
} |