@teambit/preview 0.0.621 → 0.0.629
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/__preview-1642994756471.js +1 -0
- package/dist/artifact-file-middleware.d.ts +12 -0
- package/dist/artifact-file-middleware.js +81 -0
- package/dist/artifact-file-middleware.js.map +1 -0
- package/dist/bundling-strategy.d.ts +6 -1
- package/dist/component-preview.route.d.ts +20 -0
- package/dist/component-preview.route.js +83 -0
- package/dist/component-preview.route.js.map +1 -0
- package/dist/env-preview-template.task.d.ts +42 -0
- package/dist/env-preview-template.task.js +309 -0
- package/dist/env-preview-template.task.js.map +1 -0
- package/dist/env-template.route.d.ts +26 -0
- package/dist/env-template.route.js +89 -0
- package/dist/env-template.route.js.map +1 -0
- package/dist/generate-link.d.ts +1 -1
- package/dist/generate-link.js +3 -3
- package/dist/generate-link.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/preview-artifact.d.ts +2 -0
- package/dist/preview-artifact.js +21 -0
- package/dist/preview-artifact.js.map +1 -1
- package/dist/preview-assets.route.d.ts +19 -0
- package/dist/preview-assets.route.js +66 -0
- package/dist/preview-assets.route.js.map +1 -0
- package/dist/preview-definition.d.ts +16 -3
- package/dist/preview.graphql.d.ts +8 -1
- package/dist/preview.graphql.js +13 -2
- package/dist/preview.graphql.js.map +1 -1
- package/dist/preview.main.runtime.d.ts +78 -11
- package/dist/preview.main.runtime.js +251 -18
- package/dist/preview.main.runtime.js.map +1 -1
- package/dist/preview.preview.runtime.d.ts +11 -2
- package/dist/preview.preview.runtime.js +124 -6
- package/dist/preview.preview.runtime.js.map +1 -1
- package/dist/preview.route.d.ts +3 -7
- package/dist/preview.route.js +22 -21
- package/dist/preview.route.js.map +1 -1
- package/dist/preview.task.d.ts +2 -2
- package/dist/preview.task.js +25 -24
- package/dist/preview.task.js.map +1 -1
- package/dist/strategies/component-strategy.d.ts +52 -12
- package/dist/strategies/component-strategy.js +348 -20
- package/dist/strategies/component-strategy.js.map +1 -1
- package/dist/strategies/env-strategy.d.ts +7 -5
- package/dist/strategies/env-strategy.js +27 -1
- package/dist/strategies/env-strategy.js.map +1 -1
- package/dist/strategies/generate-component-link.d.ts +5 -0
- package/dist/strategies/generate-component-link.js +25 -0
- package/dist/strategies/generate-component-link.js.map +1 -0
- package/dist/types/preview-module.d.ts +1 -0
- package/dist/webpack/html.d.ts +2 -0
- package/dist/webpack/html.js +31 -0
- package/dist/webpack/html.js.map +1 -0
- package/dist/webpack/index.d.ts +1 -0
- package/dist/webpack/index.js +23 -0
- package/dist/webpack/index.js.map +1 -0
- package/package-tar/teambit-preview-0.0.629.tgz +0 -0
- package/package.json +29 -26
- package/preview.main.runtime.tsx +235 -23
- package/preview.preview.runtime.tsx +123 -7
- package/strategies/component-strategy.ts +329 -23
- package/strategies/env-strategy.ts +28 -10
- package/strategies/generate-component-link.ts +19 -0
- package/types/preview-module.ts +2 -0
- package/webpack/html.ts +22 -0
- package/webpack/index.ts +1 -0
- package/package-tar/teambit-preview-0.0.621.tgz +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.promise.js");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.EnvTemplateRoute = void 0;
|
|
11
|
+
|
|
12
|
+
function _defineProperty2() {
|
|
13
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
|
+
_defineProperty2 = function () {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _uiFoundationUiPages() {
|
|
23
|
+
const data = require("@teambit/ui-foundation.ui.pages.static-error");
|
|
24
|
+
|
|
25
|
+
_uiFoundationUiPages = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function _artifactFileMiddleware() {
|
|
33
|
+
const data = require("./artifact-file-middleware");
|
|
34
|
+
|
|
35
|
+
_artifactFileMiddleware = function () {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Week for now
|
|
43
|
+
const CACHE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
44
|
+
|
|
45
|
+
class EnvTemplateRoute {
|
|
46
|
+
constructor(
|
|
47
|
+
/**
|
|
48
|
+
* preview extension.
|
|
49
|
+
*/
|
|
50
|
+
preview, logger) {
|
|
51
|
+
this.preview = preview;
|
|
52
|
+
this.logger = logger;
|
|
53
|
+
(0, _defineProperty2().default)(this, "route", `/env-template/:previewName/:filePath(*)`);
|
|
54
|
+
(0, _defineProperty2().default)(this, "method", 'get');
|
|
55
|
+
(0, _defineProperty2().default)(this, "resolveComponent", false);
|
|
56
|
+
(0, _defineProperty2().default)(this, "middlewares", [async (req, res, next) => {
|
|
57
|
+
try {
|
|
58
|
+
// @ts-ignore TODO: @guy please fix.
|
|
59
|
+
// const component = req.component as Component | undefined;
|
|
60
|
+
// if (!component) return res.status(404).send(noPreview());
|
|
61
|
+
let artifact; // TODO - prevent error `getVinylsAndImportIfMissing is not a function` #4680
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
const {
|
|
65
|
+
componentId: envId
|
|
66
|
+
} = req.params;
|
|
67
|
+
artifact = await this.preview.getEnvTemplateByEnvId(envId);
|
|
68
|
+
} catch (e) {
|
|
69
|
+
return res.status(404).send((0, _uiFoundationUiPages().noPreview)());
|
|
70
|
+
} // @ts-ignore
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
req.artifact = artifact; // @ts-ignore
|
|
74
|
+
|
|
75
|
+
req.isLegacyPath = false;
|
|
76
|
+
res.set('Cache-control', `private, max-age=${CACHE_MAX_AGE}`);
|
|
77
|
+
return next();
|
|
78
|
+
} catch (e) {
|
|
79
|
+
this.logger.error('failed getting preview', e);
|
|
80
|
+
return res.status(500).send((0, _uiFoundationUiPages().serverError)());
|
|
81
|
+
}
|
|
82
|
+
}, (0, _artifactFileMiddleware().getArtifactFileMiddleware)(this.logger)]);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
exports.EnvTemplateRoute = EnvTemplateRoute;
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=env-template.route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["env-template.route.ts"],"names":["CACHE_MAX_AGE","EnvTemplateRoute","constructor","preview","logger","req","res","next","artifact","componentId","envId","params","getEnvTemplateByEnvId","e","status","send","isLegacyPath","set","error"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAKA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AACA,MAAMA,aAAa,GAAG,KAAK,EAAL,GAAU,EAAV,GAAe,CAArC;;AAEO,MAAMC,gBAAN,CAA2D;AAChEC,EAAAA,WAAW;AACT;AACJ;AACA;AACYC,EAAAA,OAJC,EAKDC,MALC,EAMT;AAAA,SAFQD,OAER,GAFQA,OAER;AAAA,SADQC,MACR,GADQA,MACR;AAAA,mDAEO,yCAFP;AAAA,oDAGO,KAHP;AAAA,8DAOiB,KAPjB;AAAA,yDAUY,CACZ,OAAOC,GAAP,EAAgCC,GAAhC,EAA+CC,IAA/C,KAAsE;AACpE,UAAI;AACF;AACA;AACA;AAEA,YAAIC,QAAJ,CALE,CAMF;;AACA,YAAI;AACF,gBAAM;AAAEC,YAAAA,WAAW,EAAEC;AAAf,cAAyBL,GAAG,CAACM,MAAnC;AACAH,UAAAA,QAAQ,GAAG,MAAM,KAAKL,OAAL,CAAaS,qBAAb,CAAmCF,KAAnC,CAAjB;AACD,SAHD,CAGE,OAAOG,CAAP,EAAe;AACf,iBAAOP,GAAG,CAACQ,MAAJ,CAAW,GAAX,EAAgBC,IAAhB,CAAqB,uCAArB,CAAP;AACD,SAZC,CAcF;;;AACAV,QAAAA,GAAG,CAACG,QAAJ,GAAeA,QAAf,CAfE,CAgBF;;AACAH,QAAAA,GAAG,CAACW,YAAJ,GAAmB,KAAnB;AAEAV,QAAAA,GAAG,CAACW,GAAJ,CAAQ,eAAR,EAA0B,oBAAmBjB,aAAc,EAA3D;AAEA,eAAOO,IAAI,EAAX;AACD,OAtBD,CAsBE,OAAOM,CAAP,EAAe;AACf,aAAKT,MAAL,CAAYc,KAAZ,CAAkB,wBAAlB,EAA4CL,CAA5C;AACA,eAAOP,GAAG,CAACQ,MAAJ,CAAW,GAAX,EAAgBC,IAAhB,CAAqB,yCAArB,CAAP;AACD;AACF,KA5BW,EA6BZ,yDAA0B,KAAKX,MAA/B,CA7BY,CAVZ;AAAE;;AAP4D","sourcesContent":["import type { NextFunction, Request, Response } from '@teambit/express';\nimport type { ComponentUrlParams, RegisteredComponentRoute } from '@teambit/component';\nimport { noPreview, serverError } from '@teambit/ui-foundation.ui.pages.static-error';\nimport type { Logger } from '@teambit/logger';\n\nimport type { PreviewMain } from './preview.main.runtime';\nimport type { PreviewArtifact } from './preview-artifact';\nimport { getArtifactFileMiddleware } from './artifact-file-middleware';\n\ntype UrlParams = ComponentUrlParams & {\n filePath?: string;\n};\n\n// Week for now\nconst CACHE_MAX_AGE = 60 * 60 * 24 * 7;\n\nexport class EnvTemplateRoute implements RegisteredComponentRoute {\n constructor(\n /**\n * preview extension.\n */\n private preview: PreviewMain,\n private logger: Logger\n ) {}\n\n route = `/env-template/:previewName/:filePath(*)`;\n method = 'get';\n\n // Since we might give it a core env id\n // Then in the component route when we do host.get(id) it will fail, as we don't have the core envs in the scope/workspace\n resolveComponent = false;\n\n // @ts-ignore\n middlewares = [\n async (req: Request<UrlParams>, res: Response, next: NextFunction) => {\n try {\n // @ts-ignore TODO: @guy please fix.\n // const component = req.component as Component | undefined;\n // if (!component) return res.status(404).send(noPreview());\n\n let artifact: PreviewArtifact | undefined;\n // TODO - prevent error `getVinylsAndImportIfMissing is not a function` #4680\n try {\n const { componentId: envId } = req.params;\n artifact = await this.preview.getEnvTemplateByEnvId(envId);\n } catch (e: any) {\n return res.status(404).send(noPreview());\n }\n\n // @ts-ignore\n req.artifact = artifact;\n // @ts-ignore\n req.isLegacyPath = false;\n\n res.set('Cache-control', `private, max-age=${CACHE_MAX_AGE}`);\n\n return next();\n } catch (e: any) {\n this.logger.error('failed getting preview', e);\n return res.status(500).send(serverError());\n }\n },\n getArtifactFileMiddleware(this.logger),\n ];\n}\n"]}
|
package/dist/generate-link.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ComponentMap } from '@teambit/component';
|
|
2
|
-
export declare function generateLink(prefix: string, componentMap: ComponentMap<string[]>, defaultModule?: string): string;
|
|
2
|
+
export declare function generateLink(prefix: string, componentMap: ComponentMap<string[]>, defaultModule?: string, isSplitComponentBundle?: boolean): string;
|
package/dist/generate-link.js
CHANGED
|
@@ -18,16 +18,16 @@ function _toolboxPath() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// :TODO refactor to building an AST and generate source code based on it.
|
|
21
|
-
function generateLink(prefix, componentMap, defaultModule) {
|
|
21
|
+
function generateLink(prefix, componentMap, defaultModule, isSplitComponentBundle = false) {
|
|
22
22
|
return `
|
|
23
23
|
import { linkModules } from '${(0, _toolboxPath().toWindowsCompatiblePath)(require.resolve('./preview.preview.runtime'))}';
|
|
24
24
|
import harmony from '${(0, _toolboxPath().toWindowsCompatiblePath)(require.resolve('@teambit/harmony'))}';
|
|
25
25
|
${defaultModule ? `const defaultModule = require('${(0, _toolboxPath().toWindowsCompatiblePath)(defaultModule)}'` : ''});
|
|
26
|
-
linkModules('${prefix}', defaultModule, {
|
|
26
|
+
linkModules('${prefix}', defaultModule, ${isSplitComponentBundle}, {
|
|
27
27
|
${componentMap.toArray().map(([component, modulePaths]) => {
|
|
28
28
|
return `'${component.id.fullName}': [${modulePaths.map(path => `require('${(0, _toolboxPath().toWindowsCompatiblePath)(path)}')`).join(', ')}]`;
|
|
29
29
|
}).join(',\n')}
|
|
30
|
-
});
|
|
30
|
+
});
|
|
31
31
|
`;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["generate-link.ts"],"names":["generateLink","prefix","componentMap","defaultModule","require","resolve","toArray","map","component","modulePaths","id","fullName","path","join"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AACO,SAASA,YAAT,
|
|
1
|
+
{"version":3,"sources":["generate-link.ts"],"names":["generateLink","prefix","componentMap","defaultModule","isSplitComponentBundle","require","resolve","toArray","map","component","modulePaths","id","fullName","path","join"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AACO,SAASA,YAAT,CACLC,MADK,EAELC,YAFK,EAGLC,aAHK,EAILC,sBAAsB,GAAG,KAJpB,EAKG;AACR,SAAQ;AACV,+BAA+B,4CAAwBC,OAAO,CAACC,OAAR,CAAgB,2BAAhB,CAAxB,CAAsE;AACrG,uBAAuB,4CAAwBD,OAAO,CAACC,OAAR,CAAgB,kBAAhB,CAAxB,CAA6D;AACpF,EAAEH,aAAa,GAAI,kCAAiC,4CAAwBA,aAAxB,CAAuC,GAA5E,GAAiF,EAAG;AACnG,eAAeF,MAAO,qBAAoBG,sBAAuB;AACjE,IAAIF,YAAY,CACXK,OADD,GAECC,GAFD,CAEK,CAAC,CAACC,SAAD,EAAYC,WAAZ,CAAD,KAAmC;AACtC,WAAQ,IAAGD,SAAS,CAACE,EAAV,CAAaC,QAAS,OAAMF,WAAW,CAC/CF,GADoC,CAC/BK,IAAD,IAAW,YAAW,4CAAwBA,IAAxB,CAA8B,IADpB,EAEpCC,IAFoC,CAE/B,IAF+B,CAEzB,GAFd;AAGD,GAND,EAOCA,IAPD,CAOM,KAPN,CAOa;AACjB;AACA,CAdE;AAeD","sourcesContent":["import { toWindowsCompatiblePath } from '@teambit/toolbox.path.to-windows-compatible-path';\nimport type { ComponentMap } from '@teambit/component';\n\n// :TODO refactor to building an AST and generate source code based on it.\nexport function generateLink(\n prefix: string,\n componentMap: ComponentMap<string[]>,\n defaultModule?: string,\n isSplitComponentBundle = false\n): string {\n return `\nimport { linkModules } from '${toWindowsCompatiblePath(require.resolve('./preview.preview.runtime'))}';\nimport harmony from '${toWindowsCompatiblePath(require.resolve('@teambit/harmony'))}';\n${defaultModule ? `const defaultModule = require('${toWindowsCompatiblePath(defaultModule)}'` : ''});\nlinkModules('${prefix}', defaultModule, ${isSplitComponentBundle}, {\n ${componentMap\n .toArray()\n .map(([component, modulePaths]: any) => {\n return `'${component.id.fullName}': [${modulePaths\n .map((path) => `require('${toWindowsCompatiblePath(path)}')`)\n .join(', ')}]`;\n })\n .join(',\\n')}\n});\n`;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PreviewAspect as default, PreviewAspect, PreviewRuntime } from './preview.aspect';
|
|
2
2
|
export * from './events';
|
|
3
|
-
export type { PreviewMain } from './preview.main.runtime';
|
|
3
|
+
export type { PreviewMain, EnvPreviewConfig, ComponentPreviewSize } from './preview.main.runtime';
|
|
4
4
|
export type { PreviewPreview } from './preview.preview.runtime';
|
|
5
5
|
export { PreviewDefinition } from './preview-definition';
|
|
6
6
|
export type { PreviewModule, ModuleFile } from './types/preview-module';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export { PreviewAspect as default, PreviewAspect, PreviewRuntime } from './preview.aspect';\n\nexport * from './events';\nexport type { PreviewMain } from './preview.main.runtime';\nexport type { PreviewPreview } from './preview.preview.runtime';\nexport { PreviewDefinition } from './preview-definition';\nexport type { PreviewModule, ModuleFile } from './types/preview-module';\nexport type { RenderingContext } from './rendering-context';\n"]}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["export { PreviewAspect as default, PreviewAspect, PreviewRuntime } from './preview.aspect';\n\nexport * from './events';\nexport type { PreviewMain, EnvPreviewConfig, ComponentPreviewSize } from './preview.main.runtime';\nexport type { PreviewPreview } from './preview.preview.runtime';\nexport { PreviewDefinition } from './preview-definition';\nexport type { PreviewModule, ModuleFile } from './types/preview-module';\nexport type { RenderingContext } from './rendering-context';\n"]}
|
|
@@ -2,5 +2,7 @@ import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
|
|
|
2
2
|
export declare class PreviewArtifact {
|
|
3
3
|
private artifacts;
|
|
4
4
|
constructor(artifacts: AbstractVinyl[]);
|
|
5
|
+
getPaths(): string[];
|
|
5
6
|
getFile(path: string): AbstractVinyl | undefined;
|
|
7
|
+
getFileEndsWith(path: string): AbstractVinyl | undefined;
|
|
6
8
|
}
|
package/dist/preview-artifact.js
CHANGED
|
@@ -15,17 +15,38 @@ function _utils() {
|
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function _lodash() {
|
|
19
|
+
const data = require("lodash");
|
|
20
|
+
|
|
21
|
+
_lodash = function () {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
class PreviewArtifact {
|
|
19
29
|
constructor(artifacts) {
|
|
20
30
|
this.artifacts = artifacts;
|
|
21
31
|
}
|
|
22
32
|
|
|
33
|
+
getPaths() {
|
|
34
|
+
// TODO: check why the artifacts stored twice, then remove this uniq here
|
|
35
|
+
return (0, _lodash().uniq)(this.artifacts.map(artifact => artifact.relative));
|
|
36
|
+
}
|
|
37
|
+
|
|
23
38
|
getFile(path) {
|
|
24
39
|
return this.artifacts.find(file => {
|
|
25
40
|
return (0, _utils().pathNormalizeToLinux)(file.relative) === path;
|
|
26
41
|
});
|
|
27
42
|
}
|
|
28
43
|
|
|
44
|
+
getFileEndsWith(path) {
|
|
45
|
+
return this.artifacts.find(file => {
|
|
46
|
+
return (0, _utils().pathNormalizeToLinux)(file.relative).endsWith(path);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
29
50
|
}
|
|
30
51
|
|
|
31
52
|
exports.PreviewArtifact = PreviewArtifact;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["preview-artifact.ts"],"names":["PreviewArtifact","constructor","artifacts","getFile","path","find","file","
|
|
1
|
+
{"version":3,"sources":["preview-artifact.ts"],"names":["PreviewArtifact","constructor","artifacts","getPaths","map","artifact","relative","getFile","path","find","file","getFileEndsWith","endsWith"],"mappings":";;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,eAAN,CAAsB;AAC3BC,EAAAA,WAAW,CAASC,SAAT,EAAqC;AAAA,SAA5BA,SAA4B,GAA5BA,SAA4B;AAAE;;AAElDC,EAAAA,QAAQ,GAAG;AACT;AACA,WAAO,oBAAK,KAAKD,SAAL,CAAeE,GAAf,CAAoBC,QAAD,IAAcA,QAAQ,CAACC,QAA1C,CAAL,CAAP;AACD;;AAEDC,EAAAA,OAAO,CAACC,IAAD,EAAe;AACpB,WAAO,KAAKN,SAAL,CAAeO,IAAf,CAAqBC,IAAD,IAAU;AACnC,aAAO,mCAAqBA,IAAI,CAACJ,QAA1B,MAAwCE,IAA/C;AACD,KAFM,CAAP;AAGD;;AAEDG,EAAAA,eAAe,CAACH,IAAD,EAAe;AAC5B,WAAO,KAAKN,SAAL,CAAeO,IAAf,CAAqBC,IAAD,IAAU;AACnC,aAAO,mCAAqBA,IAAI,CAACJ,QAA1B,EAAoCM,QAApC,CAA6CJ,IAA7C,CAAP;AACD,KAFM,CAAP;AAGD;;AAlB0B","sourcesContent":["import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { uniq } from 'lodash';\n\nexport class PreviewArtifact {\n constructor(private artifacts: AbstractVinyl[]) {}\n\n getPaths() {\n // TODO: check why the artifacts stored twice, then remove this uniq here\n return uniq(this.artifacts.map((artifact) => artifact.relative));\n }\n\n getFile(path: string) {\n return this.artifacts.find((file) => {\n return pathNormalizeToLinux(file.relative) === path;\n });\n }\n\n getFileEndsWith(path: string) {\n return this.artifacts.find((file) => {\n return pathNormalizeToLinux(file.relative).endsWith(path);\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="express" />
|
|
2
|
+
import type { Request, Response, Route } from '@teambit/express';
|
|
3
|
+
import type { Logger } from '@teambit/logger';
|
|
4
|
+
import { PreviewMain } from './preview.main.runtime';
|
|
5
|
+
export declare class PreviewAssetsRoute implements Route {
|
|
6
|
+
/**
|
|
7
|
+
* preview extension.
|
|
8
|
+
*/
|
|
9
|
+
private preview;
|
|
10
|
+
private logger;
|
|
11
|
+
constructor(
|
|
12
|
+
/**
|
|
13
|
+
* preview extension.
|
|
14
|
+
*/
|
|
15
|
+
preview: PreviewMain, logger: Logger);
|
|
16
|
+
route: string;
|
|
17
|
+
method: string;
|
|
18
|
+
middlewares: ((req: Request, res: Response) => Promise<import("express").Response<any>>)[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.promise.js");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.PreviewAssetsRoute = void 0;
|
|
11
|
+
|
|
12
|
+
function _defineProperty2() {
|
|
13
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
|
+
_defineProperty2 = function () {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _uiFoundationUiPages() {
|
|
23
|
+
const data = require("@teambit/ui-foundation.ui.pages.static-error");
|
|
24
|
+
|
|
25
|
+
_uiFoundationUiPages = function () {
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
class PreviewAssetsRoute {
|
|
33
|
+
constructor(
|
|
34
|
+
/**
|
|
35
|
+
* preview extension.
|
|
36
|
+
*/
|
|
37
|
+
preview, logger) {
|
|
38
|
+
this.preview = preview;
|
|
39
|
+
this.logger = logger;
|
|
40
|
+
(0, _defineProperty2().default)(this, "route", '/preview-assets');
|
|
41
|
+
(0, _defineProperty2().default)(this, "method", 'get');
|
|
42
|
+
(0, _defineProperty2().default)(this, "middlewares", [async (req, res) => {
|
|
43
|
+
try {
|
|
44
|
+
// @ts-ignore TODO: @guy please fix.
|
|
45
|
+
const component = req.component; // if (!component) return res.status(404).send(noPreview());
|
|
46
|
+
|
|
47
|
+
if (!component) return res.status(404).jsonp({
|
|
48
|
+
error: 'not found'
|
|
49
|
+
});
|
|
50
|
+
const result = await this.preview.getPreviewFiles(component);
|
|
51
|
+
if (!result) return res.status(404).jsonp({
|
|
52
|
+
error: 'not found'
|
|
53
|
+
});
|
|
54
|
+
return res.json(result);
|
|
55
|
+
} catch (e) {
|
|
56
|
+
this.logger.error('failed getting preview assets', e);
|
|
57
|
+
return res.status(500).send((0, _uiFoundationUiPages().serverError)());
|
|
58
|
+
}
|
|
59
|
+
}]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
exports.PreviewAssetsRoute = PreviewAssetsRoute;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=preview-assets.route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["preview-assets.route.ts"],"names":["PreviewAssetsRoute","constructor","preview","logger","req","res","component","status","jsonp","error","result","getPreviewFiles","json","e","send"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAKO,MAAMA,kBAAN,CAA0C;AAC/CC,EAAAA,WAAW;AACT;AACJ;AACA;AACYC,EAAAA,OAJC,EAKDC,MALC,EAMT;AAAA,SAFQD,OAER,GAFQA,OAER;AAAA,SADQC,MACR,GADQA,MACR;AAAA,mDAEM,iBAFN;AAAA,oDAGO,KAHP;AAAA,yDAKY,CACZ,OAAOC,GAAP,EAAqBC,GAArB,KAAuC;AACrC,UAAI;AACF;AACA,cAAMC,SAAS,GAAGF,GAAG,CAACE,SAAtB,CAFE,CAGF;;AACA,YAAI,CAACA,SAAL,EAAgB,OAAOD,GAAG,CAACE,MAAJ,CAAW,GAAX,EAAgBC,KAAhB,CAAsB;AAAEC,UAAAA,KAAK,EAAE;AAAT,SAAtB,CAAP;AAChB,cAAMC,MAAM,GAAG,MAAM,KAAKR,OAAL,CAAaS,eAAb,CAA6BL,SAA7B,CAArB;AACA,YAAI,CAACI,MAAL,EAAa,OAAOL,GAAG,CAACE,MAAJ,CAAW,GAAX,EAAgBC,KAAhB,CAAsB;AAAEC,UAAAA,KAAK,EAAE;AAAT,SAAtB,CAAP;AACb,eAAOJ,GAAG,CAACO,IAAJ,CAASF,MAAT,CAAP;AACD,OARD,CAQE,OAAOG,CAAP,EAAe;AACf,aAAKV,MAAL,CAAYM,KAAZ,CAAkB,+BAAlB,EAAmDI,CAAnD;AACA,eAAOR,GAAG,CAACE,MAAJ,CAAW,GAAX,EAAgBO,IAAhB,CAAqB,yCAArB,CAAP;AACD;AACF,KAdW,CALZ;AAAE;;AAP2C","sourcesContent":["import type { Request, Response, Route } from '@teambit/express';\nimport type { Component } from '@teambit/component';\nimport { serverError } from '@teambit/ui-foundation.ui.pages.static-error';\nimport type { Logger } from '@teambit/logger';\n\nimport { PreviewMain } from './preview.main.runtime';\n\nexport class PreviewAssetsRoute implements Route {\n constructor(\n /**\n * preview extension.\n */\n private preview: PreviewMain,\n private logger: Logger\n ) {}\n\n route = '/preview-assets';\n method = 'get';\n\n middlewares = [\n async (req: Request, res: Response) => {\n try {\n // @ts-ignore TODO: @guy please fix.\n const component = req.component as Component | undefined;\n // if (!component) return res.status(404).send(noPreview());\n if (!component) return res.status(404).jsonp({ error: 'not found' });\n const result = await this.preview.getPreviewFiles(component);\n if (!result) return res.status(404).jsonp({ error: 'not found' });\n return res.json(result);\n } catch (e: any) {\n this.logger.error('failed getting preview assets', e);\n return res.status(500).send(serverError());\n }\n },\n ];\n}\n"]}
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import { Component, ComponentMap } from '@teambit/component';
|
|
2
|
-
import { ExecutionContext } from '@teambit/envs';
|
|
3
|
-
import { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
|
|
1
|
+
import type { Component, ComponentMap } from '@teambit/component';
|
|
2
|
+
import type { Environment, ExecutionContext } from '@teambit/envs';
|
|
3
|
+
import type { AbstractVinyl } from '@teambit/legacy/dist/consumer/component/sources';
|
|
4
4
|
export interface PreviewDefinition {
|
|
5
5
|
/**
|
|
6
6
|
* extension preview prefix
|
|
7
7
|
*/
|
|
8
8
|
prefix: string;
|
|
9
|
+
/**
|
|
10
|
+
* which other extension modules to include in the preview context.
|
|
11
|
+
*/
|
|
12
|
+
include?: string[];
|
|
9
13
|
/**
|
|
10
14
|
* path of the default template to be executed.
|
|
11
15
|
*/
|
|
12
16
|
renderTemplatePath?: (context: ExecutionContext) => Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* get the template by env.
|
|
19
|
+
* TODO: refactor `renderTemplatePath` to accept only an env and remove this method.
|
|
20
|
+
*/
|
|
21
|
+
renderTemplatePathByEnv?: (env: Environment) => Promise<string>;
|
|
13
22
|
/**
|
|
14
23
|
* get all files to require in the preview runtime.
|
|
15
24
|
*/
|
|
16
25
|
getModuleMap(components: Component[]): Promise<ComponentMap<AbstractVinyl[]>>;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to include the peers chunk in the output html
|
|
28
|
+
*/
|
|
29
|
+
includePeers?: boolean;
|
|
17
30
|
}
|
|
@@ -4,7 +4,14 @@ export declare function previewSchema(previewExtension: PreviewMain): {
|
|
|
4
4
|
typeDefs: import("graphql").DocumentNode;
|
|
5
5
|
resolvers: {
|
|
6
6
|
Component: {
|
|
7
|
-
preview: (component: Component) =>
|
|
7
|
+
preview: (component: Component) => {
|
|
8
|
+
component: Component;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
Preview: {
|
|
12
|
+
includesEnvTemplate: ({ component }: {
|
|
13
|
+
component: any;
|
|
14
|
+
}) => Promise<boolean>;
|
|
8
15
|
};
|
|
9
16
|
};
|
|
10
17
|
};
|
package/dist/preview.graphql.js
CHANGED
|
@@ -21,7 +21,8 @@ function previewSchema(previewExtension) {
|
|
|
21
21
|
return {
|
|
22
22
|
typeDefs: (0, _graphqlTag().default)`
|
|
23
23
|
type Preview {
|
|
24
|
-
url: String!
|
|
24
|
+
# url: String!
|
|
25
|
+
includesEnvTemplate: Boolean
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
extend type Component {
|
|
@@ -31,7 +32,17 @@ function previewSchema(previewExtension) {
|
|
|
31
32
|
resolvers: {
|
|
32
33
|
Component: {
|
|
33
34
|
preview: component => {
|
|
34
|
-
return previewExtension.getPreview(component);
|
|
35
|
+
// return previewExtension.getPreview(component);
|
|
36
|
+
return {
|
|
37
|
+
component
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
Preview: {
|
|
42
|
+
includesEnvTemplate: ({
|
|
43
|
+
component
|
|
44
|
+
}) => {
|
|
45
|
+
return previewExtension.isBundledWithEnv(component);
|
|
35
46
|
}
|
|
36
47
|
}
|
|
37
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["preview.graphql.ts"],"names":["previewSchema","previewExtension","typeDefs","resolvers","Component","preview","component","
|
|
1
|
+
{"version":3,"sources":["preview.graphql.ts"],"names":["previewSchema","previewExtension","typeDefs","resolvers","Component","preview","component","Preview","includesEnvTemplate","isBundledWithEnv"],"mappings":";;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIO,SAASA,aAAT,CAAuBC,gBAAvB,EAAsD;AAC3D,SAAO;AACLC,IAAAA,QAAQ,EAAE,0BAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAVS;AAWLC,IAAAA,SAAS,EAAE;AACTC,MAAAA,SAAS,EAAE;AACTC,QAAAA,OAAO,EAAGC,SAAD,IAA0B;AACjC;AACA,iBAAO;AAACA,YAAAA;AAAD,WAAP;AACD;AAJQ,OADF;AAOTC,MAAAA,OAAO,EAAE;AACPC,QAAAA,mBAAmB,EAAE,CAAC;AAACF,UAAAA;AAAD,SAAD,KAAiB;AACpC,iBAAOL,gBAAgB,CAACQ,gBAAjB,CAAkCH,SAAlC,CAAP;AACD;AAHM;AAPA;AAXN,GAAP;AAyBD","sourcesContent":["import { Component } from '@teambit/component';\nimport gql from 'graphql-tag';\n\nimport { PreviewMain } from './preview.main.runtime';\n\nexport function previewSchema(previewExtension: PreviewMain) {\n return {\n typeDefs: gql`\n type Preview {\n # url: String!\n includesEnvTemplate: Boolean\n }\n\n extend type Component {\n preview: Preview\n }\n `,\n resolvers: {\n Component: {\n preview: (component: Component) => {\n // return previewExtension.getPreview(component);\n return {component};\n },\n },\n Preview: {\n includesEnvTemplate: ({component}) => {\n return previewExtension.isBundledWithEnv(component);\n }\n }\n },\n };\n}\n"]}
|
|
@@ -1,23 +1,44 @@
|
|
|
1
|
-
import { BuilderMain } from '@teambit/builder';
|
|
2
|
-
import { BundlerMain } from '@teambit/bundler';
|
|
1
|
+
import type { BuilderMain } from '@teambit/builder';
|
|
2
|
+
import { Asset, BundlerMain } from '@teambit/bundler';
|
|
3
3
|
import { PubsubMain } from '@teambit/pubsub';
|
|
4
4
|
import { Component, ComponentMain, ComponentMap } from '@teambit/component';
|
|
5
|
-
import { EnvsMain } from '@teambit/envs';
|
|
5
|
+
import type { EnvsMain, PreviewEnv } from '@teambit/envs';
|
|
6
6
|
import { SlotRegistry, Harmony } from '@teambit/harmony';
|
|
7
7
|
import { UiMain } from '@teambit/ui';
|
|
8
8
|
import { PkgMain } from '@teambit/pkg';
|
|
9
|
-
import { AspectLoaderMain } from '@teambit/aspect-loader';
|
|
9
|
+
import type { AspectLoaderMain } from '@teambit/aspect-loader';
|
|
10
10
|
import { Workspace } from '@teambit/workspace';
|
|
11
11
|
import { LoggerMain, Logger } from '@teambit/logger';
|
|
12
|
+
import type { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
13
|
+
import { GraphqlMain } from '@teambit/graphql';
|
|
12
14
|
import { PreviewArtifact } from './preview-artifact';
|
|
13
15
|
import { PreviewDefinition } from './preview-definition';
|
|
14
16
|
import { BundlingStrategy } from './bundling-strategy';
|
|
15
17
|
export declare type PreviewDefinitionRegistry = SlotRegistry<PreviewDefinition>;
|
|
18
|
+
declare type PreviewFiles = {
|
|
19
|
+
files: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare type ComponentPreviewSizedFile = Asset;
|
|
22
|
+
export declare type ComponentPreviewSize = {
|
|
23
|
+
files: ComponentPreviewSizedFile[];
|
|
24
|
+
assets: ComponentPreviewSizedFile[];
|
|
25
|
+
totalFiles: number;
|
|
26
|
+
totalAssets: number;
|
|
27
|
+
total: number;
|
|
28
|
+
};
|
|
29
|
+
export declare type ComponentPreviewMetaData = {
|
|
30
|
+
size?: ComponentPreviewSize;
|
|
31
|
+
};
|
|
16
32
|
export declare type PreviewConfig = {
|
|
17
|
-
bundlingStrategy
|
|
33
|
+
bundlingStrategy?: string;
|
|
18
34
|
disabled: boolean;
|
|
19
35
|
};
|
|
36
|
+
export declare type EnvPreviewConfig = {
|
|
37
|
+
strategyName?: string;
|
|
38
|
+
splitComponentBundle?: boolean;
|
|
39
|
+
};
|
|
20
40
|
export declare type BundlingStrategySlot = SlotRegistry<BundlingStrategy>;
|
|
41
|
+
export declare type GenerateLinkFn = (prefix: string, componentMap: ComponentMap<string[]>, defaultModule?: string) => string;
|
|
21
42
|
export declare class PreviewMain {
|
|
22
43
|
/**
|
|
23
44
|
* harmony context.
|
|
@@ -29,6 +50,7 @@ export declare class PreviewMain {
|
|
|
29
50
|
private previewSlot;
|
|
30
51
|
private ui;
|
|
31
52
|
private envs;
|
|
53
|
+
private componentAspect;
|
|
32
54
|
private pkg;
|
|
33
55
|
private aspectLoader;
|
|
34
56
|
readonly config: PreviewConfig;
|
|
@@ -36,6 +58,7 @@ export declare class PreviewMain {
|
|
|
36
58
|
private builder;
|
|
37
59
|
private workspace;
|
|
38
60
|
private logger;
|
|
61
|
+
private dependencyResolver;
|
|
39
62
|
constructor(
|
|
40
63
|
/**
|
|
41
64
|
* harmony context.
|
|
@@ -44,9 +67,49 @@ export declare class PreviewMain {
|
|
|
44
67
|
/**
|
|
45
68
|
* slot for preview definitions.
|
|
46
69
|
*/
|
|
47
|
-
previewSlot: PreviewDefinitionRegistry, ui: UiMain, envs: EnvsMain, pkg: PkgMain, aspectLoader: AspectLoaderMain, config: PreviewConfig, bundlingStrategySlot: BundlingStrategySlot, builder: BuilderMain, workspace: Workspace | undefined, logger: Logger);
|
|
70
|
+
previewSlot: PreviewDefinitionRegistry, ui: UiMain, envs: EnvsMain, componentAspect: ComponentMain, pkg: PkgMain, aspectLoader: AspectLoaderMain, config: PreviewConfig, bundlingStrategySlot: BundlingStrategySlot, builder: BuilderMain, workspace: Workspace | undefined, logger: Logger, dependencyResolver: DependencyResolverMain);
|
|
48
71
|
get tempFolder(): string;
|
|
72
|
+
getComponentBundleSize(component: Component): ComponentPreviewSize | undefined;
|
|
49
73
|
getPreview(component: Component): Promise<PreviewArtifact | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* Get a list of all the artifact files generated during the GeneratePreview task
|
|
76
|
+
* @param component
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
getPreviewFiles(component: Component): Promise<PreviewFiles | undefined>;
|
|
80
|
+
/**
|
|
81
|
+
* Check if the component preview bundle contain the env as part of the bundle or only the component code
|
|
82
|
+
* (we used in the past to bundle them together, there might also be specific envs which still uses the env strategy)
|
|
83
|
+
* @param component
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
isBundledWithEnv(component: Component): Promise<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Getting the env template artifact
|
|
89
|
+
* This should be called with the env itself or it will return undefined
|
|
90
|
+
* If you want to get the env template from the env of the component,
|
|
91
|
+
* use: getEnvTemplateFromComponentEnv below
|
|
92
|
+
*
|
|
93
|
+
* @param component
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
getEnvTemplate(component: Component): Promise<PreviewArtifact | undefined>;
|
|
97
|
+
/**
|
|
98
|
+
* This is a special method to get a core env template
|
|
99
|
+
* As the core envs doesn't exist in the scope we need to bring it from other place
|
|
100
|
+
* We will bring it from the core env package files
|
|
101
|
+
*/
|
|
102
|
+
private getCoreEnvTemplate;
|
|
103
|
+
/**
|
|
104
|
+
* This will fetch the component env, then will take the env template from the component env
|
|
105
|
+
* @param component
|
|
106
|
+
*/
|
|
107
|
+
getEnvTemplateFromComponentEnv(component: Component): Promise<PreviewArtifact | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* This will fetch the component env, then will take the env template from the component env
|
|
110
|
+
* @param component
|
|
111
|
+
*/
|
|
112
|
+
getEnvTemplateByEnvId(envId: string): Promise<PreviewArtifact | undefined>;
|
|
50
113
|
getDefs(): PreviewDefinition[];
|
|
51
114
|
private writeHash;
|
|
52
115
|
private timestamp;
|
|
@@ -57,7 +120,8 @@ export declare class PreviewMain {
|
|
|
57
120
|
* @param defaultModule
|
|
58
121
|
* @param dirName
|
|
59
122
|
*/
|
|
60
|
-
writeLink(prefix: string, moduleMap: ComponentMap<string[]>, defaultModule: string | undefined, dirName: string): string;
|
|
123
|
+
writeLink(prefix: string, moduleMap: ComponentMap<string[]>, defaultModule: string | undefined, dirName: string, isSplitComponentBundle: boolean): string;
|
|
124
|
+
writeLinkContents(contents: string, targetDir: string, prefix: string): string;
|
|
61
125
|
private executionRefs;
|
|
62
126
|
private getPreviewTarget;
|
|
63
127
|
private updateLinkFiles;
|
|
@@ -76,10 +140,11 @@ export declare class PreviewMain {
|
|
|
76
140
|
private getDefaultStrategies;
|
|
77
141
|
private handleComponentChange;
|
|
78
142
|
private handleComponentRemoval;
|
|
143
|
+
getEnvPreviewConfig(env?: PreviewEnv): EnvPreviewConfig;
|
|
79
144
|
/**
|
|
80
145
|
* return the configured bundling strategy.
|
|
81
146
|
*/
|
|
82
|
-
getBundlingStrategy(): BundlingStrategy;
|
|
147
|
+
getBundlingStrategy(env?: PreviewEnv): BundlingStrategy;
|
|
83
148
|
/**
|
|
84
149
|
* register a new bundling strategy. default available strategies are `env` and ``
|
|
85
150
|
*/
|
|
@@ -92,10 +157,9 @@ export declare class PreviewMain {
|
|
|
92
157
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
93
158
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
94
159
|
static defaultConfig: {
|
|
95
|
-
bundlingStrategy: string;
|
|
96
160
|
disabled: boolean;
|
|
97
161
|
};
|
|
98
|
-
static provider([bundler, builder, componentExtension, uiMain, envs, workspace, pkg, pubsub, aspectLoader, loggerMain]: [
|
|
162
|
+
static provider([bundler, builder, componentExtension, uiMain, envs, workspace, pkg, pubsub, aspectLoader, loggerMain, dependencyResolver, graphql,]: [
|
|
99
163
|
BundlerMain,
|
|
100
164
|
BuilderMain,
|
|
101
165
|
ComponentMain,
|
|
@@ -105,6 +169,9 @@ export declare class PreviewMain {
|
|
|
105
169
|
PkgMain,
|
|
106
170
|
PubsubMain,
|
|
107
171
|
AspectLoaderMain,
|
|
108
|
-
LoggerMain
|
|
172
|
+
LoggerMain,
|
|
173
|
+
DependencyResolverMain,
|
|
174
|
+
GraphqlMain
|
|
109
175
|
], config: PreviewConfig, [previewSlot, bundlingStrategySlot]: [PreviewDefinitionRegistry, BundlingStrategySlot], harmony: Harmony): Promise<PreviewMain>;
|
|
110
176
|
}
|
|
177
|
+
export {};
|