@takeshape/ssg 10.4.9 → 10.6.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/dist/compress-html.d.ts +2 -2
- package/dist/compress-html.d.ts.map +1 -1
- package/dist/config.d.ts +20 -20
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/errors/graphql-error.d.ts +1 -1
- package/dist/errors/graphql-error.d.ts.map +1 -1
- package/dist/errors/template-render-error.d.ts +1 -1
- package/dist/errors/template-render-error.d.ts.map +1 -1
- package/dist/files.d.ts +1 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +1 -1
- package/dist/filters/create-date-filter.d.ts +1 -1
- package/dist/filters/create-date-filter.d.ts.map +1 -1
- package/dist/filters/create-image-filter.d.ts +1 -1
- package/dist/filters/create-image-filter.d.ts.map +1 -1
- package/dist/filters/create-number-filter.d.ts +2 -2
- package/dist/filters/create-number-filter.d.ts.map +1 -1
- package/dist/filters/create-route-filter.d.ts +2 -2
- package/dist/filters/create-route-filter.d.ts.map +1 -1
- package/dist/filters/create-route-filter.js +1 -1
- package/dist/generate/context.d.ts +3 -3
- package/dist/generate/context.d.ts.map +1 -1
- package/dist/generate/generate.d.ts +7 -7
- package/dist/generate/generate.d.ts.map +1 -1
- package/dist/generate/generate.js +9 -9
- package/dist/generate/streams.d.ts +4 -4
- package/dist/generate/streams.d.ts.map +1 -1
- package/dist/generate/streams.js +2 -2
- package/dist/generate/types.d.ts +21 -21
- package/dist/generate/types.d.ts.map +1 -1
- package/dist/graphql/analyze.d.ts +10 -10
- package/dist/graphql/analyze.d.ts.map +1 -1
- package/dist/graphql/analyze.js +3 -5
- package/dist/graphql/ast.d.ts +5 -5
- package/dist/graphql/ast.d.ts.map +1 -1
- package/dist/graphql/client-schema.d.ts +2 -2
- package/dist/graphql/client-schema.d.ts.map +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.d.ts.map +1 -1
- package/dist/graphql/index.js +0 -6
- package/dist/graphql/migrate.d.ts +7 -7
- package/dist/graphql/migrate.d.ts.map +1 -1
- package/dist/graphql/migrate.js +2 -2
- package/dist/graphql/pagination.d.ts +10 -10
- package/dist/graphql/pagination.d.ts.map +1 -1
- package/dist/graphql/pagination.js +4 -5
- package/dist/graphql/query.d.ts +7 -7
- package/dist/graphql/query.d.ts.map +1 -1
- package/dist/graphql/query.js +1 -1
- package/dist/graphql/schema-connector-factory.d.ts +3 -3
- package/dist/graphql/schema-connector-factory.d.ts.map +1 -1
- package/dist/graphql/schema-connector-factory.js +2 -2
- package/dist/gzip.d.ts +1 -1
- package/dist/gzip.d.ts.map +1 -1
- package/dist/nunjucks.d.ts +2 -2
- package/dist/nunjucks.d.ts.map +1 -1
- package/dist/nunjucks.js +2 -2
- package/dist/resolve-context.d.ts +8 -8
- package/dist/resolve-context.d.ts.map +1 -1
- package/dist/resolve-context.js +1 -1
- package/dist/stats.d.ts +1 -1
- package/dist/stats.d.ts.map +1 -1
- package/dist/stats.js +1 -3
- package/dist/types.d.ts +15 -15
- package/dist/types.d.ts.map +1 -1
- package/es/config.js +1 -1
- package/es/files.js +1 -1
- package/es/filters/create-route-filter.js +1 -1
- package/es/generate/generate.js +9 -9
- package/es/generate/streams.js +3 -3
- package/es/graphql/analyze.js +3 -5
- package/es/graphql/index.js +1 -1
- package/es/graphql/migrate.js +2 -2
- package/es/graphql/pagination.js +4 -5
- package/es/graphql/query.js +1 -1
- package/es/graphql/schema-connector-factory.js +2 -2
- package/es/nunjucks.js +2 -2
- package/es/resolve-context.js +1 -1
- package/es/stats.js +1 -3
- package/package.json +5 -5
package/dist/compress-html.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config } from './config';
|
|
2
|
-
import { RenderTemplateDecorator } from './types';
|
|
1
|
+
import { type Config } from './config';
|
|
2
|
+
import { type RenderTemplateDecorator } from './types';
|
|
3
3
|
export default function compressHtml(config: NonNullable<Config['htmlCompression']>): RenderTemplateDecorator;
|
|
4
4
|
//# sourceMappingURL=compress-html.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress-html.d.ts","sourceRoot":"","sources":["../../src/compress-html.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"compress-html.d.ts","sourceRoot":"","sources":["../../src/compress-html.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,UAAU,CAAC;AACrC,OAAO,EAA+D,KAAK,uBAAuB,EAAC,MAAM,SAAS,CAAC;AAMnH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,uBAAuB,CAgB5G"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FormatLocaleDefinition } from 'd3-format';
|
|
2
|
-
import { Data } from './types';
|
|
3
|
-
export
|
|
1
|
+
import { type FormatLocaleDefinition } from 'd3-format';
|
|
2
|
+
import { type Data } from './types';
|
|
3
|
+
export type GraphQLQueryConfig = {
|
|
4
4
|
query: string;
|
|
5
5
|
variables?: Record<string, any>;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export type ContextConfig = string | GraphQLQueryConfig | Data;
|
|
8
|
-
export
|
|
8
|
+
export type PaginateConfig = {
|
|
9
9
|
template?: string;
|
|
10
10
|
pageSize: number;
|
|
11
11
|
firstPage?: string;
|
|
@@ -13,29 +13,29 @@ export interface PaginateConfig {
|
|
|
13
13
|
data?: string | GraphQLQueryConfig;
|
|
14
14
|
itemName?: string;
|
|
15
15
|
property?: string;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
16
|
+
};
|
|
17
|
+
export type RouteConfig = {
|
|
18
18
|
path: string;
|
|
19
19
|
template: string;
|
|
20
20
|
context?: ContextConfig;
|
|
21
21
|
paginate?: PaginateConfig;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
};
|
|
23
|
+
export type ResolvedRouteConfig = {
|
|
24
24
|
context: Data;
|
|
25
|
-
}
|
|
26
|
-
export
|
|
25
|
+
} & Omit<RouteConfig, 'context'>;
|
|
26
|
+
export type DatesConfig = {
|
|
27
27
|
tz: string;
|
|
28
28
|
format: string;
|
|
29
29
|
locale?: string;
|
|
30
|
-
}
|
|
31
|
-
export
|
|
30
|
+
};
|
|
31
|
+
export type NumbersConfig = {
|
|
32
32
|
format?: string;
|
|
33
33
|
config?: Partial<FormatLocaleDefinition>;
|
|
34
|
-
}
|
|
34
|
+
};
|
|
35
35
|
export type RoutesMap = Record<string, RouteConfig>;
|
|
36
36
|
export type FileLoader = (path: string) => Promise<string>;
|
|
37
37
|
export type SyncFileLoader = (path: string) => string | undefined;
|
|
38
|
-
export
|
|
38
|
+
export type Config = {
|
|
39
39
|
env: Record<string, string>;
|
|
40
40
|
context?: ContextConfig;
|
|
41
41
|
routes: RoutesMap;
|
|
@@ -60,18 +60,18 @@ export interface Config {
|
|
|
60
60
|
dates?: DatesConfig;
|
|
61
61
|
numbers?: NumbersConfig;
|
|
62
62
|
}>;
|
|
63
|
-
}
|
|
63
|
+
};
|
|
64
64
|
export declare function prepareConfig(config: Partial<Config>, envConfig?: Partial<Config>): Config;
|
|
65
65
|
export declare function loadConfig(fileLoader: FileLoader, configFilePath?: string, envConfig?: Partial<Config>): Promise<Config>;
|
|
66
66
|
export declare function localizeConfig(config: Config, localeStr: string): Config;
|
|
67
|
-
export
|
|
67
|
+
export type RouteInfo = {
|
|
68
68
|
routeName: string;
|
|
69
69
|
path: string;
|
|
70
70
|
isPaginated: boolean;
|
|
71
|
-
}
|
|
72
|
-
export
|
|
71
|
+
};
|
|
72
|
+
export type RouteQuery = {
|
|
73
73
|
filePath: string;
|
|
74
|
-
}
|
|
74
|
+
} & RouteInfo;
|
|
75
75
|
export declare function isGraphQLQueryConfig(x: ContextConfig): x is GraphQLQueryConfig;
|
|
76
76
|
export declare function getGraphQLQueries(config: Pick<Config, 'routes' | 'context'>): RouteQuery[];
|
|
77
77
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,sBAAsB,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,sBAAsB,EAAC,MAAM,WAAW,CAAC;AAItD,OAAO,EAAC,KAAK,IAAI,EAAC,MAAM,SAAS,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAAC;AAE/D,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,IAAI,CAAC;CAC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O,CAAC,EAAE,aAAa,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CACd,MAAM,EACN;QACE,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,OAAO,CAAC,EAAE,aAAa,CAAC;KACzB,CACF,CAAC;CACH,CAAC;AAEF,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CA0B1F;AAED,wBAAsB,UAAU,CAC9B,UAAU,EAAE,UAAU,EACtB,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAC1B,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAaxE;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,SAAS,CAAC;AAMd,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,aAAa,GAAG,CAAC,IAAI,kBAAkB,CAE9E;AAgCD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG,UAAU,EAAE,CA0B1F"}
|
package/dist/config.js
CHANGED
|
@@ -46,7 +46,7 @@ async function loadConfig(fileLoader, configFilePath, envConfig) {
|
|
|
46
46
|
return prepareConfig(config, envConfig);
|
|
47
47
|
}
|
|
48
48
|
function localizeConfig(config, localeStr) {
|
|
49
|
-
if (!config.locales
|
|
49
|
+
if (!config.locales?.[localeStr]) {
|
|
50
50
|
throw new Error(`Locale "${localeStr}" is not configured `);
|
|
51
51
|
}
|
|
52
52
|
const locale = config.locales[localeStr];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ExtendableError from 'es6-error';
|
|
2
|
-
import { GraphQLFormattedError } from 'graphql';
|
|
2
|
+
import { type GraphQLFormattedError } from 'graphql';
|
|
3
3
|
export default class GraphQLError extends ExtendableError {
|
|
4
4
|
errors?: GraphQLFormattedError[];
|
|
5
5
|
originalMessage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-error.d.ts","sourceRoot":"","sources":["../../../src/errors/graphql-error.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"graphql-error.d.ts","sourceRoot":"","sources":["../../../src/errors/graphql-error.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,KAAK,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAiBnD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,eAAe;IAChD,MAAM,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;gBAEZ,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,qBAAqB,EAAE;CAKrE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ExtendableError from 'es6-error';
|
|
2
|
-
import { TemplateLocation } from '../types';
|
|
2
|
+
import { type TemplateLocation } from '../types';
|
|
3
3
|
export default class TemplateRenderError extends ExtendableError {
|
|
4
4
|
constructor(message: string, location?: TemplateLocation);
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-render-error.d.ts","sourceRoot":"","sources":["../../../src/errors/template-render-error.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"template-render-error.d.ts","sourceRoot":"","sources":["../../../src/errors/template-render-error.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,WAAW,CAAC;AACxC,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAQ/C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,eAAe;gBAC3C,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB;CAGhE"}
|
package/dist/files.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileLoader, SyncFileLoader } from './config';
|
|
1
|
+
import { type FileLoader, type SyncFileLoader } from './config';
|
|
2
2
|
export declare function createFileSystemLoader(basePath: string): FileLoader;
|
|
3
3
|
export declare function createSyncFileSystemLoader(basePath: string): SyncFileLoader;
|
|
4
4
|
//# sourceMappingURL=files.d.ts.map
|
package/dist/files.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,UAAU,EAAE,KAAK,cAAc,EAAC,MAAM,UAAU,CAAC;AAE9D,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAEnE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAK3E"}
|
package/dist/files.js
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createFileSystemLoader = createFileSystemLoader;
|
|
7
7
|
exports.createSyncFileSystemLoader = createSyncFileSystemLoader;
|
|
8
|
-
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
9
8
|
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
var _fsExtra = _interopRequireDefault(require("fs-extra"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function createFileSystemLoader(basePath) {
|
|
12
12
|
return async filePath => _fsExtra.default.readFile(_path.default.join(basePath, filePath), 'utf8');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Config, DatesConfig } from '../config';
|
|
1
|
+
import { type Config, type DatesConfig } from '../config';
|
|
2
2
|
export default function createDateFilter({ dates, locale: defaultLocale }: Pick<Config, 'dates' | 'locale'>): (raw: string, options?: Partial<DatesConfig> | string) => string;
|
|
3
3
|
//# sourceMappingURL=create-date-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-date-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-date-filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"create-date-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-date-filter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAExD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAC,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,QAAQ,CAAC,SAC1F,MAAM,YAAW,QAAQ,WAAW,CAAC,GAAG,MAAM,KAAQ,MAAM,CAY1E"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ImgixParams } from '@takeshape/routing';
|
|
1
|
+
import { type ImgixParams } from '@takeshape/routing';
|
|
2
2
|
export default function createImageFilter(baseUrl: string, imageDefaults?: ImgixParams): (key: string, query?: ImgixParams) => string;
|
|
3
3
|
//# sourceMappingURL=create-image-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-image-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-image-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-image-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-image-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,GAAE,WAAgB,SAC3E,MAAM,UAAU,WAAW,KAAG,MAAM,CAIlD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormatLocaleDefinition } from 'd3-format';
|
|
2
|
-
import { Config } from '../config';
|
|
1
|
+
import { type FormatLocaleDefinition } from 'd3-format';
|
|
2
|
+
import { type Config } from '../config';
|
|
3
3
|
export default function createNumberFilter({ numbers, locale }: Pick<Config, 'numbers' | 'locale'>): (value: number | string, formatStr?: string, config?: Partial<FormatLocaleDefinition>) => string;
|
|
4
4
|
//# sourceMappingURL=create-number-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-number-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-number-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,sBAAsB,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"create-number-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-number-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,sBAAsB,EAAC,MAAM,WAAW,CAAC;AAsDpE,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,WAAW,CAAC;AA0DtC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAC,OAAO,EAAE,MAAM,EAAC,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC,WAC/E,MAAM,GAAG,MAAM,cAAc,MAAM,WAAW,QAAQ,sBAAsB,CAAC,KAAG,MAAM,CAUtG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config } from '../config';
|
|
2
|
-
import { Stats } from '../types';
|
|
1
|
+
import { type Config } from '../config';
|
|
2
|
+
import { type Stats } from '../types';
|
|
3
3
|
export default function createRouteFilter(config: Pick<Config, 'routes' | 'pathPrefix'>, stats?: Stats): (this: any, obj: Record<string, any>, routeName: string) => string;
|
|
4
4
|
//# sourceMappingURL=create-route-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-route-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-route-filter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"create-route-filter.d.ts","sourceRoot":"","sources":["../../../src/filters/create-route-filter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,KAAK,KAAK,EAAC,MAAM,UAAU,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,UAC7E,GAAG,OAAO,OAAO,MAAM,EAAE,GAAG,CAAC,aAAa,MAAM,KAAG,MAAM,CAuBjF"}
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = createRouteFilter;
|
|
7
7
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
8
|
-
var _paths = require("../paths");
|
|
9
8
|
var _routing = require("@takeshape/routing");
|
|
9
|
+
var _paths = require("../paths");
|
|
10
10
|
var _stats = require("../stats");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function createRouteFilter(config, stats) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { type Data } from '../types';
|
|
2
|
+
import { type Config, type RouteConfig } from '../config';
|
|
3
|
+
import { type PathItemContext } from './types';
|
|
4
4
|
export declare function combineContext(env: Config['env'], globalContext: Data, route: RouteConfig, routeContext: Data): Data;
|
|
5
5
|
export type GetListPageContext = (items: Data[], pageNumber: number, routeContext: Data) => Data;
|
|
6
6
|
export declare const getListPageContext: GetListPageContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/generate/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/generate/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,IAAI,EAAC,MAAM,UAAU,CAAC;AACnC,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AACxD,OAAO,EAAC,KAAK,eAAe,EAAC,MAAM,SAAS,CAAC;AAE7C,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,GAAG,IAAI,CASpH;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,KAAK,IAAI,CAAC;AAEjG,eAAO,MAAM,kBAAkB,EAAE,kBAmBhC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAC,EAAE,eAAe,KAAK,IAAI,CAAC;AAErH,eAAO,MAAM,cAAc,EAAE,cAqB5B,CAAC"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Config, FileLoader, PaginateConfig, RouteConfig, SyncFileLoader } from '../config';
|
|
2
|
-
import { Data, GraphQLConnector, RenderedPage } from '../types';
|
|
3
|
-
import { GenerateResult, GetPaginatedData, RenderContext } from './types';
|
|
1
|
+
import { type Config, type FileLoader, type PaginateConfig, type RouteConfig, type SyncFileLoader } from '../config';
|
|
2
|
+
import { type Data, type GraphQLConnector, type RenderedPage } from '../types';
|
|
3
|
+
import { type GenerateResult, type GetPaginatedData, type RenderContext } from './types';
|
|
4
4
|
export declare function calculatePages(total: number, pageSize: number): number;
|
|
5
5
|
export declare function hasListPageConfig(paginate: PaginateConfig): boolean;
|
|
6
6
|
export declare function hasItemPageConfig(route: RouteConfig): boolean;
|
|
7
7
|
type RenderPaginatedRoute = (route: RouteConfig, context: Data) => Promise<RenderedPage[]>;
|
|
8
8
|
export declare function renderPaginatedTemplate(generateContext: RenderContext, getPaginatedData: GetPaginatedData): RenderPaginatedRoute;
|
|
9
|
-
export
|
|
9
|
+
export type GenerateParams = {
|
|
10
10
|
fileLoader: FileLoader;
|
|
11
11
|
connector: GraphQLConnector;
|
|
12
12
|
templateFileLoader: SyncFileLoader;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
};
|
|
14
|
+
export type GenerateRouteParams = {
|
|
15
15
|
routeName: string;
|
|
16
16
|
locale?: string;
|
|
17
17
|
contentId?: string;
|
|
18
|
-
}
|
|
18
|
+
} & GenerateParams;
|
|
19
19
|
export declare function generateRoute(config: Config, params: GenerateRouteParams): Promise<GenerateResult>;
|
|
20
20
|
export default function generate(config: Config, params: GenerateParams): Promise<GenerateResult>;
|
|
21
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/generate/generate.ts"],"names":[],"mappings":"AAgBA,OAAO,
|
|
1
|
+
{"version":3,"file":"gener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B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAuDtG"}
|
|
@@ -10,6 +10,13 @@ exports.hasItemPageConfig = hasItemPageConfig;
|
|
|
10
10
|
exports.hasListPageConfig = hasListPageConfig;
|
|
11
11
|
exports.renderPaginatedTemplate = renderPaginatedTemplate;
|
|
12
12
|
var _bluebird = _interopRequireDefault(require("bluebird"));
|
|
13
|
+
var _flatten = _interopRequireDefault(require("lodash/fp/flatten"));
|
|
14
|
+
var _partition = _interopRequireDefault(require("lodash/partition"));
|
|
15
|
+
var _values = _interopRequireDefault(require("lodash/values"));
|
|
16
|
+
var _streams = require("@takeshape/streams");
|
|
17
|
+
var _asyncIteratorToStream = _interopRequireDefault(require("async-iterator-to-stream"));
|
|
18
|
+
var _pumpify = require("pumpify");
|
|
19
|
+
var _compose = _interopRequireDefault(require("lodash/fp/compose"));
|
|
13
20
|
var _resolveContext = _interopRequireWildcard(require("../resolve-context"));
|
|
14
21
|
var _graphql = require("../graphql");
|
|
15
22
|
var _nunjucks = _interopRequireDefault(require("../nunjucks"));
|
|
@@ -17,17 +24,10 @@ var _compressHtml = _interopRequireDefault(require("../compress-html"));
|
|
|
17
24
|
var _paths = require("../paths");
|
|
18
25
|
var _graphqlError = _interopRequireDefault(require("../errors/graphql-error"));
|
|
19
26
|
var _paginationError = _interopRequireDefault(require("../errors/pagination-error"));
|
|
20
|
-
var _flatten = _interopRequireDefault(require("lodash/fp/flatten"));
|
|
21
|
-
var _partition = _interopRequireDefault(require("lodash/partition"));
|
|
22
|
-
var _values = _interopRequireDefault(require("lodash/values"));
|
|
23
|
-
var _streams = require("@takeshape/streams");
|
|
24
|
-
var _streams2 = require("./streams");
|
|
25
|
-
var _context = require("./context");
|
|
26
27
|
var _config = require("../config");
|
|
27
|
-
var _asyncIteratorToStream = _interopRequireDefault(require("async-iterator-to-stream"));
|
|
28
|
-
var _pumpify = require("pumpify");
|
|
29
|
-
var _compose = _interopRequireDefault(require("lodash/fp/compose"));
|
|
30
28
|
var _gzip = _interopRequireDefault(require("../gzip"));
|
|
29
|
+
var _streams2 = require("./streams");
|
|
30
|
+
var _context = require("./context");
|
|
31
31
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
32
32
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Stats } from '../types';
|
|
3
|
-
import { PathItemContext, RouteContext, PathItem } from './types';
|
|
4
|
-
import { GetItemContext, GetListPageContext } from './context';
|
|
5
|
-
export declare function readPageBuffer(buffer: PathItem[], last: boolean): PathItemContext;
|
|
6
2
|
import { Transform } from 'stream';
|
|
3
|
+
import { type Stats } from '../types';
|
|
4
|
+
import { type PathItemContext, type RouteContext, type PathItem } from './types';
|
|
5
|
+
import { type GetItemContext, type GetListPageContext } from './context';
|
|
6
|
+
export declare function readPageBuffer(buffer: PathItem[], last: boolean): PathItemContext;
|
|
7
7
|
export declare function createItemRenderArgs(routeContext: RouteContext, getItemContext: GetItemContext, stats: Stats): Transform;
|
|
8
8
|
export declare function createListRenderArgs(routeContext: RouteContext, getListPageContext: GetListPageContext): Transform;
|
|
9
9
|
//# sourceMappingURL=streams.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../../../src/generate/streams.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../../../src/generate/streams.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AAGjC,OAAO,EAAY,KAAK,KAAK,EAAC,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAC,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAC/E,OAAO,EAAC,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAAC,MAAM,WAAW,CAAC;AAEvE,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,GAAG,eAAe,CAQjF;AAQD,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,GACX,SAAS,CAyCX;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CA2ClH"}
|
package/dist/generate/streams.js
CHANGED
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createItemRenderArgs = createItemRenderArgs;
|
|
7
7
|
exports.createListRenderArgs = createListRenderArgs;
|
|
8
8
|
exports.readPageBuffer = readPageBuffer;
|
|
9
|
-
var _paths = require("../paths");
|
|
10
|
-
var _routing = require("@takeshape/routing");
|
|
11
9
|
var _stream = require("stream");
|
|
10
|
+
var _routing = require("@takeshape/routing");
|
|
11
|
+
var _paths = require("../paths");
|
|
12
12
|
var _stats = require("../stats");
|
|
13
13
|
function readPageBuffer(buffer, last) {
|
|
14
14
|
const {
|
package/dist/generate/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Config, FileLoader, PaginateConfig, RouteConfig, RoutesMap } from '../config';
|
|
4
|
-
export
|
|
1
|
+
import { type GraphQLSchema } from 'graphql';
|
|
2
|
+
import { type Data, type GraphQLConnector, type RenderedPage, type RenderTemplate, type Stats } from '../types';
|
|
3
|
+
import { type Config, type FileLoader, type PaginateConfig, type RouteConfig, type RoutesMap } from '../config';
|
|
4
|
+
export type GenerateResult = {
|
|
5
5
|
pages: RenderedPage[];
|
|
6
6
|
stats: Stats;
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
};
|
|
8
|
+
export type GenerateContext = {
|
|
9
9
|
config: Config;
|
|
10
10
|
pathPrefix: string;
|
|
11
11
|
clientSchema: GraphQLSchema;
|
|
@@ -14,40 +14,40 @@ export interface GenerateContext {
|
|
|
14
14
|
renderTemplate: RenderTemplate;
|
|
15
15
|
connector: GraphQLConnector;
|
|
16
16
|
fileLoader: FileLoader;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
17
|
+
};
|
|
18
|
+
export type RenderContext = {
|
|
19
19
|
globalContext: Data;
|
|
20
|
-
}
|
|
21
|
-
export
|
|
20
|
+
} & GenerateContext;
|
|
21
|
+
export type RouteContext = {
|
|
22
22
|
pathPrefix: string;
|
|
23
23
|
totalPages: number;
|
|
24
24
|
renderTemplate: RenderTemplate;
|
|
25
25
|
route: RouteConfig;
|
|
26
26
|
context: Data;
|
|
27
|
-
}
|
|
28
|
-
export
|
|
27
|
+
};
|
|
28
|
+
export type PathItem = {
|
|
29
29
|
item: Data;
|
|
30
30
|
path: string;
|
|
31
|
-
}
|
|
32
|
-
export
|
|
31
|
+
};
|
|
32
|
+
export type PathItemContext = {
|
|
33
33
|
previous?: PathItem;
|
|
34
34
|
current: PathItem;
|
|
35
35
|
next?: PathItem;
|
|
36
|
-
}
|
|
37
|
-
export
|
|
36
|
+
};
|
|
37
|
+
export type ItemBuffer = {
|
|
38
38
|
push(item: Data, path: string): void;
|
|
39
39
|
done(): Promise<RenderedPage[]>;
|
|
40
|
-
}
|
|
41
|
-
export
|
|
40
|
+
};
|
|
41
|
+
export type ListPageBuffer = {
|
|
42
42
|
push(item: Data): void;
|
|
43
43
|
done(): Promise<RenderedPage[]>;
|
|
44
|
-
}
|
|
45
|
-
export
|
|
44
|
+
};
|
|
45
|
+
export type ResolveRoutesContextParams = {
|
|
46
46
|
routes: RoutesMap;
|
|
47
47
|
srcPath: string;
|
|
48
48
|
connector: GraphQLConnector;
|
|
49
49
|
stats: Stats;
|
|
50
|
-
}
|
|
50
|
+
};
|
|
51
51
|
export type GetPaginatedData = (generateContext: GenerateContext, paginate: PaginateConfig, context: Data) => Promise<{
|
|
52
52
|
iterable: Iterable<Data>;
|
|
53
53
|
total: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/generate/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/generate/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAC,KAAK,IAAI,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,KAAK,EAAC,MAAM,UAAU,CAAC;AAC9G,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAC,MAAM,WAAW,CAAC;AAE9G,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE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K,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAC7B,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,IAAI,KACV,OAAO,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { DocumentNode, GraphQLSchema } from 'graphql';
|
|
2
|
-
import { Config, FileLoader, RouteInfo } from '../config';
|
|
3
|
-
|
|
1
|
+
import { type DocumentNode, type GraphQLSchema } from 'graphql';
|
|
2
|
+
import { type Config, type FileLoader, type RouteInfo } from '../config';
|
|
3
|
+
type FileInfo = {
|
|
4
4
|
body: string;
|
|
5
5
|
name: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
6
|
+
};
|
|
7
|
+
type Usage = {
|
|
8
8
|
file: string;
|
|
9
9
|
location: {
|
|
10
10
|
line: number;
|
|
11
11
|
column: number;
|
|
12
12
|
};
|
|
13
|
-
}
|
|
14
|
-
|
|
13
|
+
};
|
|
14
|
+
type UsageInfo = {
|
|
15
15
|
type: string;
|
|
16
16
|
usage: Usage[];
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
type UsageInfoMap = Record<string, Record<string, UsageInfo>>;
|
|
19
19
|
export declare function getFieldUsage(queryAst: DocumentNode, schema: GraphQLSchema, fileInfo: FileInfo): UsageInfoMap;
|
|
20
20
|
export declare function detectTypes(queryAst: DocumentNode, schema: GraphQLSchema): Set<string>;
|
|
21
21
|
export type TypeUsage = Record<string, RouteInfo[]>;
|
|
22
|
-
export
|
|
22
|
+
export type GetTypeUsageParams = {
|
|
23
23
|
config: Config;
|
|
24
24
|
schema: GraphQLSchema;
|
|
25
25
|
fileLoader: FileLoader;
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
export declare function getTypeUsage({ config, schema, fileLoader }: GetTypeUsageParams): Promise<TypeUsage>;
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=analyze.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../../src/graphql/analyze.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../../src/graphql/analyze.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,aAAa,EASnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,UAAU,EAAqB,KAAK,SAAS,EAAkB,MAAM,WAAW,CAAC;AAG3G,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AACF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAI9D,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,YAAY,CA0C7G;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,CAoCtF;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,wBAAsB,YAAY,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,CAmBvG"}
|
package/dist/graphql/analyze.js
CHANGED
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.detectTypes = detectTypes;
|
|
7
7
|
exports.getFieldUsage = getFieldUsage;
|
|
8
8
|
exports.getTypeUsage = getTypeUsage;
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
10
|
var _bluebird = _interopRequireDefault(require("bluebird"));
|
|
10
11
|
var _graphql = require("graphql");
|
|
11
|
-
var _query = require("./query");
|
|
12
12
|
var _config = require("../config");
|
|
13
|
-
var
|
|
13
|
+
var _query = require("./query");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
const startLocation = {
|
|
16
16
|
line: 1,
|
|
@@ -97,9 +97,7 @@ async function getTypeUsage({
|
|
|
97
97
|
const queryString = await fileLoader(_path.default.join(config.templatePath, filePath));
|
|
98
98
|
const types = detectTypes((0, _graphql.parse)(queryString), schema);
|
|
99
99
|
for (const type of types) {
|
|
100
|
-
|
|
101
|
-
result[type] = [];
|
|
102
|
-
}
|
|
100
|
+
result[type] ||= [];
|
|
103
101
|
result[type].push(info);
|
|
104
102
|
}
|
|
105
103
|
return result;
|
package/dist/graphql/ast.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ArgumentNode, DefinitionNode, DocumentNode, FieldNode, OperationDefinitionNode, SelectionNode, SelectionSetNode, VariableDefinitionNode } from 'graphql/language/ast';
|
|
2
|
-
export
|
|
1
|
+
import { type ArgumentNode, type DefinitionNode, type DocumentNode, type FieldNode, type OperationDefinitionNode, type SelectionNode, type SelectionSetNode, type VariableDefinitionNode } from 'graphql/language/ast';
|
|
2
|
+
export type Arg = {
|
|
3
3
|
name: string;
|
|
4
4
|
value: string;
|
|
5
|
-
}
|
|
6
|
-
export
|
|
5
|
+
};
|
|
6
|
+
export type Var = {
|
|
7
7
|
name: string;
|
|
8
8
|
type: string;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
export declare function createArgument({ name, value }: Arg): ArgumentNode;
|
|
11
11
|
export declare function createVariableDefinition({ name, type }: Var): VariableDefinitionNode;
|
|
12
12
|
export declare function createSelectionSet(selections: SelectionNode[]): SelectionSetNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../src/graphql/ast.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../src/graphql/ast.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAG9B,MAAM,MAAM,GAAG,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,EAAE,GAAG,GAAG,YAAY,CAe/D;AAsBD,wBAAgB,wBAAwB,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,GAAG,GAAG,sBAAsB,CAalF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAKhF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAUnD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,IAAI,uBAAuB,CAEjF;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,uBAAuB,GAAG,SAAS,CAEhF;AAED,wBAAgB,WAAW,CACzB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,uBAAuB,GAClE,YAAY,CAUd;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,YAAY,GAAG,YAAY,CAcnF;AAED,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,gBAAgB,EAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,YAAY,EAAO,GACxB,gBAAgB,CAgBlB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,YAAY,GAAG,YAAY,CAKpF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { GraphQLConnector } from '../types';
|
|
1
|
+
import { type GraphQLSchema } from 'graphql';
|
|
2
|
+
import { type GraphQLConnector } from '../types';
|
|
3
3
|
export declare function getClientSchema(connector: GraphQLConnector): Promise<GraphQLSchema>;
|
|
4
4
|
//# sourceMappingURL=client-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-schema.d.ts","sourceRoot":"","sources":["../../../src/graphql/client-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,aAAa,
|
|
1
|
+
{"version":3,"file":"client-schema.d.ts","sourceRoot":"","sources":["../../../src/graphql/client-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,aAAa,EAA0B,MAAM,SAAS,CAAC;AAC9G,OAAO,EAAC,KAAK,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAE/C,wBAAsB,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAOzF"}
|
package/dist/graphql/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export { getQueryIterator } from './pagination';
|
|
|
3
3
|
export { connectorWithMigrations } from './migrate';
|
|
4
4
|
export { getClientSchema } from './client-schema';
|
|
5
5
|
export { withQueryTransforms } from './query';
|
|
6
|
-
export { getTypeUsage, getFieldUsage, TypeUsage } from './analyze';
|
|
6
|
+
export { getTypeUsage, getFieldUsage, type TypeUsage } from './analyze';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/graphql/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/graphql/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,KAAK,SAAS,EAAC,MAAM,WAAW,CAAC"}
|
package/dist/graphql/index.js
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "TypeUsage", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _analyze.TypeUsage;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
6
|
Object.defineProperty(exports, "connectorWithMigrations", {
|
|
13
7
|
enumerable: true,
|
|
14
8
|
get: function () {
|