Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
harazdovskiy authored Dec 22, 2022
0 parents commit 10d7a45
Show file tree
Hide file tree
Showing 27 changed files with 379 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
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
9 changes: 9 additions & 0 deletions .editorconfig
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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage/
lib/
renovate.json
tsconfig.json
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"root": true,
"extends": [
"@shelf/eslint-config/typescript"
]
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.js text eol=lf
30 changes: 30 additions & 0 deletions .gitignore
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
31 changes: 31 additions & 0 deletions .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
3 changes: 3 additions & 0 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
git update-index --again
4 changes: 4 additions & 0 deletions .husky/pre-commit
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

11 changes: 11 additions & 0 deletions .husky/validate-circleci-config.sh
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
52 changes: 52 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/opensource-npm-template.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
30 changes: 30 additions & 0 deletions README.md
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)
9 changes: 9 additions & 0 deletions license
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.
66 changes: 66 additions & 0 deletions package.json
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"
}
}
8 changes: 8 additions & 0 deletions renovate.json
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"
]
}
5 changes: 5 additions & 0 deletions src/index.test.ts
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');
});
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function getFoo(): string {
return 'bar';
}
Loading

0 comments on commit 10d7a45

Please sign in to comment.