GithubHelp home page GithubHelp logo

@asunlabs/setup-template

This is a template repository for developerasun's Nodejs project configuration.

Fix below badges.

wakatime Github All Releases GitHub last commit code style: prettier

release label assign

banner image here

Content

Git

Commit convention

Run

git config --local commit.template .gitmessage.txt

Tag

Run

# create
git tag [tag-name-here]

# push
git push origin [tag-name-here]

# remove from local
git tag -d [tag-name-here]

# remove from remote
git push origin :[tag-name-here]

Or use package manager for semver.

pnpm version patch
pnpm version minor
pnpm version major

Hook

pnpm format and pnpm lint is hooked up on pre-push. Check out .husky/pre-push and package.json.

Config

Check out .gitconfig.example and configure it at .git/config

# list of alias
  h = help
	aa = add . # add all
	c = commit
	p = pull
	pom = pull origin main
	ps = push
	pf = push -f
	cn = checkout -b # check out to a new branch
	sm = switch main # check out to main

Submodule

Get what you need from another repo with git submodule.

Run to add

git submodule add https://github.com/developerasun/developerasun.git

Check status.

git submodule

# result
# 52d2c4b80553858db28cbe92ee3923a4c1fec531 developerasun (heads/main)

Run to update

cd submodule

# get latest commit
git pull

Run to remove

# step 1
git submodule deinit -f <submodule-name>

# step 2
rm -rf .git/modules/<submodule-name>

# step 3
git rm -f <submodule-name>
Empty submodule

If submodule directory is empty, try below.

Clone this repo with --recursive flag to clone with all the submodules.

git clone <https-url> --recursive

Or, if you already cloned,

git submodule update --init

Husky

Run

# Mac
pnpm dlx husky-init && pnpm install # pnpm

# Windows
pnpm dlx husky-init -and pnpm install # pnpm

Edit .husky/pre-push and package.json for pre-push hook.

Dependencies

Run preinstall for global dependency if there is any.

pnpm preinstall

Check node, npm, package manager version.

  "packageManager": "[email protected]",
  "engines": {
    "node": ">=18.12.1",
    "npm": ">=8.19.2"
  }

Package manager

Use ni if there are more than one single package manager in project.

Run

# CLI
npm i -g @antfu/ni

# From package.json
pnpm preinstall

And then,

ni <package-name># install
nun <package-name># uninstall
nr format # run prettier
nr lint # run eslint

D2 diagram

  • D2 works in UNIX OS.

Install

# install
curl -fsSL https://d2lang.com/install.sh | sh -s --

# uninstall
curl -fsSL https://d2lang.com/install.sh | sh -s -- --uninstall

Write diagram in d2

# Actors
hans: Hans Niemann

defendants: {
  mc: Magnus Carlsen
  playmagnus: Play Magnus Group
  chesscom: Chess.com
  naka: Hikaru Nakamura

  mc -> playmagnus: Owns majority
  playmagnus <-> chesscom: Merger talks
  chesscom -> naka: Sponsoring
}

# Accusations
hans -> defendants: 'sueing for $100M'

# Offense
defendants.naka -> hans: Accused of cheating on his stream
defendants.mc -> hans: Lost then withdrew with accusations
defendants.chesscom -> hans: 72 page report of cheating

Render it in browser.

d2 --watch sample.d2 test.svg

Prettier

Run

pnpm format

Edit .prettierrc.js for more detailed configuration.

ESLint

Install with

pnpm create @eslint/config

Basic setup is as follows.

  • targeting typescript
  • running in node
  • ESM
  • configuring with Javascript file

Edit .eslinrc.js for more detailed configuration.

Run

pnpm lint

Contribution

Contributors

Star History

Star History Chart

Contact

🔊

dev.promo.v0.3.0.mp4
Tech blog ENS Slack Kakaotalk
@jakesung @developerasun.eth @asunlabs @developerasun

@asunlabs's Projects

owlly icon owlly

Let your Slack team know .env changes instantly. Powered by @developerasun

pawcon-monorepo icon pawcon-monorepo

A monorepo for PawCon blockchain/metaverse project . Powered by @developerasun

setup-template icon setup-template

This is a template repository for developerasun's Nodejs project configuration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.