pluggable-codegen 0.2.0 → 0.2.2
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 +10 -9
- package/dist/{chunk-WINVBDX2.js → chunk-CBSI3RRL.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ config file (which is useful if you want to run the codegen standalone).
|
|
|
27
27
|
|
|
28
28
|
```typescript
|
|
29
29
|
// codegen.config.js
|
|
30
|
+
import { defineCodegen } from 'pluggable-codegen';
|
|
30
31
|
|
|
31
32
|
export default defineCodegen(
|
|
32
33
|
// optional global config; default values shown
|
|
@@ -53,11 +54,12 @@ export default defineCodegen(
|
|
|
53
54
|
// you can also return null, in which case nothing will be written
|
|
54
55
|
return `export const fileList = ${JSON.stringify(files)};`;
|
|
55
56
|
},
|
|
56
|
-
// set to 'files' if your generated output is based only on
|
|
57
|
-
// or to 'contents' if the output is
|
|
57
|
+
// set to 'files' if your generated output is based only on
|
|
58
|
+
// the list of file names, or to 'contents' if the output is
|
|
59
|
+
// based on the files' contents:
|
|
58
60
|
cacheBy: undefined,
|
|
59
|
-
// you can override the global 'eslint', 'prettier',
|
|
60
|
-
// per-job:
|
|
61
|
+
// you can override the global 'eslint', 'prettier',
|
|
62
|
+
// and 'glob' options per-job:
|
|
61
63
|
// prettier: false,
|
|
62
64
|
},
|
|
63
65
|
);
|
|
@@ -82,8 +84,7 @@ import { codegen } from 'pluggable-codegen';
|
|
|
82
84
|
|
|
83
85
|
export default defineConfig({
|
|
84
86
|
plugins: [
|
|
85
|
-
codegen(),
|
|
86
|
-
// same arguments as defineCodegen()
|
|
87
|
+
codegen(), // same arguments as defineCodegen()
|
|
87
88
|
],
|
|
88
89
|
});
|
|
89
90
|
```
|
|
@@ -133,14 +134,14 @@ declare class File {
|
|
|
133
134
|
|
|
134
135
|
### SvelteKit Routegen
|
|
135
136
|
|
|
136
|
-
The [`sveltekit-routegen`](https://
|
|
137
|
+
The [`sveltekit-routegen`](https://github.com/jahudka/sveltekit-routegen)
|
|
137
138
|
package (which you can install separately) exports a codegen preset which
|
|
138
139
|
generates type-safe helpers for generating URLs from routes in SvelteKit.
|
|
139
140
|
|
|
140
141
|
### GraphQL Codegen
|
|
141
142
|
|
|
142
|
-
This preset wraps the `graphql-code-generator`
|
|
143
|
+
This preset wraps the `graphql-code-generator` package so that you don't
|
|
143
144
|
have to run `gql-gen --watch` separately. It doesn't accept any options;
|
|
144
|
-
simply configure `gql-gen` using
|
|
145
|
+
simply configure `gql-gen` using a `graphql.config.yml` file as you would if
|
|
145
146
|
you used `gql-gen` standalone and add the `gqlgen()` job exported from
|
|
146
147
|
`pluggable-codegen/presets/graphql-code-generator`.
|
|
@@ -80,7 +80,7 @@ var Cache = class {
|
|
|
80
80
|
this.#getOutputHash(resolve2(this.#rootDir, output))
|
|
81
81
|
]);
|
|
82
82
|
const entry = cacheData.get(output);
|
|
83
|
-
if (
|
|
83
|
+
if (entry && entry.source === sourceHash && entry.output === outputHash) {
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
const newHash = await generate();
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -59,7 +59,7 @@ var Cache = class {
|
|
|
59
59
|
this.#getOutputHash(_path.resolve.call(void 0, this.#rootDir, output))
|
|
60
60
|
]);
|
|
61
61
|
const entry = cacheData.get(output);
|
|
62
|
-
if (
|
|
62
|
+
if (entry && entry.source === sourceHash && entry.output === outputHash) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
const newHash = await generate();
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pluggable-codegen",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
5
|
+
"homepage": "https://github.com/jahudka/sveltekit-routegen",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/jahudka/sveltekit-routegen.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/jahudka/sveltekit-routegen/issues"
|
|
12
|
+
},
|
|
13
|
+
"maintainers": [
|
|
6
14
|
{
|
|
7
15
|
"name": "Dan Kadera",
|
|
8
16
|
"email": "me@subsonic.cz",
|