@spacetimewave/trustnet-engine
v0.1.0
Published
Trustnet Engine
Downloads
2
Readme
Trustnet Engine
Welcome to trustnet engine.
Installation
Soon...
Configuration
Install pnpm with NodeJS v16.x.x or greater.
$ corepack enable
$ corepack prepare pnpm@latest --activate
Create the project with Vite
$ pnpm create vite <app>
> Select a framework: Vanilla
> Select a variant: TypeScript
$ cd <app>
$ pnpm install
$ pnpm update
Login using GitHub CLI saving an encrypted SSH key to push commits
$ gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? SSH
? Generate a new SSH key to add to your GitHub account? Yes
? Enter a passphrase for your new SSH key (Optional) ****************
? Title for your SSH key: github
? How would you like to authenticate GitHub CLI? Login with a web browser
Clone the GitHub repository in your local machine
$ git clone [email protected]:spacetimewave/trustnet-engine.git
Install Prettier formatter as development dependency.
$ pnpm add -D prettier
Install Prettier - Code formatter
extension in VSCode.
Add to .vscode/settings.json the following settings.
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Install ESLint linter as development dependency.
$ pnpm create @eslint/config
√ How would you like to use ESLint? · style
√ What type of modules does your project use? · esm
√ Which framework does your project use? · none
√ Does your project use TypeScript? · No / Yes
√ Where does your code run? · browser
√ How would you like to define a style for your project? · guide
√ Which style guide do you want to follow? · standard-with-typescript
√ What format do you want your config file to be in? · JSON
The config that you've selected requires the following dependencies:
eslint-config-standard-with-typescript@latest @typescript-eslint/eslint-plugin@^6.4.0 eslint@^8.0.1 eslint-plugin-import@^2.25.2 eslint-plugin-n@^15.0.0 || ^16.0.0 eslint-plugin-promise@^6.0.0 typescript@*
√ Would you like to install them now? · No / Yes
√ Which package manager do you want to use? · pnpm
Install eslint-config-prettier
to turn-off eslint rules that are unnecessary or might conflict with Prettier. Install eslint-config-prettier
to run Prettier as an Eslint-rule.
pnpm add -D eslint-config-prettier eslint-plugin-prettier
Add unit tests.
pnpm add -D jest @types/jest ts-jest ts-node
| Package | Purpose | | ----------- | --------------------------------------------- | | jest | Test runner | | ts-jest | For running jest in typescript supported app. | | ts-node | For creating jest config file in TS extension | | @types/jest | Types library for Jest |
Add commit lint and pre-commit hooks.
pnpm add -D @commitlint/cli @commitlint/config-conventional
pnpm add -D husky lint-staged
Build code for deployment
$ pnpm build
$ npm login
$ npm publish --access=public
Technologies
| Feature | Technology | | ------------------------- | ----------- | | Package manager | PNPM | | Package bundler | Vite | | Programming language | Typescript | | Basic linting | ESLint | | Code formatting | Prettier | | Testing | TS Jest | | Pre-commit hook validator | Husky | | Linting only staged files | lint-staged | | Lint git commit messages | commitlint |