@ohos-ports/rsbuild-core 1.7.2-beta.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/LICENSE +21 -0
- package/README.md +27 -0
- package/bin/rsbuild.js +20 -0
- package/compiled/@jridgewell/remapping/index.d.ts +1 -0
- package/compiled/@jridgewell/remapping/index.js +1222 -0
- package/compiled/@jridgewell/remapping/license +19 -0
- package/compiled/@jridgewell/remapping/package.json +1 -0
- package/compiled/@jridgewell/trace-mapping/index.d.ts +194 -0
- package/compiled/@jridgewell/trace-mapping/index.js +1408 -0
- package/compiled/@jridgewell/trace-mapping/license +19 -0
- package/compiled/@jridgewell/trace-mapping/package.json +1 -0
- package/compiled/chokidar/index.d.ts +384 -0
- package/compiled/chokidar/index.js +1793 -0
- package/compiled/chokidar/license +21 -0
- package/compiled/chokidar/package.json +1 -0
- package/compiled/connect/index.d.ts +90 -0
- package/compiled/connect/index.js +1240 -0
- package/compiled/connect/license +25 -0
- package/compiled/connect/package.json +1 -0
- package/compiled/cors/index.d.ts +56 -0
- package/compiled/cors/index.js +371 -0
- package/compiled/cors/license +22 -0
- package/compiled/cors/package.json +1 -0
- package/compiled/css-loader/api.js +85 -0
- package/compiled/css-loader/getUrl.js +26 -0
- package/compiled/css-loader/index.d.ts +1 -0
- package/compiled/css-loader/index.js +2 -0
- package/compiled/css-loader/license +20 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +16 -0
- package/compiled/html-rspack-plugin/default_index.ejs +9 -0
- package/compiled/html-rspack-plugin/index.d.ts +290 -0
- package/compiled/html-rspack-plugin/index.js +1602 -0
- package/compiled/html-rspack-plugin/license +20 -0
- package/compiled/html-rspack-plugin/loader.js +166 -0
- package/compiled/html-rspack-plugin/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +319 -0
- package/compiled/http-proxy-middleware/index.js +5284 -0
- package/compiled/http-proxy-middleware/license +22 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/launch-editor-middleware/index.d.ts +1 -0
- package/compiled/launch-editor-middleware/index.js +719 -0
- package/compiled/launch-editor-middleware/license +21 -0
- package/compiled/launch-editor-middleware/package.json +1 -0
- package/compiled/memfs/index.d.ts +1462 -0
- package/compiled/memfs/index.js +1 -0
- package/compiled/memfs/license +201 -0
- package/compiled/memfs/package.json +1 -0
- package/compiled/mrmime/index.d.ts +4 -0
- package/compiled/mrmime/index.js +456 -0
- package/compiled/mrmime/package.json +1 -0
- package/compiled/picocolors/index.d.ts +55 -0
- package/compiled/picocolors/index.js +108 -0
- package/compiled/picocolors/license +15 -0
- package/compiled/picocolors/package.json +1 -0
- package/compiled/postcss/index.js +1 -0
- package/compiled/postcss/lib/at-rule.d.ts +140 -0
- package/compiled/postcss/lib/comment.d.ts +68 -0
- package/compiled/postcss/lib/container.d.ts +483 -0
- package/compiled/postcss/lib/css-syntax-error.d.ts +248 -0
- package/compiled/postcss/lib/declaration.d.ts +151 -0
- package/compiled/postcss/lib/document.d.ts +69 -0
- package/compiled/postcss/lib/fromJSON.d.ts +9 -0
- package/compiled/postcss/lib/input.d.ts +227 -0
- package/compiled/postcss/lib/lazy-result.d.ts +190 -0
- package/compiled/postcss/lib/list.d.ts +60 -0
- package/compiled/postcss/lib/no-work-result.d.ts +46 -0
- package/compiled/postcss/lib/node.d.ts +556 -0
- package/compiled/postcss/lib/parse.d.ts +9 -0
- package/compiled/postcss/lib/postcss.d.ts +458 -0
- package/compiled/postcss/lib/previous-map.d.ts +81 -0
- package/compiled/postcss/lib/processor.d.ts +115 -0
- package/compiled/postcss/lib/result.d.ts +205 -0
- package/compiled/postcss/lib/root.d.ts +87 -0
- package/compiled/postcss/lib/rule.d.ts +126 -0
- package/compiled/postcss/lib/source-map-js.d.ts +4 -0
- package/compiled/postcss/lib/stringifier.d.ts +46 -0
- package/compiled/postcss/lib/stringify.d.ts +9 -0
- package/compiled/postcss/lib/warning.d.ts +147 -0
- package/compiled/postcss/license +20 -0
- package/compiled/postcss/package.json +1 -0
- package/compiled/postcss-loader/index.d.ts +1 -0
- package/compiled/postcss-loader/index.js +720 -0
- package/compiled/postcss-loader/license +20 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/rslog/index.d.ts +67 -0
- package/compiled/rslog/license +21 -0
- package/compiled/rslog/package.json +1 -0
- package/compiled/rspack-chain/license +22 -0
- package/compiled/rspack-chain/package.json +1 -0
- package/compiled/rspack-chain/types/index.d.ts +545 -0
- package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
- package/compiled/rspack-manifest-plugin/index.js +409 -0
- package/compiled/rspack-manifest-plugin/license +21 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -0
- package/compiled/sirv/index.d.ts +1 -0
- package/compiled/sirv/index.js +274 -0
- package/compiled/sirv/package.json +1 -0
- package/compiled/style-loader/index.d.ts +1 -0
- package/compiled/style-loader/index.js +427 -0
- package/compiled/style-loader/license +20 -0
- package/compiled/style-loader/package.json +1 -0
- package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
- package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
- package/compiled/style-loader/runtime/insertBySelector.js +34 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
- package/compiled/style-loader/runtime/isOldIE.js +17 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
- package/compiled/tinyglobby/index.d.ts +46 -0
- package/compiled/tinyglobby/index.js +2664 -0
- package/compiled/tinyglobby/license +21 -0
- package/compiled/tinyglobby/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
- package/compiled/webpack-bundle-analyzer/index.js +23 -0
- package/compiled/webpack-bundle-analyzer/license +20 -0
- package/compiled/webpack-bundle-analyzer/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
- package/compiled/webpack-merge/index.d.ts +31 -0
- package/compiled/webpack-merge/index.js +1200 -0
- package/compiled/webpack-merge/license +20 -0
- package/compiled/webpack-merge/package.json +1 -0
- package/compiled/ws/index.d.ts +437 -0
- package/compiled/ws/index.js +3161 -0
- package/compiled/ws/license +20 -0
- package/compiled/ws/package.json +1 -0
- package/dist/0~open.js +427 -0
- package/dist/0~range-parser.js +49 -0
- package/dist/0~range-parser.js.LICENSE.txt +6 -0
- package/dist/131.js +9305 -0
- package/dist/131.js.LICENSE.txt +26 -0
- package/dist/136.mjs +42 -0
- package/dist/2~open.cjs +436 -0
- package/dist/2~range-parser.cjs +52 -0
- package/dist/2~range-parser.cjs.LICENSE.txt +6 -0
- package/dist/client/59.js +22 -0
- package/dist/client/hmr.js +206 -0
- package/dist/client/overlay.js +203 -0
- package/dist/ignoreCssLoader.mjs +3 -0
- package/dist/index.cjs +9456 -0
- package/dist/index.cjs.LICENSE.txt +26 -0
- package/dist/index.js +1 -0
- package/dist/rslib-runtime.js +44 -0
- package/dist/transformLoader.mjs +1 -0
- package/dist/transformRawLoader.mjs +4 -0
- package/dist-types/cli/commands.d.ts +28 -0
- package/dist-types/cli/index.d.ts +1 -0
- package/dist-types/cli/init.d.ts +7 -0
- package/dist-types/client/hmr.d.ts +3 -0
- package/dist-types/client/log.d.ts +13 -0
- package/dist-types/client/overlay.d.ts +1 -0
- package/dist-types/configChain.d.ts +154 -0
- package/dist-types/constants.d.ts +52 -0
- package/dist-types/createContext.d.ts +11 -0
- package/dist-types/createRsbuild.d.ts +5 -0
- package/dist-types/defaultConfig.d.ts +25 -0
- package/dist-types/helpers/compiler.d.ts +5 -0
- package/dist-types/helpers/exitHook.d.ts +3 -0
- package/dist-types/helpers/format.d.ts +2 -0
- package/dist-types/helpers/fs.d.ts +17 -0
- package/dist-types/helpers/index.d.ts +29 -0
- package/dist-types/helpers/path.d.ts +26 -0
- package/dist-types/helpers/stats.d.ts +18 -0
- package/dist-types/helpers/url.d.ts +11 -0
- package/dist-types/helpers/vendors.d.ts +29 -0
- package/dist-types/helpers/version.d.ts +7 -0
- package/dist-types/hooks.d.ts +44 -0
- package/dist-types/index.d.ts +22 -0
- package/dist-types/initPlugins.d.ts +6 -0
- package/dist-types/inspectConfig.d.ts +35 -0
- package/dist-types/loadConfig.d.ts +60 -0
- package/dist-types/loadEnv.d.ts +63 -0
- package/dist-types/loader/ignoreCssLoader.d.ts +3 -0
- package/dist-types/loader/transformLoader.d.ts +8 -0
- package/dist-types/loader/transformRawLoader.d.ts +3 -0
- package/dist-types/logger.d.ts +19 -0
- package/dist-types/mergeConfig.d.ts +2 -0
- package/dist-types/package.json +1 -0
- package/dist-types/pluginHelper.d.ts +12 -0
- package/dist-types/pluginManager.d.ts +21 -0
- package/dist-types/plugins/appIcon.d.ts +2 -0
- package/dist-types/plugins/asset.d.ts +3 -0
- package/dist-types/plugins/basic.d.ts +5 -0
- package/dist-types/plugins/bundleAnalyzer.d.ts +2 -0
- package/dist-types/plugins/cache.d.ts +2 -0
- package/dist-types/plugins/cleanOutput.d.ts +2 -0
- package/dist-types/plugins/css.d.ts +4 -0
- package/dist-types/plugins/define.d.ts +2 -0
- package/dist-types/plugins/entry.d.ts +2 -0
- package/dist-types/plugins/esm.d.ts +2 -0
- package/dist-types/plugins/externals.d.ts +2 -0
- package/dist-types/plugins/fileSize.d.ts +6 -0
- package/dist-types/plugins/html.d.ts +9 -0
- package/dist-types/plugins/inlineChunk.d.ts +6 -0
- package/dist-types/plugins/lazyCompilation.d.ts +2 -0
- package/dist-types/plugins/manifest.d.ts +2 -0
- package/dist-types/plugins/minimize.d.ts +10 -0
- package/dist-types/plugins/moduleFederation.d.ts +2 -0
- package/dist-types/plugins/moment.d.ts +2 -0
- package/dist-types/plugins/nodeAddons.d.ts +2 -0
- package/dist-types/plugins/nonce.d.ts +2 -0
- package/dist-types/plugins/output.d.ts +2 -0
- package/dist-types/plugins/performance.d.ts +5 -0
- package/dist-types/plugins/progress.d.ts +2 -0
- package/dist-types/plugins/resolve.d.ts +2 -0
- package/dist-types/plugins/resourceHints.d.ts +2 -0
- package/dist-types/plugins/rsdoctor.d.ts +2 -0
- package/dist-types/plugins/rspackProfile.d.ts +2 -0
- package/dist-types/plugins/server.d.ts +2 -0
- package/dist-types/plugins/sourceMap.d.ts +2 -0
- package/dist-types/plugins/splitChunks.d.ts +4 -0
- package/dist-types/plugins/sri.d.ts +2 -0
- package/dist-types/plugins/swc.d.ts +5 -0
- package/dist-types/plugins/target.d.ts +2 -0
- package/dist-types/plugins/wasm.d.ts +2 -0
- package/dist-types/provider/build.d.ts +4 -0
- package/dist-types/provider/createCompiler.d.ts +6 -0
- package/dist-types/provider/helpers.d.ts +12 -0
- package/dist-types/provider/initConfigs.d.ts +19 -0
- package/dist-types/provider/provider.d.ts +2 -0
- package/dist-types/provider/rspackConfig.d.ts +8 -0
- package/dist-types/restart.d.ts +18 -0
- package/dist-types/rspack-plugins/RsbuildHtmlPlugin.d.ts +38 -0
- package/dist-types/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +32 -0
- package/dist-types/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +28 -0
- package/dist-types/rspack-plugins/resource-hints/extractChunks.d.ts +23 -0
- package/dist-types/rspack-plugins/resource-hints/getResourceType.d.ts +22 -0
- package/dist-types/rspack.d.ts +2 -0
- package/dist-types/server/ansiHTML.d.ts +4 -0
- package/dist-types/server/assets-middleware/getFileFromUrl.d.ts +12 -0
- package/dist-types/server/assets-middleware/index.d.ts +37 -0
- package/dist-types/server/assets-middleware/middleware.d.ts +2 -0
- package/dist-types/server/assets-middleware/parseTokenList.d.ts +1 -0
- package/dist-types/server/assets-middleware/setupOutputFileSystem.d.ts +3 -0
- package/dist-types/server/assets-middleware/setupWriteToDisk.d.ts +15 -0
- package/dist-types/server/browserLogs.d.ts +9 -0
- package/dist-types/server/buildManager.d.ts +33 -0
- package/dist-types/server/cliShortcuts.d.ts +10 -0
- package/dist-types/server/devMiddlewares.d.ts +21 -0
- package/dist-types/server/devServer.d.ts +79 -0
- package/dist-types/server/environment.d.ts +8 -0
- package/dist-types/server/gracefulShutdown.d.ts +10 -0
- package/dist-types/server/gzipMiddleware.d.ts +2 -0
- package/dist-types/server/helper.d.ts +91 -0
- package/dist-types/server/historyApiFallback.d.ts +2 -0
- package/dist-types/server/hmrFallback.d.ts +1 -0
- package/dist-types/server/httpServer.d.ts +7 -0
- package/dist-types/server/middlewares.d.ts +33 -0
- package/dist-types/server/open.d.ts +10 -0
- package/dist-types/server/overlay.d.ts +3 -0
- package/dist-types/server/prodServer.d.ts +24 -0
- package/dist-types/server/proxy.d.ts +6 -0
- package/dist-types/server/runner/asModule.d.ts +2 -0
- package/dist-types/server/runner/basic.d.ts +29 -0
- package/dist-types/server/runner/cjs.d.ts +10 -0
- package/dist-types/server/runner/esm.d.ts +6 -0
- package/dist-types/server/runner/index.d.ts +4 -0
- package/dist-types/server/runner/type.d.ts +42 -0
- package/dist-types/server/socketServer.d.ts +81 -0
- package/dist-types/server/watchFiles.d.ts +14 -0
- package/dist-types/types/config.d.ts +1882 -0
- package/dist-types/types/context.d.ts +110 -0
- package/dist-types/types/hooks.d.ts +275 -0
- package/dist-types/types/index.d.ts +8 -0
- package/dist-types/types/plugin.d.ts +585 -0
- package/dist-types/types/rsbuild.d.ts +286 -0
- package/dist-types/types/rspack.d.ts +16 -0
- package/dist-types/types/thirdParty.d.ts +186 -0
- package/dist-types/types/utils.d.ts +19 -0
- package/package.json +114 -0
- package/static/openChrome.applescript +95 -0
- package/types.d.ts +349 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* istanbul ignore next */
|
|
4
|
+
function setAttributesWithoutAttributes(styleElement, attributes) {
|
|
5
|
+
Object.keys(attributes).forEach(function (key) {
|
|
6
|
+
styleElement.setAttribute(key, attributes[key]);
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
module.exports = setAttributesWithoutAttributes;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* istanbul ignore next */
|
|
4
|
+
function setAttributesWithoutAttributes(styleElement) {
|
|
5
|
+
var nonce = typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
|
|
6
|
+
if (nonce) {
|
|
7
|
+
styleElement.setAttribute("nonce", nonce);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
module.exports = setAttributesWithoutAttributes;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* istanbul ignore next */
|
|
4
|
+
var replaceText = function replaceText() {
|
|
5
|
+
var textStore = [];
|
|
6
|
+
return function replace(index, replacement) {
|
|
7
|
+
textStore[index] = replacement;
|
|
8
|
+
return textStore.filter(Boolean).join("\n");
|
|
9
|
+
};
|
|
10
|
+
}();
|
|
11
|
+
|
|
12
|
+
/* istanbul ignore next */
|
|
13
|
+
function apply(styleElement, index, remove, obj) {
|
|
14
|
+
var css;
|
|
15
|
+
if (remove) {
|
|
16
|
+
css = "";
|
|
17
|
+
} else {
|
|
18
|
+
css = "";
|
|
19
|
+
if (obj.supports) {
|
|
20
|
+
css += "@supports (".concat(obj.supports, ") {");
|
|
21
|
+
}
|
|
22
|
+
if (obj.media) {
|
|
23
|
+
css += "@media ".concat(obj.media, " {");
|
|
24
|
+
}
|
|
25
|
+
var needLayer = typeof obj.layer !== "undefined";
|
|
26
|
+
if (needLayer) {
|
|
27
|
+
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
|
|
28
|
+
}
|
|
29
|
+
css += obj.css;
|
|
30
|
+
if (needLayer) {
|
|
31
|
+
css += "}";
|
|
32
|
+
}
|
|
33
|
+
if (obj.media) {
|
|
34
|
+
css += "}";
|
|
35
|
+
}
|
|
36
|
+
if (obj.supports) {
|
|
37
|
+
css += "}";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// For old IE
|
|
42
|
+
/* istanbul ignore if */
|
|
43
|
+
if (styleElement.styleSheet) {
|
|
44
|
+
styleElement.styleSheet.cssText = replaceText(index, css);
|
|
45
|
+
} else {
|
|
46
|
+
var cssNode = document.createTextNode(css);
|
|
47
|
+
var childNodes = styleElement.childNodes;
|
|
48
|
+
if (childNodes[index]) {
|
|
49
|
+
styleElement.removeChild(childNodes[index]);
|
|
50
|
+
}
|
|
51
|
+
if (childNodes.length) {
|
|
52
|
+
styleElement.insertBefore(cssNode, childNodes[index]);
|
|
53
|
+
} else {
|
|
54
|
+
styleElement.appendChild(cssNode);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
var singletonData = {
|
|
59
|
+
singleton: null,
|
|
60
|
+
singletonCounter: 0
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* istanbul ignore next */
|
|
64
|
+
function domAPI(options) {
|
|
65
|
+
if (typeof document === "undefined") return {
|
|
66
|
+
update: function update() {},
|
|
67
|
+
remove: function remove() {}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// eslint-disable-next-line no-undef,no-use-before-define
|
|
71
|
+
var styleIndex = singletonData.singletonCounter++;
|
|
72
|
+
var styleElement =
|
|
73
|
+
// eslint-disable-next-line no-undef,no-use-before-define
|
|
74
|
+
singletonData.singleton || (
|
|
75
|
+
// eslint-disable-next-line no-undef,no-use-before-define
|
|
76
|
+
singletonData.singleton = options.insertStyleElement(options));
|
|
77
|
+
return {
|
|
78
|
+
update: function update(obj) {
|
|
79
|
+
apply(styleElement, styleIndex, false, obj);
|
|
80
|
+
},
|
|
81
|
+
remove: function remove(obj) {
|
|
82
|
+
apply(styleElement, styleIndex, true, obj);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
module.exports = domAPI;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* istanbul ignore next */
|
|
4
|
+
function apply(styleElement, options, obj) {
|
|
5
|
+
var css = "";
|
|
6
|
+
if (obj.supports) {
|
|
7
|
+
css += "@supports (".concat(obj.supports, ") {");
|
|
8
|
+
}
|
|
9
|
+
if (obj.media) {
|
|
10
|
+
css += "@media ".concat(obj.media, " {");
|
|
11
|
+
}
|
|
12
|
+
var needLayer = typeof obj.layer !== "undefined";
|
|
13
|
+
if (needLayer) {
|
|
14
|
+
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
|
|
15
|
+
}
|
|
16
|
+
css += obj.css;
|
|
17
|
+
if (needLayer) {
|
|
18
|
+
css += "}";
|
|
19
|
+
}
|
|
20
|
+
if (obj.media) {
|
|
21
|
+
css += "}";
|
|
22
|
+
}
|
|
23
|
+
if (obj.supports) {
|
|
24
|
+
css += "}";
|
|
25
|
+
}
|
|
26
|
+
var sourceMap = obj.sourceMap;
|
|
27
|
+
if (sourceMap && typeof btoa !== "undefined") {
|
|
28
|
+
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// For old IE
|
|
32
|
+
/* istanbul ignore if */
|
|
33
|
+
options.styleTagTransform(css, styleElement, options.options);
|
|
34
|
+
}
|
|
35
|
+
function removeStyleElement(styleElement) {
|
|
36
|
+
// istanbul ignore if
|
|
37
|
+
if (styleElement.parentNode === null) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
styleElement.parentNode.removeChild(styleElement);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* istanbul ignore next */
|
|
44
|
+
function domAPI(options) {
|
|
45
|
+
if (typeof document === "undefined") {
|
|
46
|
+
return {
|
|
47
|
+
update: function update() {},
|
|
48
|
+
remove: function remove() {}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
var styleElement = options.insertStyleElement(options);
|
|
52
|
+
return {
|
|
53
|
+
update: function update(obj) {
|
|
54
|
+
apply(styleElement, options, obj);
|
|
55
|
+
},
|
|
56
|
+
remove: function remove() {
|
|
57
|
+
removeStyleElement(styleElement);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
module.exports = domAPI;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* istanbul ignore next */
|
|
4
|
+
function styleTagTransform(css, styleElement) {
|
|
5
|
+
if (styleElement.styleSheet) {
|
|
6
|
+
styleElement.styleSheet.cssText = css;
|
|
7
|
+
} else {
|
|
8
|
+
while (styleElement.firstChild) {
|
|
9
|
+
styleElement.removeChild(styleElement.firstChild);
|
|
10
|
+
}
|
|
11
|
+
styleElement.appendChild(document.createTextNode(css));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
module.exports = styleTagTransform;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/utils.d.ts
|
|
2
|
+
|
|
3
|
+
declare const convertPathToPattern: (path: string) => string;
|
|
4
|
+
declare const escapePath: (path: string) => string;
|
|
5
|
+
// #endregion
|
|
6
|
+
// #region isDynamicPattern
|
|
7
|
+
/*
|
|
8
|
+
Has a few minor differences with `fast-glob` for better accuracy:
|
|
9
|
+
|
|
10
|
+
Doesn't necessarily return false on patterns that include `\\`.
|
|
11
|
+
|
|
12
|
+
Returns true if the pattern includes parentheses,
|
|
13
|
+
regardless of them representing one single pattern or not.
|
|
14
|
+
|
|
15
|
+
Returns true for unfinished glob extensions i.e. `(h`, `+(h`.
|
|
16
|
+
|
|
17
|
+
Returns true for unfinished brace expansions as long as they include `,` or `..`.
|
|
18
|
+
*/
|
|
19
|
+
declare function isDynamicPattern(pattern: string, options?: {
|
|
20
|
+
caseSensitiveMatch: boolean;
|
|
21
|
+
}): boolean; //#endregion
|
|
22
|
+
//#region src/index.d.ts
|
|
23
|
+
|
|
24
|
+
// #endregion
|
|
25
|
+
// #region log
|
|
26
|
+
interface GlobOptions {
|
|
27
|
+
absolute?: boolean;
|
|
28
|
+
cwd?: string;
|
|
29
|
+
patterns?: string | string[];
|
|
30
|
+
ignore?: string | string[];
|
|
31
|
+
dot?: boolean;
|
|
32
|
+
deep?: number;
|
|
33
|
+
followSymbolicLinks?: boolean;
|
|
34
|
+
caseSensitiveMatch?: boolean;
|
|
35
|
+
expandDirectories?: boolean;
|
|
36
|
+
onlyDirectories?: boolean;
|
|
37
|
+
onlyFiles?: boolean;
|
|
38
|
+
debug?: boolean;
|
|
39
|
+
}
|
|
40
|
+
declare function glob(patterns: string | string[], options?: Omit<GlobOptions, "patterns">): Promise<string[]>;
|
|
41
|
+
declare function glob(options: GlobOptions): Promise<string[]>;
|
|
42
|
+
declare function globSync(patterns: string | string[], options?: Omit<GlobOptions, "patterns">): string[];
|
|
43
|
+
declare function globSync(options: GlobOptions): string[];
|
|
44
|
+
|
|
45
|
+
export { convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };
|
|
46
|
+
export type { GlobOptions };
|