weboptimizer 2.0.1429 → 2.0.1435
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/package.json +10 -10
- package/test/browser.d.ts +1 -0
- package/test/browser.js +37 -0
- package/test/configurator.d.ts +1 -0
- package/test/configurator.js +16 -0
- package/test/ejsLoader.d.ts +1 -0
- package/test/ejsLoader.js +53 -0
- package/test/helper.d.ts +1 -0
- package/test/helper.js +397 -0
- package/test/index.d.ts +1 -0
- package/test/index.js +44 -0
- package/test/stylelintConfigurator.d.ts +1 -0
- package/test/stylelintConfigurator.js +16 -0
- package/test/webpackConfigurator.d.ts +1 -0
- package/test/webpackConfigurator.js +43 -0
- package/browser.d.ts +0 -11
- package/configurator.d.ts +0 -26
- package/ejsLoader.d.ts +0 -35
- package/helper.d.ts +0 -284
- package/index.d.ts +0 -20
- package/jestEnvironmentBrowser.d.ts +0 -18
- package/stylelintConfigurator.d.ts +0 -2
- package/type.d.ts +0 -483
- package/webpackConfigurator.d.ts +0 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// #!/usr/bin/env babel-node
|
|
2
|
+
// -*- coding: utf-8 -*-
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
// region imports
|
|
6
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
7
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _globals = require("@jest/globals");
|
|
11
|
+
var _clientnode = _interopRequireDefault(require("clientnode"));
|
|
12
|
+
var _webpack = _interopRequireDefault(require("webpack"));
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
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; }
|
|
15
|
+
// endregion
|
|
16
|
+
// Suppress log output.
|
|
17
|
+
console.debug = _clientnode["default"].noop;
|
|
18
|
+
(0, _globals.test)('webpackConfigurator', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
19
|
+
var webpackConfiguration;
|
|
20
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
_context.next = 2;
|
|
24
|
+
return Promise.resolve().then(function () {
|
|
25
|
+
return _interopRequireWildcard(require('../webpackConfigurator'));
|
|
26
|
+
});
|
|
27
|
+
case 2:
|
|
28
|
+
webpackConfiguration = _context.sent["default"];
|
|
29
|
+
(0, _globals.expect)(webpackConfiguration.entry.index).toContain('./index.ts');
|
|
30
|
+
if (!webpackConfiguration.output) webpackConfiguration.output = {};
|
|
31
|
+
webpackConfiguration.output.path = __dirname;
|
|
32
|
+
webpackConfiguration.output.filename = 'dummy.compiled.js';
|
|
33
|
+
(0, _globals.expect)((0, _webpack["default"])(webpackConfiguration)).toBeInstanceOf(Object);
|
|
34
|
+
case 8:
|
|
35
|
+
case "end":
|
|
36
|
+
return _context.stop();
|
|
37
|
+
}
|
|
38
|
+
}, _callee);
|
|
39
|
+
})));
|
|
40
|
+
// region vim modline
|
|
41
|
+
// vim: set tabstop=4 shiftwidth=4 expandtab:
|
|
42
|
+
// vim: foldmethod=marker foldmarker=region,endregion:
|
|
43
|
+
// endregion
|
package/browser.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Browser, InitializedBrowser } from './type';
|
|
2
|
-
export declare const browser: Browser;
|
|
3
|
-
/**
|
|
4
|
-
* Provides a generic browser api in node or web contexts.
|
|
5
|
-
* @param replaceWindow - Indicates whether a potential existing window object
|
|
6
|
-
* should be replaced or not.
|
|
7
|
-
*
|
|
8
|
-
* @returns Determined environment.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getInitializedBrowser: (replaceWindow?: boolean) => Promise<InitializedBrowser>;
|
|
11
|
-
export default getInitializedBrowser;
|
package/configurator.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/// <reference types="webpack-env" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
/// <reference types="node" />
|
|
7
|
-
import { ResolvedConfiguration } from './type';
|
|
8
|
-
export declare let loadedConfiguration: null | ResolvedConfiguration;
|
|
9
|
-
/**
|
|
10
|
-
* Main entry point to determine current configuration.
|
|
11
|
-
* @param context - Location from where to build current application.
|
|
12
|
-
* @param currentWorkingDirectory - Current working directory to use as
|
|
13
|
-
* reference.
|
|
14
|
-
* @param commandLineArguments - Arguments to take into account.
|
|
15
|
-
* @param webOptimizerPath - Current optimizer context path.
|
|
16
|
-
* @param environment - Environment variables to take into account.
|
|
17
|
-
*
|
|
18
|
-
* @returns Nothing.
|
|
19
|
-
*/
|
|
20
|
-
export declare const load: (context?: string, currentWorkingDirectory?: string, commandLineArguments?: Array<string>, webOptimizerPath?: string, environment?: NodeJS.ProcessEnv) => ResolvedConfiguration;
|
|
21
|
-
/**
|
|
22
|
-
* Get cached or determined configuration object.
|
|
23
|
-
* @returns Nothing.
|
|
24
|
-
*/
|
|
25
|
-
export declare const get: () => ResolvedConfiguration;
|
|
26
|
-
export default get;
|
package/ejsLoader.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Encoding, Mapping } from 'clientnode/type';
|
|
2
|
-
import { Options, TemplateFunction as EJSTemplateFunction } from 'ejs';
|
|
3
|
-
import { LoaderContext } from 'webpack';
|
|
4
|
-
import { Extensions, Replacements } from './type';
|
|
5
|
-
export type PreCompiledTemplateFunction = ((...parameters: Array<unknown>) => string);
|
|
6
|
-
export type TemplateFunction = EJSTemplateFunction | PreCompiledTemplateFunction;
|
|
7
|
-
export type CompilerOptions = Options & {
|
|
8
|
-
encoding: Encoding;
|
|
9
|
-
isString?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export type CompileFunction = (template: string, options?: Partial<CompilerOptions>, compileSteps?: number) => TemplateFunction;
|
|
12
|
-
export type LoaderConfiguration = Mapping<unknown> & {
|
|
13
|
-
compiler: Partial<CompilerOptions>;
|
|
14
|
-
compileSteps: number;
|
|
15
|
-
compress: {
|
|
16
|
-
html: Mapping<unknown>;
|
|
17
|
-
javaScript: Mapping<unknown>;
|
|
18
|
-
};
|
|
19
|
-
context: string;
|
|
20
|
-
debug: boolean;
|
|
21
|
-
extensions: Extensions;
|
|
22
|
-
locals?: Mapping<unknown>;
|
|
23
|
-
module: {
|
|
24
|
-
aliases: Mapping<string>;
|
|
25
|
-
replacements: Replacements;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Main transformation function.
|
|
30
|
-
* @param source - Input string to transform.
|
|
31
|
-
*
|
|
32
|
-
* @returns Transformed string.
|
|
33
|
-
*/
|
|
34
|
-
export declare const loader: (this: LoaderContext<LoaderConfiguration>, source: string) => string;
|
|
35
|
-
export default loader;
|
package/helper.d.ts
DELETED
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import { Encoding, Mapping } from 'clientnode/type';
|
|
2
|
-
import { BuildConfiguration, Extensions, GivenInjection, GivenInjectionConfiguration, NormalizedGivenInjection, PathConfiguration, PackageDescriptor, Replacements, ResolvedBuildConfiguration, SpecificExtensions } from './type';
|
|
3
|
-
export declare const KNOWN_FILE_EXTENSIONS: Array<string>;
|
|
4
|
-
/**
|
|
5
|
-
* Provides a class of static methods with generic use cases.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Helper {
|
|
8
|
-
/**
|
|
9
|
-
* Determines whether given file path is within given list of file
|
|
10
|
-
* locations.
|
|
11
|
-
* @param filePath - Path to file to check.
|
|
12
|
-
* @param locationsToCheck - Locations to take into account.
|
|
13
|
-
*
|
|
14
|
-
* @returns Value "true" if given file path is within one of given
|
|
15
|
-
* locations or "false" otherwise.
|
|
16
|
-
*/
|
|
17
|
-
static isFilePathInLocation(this: void, filePath: string, locationsToCheck: Array<string>): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Strips loader informations form given module request including loader
|
|
20
|
-
* prefix and query parameter.
|
|
21
|
-
* @param moduleID - Module request to strip.
|
|
22
|
-
*
|
|
23
|
-
* @returns Given module id stripped.
|
|
24
|
-
*/
|
|
25
|
-
static stripLoader(this: void, moduleID: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Converts given list of path to a normalized list with unique values.
|
|
28
|
-
* @param paths - File paths.
|
|
29
|
-
*
|
|
30
|
-
* @returns The given file path list with normalized unique values.
|
|
31
|
-
*/
|
|
32
|
-
static normalizePaths(this: void, paths: Array<string>): Array<string>;
|
|
33
|
-
/**
|
|
34
|
-
* Applies file path/name placeholder replacements with given bundle
|
|
35
|
-
* associated informations.
|
|
36
|
-
* @param template - File path to process placeholder in.
|
|
37
|
-
* @param scope - Scope to use for processing.
|
|
38
|
-
*
|
|
39
|
-
* @returns Processed file path.
|
|
40
|
-
*/
|
|
41
|
-
static renderFilePathTemplate(this: void, template: string, scope?: Mapping<number | string>): string;
|
|
42
|
-
/**
|
|
43
|
-
* Converts given request to a resolved request with given context
|
|
44
|
-
* embedded.
|
|
45
|
-
* @param request - Request to determine.
|
|
46
|
-
* @param context - Context of given request to resolve relative to.
|
|
47
|
-
* @param referencePath - Path to resolve local modules relative to.
|
|
48
|
-
* @param aliases - Mapping of aliases to take into account.
|
|
49
|
-
* @param moduleReplacements - Mapping of replacements to take into
|
|
50
|
-
* account.
|
|
51
|
-
* @param relativeModuleLocations - List of relative directory paths to
|
|
52
|
-
* search for modules in.
|
|
53
|
-
*
|
|
54
|
-
* @returns A new resolved request.
|
|
55
|
-
*/
|
|
56
|
-
static applyContext(this: void, request: string, context?: string, referencePath?: string, aliases?: Mapping, moduleReplacements?: Replacements, relativeModuleLocations?: Array<string>): false | string;
|
|
57
|
-
/**
|
|
58
|
-
* Check if given request points to an external dependency not maintained
|
|
59
|
-
* by current package context.
|
|
60
|
-
* @param request - Request to determine.
|
|
61
|
-
* @param context - Context of current project.
|
|
62
|
-
* @param requestContext - Context of given request to resolve relative to.
|
|
63
|
-
* @param normalizedGivenInjection - Mapping of chunk names to modules
|
|
64
|
-
* which should be injected.
|
|
65
|
-
* @param relativeExternalModuleLocations - Array of paths where external
|
|
66
|
-
* modules take place.
|
|
67
|
-
* @param aliases - Mapping of aliases to take into account.
|
|
68
|
-
* @param moduleReplacements - Mapping of replacements to take into
|
|
69
|
-
* account.
|
|
70
|
-
* @param extensions - List of file and module extensions to take into
|
|
71
|
-
* account.
|
|
72
|
-
* @param referencePath - Path to resolve local modules relative to.
|
|
73
|
-
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
74
|
-
* @param relativeModuleLocations - List of relative file path to search
|
|
75
|
-
* for modules in.
|
|
76
|
-
* @param packageEntryFileNames - List of package entry file names to
|
|
77
|
-
* search for. The magic name "__package__" will search for an appreciate
|
|
78
|
-
* entry in a "package.json" file.
|
|
79
|
-
* @param packageMainPropertyNames - List of package file main property
|
|
80
|
-
* names to search for package representing entry module definitions.
|
|
81
|
-
* @param packageAliasPropertyNames - List of package file alias property
|
|
82
|
-
* names to search for package specific module aliases.
|
|
83
|
-
* @param includePattern - Array of regular expressions to explicitly mark
|
|
84
|
-
* as external dependency.
|
|
85
|
-
* @param excludePattern - Array of regular expressions to explicitly mark
|
|
86
|
-
* as internal dependency.
|
|
87
|
-
* @param inPlaceNormalLibrary - Indicates whether normal libraries should
|
|
88
|
-
* be external or not.
|
|
89
|
-
* @param inPlaceDynamicLibrary - Indicates whether requests with
|
|
90
|
-
* integrated loader configurations should be marked as external or not.
|
|
91
|
-
* @param encoding - Encoding for file names to use during file traversing.
|
|
92
|
-
*
|
|
93
|
-
* @returns A new resolved request indicating whether given request is an
|
|
94
|
-
* external one.
|
|
95
|
-
*/
|
|
96
|
-
static determineExternalRequest(this: void, request: string, context?: string, requestContext?: string, normalizedGivenInjection?: NormalizedGivenInjection, relativeExternalModuleLocations?: Array<string>, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: Extensions, referencePath?: string, pathsToIgnore?: Array<string>, relativeModuleLocations?: Array<string>, packageEntryFileNames?: Array<string>, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, includePattern?: Array<string | RegExp>, excludePattern?: Array<string | RegExp>, inPlaceNormalLibrary?: boolean, inPlaceDynamicLibrary?: boolean, encoding?: Encoding): null | string;
|
|
97
|
-
/**
|
|
98
|
-
* Determines asset type of given file.
|
|
99
|
-
* @param filePath - Path to file to analyse.
|
|
100
|
-
* @param buildConfiguration - Meta informations for available asset
|
|
101
|
-
* types.
|
|
102
|
-
* @param paths - List of paths to search if given path doesn't reference
|
|
103
|
-
* a file directly.
|
|
104
|
-
*
|
|
105
|
-
* @returns Determined file type or "null" of given file couldn't be
|
|
106
|
-
* determined.
|
|
107
|
-
*/
|
|
108
|
-
static determineAssetType(this: void, filePath: string, buildConfiguration: BuildConfiguration, paths: PathConfiguration): null | string;
|
|
109
|
-
/**
|
|
110
|
-
* Adds a property with a stored array of all matching file paths, which
|
|
111
|
-
* matches each build configuration in given entry path and converts given
|
|
112
|
-
* build configuration into a sorted array were javaScript files takes
|
|
113
|
-
* precedence.
|
|
114
|
-
* @param configuration - Given build configurations.
|
|
115
|
-
* @param entryPath - Path to analyse nested structure.
|
|
116
|
-
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
117
|
-
* @param mainFileBasenames - File basenames to sort into the front.
|
|
118
|
-
*
|
|
119
|
-
* @returns Converted build configuration.
|
|
120
|
-
*/
|
|
121
|
-
static resolveBuildConfigurationFilePaths(this: void, configuration: BuildConfiguration, entryPath?: string, pathsToIgnore?: Array<string>, mainFileBasenames?: Array<string>): ResolvedBuildConfiguration;
|
|
122
|
-
/**
|
|
123
|
-
* Determines all file and directory paths related to given internal
|
|
124
|
-
* modules as array.
|
|
125
|
-
* @param givenInjection - List of module ids or module file paths.
|
|
126
|
-
* @param aliases - Mapping of aliases to take into account.
|
|
127
|
-
* @param moduleReplacements - Mapping of module replacements to take into
|
|
128
|
-
* account.
|
|
129
|
-
* @param extensions - List of file and module extensions to take into
|
|
130
|
-
* account.
|
|
131
|
-
* @param context - File path to resolve relative to.
|
|
132
|
-
* @param referencePath - Path to search for local modules.
|
|
133
|
-
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
134
|
-
* @param relativeModuleLocations - List of relative file path to search
|
|
135
|
-
* for modules in.
|
|
136
|
-
* @param packageEntryFileNames - List of package entry file names to
|
|
137
|
-
* search for. The magic name "__package__" will search for an appreciate
|
|
138
|
-
* entry in a "package.json" file.
|
|
139
|
-
* @param packageMainPropertyNames - List of package file main property
|
|
140
|
-
* names to search for package representing entry module definitions.
|
|
141
|
-
* @param packageAliasPropertyNames - List of package file alias property
|
|
142
|
-
* names to search for package specific module aliases.
|
|
143
|
-
* @param encoding - File name encoding to use during file traversing.
|
|
144
|
-
*
|
|
145
|
-
* @returns Object with a file path and directory path key mapping to
|
|
146
|
-
* corresponding list of paths.
|
|
147
|
-
*/
|
|
148
|
-
static determineModuleLocations(this: void, givenInjection: GivenInjection, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: SpecificExtensions, context?: string, referencePath?: string, pathsToIgnore?: Array<string>, relativeModuleLocations?: Array<string>, packageEntryFileNames?: Array<string>, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, encoding?: Encoding): {
|
|
149
|
-
directoryPaths: Array<string>;
|
|
150
|
-
filePaths: Array<string>;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Determines a list of concrete file paths for given module id pointing to
|
|
154
|
-
* a folder which isn't a package.
|
|
155
|
-
* @param normalizedGivenInjection - Injection data structure of modules
|
|
156
|
-
* with folder references to resolve.
|
|
157
|
-
* @param aliases - Mapping of aliases to take into account.
|
|
158
|
-
* @param moduleReplacements - Mapping of replacements to take into
|
|
159
|
-
* account.
|
|
160
|
-
* @param context - File path to determine relative to.
|
|
161
|
-
* @param referencePath - Path to resolve local modules relative to.
|
|
162
|
-
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
163
|
-
*
|
|
164
|
-
* @returns Given injections with resolved folder pointing modules.
|
|
165
|
-
*/
|
|
166
|
-
static resolveModulesInFolders(this: void, normalizedGivenInjection: NormalizedGivenInjection, aliases?: Mapping, moduleReplacements?: Replacements, context?: string, referencePath?: string, pathsToIgnore?: Array<string>): NormalizedGivenInjection;
|
|
167
|
-
/**
|
|
168
|
-
* Every injection definition type can be represented as plain object
|
|
169
|
-
* (mapping from chunk name to array of module ids). This method converts
|
|
170
|
-
* each representation into the normalized plain object notation.
|
|
171
|
-
* @param givenInjection - Given entry injection to normalize.
|
|
172
|
-
*
|
|
173
|
-
* @returns Normalized representation of given entry injection.
|
|
174
|
-
*/
|
|
175
|
-
static normalizeGivenInjection(this: void, givenInjection: GivenInjection): NormalizedGivenInjection;
|
|
176
|
-
/**
|
|
177
|
-
* Determines all concrete file paths for given injection which are marked
|
|
178
|
-
* with the "__auto__" indicator.
|
|
179
|
-
* @param givenInjection - Given entry and external injection to take
|
|
180
|
-
* into account.
|
|
181
|
-
* @param buildConfigurations - Resolved build configuration.
|
|
182
|
-
* @param aliases - Mapping of aliases to take into account.
|
|
183
|
-
* @param moduleReplacements - Mapping of replacements to take into
|
|
184
|
-
* account.
|
|
185
|
-
* @param extensions - List of file and module extensions to take into
|
|
186
|
-
* account.
|
|
187
|
-
* @param context - File path to use as starting point.
|
|
188
|
-
* @param referencePath - Reference path from where local files should be
|
|
189
|
-
* resolved.
|
|
190
|
-
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
191
|
-
*
|
|
192
|
-
* @returns Given injection with resolved marked indicators.
|
|
193
|
-
*/
|
|
194
|
-
static resolveAutoInjection<T extends GivenInjectionConfiguration>(this: void, givenInjection: T, buildConfigurations: ResolvedBuildConfiguration, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: Extensions, context?: string, referencePath?: string, pathsToIgnore?: Array<string>): T;
|
|
195
|
-
/**
|
|
196
|
-
* Determines all module file paths.
|
|
197
|
-
* @param buildConfigurations - Resolved build configuration.
|
|
198
|
-
* @param moduleFilePathsToExclude - A list of modules file paths to
|
|
199
|
-
* exclude (specified by path or id) or a mapping from chunk names to
|
|
200
|
-
* module ids.
|
|
201
|
-
* @param context - File path to use as starting point.
|
|
202
|
-
*
|
|
203
|
-
* @returns All determined module file paths.
|
|
204
|
-
*/
|
|
205
|
-
static getAutoInjection(this: void, buildConfigurations: ResolvedBuildConfiguration, moduleFilePathsToExclude: Array<string>, context: string): Mapping;
|
|
206
|
-
/**
|
|
207
|
-
* Determines a resolved module file path in given package path.
|
|
208
|
-
* @param packagePath - Path to package to resolve in.
|
|
209
|
-
* @param packageMainPropertyNames - List of package file main property
|
|
210
|
-
* names to search for package representing entry module definitions.
|
|
211
|
-
* @param packageAliasPropertyNames - List of package file alias property
|
|
212
|
-
* names to search for package specific module aliases.
|
|
213
|
-
* @param encoding - Encoding to use for file names during file traversing.
|
|
214
|
-
*
|
|
215
|
-
* @returns Path if found and / or additional package aliases to consider.
|
|
216
|
-
*/
|
|
217
|
-
static determineModuleFilePathInPackage(this: void, packagePath: string, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, encoding?: Encoding): {
|
|
218
|
-
fileName: null | string;
|
|
219
|
-
packageAliases: Mapping | null;
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* Determines a concrete file path for given module id.
|
|
223
|
-
* @param moduleID - Module id to determine.
|
|
224
|
-
* @param aliases - Mapping of aliases to take into account.
|
|
225
|
-
* @param moduleReplacements - Mapping of replacements to take into
|
|
226
|
-
* account.
|
|
227
|
-
* @param extensions - List of file and module extensions to take into
|
|
228
|
-
* account.
|
|
229
|
-
* @param context - File path to determine relative to.
|
|
230
|
-
* @param referencePath - Path to resolve local modules relative to.
|
|
231
|
-
* @param pathsToIgnore - Paths which marks location to ignore.
|
|
232
|
-
* @param relativeModuleLocations - List of relative file path to search
|
|
233
|
-
* for modules in.
|
|
234
|
-
* @param packageEntryFileNames - List of package entry file names to
|
|
235
|
-
* search for. The magic name "__package__" will search for an appreciate
|
|
236
|
-
* entry in a "package.json" file.
|
|
237
|
-
* @param packageMainPropertyNames - List of package file main property
|
|
238
|
-
* names to search for package representing entry module definitions.
|
|
239
|
-
* @param packageAliasPropertyNames - List of package file alias property
|
|
240
|
-
* names to search for package specific module aliases.
|
|
241
|
-
* @param encoding - Encoding to use for file names during file traversing.
|
|
242
|
-
*
|
|
243
|
-
* @returns File path or given module id if determinations has failed or
|
|
244
|
-
* wasn't necessary.
|
|
245
|
-
*/
|
|
246
|
-
static determineModuleFilePath(this: void, moduleID: false | string, aliases?: Mapping, moduleReplacements?: Replacements, extensions?: SpecificExtensions, context?: string, referencePath?: string, pathsToIgnore?: Array<string>, relativeModuleLocations?: Array<string>, packageEntryFileNames?: Array<string>, packageMainPropertyNames?: Array<string>, packageAliasPropertyNames?: Array<string>, encoding?: Encoding): null | string;
|
|
247
|
-
/**
|
|
248
|
-
* Determines a concrete file path for given module id.
|
|
249
|
-
* @param moduleID - Module id to determine.
|
|
250
|
-
* @param aliases - Mapping of aliases to take into account.
|
|
251
|
-
*
|
|
252
|
-
* @returns The alias applied given module id.
|
|
253
|
-
*/
|
|
254
|
-
static applyAliases(this: void, moduleID: string, aliases: Mapping): string;
|
|
255
|
-
/**
|
|
256
|
-
* Determines a concrete file path for given module id.
|
|
257
|
-
* @param moduleID - Module id to determine.
|
|
258
|
-
* @param replacements - Mapping of regular expressions to their
|
|
259
|
-
* corresponding replacements.
|
|
260
|
-
*
|
|
261
|
-
* @returns The replacement applied given module id.
|
|
262
|
-
*/
|
|
263
|
-
static applyModuleReplacements(this: void, moduleID: false | string, replacements: Replacements): false | string;
|
|
264
|
-
/**
|
|
265
|
-
* Determines the nearest package configuration file from given file path.
|
|
266
|
-
* @param start - Reference location to search from.
|
|
267
|
-
* @param fileName - Package configuration file name.
|
|
268
|
-
*
|
|
269
|
-
* @returns Determined file path.
|
|
270
|
-
*/
|
|
271
|
-
static findPackageDescriptorFilePath(this: void, start: Array<string> | string, fileName?: string): null | string;
|
|
272
|
-
/**
|
|
273
|
-
* Determines the nearest package configuration from given module file
|
|
274
|
-
* path.
|
|
275
|
-
* @param modulePath - Module path to take as reference location (leaf in
|
|
276
|
-
* tree).
|
|
277
|
-
* @param fileName - Package configuration file name.
|
|
278
|
-
*
|
|
279
|
-
* @returns A object containing found parsed configuration an their
|
|
280
|
-
* corresponding file path.
|
|
281
|
-
*/
|
|
282
|
-
static getClosestPackageDescriptor(this: void, modulePath: string, fileName?: string): null | PackageDescriptor;
|
|
283
|
-
}
|
|
284
|
-
export default Helper;
|
package/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env babel-node
|
|
2
|
-
/// <reference types="webpack-env" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
/// <reference types="node" />
|
|
7
|
-
/// <reference types="node" />
|
|
8
|
-
/**
|
|
9
|
-
* Main entry point.
|
|
10
|
-
* @param context - Location from where to build current application.
|
|
11
|
-
* @param currentWorkingDirectory - Current working directory to use as
|
|
12
|
-
* reference.
|
|
13
|
-
* @param commandLineArguments - Arguments to take into account.
|
|
14
|
-
* @param webOptimizerPath - Current optimizer context path.
|
|
15
|
-
* @param environment - Environment variables to take into account.
|
|
16
|
-
*
|
|
17
|
-
* @returns Nothing.
|
|
18
|
-
*/
|
|
19
|
-
declare const main: (context?: string, currentWorkingDirectory?: string, commandLineArguments?: Array<string>, webOptimizerPath?: string, environment?: NodeJS.ProcessEnv) => Promise<() => void>;
|
|
20
|
-
export default main;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Implements the default browser environment to run script context in.
|
|
3
|
-
*/
|
|
4
|
-
export declare class BrowserEnvironment {
|
|
5
|
-
/**
|
|
6
|
-
* @returns Nothing.
|
|
7
|
-
*/
|
|
8
|
-
setup(): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* @returns Nothing.
|
|
11
|
-
*/
|
|
12
|
-
teardown(): void;
|
|
13
|
-
/**
|
|
14
|
-
* @returns Null.
|
|
15
|
-
*/
|
|
16
|
-
runScript(): null;
|
|
17
|
-
}
|
|
18
|
-
export default BrowserEnvironment;
|