Skip to content

Commit f91c743

Browse files
committed
Rename package to scoped @sahinur/forgedata; bump CI action/toolchain versions
npm's anti-typosquatting policy blocks the unscoped "forgedata" name as too similar to "form-data", so the package now publishes as @sahinur/forgedata. The forgedata CLI command name is unaffected by the scope change. Also: fix the bin path / typesVersions formatting flagged by `npm pkg fix`, bump @typescript-eslint to v8 (clears a TS 5.9 support warning), and bump actions/checkout, actions/setup-node, and actions/upload-artifact to their current majors to clear GitHub's Node 20 runtime deprecation warning.
1 parent 4ddfe84 commit f91c743

15 files changed

Lines changed: 64 additions & 55 deletions

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node-version: [18.x, 20.x, 22.x]
15+
node-version: [18.x, 20.x, 22.x, 24.x]
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v7
1818

1919
- name: Setup Node ${{ matrix.node-version }}
20-
uses: actions/setup-node@v4
20+
uses: actions/setup-node@v6
2121
with:
2222
node-version: ${{ matrix.node-version }}
2323
cache: "npm"
@@ -38,8 +38,8 @@ jobs:
3838
run: npm run build
3939

4040
- name: Upload coverage
41-
if: matrix.node-version == '20.x'
42-
uses: actions/upload-artifact@v4
41+
if: matrix.node-version == '22.x'
42+
uses: actions/upload-artifact@v7
4343
with:
4444
name: coverage
4545
path: coverage

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
pull-requests: write
2424
id-token: write
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v7
2727
with:
2828
fetch-depth: 0
2929

3030
- name: Setup Node
31-
uses: actions/setup-node@v4
31+
uses: actions/setup-node@v6
3232
with:
33-
node-version: 20.x
33+
node-version: 22.x
3434
cache: "npm"
3535
registry-url: "https://registry.npmjs.org"
3636

‎CHANGELOG.md‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ this line by CI; do not hand-edit past releases.
1313

1414
## [0.1.0] - Unreleased
1515

16-
Initial release.
16+
Initial release. Published as the scoped package `@sahinur/forgedata` — the
17+
unscoped `forgedata` name is blocked by npm's anti-typosquatting policy
18+
(flagged as too similar to the popular `form-data` package). The CLI command
19+
itself is still the short `forgedata` regardless of package scope.
1720

1821
### Added
1922

@@ -30,14 +33,14 @@ Initial release.
3033
`weighted`, `probability`, `randomArray`, `randomObjectKey/Value`.
3134
- Generator introspection: `forge.listGenerators()` / `forge.invoke()`, built
3235
by walking the real module classes rather than a hand-maintained registry.
33-
- React integration at the `forgedata/react` subpath: `ForgeDataProvider`,
36+
- React integration at the `@sahinur/forgedata/react` subpath: `ForgeDataProvider`,
3437
`useForgeData()`, `useGenerator()`. `react` is an optional peer dependency.
3538
- CLI (`forgedata` bin): `list` and `generate` commands with
3639
`--seed`/`--locale`/`--count`/`--json` flags.
3740
- ESM + CommonJS builds with full TypeScript declarations for the main entry,
38-
`forgedata/react`, and the CLI.
41+
`@sahinur/forgedata/react`, and the CLI.
3942
- 100% statement/branch/function/line test coverage (enforced in CI).
4043
- Zero runtime dependencies; only web-standard APIs (`btoa`, etc.) so the
4144
package runs unmodified on Node.js 18+, Bun, Deno, and in browsers.
4245

43-
[0.1.0]: https://github.com/forgedata/forgedata/releases/tag/v0.1.0
46+
[0.1.0]: https://github.com/devSahinur/ForgeData/releases/tag/v0.1.0

‎README.md‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ A modern, modular, tree-shakable, zero-runtime-dependency fake data generator fo
1111
- **Seedable** — deterministic output for tests and snapshots
1212
- **9 built-in locales**, plus a custom locale API
1313
- **Custom generators** via `forge.define(...)`
14-
- **React integration** (`forgedata/react`): a provider + two hooks
14+
- **React integration** (`@sahinur/forgedata/react`): a provider + two hooks
1515
- **CLI** (`forgedata`): generate fake data from your terminal or scripts
1616
- **100% test coverage** (statements/branches/functions/lines)
1717

1818
## Install
1919

2020
```bash
21-
npm install forgedata
21+
npm install @sahinur/forgedata
2222
```
2323

2424
## Quick start
2525

2626
```ts
27-
import { ForgeData } from "forgedata";
27+
import { ForgeData } from "@sahinur/forgedata";
2828

2929
const forge = new ForgeData();
3030

@@ -39,7 +39,7 @@ forge.ai.prompt(); // "Explain quantum computing to a beginner...
3939
Or use the ready-made default instance for quick scripts:
4040

4141
```ts
42-
import { forge } from "forgedata";
42+
import { forge } from "@sahinur/forgedata";
4343

4444
console.log(forge.person.fullName());
4545
```
@@ -141,7 +141,7 @@ This is what the CLI is built on.
141141
## React integration
142142

143143
```tsx
144-
import { ForgeDataProvider, useForgeData, useGenerator } from "forgedata/react";
144+
import { ForgeDataProvider, useForgeData, useGenerator } from "@sahinur/forgedata/react";
145145

146146
function App() {
147147
return (
@@ -161,19 +161,19 @@ function UserCard() {
161161
}
162162
```
163163

164-
`useForgeData()` works even without a `ForgeDataProvider` (it falls back to a shared default instance) — wrap your tree in a provider whenever you need a specific seed/locale or per-instance isolation. `react` is an optional peer dependency; the main `forgedata` entry point never imports it.
164+
`useForgeData()` works even without a `ForgeDataProvider` (it falls back to a shared default instance) — wrap your tree in a provider whenever you need a specific seed/locale or per-instance isolation. `react` is an optional peer dependency; the main `@sahinur/forgedata` entry point never imports it.
165165

166166
## CLI
167167

168168
```bash
169-
npx forgedata list # every generator id
170-
npx forgedata list --module person # filtered to one module
171-
npx forgedata generate person.fullName # one value
172-
npx forgedata generate internet.email --count 5 --seed 42
173-
npx forgedata generate location.country --locale ja --json
169+
npx --package=@sahinur/forgedata forgedata list # every generator id
170+
npx --package=@sahinur/forgedata forgedata list --module person # filtered to one module
171+
npx --package=@sahinur/forgedata forgedata generate person.fullName # one value
172+
npx --package=@sahinur/forgedata forgedata generate internet.email --count 5 --seed 42
173+
npx --package=@sahinur/forgedata forgedata generate location.country --locale ja --json
174174
```
175175

176-
Install it globally or use `npx`; see [docs/cli.md](./docs/cli.md) for the full flag reference.
176+
Install it globally (`npm install -g @sahinur/forgedata`) to just run `forgedata ...` directly; see [docs/cli.md](./docs/cli.md) for the full flag reference.
177177

178178
## Modules
179179

@@ -204,8 +204,8 @@ ForgeData avoids Node-only APIs in `src/` — it uses only `btoa`, `Math`/`Date`
204204

205205
- **Node.js**: `import`/`require` both work out of the box.
206206
- **Bun**: works via the same ESM/CJS builds.
207-
- **Deno**: `import { ForgeData } from "npm:forgedata";`
208-
- **Browsers**: `import { ForgeData } from "forgedata";` through any bundler, or `examples/browser.html` for a zero-bundler example.
207+
- **Deno**: `import { ForgeData } from "npm:@sahinur/forgedata";`
208+
- **Browsers**: `import { ForgeData } from "@sahinur/forgedata";` through any bundler, or `examples/browser.html` for a zero-bundler example.
209209

210210
## Development
211211

‎RELEASE_NOTES.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ alternative to Faker.js with React integration and a CLI built in.
2626
plus a custom locale API.
2727
- **Custom generators** (`forge.define()`) and a **unique-value generator**
2828
(`forge.unique.email()`, etc.).
29-
- **React integration** at `forgedata/react`: `ForgeDataProvider`,
29+
- **React integration** at `@sahinur/forgedata/react`: `ForgeDataProvider`,
3030
`useForgeData()`, `useGenerator()`. `react` is an optional peer dependency —
3131
the main entry point never imports it.
3232
- **CLI** (`forgedata`): `forgedata generate person.fullName --seed 42`,
@@ -36,13 +36,17 @@ alternative to Faker.js with React integration and a CLI built in.
3636
## Install
3737

3838
```bash
39-
npm install forgedata
39+
npm install @sahinur/forgedata
4040
```
4141

42+
Published under the `@sahinur` scope because npm's anti-typosquatting policy
43+
blocks the unscoped `forgedata` name (too similar to the popular `form-data`
44+
package). The CLI command is still just `forgedata`.
45+
4246
## Quick start
4347

4448
```ts
45-
import { ForgeData } from "forgedata";
49+
import { ForgeData } from "@sahinur/forgedata";
4650

4751
const forge = new ForgeData({ seed: 42 });
4852
forge.person.fullName();
@@ -54,6 +58,6 @@ reference, React guide, CLI reference, and migration notes from Faker.js.
5458

5559
## Links
5660

57-
- npm: https://www.npmjs.com/package/forgedata
61+
- npm: https://www.npmjs.com/package/@sahinur/forgedata
5862
- Docs: [docs/getting-started.md](./docs/getting-started.md)
5963
- Changelog: [CHANGELOG.md](./CHANGELOG.md)

‎docs/api-reference.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Every module below is a plain class instantiated once per `ForgeData`. Full meth
6060

6161
Built-in codes: `en`, `bn`, `hi`, `ar`, `ja`, `fr`, `de`, `es`, `zh`. Register additional ones with `forge.defineLocale(data)`.
6262

63-
## React (`forgedata/react`)
63+
## React (`@sahinur/forgedata/react`)
6464

6565
See [react.md](./react.md).
6666

‎docs/cli.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# CLI Reference
22

33
```bash
4-
npx forgedata --help
4+
npx --package=@sahinur/forgedata forgedata --help
55
```
66

7+
(The package is published as `@sahinur/forgedata`, but its bin command is the shorter `forgedata` — `npx` needs `--package` whenever the command name doesn't match the package name. Once installed — globally or as a project dependency — just run `forgedata ...` directly, as in every example below.)
8+
79
```
810
forgedata v0.1.0 — fake data from the command line
911
@@ -51,14 +53,14 @@ Non-string results (objects, e.g. `location.airport`) are printed as JSON even w
5153
## Installing globally
5254

5355
```bash
54-
npm install -g forgedata
56+
npm install -g @sahinur/forgedata
5557
forgedata list
5658
```
5759

5860
Or invoke it without installing:
5961

6062
```bash
61-
npx forgedata generate person.fullName
63+
npx --package=@sahinur/forgedata forgedata generate person.fullName
6264
```
6365

6466
## Scripting example

‎docs/contributing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Core argument parsing/dispatch logic lives in `src/cli-core.ts` (fully unit test
4040

4141
## Working on the React integration
4242

43-
`src/react/index.tsx` is a separate tsup entry (`forgedata/react`) with `react` as an external peer dependency — never import it from `src/index.ts`. Test with `@testing-library/react` + jsdom (`// @vitest-environment jsdom` at the top of the test file).
43+
`src/react/index.tsx` is a separate tsup entry (`@sahinur/forgedata/react`) with `react` as an external peer dependency — never import it from `src/index.ts`. Test with `@testing-library/react` + jsdom (`// @vitest-environment jsdom` at the top of the test file).
4444

4545
## Code style
4646

‎docs/getting-started.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
## Install
44

55
```bash
6-
npm install forgedata
6+
npm install @sahinur/forgedata
77
```
88

99
## Your first generator
1010

1111
```ts
12-
import { ForgeData } from "forgedata";
12+
import { ForgeData } from "@sahinur/forgedata";
1313

1414
const forge = new ForgeData();
1515

@@ -22,7 +22,7 @@ console.log(forge.internet.email());
2222
## Seeding for deterministic tests
2323

2424
```ts
25-
import { ForgeData } from "forgedata";
25+
import { ForgeData } from "@sahinur/forgedata";
2626

2727
const forge = new ForgeData({ seed: "my-test-suite" });
2828

‎docs/migration-guide.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ ForgeData follows a similar module-and-method shape to `@faker-js/faker`, but wi
2323

2424
## Key differences
2525

26-
1. **Instance-based, not a global singleton.** `new ForgeData()` gives you an isolated random stream. ForgeData also exports a ready-made singleton (`import { forge } from "forgedata"`), but construct your own per test file/suite when you need isolation.
26+
1. **Instance-based, not a global singleton.** `new ForgeData()` gives you an isolated random stream. ForgeData also exports a ready-made singleton (`import { forge } from "@sahinur/forgedata"`), but construct your own per test file/suite when you need isolation.
2727
2. **Seeding is constructor-first.** Prefer `new ForgeData({ seed })` over calling `.seed()` after the fact, though both work.
2828
3. **Locale data shape is simpler.** ForgeData locales cover names, places, lorem words, and company phrasing — not every Faker.js locale category. Extend via `forge.defineLocale(...)`.
2929
4. **No module-specific singletons** like `faker.fakerEN`, `faker.fakerDE`, etc. — pass `locale` to the constructor or call `forge.locale(code)`.
3030
5. **Unique generator is per-instance and explicit** (`forge.unique.email()`), not a global unique-tracking layer.
31-
6. **Built-in React integration and CLI** — Faker.js has neither out of the box; ForgeData ships `forgedata/react` and the `forgedata` CLI.
31+
6. **Built-in React integration and CLI** — Faker.js has neither out of the box; ForgeData ships `@sahinur/forgedata/react` and the `forgedata` CLI.
3232
7. **Generator discovery is programmatic.** `forge.listGenerators()` walks the real classes instead of requiring a hand-maintained catalogue — useful for building your own tooling (it's what the CLI is built on).
3333

3434
## Things ForgeData intentionally does not replicate

0 commit comments

Comments
 (0)