generated from wopjs/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,409 additions
and
6,604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,43 @@ | ||
# @wopjs/template | ||
# @wopjs/gzip-size | ||
|
||
[![Build Status](https://github.com/wopjs/template/actions/workflows/build.yml/badge.svg)](https://github.com/wopjs/template/actions/workflows/build.yml) | ||
[![Build Status](https://github.com/wopjs/gzip-size/actions/workflows/build.yml/badge.svg)](https://github.com/wopjs/gzip-size/actions/workflows/build.yml) | ||
[![npm-version](https://img.shields.io/npm/v/@wopjs/gzip-size.svg)](https://www.npmjs.com/package/@wopjs/gzip-size) | ||
Print gzip size of a file. | ||
|
||
A template starter repo for modern JavaScript and TypeScript development, designed to ensure high-quality code output. | ||
## Install | ||
|
||
- **ESLint Configuration**: Includes TypeScript support and automatic import sorting. | ||
- **Testing Framework**: Utilizes Vitest for seamless testing and coverage reporting. | ||
- **Documentation Generation**: Handled by TypeDoc for creating detailed documentation. | ||
- **Build Process**: Uses `tsup` to bundle compact, readable code with a focus on minimizing bundle size. | ||
- **Continuous Integration**: Includes GitHub Actions for automated CI testing, versioning and publishing. | ||
``` | ||
npm add @wopjs/gzip-size | ||
``` | ||
|
||
## Install | ||
## Usage | ||
|
||
After you have cloned the repository generated by this template, run the following command to rename the package and install dependencies: | ||
`package.json`: | ||
|
||
```console | ||
node scripts/setup.mjs | ||
```json | ||
{ | ||
"scripts": { | ||
"gzip-size": "gzip-size dist/index.mjs dist/index.js" | ||
} | ||
} | ||
``` | ||
|
||
It will update the template with info inferred from git or directory name, and install dependencies. | ||
## Development | ||
|
||
### Publish New Version | ||
|
||
You can also set the info manually by running: | ||
You can use [npm version](https://docs.npmjs.com/cli/v10/commands/npm-version) to bump version. | ||
|
||
```console | ||
node scripts/setup.mjs --name "package-name" --description "package description" --repo "https://github.com/wopjs/template.git" | ||
``` | ||
npm version patch | ||
``` | ||
|
||
Push the tag to remote and CI will publish the new version to npm. | ||
|
||
``` | ||
git push --follow-tags | ||
``` | ||
|
||
## License | ||
### CI Auto Publish | ||
|
||
MIT @ [wopjs](https://github.com/wopjs) | ||
If you want to publish the package in CI, you need to set the `NPM_TOKEN` secrets [in GitHub repository settings](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository). See how to [create a NPM access token](https://docs.npmjs.com/creating-and-viewing-access-tokens). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env node | ||
|
||
import { gzipSizeFromFileSync } from "gzip-size"; | ||
import prettyBytes from "pretty-bytes"; | ||
import { gray, green } from "yoctocolors"; | ||
|
||
const filePaths = process.argv.slice(2); | ||
|
||
for (const filePath of filePaths) { | ||
console.log(`${gray("gzip")} ${filePath} ${green(prettyBytes(gzipSizeFromFileSync(filePath)))}`); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.