Skip to content

Commit

Permalink
feat: init project
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Jan 20, 2025
1 parent cdb4b18 commit cd5df06
Show file tree
Hide file tree
Showing 17 changed files with 1,409 additions and 6,604 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,4 @@ jobs:
npm_config_loglevel: "error"

- name: Lint 🧹
run: |
npm run lint
npm run ts-check
- name: Build 🔧
run: npm run build

- name: Test 🧪
run: npm run test:ci

# - name: Coveralls 🎉
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docs 📖
run: npm run docs

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs
run: npm run lint
10 changes: 1 addition & 9 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,4 @@ jobs:
npm_config_loglevel: "error"

- name: Lint 🧹
run: |
npm run lint
npm run ts-check
- name: Build 🔧
run: npm run build

- name: Test 🧪
run: npm run test:ci
run: npm run lint
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
npm_config_fund: "false"
npm_config_loglevel: "error"

- name: Build 🔧
run: npm run build

- name: Publish Package 🚀
run: npm publish --provenance --access public
env:
Expand Down
48 changes: 30 additions & 18 deletions README.md
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).
35 changes: 0 additions & 35 deletions README.template.md

This file was deleted.

9 changes: 0 additions & 9 deletions assets/docs.css

This file was deleted.

11 changes: 11 additions & 0 deletions cli.js
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)))}`);
}
1 change: 0 additions & 1 deletion mangle-cache.json

This file was deleted.

Loading

0 comments on commit cd5df06

Please sign in to comment.