Skip to content

Commit 195d0f9

Browse files
v0.0.0 (#1)
* Adds types and type-guards * Adds optional and event-emitter * Exports refactoring * Updates `package.json` and `README.md` * Adds documentation * Enables push on branch * Updates TODO.md
1 parent 945ea6d commit 195d0f9

File tree

94 files changed

+3865
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+3865
-57
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Release
22

33
on:
4-
# Disabled for template
5-
# push:
6-
# branches:
7-
# - master
4+
push:
5+
branches:
6+
- master
87

98
workflow_dispatch:
109

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ src/
33
tests/
44
.github/
55
.changeset/
6+
docs/
67

78
.gitignore
89
.npmignore
910
.prettierrc
1011
jest.config.js
11-
tsconfig.json
12+
tsconfig.json
13+
TODO.md

README.md

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
# NPM Package Template
1+
# TypeScript Utils
22

3-
[![npm version](https://img.shields.io/npm/v/@lilbunnyrabbit/<name>.svg)](https://www.npmjs.com/package/@lilbunnyrabbit/<name>)
4-
[![npm downloads](https://img.shields.io/npm/dt/@lilbunnyrabbit/<name>.svg)](https://www.npmjs.com/package/@lilbunnyrabbit/<name>)
3+
[![npm version](https://img.shields.io/npm/v/@lilbunnyrabbit/utils.svg)](https://www.npmjs.com/package/@lilbunnyrabbit/utils)
4+
[![npm downloads](https://img.shields.io/npm/dt/@lilbunnyrabbit/utils.svg)](https://www.npmjs.com/package/@lilbunnyrabbit/utils)
55

6-
This repository serves as a template for creating npm packages, simplifying the setup and development process for your npm packages. Replace all the `<name>` with the name of the repository and/or package.
6+
TypeScript Utils is a comprehensive collection of utilities tailored for [TypeScript](https://www.typescriptlang.org/) development, crafted to support a broad spectrum of projects and packages. This toolkit is designed to enhance developer productivity and code quality, offering a diverse array of utilities ranging from custom types and type guards to an extensive set of tools for event management, data manipulation, and more. Whether you're streamlining your development workflow, ensuring type safety, or facilitating event-driven architectures, TypeScript Utils provides the essential building blocks to elevate your [TypeScript](https://www.typescriptlang.org/) projects.
7+
8+
## Documentation
9+
10+
Explore the full capabilities of TypeScript Utils and learn how to integrate these utilities into your projects by visiting the [API Documentation](https://lilbunnyrabbit.github.io/typescript-utils/api).
711

812
## Installation
913

1014
To use this package in your project, run:
1115

1216
```sh
13-
npm i @lilbunnyrabbit/<name>
17+
npm i @lilbunnyrabbit/utils
1418
```
1519

1620
## Development
@@ -22,45 +26,33 @@ This section provides a guide for developers to set up the project environment a
2226
Clone the repository and install dependencies:
2327

2428
```sh
25-
git clone https://github.com/lilBunnyRabbit/npm-package-template.git
26-
cd npm-package-template
29+
git clone https://github.com/lilBunnyRabbit/typescript-utils.git
30+
cd typescript-utils
2731
npm install
2832
```
2933

3034
### NPM Scripts
3135

3236
The project includes several npm scripts to streamline common tasks such as building, testing, and cleaning up the project.
3337

34-
- **`build`**: Compiles the TypeScript source code to JavaScript, placing the output in the `dist` directory. This script is essential for preparing the package for publication or testing in a built form.
35-
```sh
36-
npm run build
37-
```
38-
- **`test`**: Executes the test suite using Jest. This script is crucial for ensuring that your code meets all defined tests and behaves as expected.
39-
```sh
40-
npm test
41-
```
42-
- **`clean`**: Removes both the `dist` directory and the `node_modules` directory. Useful for resetting the project's state during development or before a fresh install of dependencies.
43-
```sh
44-
npm run clean
45-
```
46-
- **`changeset`**: Manages versioning and changelog generation based on conventional commit messages. This script helps in preparing for a new release by determining which parts of the package need version updates.
47-
```sh
48-
npm run changeset
49-
```
50-
- **`release`**: Publishes the package to npm. It uses `changeset publish` to update package versions and changelogs automatically before publishing. This script streamlines the release process, making it easier to publish new versions of your package.
51-
```sh
52-
npm run release
53-
```
38+
| Script | Description | Command |
39+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
40+
| **`build`** | Compiles the [TypeScript](https://www.typescriptlang.org/) source code to JavaScript, placing the output in the `dist` directory. Essential for preparing the package for publication or testing. | `npm run build` |
41+
| **`test`** | Executes the test suite using [Jest](https://jestjs.io/). Crucial for ensuring that your code meets all defined tests and behaves as expected. | `npm test` |
42+
| **`clean`** | Removes both the `dist` directory and the `node_modules` directory. Useful for resetting the project's state during development or before a fresh install. | `npm run clean` |
43+
| **`changeset`** | Manages versioning and changelog generation based on conventional commit messages. Helps prepare for a new release by determining which parts of the package need version updates. | `npm run changeset` |
44+
| **`release`** | Publishes the package to npm. Uses `changeset publish` to automatically update package versions and changelogs before publishing. Streamlines the release process. | `npm run release` |
45+
| **`generate:docs`** | Generates project documentation using [Typedoc](https://typedoc.org/). Facilitates the creation of comprehensive and accessible API documentation. | `npm run generate:docs` |
5446

5547
These scripts are designed to facilitate the development process, from cleaning and building the project to running tests and releasing new versions. Feel free to use and customize them as needed for your development workflow.
5648

5749
## Contribution
5850

59-
Contributions are always welcome! Please read the contribution guidelines first.
51+
Contributions are always welcome! For any enhancements or bug fixes, please open a pull request linked to the relevant issue. If there's no existing issue related to your contribution, feel free to create one.
6052

6153
## Support
6254

63-
If you find this template useful, consider supporting by buying me a coffee.
55+
Your support is greatly appreciated! If this package has been helpful, consider supporting by buying me a coffee.
6456

6557
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/lilBunnyRabbit)
6658

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [ ] Include code from `depricated-typescript-utils`
2+
- [ ] Types testing

docs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

docs/api/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

docs/api/assets/highlight.css

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
:root {
2+
--light-hl-0: #795E26;
3+
--dark-hl-0: #DCDCAA;
4+
--light-hl-1: #000000;
5+
--dark-hl-1: #D4D4D4;
6+
--light-hl-2: #A31515;
7+
--dark-hl-2: #CE9178;
8+
--light-hl-3: #AF00DB;
9+
--dark-hl-3: #C586C0;
10+
--light-hl-4: #0000FF;
11+
--dark-hl-4: #569CD6;
12+
--light-hl-5: #001080;
13+
--dark-hl-5: #9CDCFE;
14+
--light-hl-6: #267F99;
15+
--dark-hl-6: #4EC9B0;
16+
--light-hl-7: #0070C1;
17+
--dark-hl-7: #4FC1FF;
18+
--light-hl-8: #008000;
19+
--dark-hl-8: #6A9955;
20+
--light-hl-9: #000000FF;
21+
--dark-hl-9: #D4D4D4;
22+
--light-hl-10: #098658;
23+
--dark-hl-10: #B5CEA8;
24+
--light-code-background: #FFFFFF;
25+
--dark-code-background: #1E1E1E;
26+
}
27+
28+
@media (prefers-color-scheme: light) { :root {
29+
--hl-0: var(--light-hl-0);
30+
--hl-1: var(--light-hl-1);
31+
--hl-2: var(--light-hl-2);
32+
--hl-3: var(--light-hl-3);
33+
--hl-4: var(--light-hl-4);
34+
--hl-5: var(--light-hl-5);
35+
--hl-6: var(--light-hl-6);
36+
--hl-7: var(--light-hl-7);
37+
--hl-8: var(--light-hl-8);
38+
--hl-9: var(--light-hl-9);
39+
--hl-10: var(--light-hl-10);
40+
--code-background: var(--light-code-background);
41+
} }
42+
43+
@media (prefers-color-scheme: dark) { :root {
44+
--hl-0: var(--dark-hl-0);
45+
--hl-1: var(--dark-hl-1);
46+
--hl-2: var(--dark-hl-2);
47+
--hl-3: var(--dark-hl-3);
48+
--hl-4: var(--dark-hl-4);
49+
--hl-5: var(--dark-hl-5);
50+
--hl-6: var(--dark-hl-6);
51+
--hl-7: var(--dark-hl-7);
52+
--hl-8: var(--dark-hl-8);
53+
--hl-9: var(--dark-hl-9);
54+
--hl-10: var(--dark-hl-10);
55+
--code-background: var(--dark-code-background);
56+
} }
57+
58+
:root[data-theme='light'] {
59+
--hl-0: var(--light-hl-0);
60+
--hl-1: var(--light-hl-1);
61+
--hl-2: var(--light-hl-2);
62+
--hl-3: var(--light-hl-3);
63+
--hl-4: var(--light-hl-4);
64+
--hl-5: var(--light-hl-5);
65+
--hl-6: var(--light-hl-6);
66+
--hl-7: var(--light-hl-7);
67+
--hl-8: var(--light-hl-8);
68+
--hl-9: var(--light-hl-9);
69+
--hl-10: var(--light-hl-10);
70+
--code-background: var(--light-code-background);
71+
}
72+
73+
:root[data-theme='dark'] {
74+
--hl-0: var(--dark-hl-0);
75+
--hl-1: var(--dark-hl-1);
76+
--hl-2: var(--dark-hl-2);
77+
--hl-3: var(--dark-hl-3);
78+
--hl-4: var(--dark-hl-4);
79+
--hl-5: var(--dark-hl-5);
80+
--hl-6: var(--dark-hl-6);
81+
--hl-7: var(--dark-hl-7);
82+
--hl-8: var(--dark-hl-8);
83+
--hl-9: var(--dark-hl-9);
84+
--hl-10: var(--dark-hl-10);
85+
--code-background: var(--dark-code-background);
86+
}
87+
88+
.hl-0 { color: var(--hl-0); }
89+
.hl-1 { color: var(--hl-1); }
90+
.hl-2 { color: var(--hl-2); }
91+
.hl-3 { color: var(--hl-3); }
92+
.hl-4 { color: var(--hl-4); }
93+
.hl-5 { color: var(--hl-5); }
94+
.hl-6 { color: var(--hl-6); }
95+
.hl-7 { color: var(--hl-7); }
96+
.hl-8 { color: var(--hl-8); }
97+
.hl-9 { color: var(--hl-9); }
98+
.hl-10 { color: var(--hl-10); }
99+
pre, code { background: var(--code-background); }

0 commit comments

Comments
 (0)