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 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 the file names,
57
- // or to 'contents' if the output is based on the files' contents:
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', and 'glob' options
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://www.npmjs.com/package/sveltekit-routegen)
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` codegen so that you don't
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 the `graphql.config.yml` file as you would if
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 (!entry || entry.source !== sourceHash || entry.output !== outputHash) {
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
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  Codegen,
4
4
  lookupPath
5
- } from "./chunk-WINVBDX2.js";
5
+ } from "./chunk-CBSI3RRL.js";
6
6
  import {
7
7
  __require
8
8
  } from "./chunk-3RG5ZIWI.js";
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 (!entry || entry.source !== sourceHash || entry.output !== outputHash) {
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Codegen,
3
3
  File
4
- } from "./chunk-WINVBDX2.js";
4
+ } from "./chunk-CBSI3RRL.js";
5
5
  import "./chunk-3RG5ZIWI.js";
6
6
 
7
7
  // src/plugin.ts
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "pluggable-codegen",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "license": "MIT",
5
- "contributors": [
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",