You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f91c743
Browse filesBrowse the repository at this point in the historyBrowse files
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.
`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.
165
165
166
166
## CLI
167
167
168
168
```bash
169
-
npx forgedata list # every generator id
170
-
npx forgedata list --module person# filtered to one module
npx --package=@sahinur/forgedata forgedata generate location.country --locale ja --json
174
174
```
175
175
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.
177
177
178
178
## Modules
179
179
@@ -204,8 +204,8 @@ ForgeData avoids Node-only APIs in `src/` — it uses only `btoa`, `Math`/`Date`
204
204
205
205
-**Node.js**: `import`/`require` both work out of the box.
206
206
-**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.
Copy file name to clipboardExpand all lines: docs/cli.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
# CLI Reference
2
2
3
3
```bash
4
-
npx forgedata --help
4
+
npx --package=@sahinur/forgedata forgedata --help
5
5
```
6
6
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
+
7
9
```
8
10
forgedata v0.1.0 — fake data from the command line
9
11
@@ -51,14 +53,14 @@ Non-string results (objects, e.g. `location.airport`) are printed as JSON even w
Copy file name to clipboardExpand all lines: docs/contributing.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Core argument parsing/dispatch logic lives in `src/cli-core.ts` (fully unit test
40
40
41
41
## Working on the React integration
42
42
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).
Copy file name to clipboardExpand all lines: docs/migration-guide.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,12 @@ ForgeData follows a similar module-and-method shape to `@faker-js/faker`, but wi
23
23
24
24
## Key differences
25
25
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.
27
27
2.**Seeding is constructor-first.** Prefer `new ForgeData({ seed })` over calling `.seed()` after the fact, though both work.
28
28
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(...)`.
29
29
4.**No module-specific singletons** like `faker.fakerEN`, `faker.fakerDE`, etc. — pass `locale` to the constructor or call `forge.locale(code)`.
30
30
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.
32
32
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).
33
33
34
34
## Things ForgeData intentionally does not replicate
0 commit comments