@graphql-codegen/time 3.1.2-alpha-714e0efe9.0 → 3.2.0-alpha-2fbcdb6d3.0
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/cjs/config.js
ADDED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const moment = _interopDefault(require('moment'));
|
|
8
|
-
const path = require('path');
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.plugin = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const moment_1 = tslib_1.__importDefault(require("moment"));
|
|
6
|
+
const path_1 = require("path");
|
|
10
7
|
const plugin = async (schema, documents, config, { outputFile }) => {
|
|
11
8
|
let format;
|
|
12
9
|
let message = 'Generated on ';
|
|
@@ -18,12 +15,11 @@ const plugin = async (schema, documents, config, { outputFile }) => {
|
|
|
18
15
|
message = config.message;
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
|
-
const outputFileExtension = outputFile &&
|
|
18
|
+
const outputFileExtension = outputFile && (0, path_1.extname)(outputFile);
|
|
22
19
|
let commentPrefix = '//';
|
|
23
20
|
if ((outputFileExtension || '').toLowerCase() === '.graphql') {
|
|
24
21
|
commentPrefix = '#';
|
|
25
22
|
}
|
|
26
|
-
return commentPrefix + ' ' + message +
|
|
23
|
+
return commentPrefix + ' ' + message + (0, moment_1.default)().format(format) + '\n';
|
|
27
24
|
};
|
|
28
|
-
|
|
29
25
|
exports.plugin = plugin;
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
package/esm/config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
import { extname } from 'path';
|
|
3
|
-
|
|
4
|
-
const plugin = async (schema, documents, config, { outputFile }) => {
|
|
3
|
+
export const plugin = async (schema, documents, config, { outputFile }) => {
|
|
5
4
|
let format;
|
|
6
5
|
let message = 'Generated on ';
|
|
7
6
|
if (config && typeof config === 'object') {
|
|
@@ -19,5 +18,3 @@ const plugin = async (schema, documents, config, { outputFile }) => {
|
|
|
19
18
|
}
|
|
20
19
|
return commentPrefix + ' ' + message + moment().format(format) + '\n';
|
|
21
20
|
};
|
|
22
|
-
|
|
23
|
-
export { plugin };
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/time",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-alpha-2fbcdb6d3.0",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for adding the current time for an output file",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "2.
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^2.5.0-alpha-2fbcdb6d3.0",
|
|
10
10
|
"moment": "~2.29.1"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
@@ -15,21 +15,28 @@
|
|
|
15
15
|
"directory": "packages/plugins/other/time"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
|
-
"main": "index.js",
|
|
19
|
-
"module": "index.
|
|
20
|
-
"typings": "index.d.ts",
|
|
18
|
+
"main": "cjs/index.js",
|
|
19
|
+
"module": "esm/index.js",
|
|
20
|
+
"typings": "typings/index.d.ts",
|
|
21
21
|
"typescript": {
|
|
22
|
-
"definition": "index.d.ts"
|
|
22
|
+
"definition": "typings/index.d.ts"
|
|
23
23
|
},
|
|
24
|
+
"type": "module",
|
|
24
25
|
"exports": {
|
|
25
|
-
"./package.json": "./package.json",
|
|
26
26
|
".": {
|
|
27
|
-
"require":
|
|
28
|
-
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./typings/index.d.ts",
|
|
29
|
+
"default": "./cjs/index.js"
|
|
30
|
+
},
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./typings/index.d.ts",
|
|
33
|
+
"default": "./esm/index.js"
|
|
34
|
+
},
|
|
35
|
+
"default": {
|
|
36
|
+
"types": "./typings/index.d.ts",
|
|
37
|
+
"default": "./esm/index.js"
|
|
38
|
+
}
|
|
29
39
|
},
|
|
30
|
-
"
|
|
31
|
-
"require": "./*.js",
|
|
32
|
-
"import": "./*.mjs"
|
|
33
|
-
}
|
|
40
|
+
"./package.json": "./package.json"
|
|
34
41
|
}
|
|
35
|
-
}
|
|
42
|
+
}
|
|
@@ -4,7 +4,7 @@ export interface TimePluginConfig {
|
|
|
4
4
|
* @default YYYY-MM-DDTHH:mm:ssZ
|
|
5
5
|
*
|
|
6
6
|
* @exampleMarkdown
|
|
7
|
-
* ```
|
|
7
|
+
* ```yaml
|
|
8
8
|
* generates:
|
|
9
9
|
* path/to/file.ts:
|
|
10
10
|
* plugins:
|
|
@@ -18,7 +18,7 @@ export interface TimePluginConfig {
|
|
|
18
18
|
* @default 'Generated on'
|
|
19
19
|
*
|
|
20
20
|
* @exampleMarkdown
|
|
21
|
-
* ```
|
|
21
|
+
* ```yaml
|
|
22
22
|
* generates:
|
|
23
23
|
* path/to/file.ts:
|
|
24
24
|
* plugins:
|