@teambit/harmony.testing.load-aspect 0.0.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/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/load-aspect.d.ts +4 -0
- package/dist/load-aspect.js +113 -0
- package/dist/load-aspect.js.map +1 -0
- package/index.ts +1 -0
- package/load-aspect.ts +101 -0
- package/package-tar/teambit-harmony.testing.load-aspect-0.0.2.tgz +0 -0
- package/package.json +57 -0
- package/tsconfig.json +26 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadAspect, getConfig } from './load-aspect';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConfig = exports.loadAspect = void 0;
|
|
4
|
+
var load_aspect_1 = require("./load-aspect");
|
|
5
|
+
Object.defineProperty(exports, "loadAspect", { enumerable: true, get: function () { return load_aspect_1.loadAspect; } });
|
|
6
|
+
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return load_aspect_1.getConfig; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AAA7C,yGAAA,UAAU,OAAA;AAAE,wGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Aspect } from '@teambit/harmony';
|
|
2
|
+
import { Config } from '@teambit/harmony/dist/harmony-config';
|
|
3
|
+
export declare function loadAspect<T>(targetAspect: Aspect, cwd?: string, runtime?: string): Promise<T>;
|
|
4
|
+
export declare function getConfig(cwd?: string): Promise<Config>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getConfig = exports.loadAspect = void 0;
|
|
16
|
+
const path_1 = require("path");
|
|
17
|
+
const consumer_1 = require("@teambit/legacy/dist/consumer");
|
|
18
|
+
const utils_1 = require("@teambit/legacy/dist/utils");
|
|
19
|
+
const fs_1 = require("fs");
|
|
20
|
+
const harmony_1 = require("@teambit/harmony");
|
|
21
|
+
const component_1 = require("@teambit/component");
|
|
22
|
+
const harmony_config_1 = require("@teambit/harmony/dist/harmony-config");
|
|
23
|
+
const cli_1 = require("@teambit/cli");
|
|
24
|
+
const node_1 = require("@teambit/node");
|
|
25
|
+
const component_loader_1 = __importDefault(require("@teambit/legacy/dist/consumer/component/component-loader"));
|
|
26
|
+
const component_config_1 = __importDefault(require("@teambit/legacy/dist/consumer/config/component-config"));
|
|
27
|
+
const component_overrides_1 = __importDefault(require("@teambit/legacy/dist/consumer/config/component-overrides"));
|
|
28
|
+
const package_json_transformer_1 = require("@teambit/legacy/dist/consumer/component/package-json-transformer");
|
|
29
|
+
const many_components_writer_1 = __importDefault(require("@teambit/legacy/dist/consumer/component-ops/many-components-writer"));
|
|
30
|
+
const config_1 = require("@teambit/legacy/dist/consumer/config");
|
|
31
|
+
const workspace_config_1 = __importDefault(require("@teambit/legacy/dist/consumer/config/workspace-config"));
|
|
32
|
+
const dependency_resolver_1 = require("@teambit/legacy/dist/consumer/component/dependencies/dependency-resolver");
|
|
33
|
+
function getPackageName(aspect, id) {
|
|
34
|
+
return `@teambit/${id.name}`;
|
|
35
|
+
// const [owner, name] = aspect.id.split('.');
|
|
36
|
+
// return `@${owner}/${replaceAll(name, '/', '.')}`;
|
|
37
|
+
}
|
|
38
|
+
function loadAspect(targetAspect, cwd = process.cwd(), runtime = 'main') {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
clearGlobalsIfNeeded();
|
|
41
|
+
const config = yield getConfig(cwd);
|
|
42
|
+
const configMap = config.toObject();
|
|
43
|
+
configMap['teambit.harmony/bit'] = {
|
|
44
|
+
cwd,
|
|
45
|
+
};
|
|
46
|
+
// CLIAspect is needed for register the main runtime. NodeAspect is needed to get the default env if nothing
|
|
47
|
+
// was configured. If it's not loaded here, it'll throw an error later that there is no node-env.
|
|
48
|
+
const harmony = yield harmony_1.Harmony.load([cli_1.CLIAspect, node_1.NodeAspect, targetAspect], runtime, configMap);
|
|
49
|
+
yield harmony.run((aspect, runtimeDef) => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const id = component_1.ComponentID.fromString(aspect.id);
|
|
51
|
+
const packageName = getPackageName(aspect, id);
|
|
52
|
+
const mainFilePath = require.resolve(packageName);
|
|
53
|
+
const packagePath = (0, path_1.resolve)((0, path_1.join)(mainFilePath, '..'));
|
|
54
|
+
const files = (0, fs_1.readdirSync)(packagePath);
|
|
55
|
+
const runtimePath = files.find((path) => path.includes(`.${runtimeDef.name}.runtime.js`));
|
|
56
|
+
if (!runtimePath)
|
|
57
|
+
throw new Error(`could not find runtime '${runtimeDef.name}' for aspect ID '${aspect.id}'`);
|
|
58
|
+
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
59
|
+
const runtimeC = require((0, path_1.join)(packagePath, runtimePath));
|
|
60
|
+
if (aspect.id === targetAspect.id) {
|
|
61
|
+
targetAspect.addRuntime(runtimeC.default);
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
return harmony.get(targetAspect.id);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
exports.loadAspect = loadAspect;
|
|
68
|
+
function getConfig(cwd = process.cwd()) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const consumerInfo = yield (0, consumer_1.getConsumerInfo)(cwd);
|
|
71
|
+
const scopePath = (0, utils_1.propogateUntil)(cwd);
|
|
72
|
+
const globalConfigOpts = {
|
|
73
|
+
name: '.bitrc.jsonc',
|
|
74
|
+
};
|
|
75
|
+
const configOpts = {
|
|
76
|
+
global: globalConfigOpts,
|
|
77
|
+
shouldThrow: false,
|
|
78
|
+
cwd: (consumerInfo === null || consumerInfo === void 0 ? void 0 : consumerInfo.path) || scopePath,
|
|
79
|
+
};
|
|
80
|
+
if (consumerInfo) {
|
|
81
|
+
const config = harmony_config_1.Config.load('workspace.jsonc', configOpts);
|
|
82
|
+
return config;
|
|
83
|
+
}
|
|
84
|
+
if (scopePath && !consumerInfo) {
|
|
85
|
+
return harmony_config_1.Config.load('scope.jsonc', configOpts);
|
|
86
|
+
}
|
|
87
|
+
return harmony_config_1.Config.loadGlobal(globalConfigOpts);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
exports.getConfig = getConfig;
|
|
91
|
+
function clearGlobalsIfNeeded() {
|
|
92
|
+
if (!consumer_1.loadConsumer.cache && !package_json_transformer_1.PackageJsonTransformer.packageJsonTransformersRegistry.length) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
delete consumer_1.loadConsumer.cache;
|
|
96
|
+
component_loader_1.default.onComponentLoadSubscribers = [];
|
|
97
|
+
component_overrides_1.default.componentOverridesLoadingRegistry = {};
|
|
98
|
+
component_config_1.default.componentConfigLegacyLoadingRegistry = {};
|
|
99
|
+
component_config_1.default.componentConfigLoadingRegistry = {};
|
|
100
|
+
package_json_transformer_1.PackageJsonTransformer.packageJsonTransformersRegistry = [];
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
dependency_resolver_1.DependencyResolver.getWorkspacePolicy = undefined;
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
many_components_writer_1.default.externalInstaller = {};
|
|
105
|
+
config_1.ExtensionDataList.coreExtensionsNames = new Map();
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
workspace_config_1.default.workspaceConfigEnsuringRegistry = undefined;
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
workspace_config_1.default.workspaceConfigIsExistRegistry = undefined;
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
workspace_config_1.default.workspaceConfigLoadingRegistry = undefined;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=load-aspect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-aspect.js","sourceRoot":"","sources":["../load-aspect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+BAAqC;AACrC,4DAA8E;AAC9E,sDAA8E;AAC9E,2BAAiC;AAEjC,8CAAmD;AACnD,kDAAiD;AACjD,yEAA8D;AAC9D,sCAAyC;AACzC,wCAA2C;AAC3C,gHAAuF;AACvF,6GAAoF;AACpF,mHAA0F;AAC1F,+GAA0G;AAC1G,gIAAsG;AACtG,iEAAyE;AACzE,6GAAoF;AACpF,kHAA8G;AAE9G,SAAS,cAAc,CAAC,MAAW,EAAE,EAAe;IAClD,OAAO,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC;IAC7B,8CAA8C;IAC9C,oDAAoD;AACtD,CAAC;AAED,SAAsB,UAAU,CAAI,YAAoB,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,GAAG,MAAM;;QAC7F,oBAAoB,EAAE,CAAC;QAC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AAe,CAAC,oCAAoC,GAAG,EAAE,CAAC;IAC1D,0BAAe,CAAC,8BAA8B,GAAG,EAAE,CAAC;IACpD,iDAAsB,CAAC,+BAA+B,GAAG,EAAE,CAAC;IAC5D,aAAa;IACb,wCAAkB,CAAC,kBAAkB,GAAG,SAAS,CAAC;IAClD,aAAa;IACb,gCAAoB,CAAC,iBAAiB,GAAG,EAAE,CAAC;IAC5C,0BAAiB,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;IAClD,aAAa;IACb,0BAAe,CAAC,+BAA+B,GAAG,SAAS,CAAC;IAC5D,aAAa;IACb,0BAAe,CAAC,8BAA8B,GAAG,SAAS,CAAC;IAC3D,aAAa;IACb,0BAAe,CAAC,8BAA8B,GAAG,SAAS,CAAC;AAC7D,CAAC"}
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadAspect, getConfig } from './load-aspect';
|
package/load-aspect.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { resolve, join } from 'path';
|
|
2
|
+
import { getConsumerInfo, loadConsumer } from '@teambit/legacy/dist/consumer';
|
|
3
|
+
import { propogateUntil as propagateUntil } from '@teambit/legacy/dist/utils';
|
|
4
|
+
import { readdirSync } from 'fs';
|
|
5
|
+
import { ConfigOptions } from '@teambit/harmony/dist/harmony-config/harmony-config';
|
|
6
|
+
import { Harmony, Aspect } from '@teambit/harmony';
|
|
7
|
+
import { ComponentID } from '@teambit/component';
|
|
8
|
+
import { Config } from '@teambit/harmony/dist/harmony-config';
|
|
9
|
+
import { CLIAspect } from '@teambit/cli';
|
|
10
|
+
import { NodeAspect } from '@teambit/node';
|
|
11
|
+
import ComponentLoader from '@teambit/legacy/dist/consumer/component/component-loader';
|
|
12
|
+
import ComponentConfig from '@teambit/legacy/dist/consumer/config/component-config';
|
|
13
|
+
import ComponentOverrides from '@teambit/legacy/dist/consumer/config/component-overrides';
|
|
14
|
+
import { PackageJsonTransformer } from '@teambit/legacy/dist/consumer/component/package-json-transformer';
|
|
15
|
+
import ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';
|
|
16
|
+
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';
|
|
17
|
+
import WorkspaceConfig from '@teambit/legacy/dist/consumer/config/workspace-config';
|
|
18
|
+
import { DependencyResolver } from '@teambit/legacy/dist/consumer/component/dependencies/dependency-resolver';
|
|
19
|
+
|
|
20
|
+
function getPackageName(aspect: any, id: ComponentID) {
|
|
21
|
+
return `@teambit/${id.name}`;
|
|
22
|
+
// const [owner, name] = aspect.id.split('.');
|
|
23
|
+
// return `@${owner}/${replaceAll(name, '/', '.')}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function loadAspect<T>(targetAspect: Aspect, cwd = process.cwd(), runtime = 'main'): Promise<T> {
|
|
27
|
+
clearGlobalsIfNeeded();
|
|
28
|
+
const config = await getConfig(cwd);
|
|
29
|
+
const configMap = config.toObject();
|
|
30
|
+
configMap['teambit.harmony/bit'] = {
|
|
31
|
+
cwd,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// CLIAspect is needed for register the main runtime. NodeAspect is needed to get the default env if nothing
|
|
35
|
+
// was configured. If it's not loaded here, it'll throw an error later that there is no node-env.
|
|
36
|
+
const harmony = await Harmony.load([CLIAspect, NodeAspect, targetAspect], runtime, configMap);
|
|
37
|
+
|
|
38
|
+
await harmony.run(async (aspect, runtimeDef) => {
|
|
39
|
+
const id = ComponentID.fromString(aspect.id);
|
|
40
|
+
const packageName = getPackageName(aspect, id);
|
|
41
|
+
const mainFilePath = require.resolve(packageName);
|
|
42
|
+
const packagePath = resolve(join(mainFilePath, '..'));
|
|
43
|
+
const files = readdirSync(packagePath);
|
|
44
|
+
const runtimePath = files.find((path) => path.includes(`.${runtimeDef.name}.runtime.js`));
|
|
45
|
+
if (!runtimePath) throw new Error(`could not find runtime '${runtimeDef.name}' for aspect ID '${aspect.id}'`);
|
|
46
|
+
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
47
|
+
const runtimeC = require(join(packagePath, runtimePath));
|
|
48
|
+
if (aspect.id === targetAspect.id) {
|
|
49
|
+
targetAspect.addRuntime(runtimeC.default);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return harmony.get(targetAspect.id);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function getConfig(cwd = process.cwd()) {
|
|
57
|
+
const consumerInfo = await getConsumerInfo(cwd);
|
|
58
|
+
const scopePath = propagateUntil(cwd);
|
|
59
|
+
const globalConfigOpts = {
|
|
60
|
+
name: '.bitrc.jsonc',
|
|
61
|
+
};
|
|
62
|
+
const configOpts: ConfigOptions = {
|
|
63
|
+
global: globalConfigOpts,
|
|
64
|
+
shouldThrow: false,
|
|
65
|
+
cwd: consumerInfo?.path || scopePath,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
if (consumerInfo) {
|
|
69
|
+
const config = Config.load('workspace.jsonc', configOpts);
|
|
70
|
+
return config;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (scopePath && !consumerInfo) {
|
|
74
|
+
return Config.load('scope.jsonc', configOpts);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return Config.loadGlobal(globalConfigOpts);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function clearGlobalsIfNeeded() {
|
|
81
|
+
if (!loadConsumer.cache && !PackageJsonTransformer.packageJsonTransformersRegistry.length) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
delete loadConsumer.cache;
|
|
85
|
+
ComponentLoader.onComponentLoadSubscribers = [];
|
|
86
|
+
ComponentOverrides.componentOverridesLoadingRegistry = {};
|
|
87
|
+
ComponentConfig.componentConfigLegacyLoadingRegistry = {};
|
|
88
|
+
ComponentConfig.componentConfigLoadingRegistry = {};
|
|
89
|
+
PackageJsonTransformer.packageJsonTransformersRegistry = [];
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
DependencyResolver.getWorkspacePolicy = undefined;
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
ManyComponentsWriter.externalInstaller = {};
|
|
94
|
+
ExtensionDataList.coreExtensionsNames = new Map();
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
WorkspaceConfig.workspaceConfigEnsuringRegistry = undefined;
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
WorkspaceConfig.workspaceConfigIsExistRegistry = undefined;
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
WorkspaceConfig.workspaceConfigLoadingRegistry = undefined;
|
|
101
|
+
}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/harmony.testing.load-aspect",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"scope": "teambit.harmony",
|
|
7
|
+
"name": "testing/load-aspect",
|
|
8
|
+
"version": "0.0.2"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@teambit/harmony": "0.2.11"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@types/mocha": "5.2.7",
|
|
15
|
+
"@babel/runtime": "7.12.18",
|
|
16
|
+
"@types/node": "12.20.4",
|
|
17
|
+
"@types/jest": "26.0.20"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {},
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"bit": {
|
|
22
|
+
"bindingPrefix": "@teambit",
|
|
23
|
+
"env": {},
|
|
24
|
+
"overrides": {
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@teambit/legacy": "-"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@teambit/legacy": "-",
|
|
30
|
+
"@types/mocha": "5.2.7",
|
|
31
|
+
"@babel/runtime": "7.12.18",
|
|
32
|
+
"@types/node": "12.20.4",
|
|
33
|
+
"@types/jest": "26.0.20"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"private": false,
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=12.22.0"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "https://github.com/teambit/bit"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"bit",
|
|
47
|
+
"components",
|
|
48
|
+
"collaboration",
|
|
49
|
+
"web",
|
|
50
|
+
"react",
|
|
51
|
+
"react-components",
|
|
52
|
+
"angular",
|
|
53
|
+
"angular-components",
|
|
54
|
+
"vue",
|
|
55
|
+
"vue-components"
|
|
56
|
+
]
|
|
57
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "commonjs",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"outDir": "dist",
|
|
18
|
+
"moduleResolution": "node",
|
|
19
|
+
"esModuleInterop": true,
|
|
20
|
+
"rootDir": ".",
|
|
21
|
+
"resolveJsonModule": true
|
|
22
|
+
},
|
|
23
|
+
"exclude": [
|
|
24
|
+
"dist"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|