@relevate/poolster-plugin-faker 0.0.0-stage → 0.5.0-alpha.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/LICENSE +21 -0
- package/README.md +21 -2
- package/index.cjs +11 -0
- package/index.d.ts +4 -0
- package/index.mjs +3 -0
- package/package.json +33 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Relevate
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @relevate/poolster-plugin-faker
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Select Poolster's compiled Rust faker plugin from a JavaScript config. Install
|
|
4
|
+
with `@relevate/poolster` and `@relevate/poolster-plugin-typescript`, then
|
|
5
|
+
list both factories in `plugins`. Nothing is registered automatically.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { defineConfig } from '@relevate/poolster'
|
|
9
|
+
import { pluginTypeScript } from '@relevate/poolster-plugin-typescript'
|
|
10
|
+
import { pluginFaker } from '@relevate/poolster-plugin-faker'
|
|
11
|
+
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
input: './openapi.yaml',
|
|
14
|
+
output: './generated',
|
|
15
|
+
name: 'Example',
|
|
16
|
+
version: '1.0.0',
|
|
17
|
+
plugins: [pluginTypeScript(), pluginFaker({ target: 'typescript' })],
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The `target` names the TypeScript SDK package path; use it when the package
|
|
22
|
+
path differs from the default or multiple TypeScript packages are selected.
|
package/index.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function pluginFaker(options = {}) {
|
|
4
|
+
if (!options || typeof options !== 'object' || Array.isArray(options)) throw new TypeError('pluginFaker options must be an object');
|
|
5
|
+
for (const key of Object.keys(options)) if (key !== 'target' && key !== 'output') throw new TypeError('unknown pluginFaker option ' + key);
|
|
6
|
+
if (options.target != null && (typeof options.target !== 'string' || !options.target)) throw new TypeError('target must be a nonempty string');
|
|
7
|
+
if (options.output != null && (typeof options.output !== 'string' || !options.output)) throw new TypeError('output must be a nonempty string');
|
|
8
|
+
return { kind: 'native-addon', name: '@relevate/poolster-plugin-faker', plugin: 'faker', target: options.target ?? 'typescript', ...(options.output ? { output: options.output } : {}) };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = { pluginFaker };
|
package/index.d.ts
ADDED
package/index.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relevate/poolster-plugin-faker",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.5.0-alpha.1",
|
|
4
|
+
"description": "Poolster plugin exports for faker",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/rlvtapp/poolster.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "index.cjs",
|
|
11
|
+
"types": "index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"import": "./index.mjs",
|
|
16
|
+
"require": "./index.cjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.cjs",
|
|
21
|
+
"index.mjs",
|
|
22
|
+
"index.d.ts",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@relevate/poolster": "0.5.0-alpha.1"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|