Skip to content

Commit

Permalink
chore: init package
Browse files Browse the repository at this point in the history
  • Loading branch information
freitzzz committed Jul 12, 2023
1 parent 855b49f commit cf8aa42
Show file tree
Hide file tree
Showing 24 changed files with 11,410 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
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)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": true,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
node_modules
dist
ignore
.env
.env.*
!.env.example

package-lock.json
docs
bin
22 changes: 22 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": ["@typescript-eslint", "prettier", "unused-imports"],
"ignorePatterns": ["*.cjs"],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2016
},
"rules": {
"unused-imports/no-unused-imports": "error"
},
"env": {
"browser": true,
"es2016": true
}
}
23 changes: 23 additions & 0 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish docs site to GitHub Pages
on:
repository_dispatch:
types: [npm-published]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'

- run: npm install --frozen-lockfile
- run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npm run docs:publish -- -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to NPM
on:
push:
branches:
- 'master'

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'

- run: npm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Notify if published
if: steps.changesets.outputs.published == 'true'
uses: peter-evans/repository-dispatch@v2
with:
event-type: npm-published
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
dist/
coverage/
docs/
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
node_modules
coverage
dist
.env
.env.*
!.env.example

package-lock.json
docs
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 80
}
12 changes: 12 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript"
},
"target": "es2016"
},
"module": {
"type": "commonjs"
}
}
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# vault

A small, type inferred container designed for dependency injection 🫙

![npm version](https://badgen.net/npm/v/@web-pacotes/vault) ![npm total downloads](https://badgen.net/npm/dt/@web-pacotes/vault) ![bundlephobia bundle size](https://badgen.net/bundlephobia/min/@web-pacotes/vault)

---

## How to use

todo: describe usage

```typescript
todo: include usage code here
```

Additionally, you can a small, type inferred container designed for dependency injection 🫙. Execute the following command for more info:

```bash
vault --help
```

## Features

todo: enumerate features package currently provides

### Upcoming features

todo: enumerate features package does not provide

---

## Bugs and Contributions

Found any bug (including typos) in the package? Do you have any suggestion
or feature to include for future releases? Please create an issue via
GitHub in order to track each contribution. Also, pull requests are very
welcome!

To contribute, start by setting up your local development environment. The [setup.md](setup.md) document will onboard you on how to do so!

## Contact

This template was prepared by:

- João Freitas, @freitzzz
- Rute Santos, @rutesantos4

Contact us for freelancing work!
7 changes: 7 additions & 0 deletions example/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import sum from 'vault';

function main() {
console.log(sum(40, 2));
}

main();
46 changes: 46 additions & 0 deletions example/package-lock.json

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

14 changes: 14 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "vault-example",
"version": "0.0.0",
"description": "Example project to test vault",
"main": "dist/index.js",
"module": "dist/index.cjs",
"types": "dist/index.d.ts",
"sideEffects": false,
"author": "web-pacotes",
"license": "none",
"dependencies": {
"vault": "file:../"
}
}
21 changes: 21 additions & 0 deletions hooks/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

script_file_name=$(basename $0)
script_dir_path=$(dirname $(realpath $0))
git_hooks_dir_path="$script_dir_path/../.git/hooks"

dir_files=$(ls $script_dir_path)

if [[ ! -d $git_hooks_dir_path ]]
then
mkdir $git_hooks_dir_path
fi

for file in ${dir_files[@]}; do
file_path="$script_dir_path/$file"

if [[ -f $file_path && "$file" != "$script_file_name" ]]
then
cp $file_path $git_hooks_dir_path
fi
done
11 changes: 11 additions & 0 deletions hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

npm run lint

if [[ $? != 0 ]]; then
npm run format

exit 1
fi

exit 0
23 changes: 23 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
export default {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,

// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',

// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',

// A preset that is used as a base for Jest's configuration
preset: 'ts-jest',

// A list of paths to directories that Jest should use to search for files in
roots: ['src']
};
Loading

0 comments on commit cf8aa42

Please sign in to comment.