@joycostudio/scripts 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -0
- package/dist/cli.js +3539 -0
- package/lib/codemod/fix-svg-jsx-attrs.js +132 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @joycostudio/scripts
|
|
2
|
+
|
|
3
|
+
Joyco utility scripts bundled as a pnpx CLI.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpx @joycostudio/scripts --help
|
|
9
|
+
pnpx @joycostudio/scripts compress ./images ./output --quality 80
|
|
10
|
+
pnpx @joycostudio/scripts resize ./images ./output --width 1920 --height 1080
|
|
11
|
+
pnpx @joycostudio/scripts sequence -z 4 ./frames ./output/frame_%n.png
|
|
12
|
+
pnpx @joycostudio/scripts fix-svg src --dry --print
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For local development, build the CLI before running it directly:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm build
|
|
19
|
+
node dist/cli.js --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Adding a new script
|
|
23
|
+
|
|
24
|
+
1) Add or update the core logic in `src/core/` so it can be unit tested without spawning the CLI.
|
|
25
|
+
2) Create a new command module in `src/commands/` that exports a `register(program)` function.
|
|
26
|
+
3) Wire the new command into `src/cli.ts` by adding it to the registrations list.
|
|
27
|
+
|
|
28
|
+
Commands own their Commander configuration directly (args/options/help/examples), so you can use full Commander features when needed.
|
|
29
|
+
|
|
30
|
+
## 🦋 Version Management
|
|
31
|
+
|
|
32
|
+
This library uses [Changesets](https://github.com/changesets/changesets) to manage versions and publish releases.
|
|
33
|
+
|
|
34
|
+
### Adding a changeset
|
|
35
|
+
|
|
36
|
+
When you make changes that need to be released:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm changeset
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This will prompt you to:
|
|
43
|
+
1. Select which packages you want to include in the changeset
|
|
44
|
+
2. Choose whether it's a major/minor/patch bump
|
|
45
|
+
3. Provide a summary of the changes
|
|
46
|
+
|
|
47
|
+
### Creating a release
|
|
48
|
+
|
|
49
|
+
To create a new version and update the changelog:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# 1. Create new versions of packages
|
|
53
|
+
pnpm version:package
|
|
54
|
+
|
|
55
|
+
# 2. Release (publishes to npm)
|
|
56
|
+
pnpm release
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Remember to commit all changes after creating a release.
|
|
60
|
+
|
|
61
|
+
## 🤖 Automatic Workflows
|
|
62
|
+
|
|
63
|
+
This package comes with two GitHub Actions workflows:
|
|
64
|
+
|
|
65
|
+
1. **Release Workflow** (`.github/workflows/release.yml`): Automates the release process using Changesets. It will automatically create release pull requests and publish to npm when changes are pushed to the main branch.
|
|
66
|
+
|
|
67
|
+
2. **Publish Any Commit** (`.github/workflows/publish-any-commit.yml`): Builds and publishes packages for any commit or pull request using [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new).
|
|
68
|
+
|
|
69
|
+
> **Note:** For the PR preview workflow, you need to install [PKG.PR.NEW](https://github.com/apps/pkg-pr-new) on the target repository.
|
|
70
|
+
|
|
71
|
+
> **Note:** For the release workflow, you need to add an `NPM_TOKEN` secret to your repository settings.
|