All Projects β†’ garronej β†’ ts-ci

garronej / ts-ci

Licence: MIT, MIT licenses found Licenses found MIT LICENSE MIT LICENSE.template
πŸš€ A starter for TS projects meant to be published on NPM.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to ts-ci

Darkmode.js
πŸŒ“ Add a dark-mode / night-mode to your website in a few seconds
Stars: ✭ 2,339 (+729.43%)
Mutual labels:  npm-package, npm-module
Ts ci
βœ… Continuous integration setup for TypeScript projects via GitHub Actions.
Stars: ✭ 225 (-20.21%)
Mutual labels:  npm-package, npm-module
Jsonexport
{} β†’ πŸ“„ it's easy to convert JSON to CSV
Stars: ✭ 208 (-26.24%)
Mutual labels:  npm-package, npm-module
Homebridge Wol
A Wake on Lan plugin for Homebridge
Stars: ✭ 150 (-46.81%)
Mutual labels:  npm-package, npm-module
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-MΓΆller
Stars: ✭ 17 (-93.97%)
Mutual labels:  npm-package, npm-module
Reactopt
A CLI React performance optimization tool that identifies potential unnecessary re-rendering
Stars: ✭ 1,975 (+600.35%)
Mutual labels:  npm-package, npm-module
Eslint Plugin Eslint Comments
Additional ESLint rules for directive comments of ESLint.
Stars: ✭ 221 (-21.63%)
Mutual labels:  npm-package, npm-module
Forge Node App
πŸ› πŸ“¦πŸŽ‰ Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (-68.09%)
Mutual labels:  npm-package, npm-module
js-stack-from-scratch
🌺 Russian translation of "JavaScript Stack from Scratch" from the React-Theming developers https://github.com/sm-react/react-theming
Stars: ✭ 394 (+39.72%)
Mutual labels:  npm-package, npm-module
Singlespotify
🎡 Create Spotify playlists based on one artist through the command line
Stars: ✭ 254 (-9.93%)
Mutual labels:  npm-package, npm-module
React Ckeditor
CKEditor component for React with plugin and custom event listeners support
Stars: ✭ 124 (-56.03%)
Mutual labels:  npm-package, npm-module
MinifyAllCli
πŸ“¦ A lightweight, simple and easy npm tool to π—Ίπ—Άπ—»π—Άπ—³π˜† JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as π‘ͺ𝑳𝑰 tool or π’Šπ’Žπ’‘π’π’“π’•π’‚π’ƒπ’π’† in TS/JS as a 𝑴𝑢𝑫𝑼𝑳𝑬 πŸ₯°
Stars: ✭ 21 (-92.55%)
Mutual labels:  npm-package, npm-module
Tplink Cloud Api
A node.js npm module to remotely control TP-Link smartplugs (HS100, HS110) and smartbulbs (LB100, LB110, LB120, LB130) using their cloud web service (no need to be on the same wifi/lan)
Stars: ✭ 96 (-65.96%)
Mutual labels:  npm-package, npm-module
Node Regedit
Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
Stars: ✭ 178 (-36.88%)
Mutual labels:  npm-package, npm-module
Event Target Shim
An implementation of WHATWG EventTarget interface, plus few extensions.
Stars: ✭ 89 (-68.44%)
Mutual labels:  npm-package, npm-module
Abort Controller
An implementation of WHATWG AbortController interface.
Stars: ✭ 213 (-24.47%)
Mutual labels:  npm-package, npm-module
Webcam Easy
javascript access webcam stream and take photo
Stars: ✭ 79 (-71.99%)
Mutual labels:  npm-package, npm-module
Node Loadbalance
A collection of distilled load balancing engines
Stars: ✭ 79 (-71.99%)
Mutual labels:  npm-package, npm-module
Typescript Lib Starter
Typescript library starter
Stars: ✭ 235 (-16.67%)
Mutual labels:  npm-package, prettier
arcscord
A Discord library written in typescript
Stars: ✭ 18 (-93.62%)
Mutual labels:  npm-package, npm-module

πŸš€A starter for any TypeScript project meant to be published on NPMπŸš€

Screen.Recording.2022-05-06.at.00.30.33.mov

ts-ci is a project starter like TSDX or typescript-starter but (arguably) better because:

  • It's not a CLI tool, the automation happens with Github Actions.
    Update your package.json version number, push. Voila, your new version is published on NPM.
  • It doesn't bundle your library into a single file so users can cherry-pick what they want to import from your lib, your modules will be tree shakable.
    E.g: import { aSpecificFunction } from "your-module/aSpecificFile"

How to use

  • Click on image
  • The repo name you will choose will be used as a module name for NPM.
  • Go to the repository Settings tab, then Secrets you will need to add a new secret: NPM_TOKEN, you NPM authorization token.
  • To trigger publishing edit the package.json version field ( 0.0.0-> 0.0.1 for example) then push changes... that's all !
  • Publish beta release by setting your version number to X.Y.Z-beta.T (example: 1.0.0-beta.32). You usually want to do that from a branch, it work as well! You just have to open a PR.

Features

This template automates the boring and tedious tasks of:

  • Filling up the package.json
  • Setting up Typescript.
  • Testing on multiple Node version running on Ubuntu and Windows before publishing.
  • Maintaining a CHANGELOG.
  • Publishing on NPM and creating corresponding GitHub releases.

Besides, good stuff that comes with using this template:

  • The dist/ directory is not tracked on the main branch.
  • Shorter specific file import path.
    import {...} from "my_module/theFile" instead of the usual import {...} from "my_module/dist/theFile"
  • ESlint and Prettier are automatically run against files staged for commit. (Optional, you can disable this feature)

Examples of project using this template

FAQ

Click to expand

Can I use npm instead of yarn

Yes, just remove the yarn.lock file.

What will be included in the npm bundle?

All filles listed in the files property of your package JSON.

How to debug the action

You can increase the verbosity by creating a new secret ACTIONS_STEP_DEBUG and setting it to true.

image

Disable linting and formatting

Remove this, this and this from your package.json
Remove this and this from github/workflows/ci.yaml
Remove .eslintignore, .eslintrc.js, .prettierignore and .prettierrc.json.

Accessing files outside the dist/ directory

The drawback of having short import path is that the dir structure
is not exactly the same in production ( in the npm bundle ) and in development.

The files and directories in dist/ will be moved to the root of the project.

As a result this won't work in production:

src/index.ts

import * as fs from "fs";
import * as path from "path";

const str = fs.readFileSync(
    path.join(__dirname,"..", "package.json")
).toString("utf8");

Because /dist/index.js will be moved to /index.js

You'll have to do:

src/index.ts

import * as fs from "fs";
import * as path from "path";
import { getProjectRoot } from "./tools/getProjectRoot";

const str = fs.readFileSync(
    path.join(getProjectRoot(),"package.json")
).toString("utf8");

With getProjectRoot.ts being:

import * as fs from "fs";
import * as path from "path";

function getProjectRootRec(dirPath: string): string {
    if (fs.existsSync(path.join(dirPath, "package.json"))) {
        return dirPath;
    }
    return getProjectRootRec(path.join(dirPath, ".."));
}

let result: string | undefined = undefined;

export function getProjectRoot(): string {
    if (result !== undefined) {
        return result;
    }

    return (result = getProjectRootRec(__dirname));
}

How does the automatic CHANGELOG.md update works?

Starting from the second release, a CHANGELOG.md will be created at the root of the repo.

Example:
image

The CHANGELOG.md is built from the commits messages since last release.

Are NOT included in the CHANGELOG.md:

  • The commit messages that includes the word "changelog" ( non-case sensitive ).
  • The commit messages that start with "Merge branch ".
  • The commit messages that with "GitBook: "

The GitHub release will point to a freezed version of the CHANGELOG.md:
image

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].