@fastly/compute-js-static-publish 6.3.0 → 7.0.0-beta.0
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 +1 -1
- package/README.md +31 -586
- package/README.short.md +53 -0
- package/build/cli/commands/clean.d.ts +2 -0
- package/build/cli/commands/clean.d.ts.map +1 -0
- package/build/cli/commands/clean.js +121 -0
- package/build/cli/commands/collections/delete.d.ts +2 -0
- package/build/cli/commands/collections/delete.d.ts.map +1 -0
- package/build/cli/commands/collections/delete.js +88 -0
- package/build/cli/commands/collections/index.d.ts +2 -0
- package/build/cli/commands/collections/index.d.ts.map +1 -0
- package/build/cli/commands/collections/index.js +52 -0
- package/build/cli/commands/collections/list.d.ts +2 -0
- package/build/cli/commands/collections/list.d.ts.map +1 -0
- package/build/cli/commands/collections/list.js +62 -0
- package/build/cli/commands/index.d.ts +2 -0
- package/build/cli/commands/index.d.ts.map +1 -0
- package/build/cli/commands/index.js +67 -0
- package/build/cli/commands/init-app.d.ts +18 -2
- package/build/cli/commands/init-app.d.ts.map +1 -1
- package/build/cli/commands/init-app.js +291 -264
- package/build/cli/commands/publish-content.d.ts +2 -0
- package/build/cli/commands/publish-content.d.ts.map +1 -0
- package/build/cli/commands/publish-content.js +472 -0
- package/build/cli/compression/brotli.d.ts +1 -1
- package/build/cli/compression/brotli.d.ts.map +1 -1
- package/build/cli/compression/brotli.js +8 -11
- package/build/cli/compression/gzip.d.ts +1 -1
- package/build/cli/compression/gzip.d.ts.map +1 -1
- package/build/cli/compression/gzip.js +8 -11
- package/build/cli/compression/index.d.ts +3 -6
- package/build/cli/compression/index.d.ts.map +1 -1
- package/build/cli/compression/index.js +8 -9
- package/build/cli/fastly-api/api-token.d.ts +17 -0
- package/build/cli/fastly-api/api-token.d.ts.map +1 -0
- package/build/cli/fastly-api/api-token.js +94 -0
- package/build/cli/fastly-api/kv-store.d.ts +24 -0
- package/build/cli/fastly-api/kv-store.d.ts.map +1 -0
- package/build/cli/{util → fastly-api}/kv-store.js +42 -22
- package/build/cli/index.js +7 -91
- package/build/cli/util/args.d.ts +16 -0
- package/build/cli/util/args.d.ts.map +1 -0
- package/build/cli/util/args.js +55 -0
- package/build/cli/util/config.d.ts +13 -0
- package/build/cli/util/config.d.ts.map +1 -0
- package/build/cli/{load-config.js → util/config.js} +234 -187
- package/build/{util → cli/util}/content-types.d.ts +1 -2
- package/build/cli/util/content-types.d.ts.map +1 -0
- package/build/{util → cli/util}/content-types.js +11 -6
- package/build/cli/util/data.d.ts +3 -3
- package/build/cli/util/data.d.ts.map +1 -1
- package/build/cli/util/data.js +6 -2
- package/build/cli/util/files.d.ts +10 -2
- package/build/cli/util/files.d.ts.map +1 -1
- package/build/cli/util/files.js +53 -6
- package/build/cli/util/kv-store-items.d.ts +12 -0
- package/build/cli/util/kv-store-items.d.ts.map +1 -0
- package/build/cli/util/kv-store-items.js +161 -0
- package/build/cli/util/kv-store-local-server.d.ts +3 -0
- package/build/cli/util/kv-store-local-server.d.ts.map +1 -0
- package/build/cli/util/kv-store-local-server.js +35 -0
- package/build/cli/util/package.d.ts +9 -0
- package/build/cli/util/package.d.ts.map +1 -0
- package/build/cli/util/package.js +44 -0
- package/build/cli/util/retryable.d.ts +12 -0
- package/build/cli/util/retryable.d.ts.map +1 -0
- package/build/cli/util/retryable.js +43 -0
- package/build/cli/util/variants.d.ts +4 -0
- package/build/cli/util/variants.d.ts.map +1 -0
- package/build/cli/util/variants.js +27 -0
- package/build/index.d.ts +5 -5
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -6
- package/build/models/assets/kvstore-assets.d.ts +17 -0
- package/build/models/assets/kvstore-assets.d.ts.map +1 -0
- package/build/models/assets/kvstore-assets.js +28 -0
- package/build/{constants/compression.d.ts → models/compression/index.d.ts} +2 -1
- package/build/models/compression/index.d.ts.map +1 -0
- package/build/models/compression/index.js +11 -0
- package/build/models/config/publish-content-config.d.ts +41 -0
- package/build/models/config/publish-content-config.d.ts.map +1 -0
- package/build/models/config/publish-content-config.js +5 -0
- package/build/models/config/publisher-server-config.d.ts +20 -0
- package/build/models/config/publisher-server-config.d.ts.map +1 -0
- package/build/models/config/publisher-server-config.js +5 -0
- package/build/models/config/static-publish-rc.d.ts +6 -0
- package/build/models/config/static-publish-rc.d.ts.map +1 -0
- package/build/models/config/static-publish-rc.js +5 -0
- package/build/server/collection-selector/from-config-store.d.ts +2 -0
- package/build/server/collection-selector/from-config-store.d.ts.map +1 -0
- package/build/server/collection-selector/from-config-store.js +15 -0
- package/build/server/collection-selector/from-cookie.d.ts +23 -0
- package/build/server/collection-selector/from-cookie.d.ts.map +1 -0
- package/build/server/collection-selector/from-cookie.js +98 -0
- package/build/server/collection-selector/from-request.d.ts +13 -0
- package/build/server/collection-selector/from-request.d.ts.map +1 -0
- package/build/server/collection-selector/from-request.js +22 -0
- package/build/server/collection-selector/index.d.ts +5 -0
- package/build/server/collection-selector/index.d.ts.map +1 -0
- package/build/server/collection-selector/index.js +7 -0
- package/build/server/collection-selector/request-collection-selector.d.ts +5 -0
- package/build/server/collection-selector/request-collection-selector.d.ts.map +1 -0
- package/build/server/collection-selector/request-collection-selector.js +5 -0
- package/build/server/publisher-server/index.d.ts +38 -0
- package/build/server/publisher-server/index.d.ts.map +1 -0
- package/build/server/publisher-server/index.js +415 -0
- package/build/server/publisher-server/serve-preconditions/if-modified-since.d.ts +3 -0
- package/build/server/publisher-server/serve-preconditions/if-modified-since.d.ts.map +1 -0
- package/build/server/{serve-preconditions → publisher-server/serve-preconditions}/if-modified-since.js +6 -2
- package/build/server/publisher-server/serve-preconditions/if-none-match.d.ts.map +1 -0
- package/build/server/{serve-preconditions → publisher-server/serve-preconditions}/if-none-match.js +4 -0
- package/build/server/util/cookies.d.ts +2 -0
- package/build/server/util/cookies.d.ts.map +1 -0
- package/build/server/util/cookies.js +14 -0
- package/build/server/util/kv-store.d.ts +3 -0
- package/build/server/util/kv-store.d.ts.map +1 -0
- package/build/server/util/kv-store.js +95 -0
- package/package.json +18 -10
- package/build/cli/commands/build-static.d.ts +0 -3
- package/build/cli/commands/build-static.d.ts.map +0 -1
- package/build/cli/commands/build-static.js +0 -541
- package/build/cli/commands/clean-kv-store.d.ts +0 -3
- package/build/cli/commands/clean-kv-store.d.ts.map +0 -1
- package/build/cli/commands/clean-kv-store.js +0 -55
- package/build/cli/load-config.d.ts +0 -6
- package/build/cli/load-config.d.ts.map +0 -1
- package/build/cli/presets/implementations/astro.d.ts +0 -7
- package/build/cli/presets/implementations/astro.d.ts.map +0 -1
- package/build/cli/presets/implementations/astro.js +0 -23
- package/build/cli/presets/implementations/create-react-app.d.ts +0 -11
- package/build/cli/presets/implementations/create-react-app.d.ts.map +0 -1
- package/build/cli/presets/implementations/create-react-app.js +0 -34
- package/build/cli/presets/implementations/docusaurus.d.ts +0 -7
- package/build/cli/presets/implementations/docusaurus.d.ts.map +0 -1
- package/build/cli/presets/implementations/docusaurus.js +0 -13
- package/build/cli/presets/implementations/gatsby.d.ts +0 -7
- package/build/cli/presets/implementations/gatsby.d.ts.map +0 -1
- package/build/cli/presets/implementations/gatsby.js +0 -13
- package/build/cli/presets/implementations/next.d.ts +0 -7
- package/build/cli/presets/implementations/next.d.ts.map +0 -1
- package/build/cli/presets/implementations/next.js +0 -13
- package/build/cli/presets/implementations/sveltekit.d.ts +0 -7
- package/build/cli/presets/implementations/sveltekit.d.ts.map +0 -1
- package/build/cli/presets/implementations/sveltekit.js +0 -13
- package/build/cli/presets/implementations/vite.d.ts +0 -7
- package/build/cli/presets/implementations/vite.d.ts.map +0 -1
- package/build/cli/presets/implementations/vite.js +0 -13
- package/build/cli/presets/implementations/vue.d.ts +0 -7
- package/build/cli/presets/implementations/vue.d.ts.map +0 -1
- package/build/cli/presets/implementations/vue.js +0 -24
- package/build/cli/presets/index.d.ts +0 -3
- package/build/cli/presets/index.d.ts.map +0 -1
- package/build/cli/presets/index.js +0 -20
- package/build/cli/presets/preset-base.d.ts +0 -21
- package/build/cli/presets/preset-base.d.ts.map +0 -1
- package/build/cli/presets/preset-base.js +0 -1
- package/build/cli/util/fastly-api.d.ts +0 -10
- package/build/cli/util/fastly-api.d.ts.map +0 -1
- package/build/cli/util/fastly-api.js +0 -47
- package/build/cli/util/hash.d.ts +0 -5
- package/build/cli/util/hash.d.ts.map +0 -1
- package/build/cli/util/hash.js +0 -9
- package/build/cli/util/id.d.ts +0 -3
- package/build/cli/util/id.d.ts.map +0 -1
- package/build/cli/util/id.js +0 -17
- package/build/cli/util/kv-store.d.ts +0 -16
- package/build/cli/util/kv-store.d.ts.map +0 -1
- package/build/cli/util/publish-id.d.ts +0 -5
- package/build/cli/util/publish-id.d.ts.map +0 -1
- package/build/cli/util/publish-id.js +0 -26
- package/build/compute-js.d.ts +0 -3
- package/build/compute-js.d.ts.map +0 -1
- package/build/compute-js.js +0 -2
- package/build/constants/compression.d.ts.map +0 -1
- package/build/constants/compression.js +0 -4
- package/build/server/assets/asset-manager.d.ts +0 -8
- package/build/server/assets/asset-manager.d.ts.map +0 -1
- package/build/server/assets/asset-manager.js +0 -14
- package/build/server/assets/content-asset-kv-store.d.ts +0 -19
- package/build/server/assets/content-asset-kv-store.d.ts.map +0 -1
- package/build/server/assets/content-asset-kv-store.js +0 -70
- package/build/server/assets/content-asset-wasm-inline.d.ts +0 -18
- package/build/server/assets/content-asset-wasm-inline.d.ts.map +0 -1
- package/build/server/assets/content-asset-wasm-inline.js +0 -52
- package/build/server/assets/content-assets.d.ts +0 -46
- package/build/server/assets/content-assets.d.ts.map +0 -1
- package/build/server/assets/content-assets.js +0 -100
- package/build/server/assets/module-assets.d.ts +0 -23
- package/build/server/assets/module-assets.d.ts.map +0 -1
- package/build/server/assets/module-assets.js +0 -45
- package/build/server/kv-store/inline-store-entry.d.ts +0 -25
- package/build/server/kv-store/inline-store-entry.d.ts.map +0 -1
- package/build/server/kv-store/inline-store-entry.js +0 -100
- package/build/server/publisher-server.d.ts +0 -23
- package/build/server/publisher-server.d.ts.map +0 -1
- package/build/server/publisher-server.js +0 -257
- package/build/server/serve-preconditions/if-modified-since.d.ts +0 -4
- package/build/server/serve-preconditions/if-modified-since.d.ts.map +0 -1
- package/build/server/serve-preconditions/if-none-match.d.ts.map +0 -1
- package/build/server/util/http.d.ts +0 -2
- package/build/server/util/http.d.ts.map +0 -1
- package/build/server/util/http.js +0 -9
- package/build/types/compute.d.ts +0 -11
- package/build/types/compute.d.ts.map +0 -1
- package/build/types/compute.js +0 -1
- package/build/types/config-normalized.d.ts +0 -34
- package/build/types/config-normalized.d.ts.map +0 -1
- package/build/types/config-normalized.js +0 -1
- package/build/types/config.d.ts +0 -37
- package/build/types/config.d.ts.map +0 -1
- package/build/types/config.js +0 -1
- package/build/types/content-assets.d.ts +0 -55
- package/build/types/content-assets.d.ts.map +0 -1
- package/build/types/content-assets.js +0 -1
- package/build/types/content-types.d.ts +0 -11
- package/build/types/content-types.d.ts.map +0 -1
- package/build/types/content-types.js +0 -1
- package/build/types/index.d.ts +0 -7
- package/build/types/index.d.ts.map +0 -1
- package/build/types/index.js +0 -1
- package/build/types/module-assets.d.ts +0 -15
- package/build/types/module-assets.d.ts.map +0 -1
- package/build/types/module-assets.js +0 -1
- package/build/types/util.d.ts +0 -7
- package/build/types/util.d.ts.map +0 -1
- package/build/types/util.js +0 -1
- package/build/util/content-types.d.ts.map +0 -1
- package/build/util/index.d.ts +0 -3
- package/build/util/index.d.ts.map +0 -1
- package/build/util/index.js +0 -2
- package/build/util/metadata.d.ts +0 -3
- package/build/util/metadata.d.ts.map +0 -1
- package/build/util/metadata.js +0 -12
- package/resources/README.md +0 -3
- package/resources/statics-metadata.d.ts +0 -10
- package/resources/statics.d.ts +0 -19
- package/resources/webpack.config.js +0 -41
- /package/build/server/{serve-preconditions → publisher-server/serve-preconditions}/if-none-match.d.ts +0 -0
|
@@ -1,179 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Fastly, Inc.
|
|
3
|
+
* Licensed under the MIT license. See LICENSE file for details.
|
|
4
|
+
*/
|
|
5
|
+
import path from 'node:path';
|
|
3
6
|
import globToRegExp from 'glob-to-regexp';
|
|
4
|
-
import { buildNormalizeFunctionForArray, buildNormalizeFunctionForObject, isSpecified, isStringAndNotEmpty, } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { buildNormalizeFunctionForArray, buildNormalizeFunctionForObject, isSpecified, isStringAndNotEmpty, } from './data.js';
|
|
8
|
+
export class LoadConfigError extends Error {
|
|
9
|
+
constructor(configFilePath, errors) {
|
|
10
|
+
super(`Error loading config file ${configFilePath}`);
|
|
11
|
+
this.errors = errors;
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
}
|
|
14
|
+
export async function loadStaticPublisherRcFile() {
|
|
15
|
+
let configRaw;
|
|
16
|
+
const configFile = './static-publish.rc.js';
|
|
17
|
+
try {
|
|
18
|
+
const filePath = path.resolve(configFile);
|
|
19
|
+
configRaw = (await import(filePath)).default;
|
|
12
20
|
}
|
|
13
|
-
|
|
14
|
-
//
|
|
21
|
+
catch {
|
|
22
|
+
//
|
|
15
23
|
}
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
if (configRaw == null) {
|
|
25
|
+
throw new LoadConfigError(configFile, [
|
|
26
|
+
'Unable to load ' + configFile,
|
|
27
|
+
]);
|
|
18
28
|
}
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
const errors = [];
|
|
30
|
+
const config = normalizeStaticPublisherRc(configRaw, errors);
|
|
31
|
+
if (config == null) {
|
|
32
|
+
throw new LoadConfigError(configFile, errors);
|
|
33
|
+
}
|
|
34
|
+
return config;
|
|
35
|
+
}
|
|
36
|
+
export const normalizeStaticPublisherRc = buildNormalizeFunctionForObject((config, errors) => {
|
|
37
|
+
let { kvStoreName, publishId, defaultCollectionName, } = config;
|
|
38
|
+
if (!isSpecified(config, 'kvStoreName')) {
|
|
39
|
+
errors.push('kvStoreName must be specified.');
|
|
21
40
|
}
|
|
22
41
|
else {
|
|
23
|
-
if (
|
|
42
|
+
if (isStringAndNotEmpty(kvStoreName)) {
|
|
24
43
|
// ok
|
|
25
44
|
}
|
|
26
45
|
else {
|
|
27
|
-
errors.push('
|
|
46
|
+
errors.push('kvStoreName must be a non-empty string.');
|
|
28
47
|
}
|
|
29
48
|
}
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
test,
|
|
35
|
-
contentType,
|
|
36
|
-
text,
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
const normalizeContentTypeDefs = buildNormalizeFunctionForArray((config, errors) => {
|
|
40
|
-
return normalizeContentTypeDef(config, errors);
|
|
41
|
-
});
|
|
42
|
-
const normalizePublisherServerConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
43
|
-
let { publicDirPrefix, staticItems, compression, spaFile, notFoundPageFile, autoExt, autoIndex } = config;
|
|
44
|
-
if (!isSpecified(config, 'publicDirPrefix')) {
|
|
45
|
-
publicDirPrefix = '';
|
|
49
|
+
if (!isSpecified(config, 'publishId')) {
|
|
50
|
+
errors.push('publishId must be specified.');
|
|
46
51
|
}
|
|
47
52
|
else {
|
|
48
|
-
if (
|
|
53
|
+
if (isStringAndNotEmpty(publishId)) {
|
|
49
54
|
// ok
|
|
50
55
|
}
|
|
51
56
|
else {
|
|
52
|
-
errors.push('
|
|
57
|
+
errors.push('publishId must be a non-empty string.');
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
|
-
if (!isSpecified(config, '
|
|
56
|
-
|
|
60
|
+
if (!isSpecified(config, 'defaultCollectionName')) {
|
|
61
|
+
errors.push('defaultCollectionName must be specified.');
|
|
57
62
|
}
|
|
58
63
|
else {
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (!Array.isArray(staticItems)) {
|
|
63
|
-
staticItems = [staticItems];
|
|
64
|
-
}
|
|
65
|
-
if (staticItems.every((x) => typeof x === 'string')) {
|
|
66
|
-
staticItems = staticItems.map((x, index) => {
|
|
67
|
-
if (x.includes('*')) {
|
|
68
|
-
let re;
|
|
69
|
-
try {
|
|
70
|
-
const regexp = globToRegExp(x, { globstar: true });
|
|
71
|
-
re = 're:' + String(regexp);
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
errors.push(`staticItems item at index ${index}, '${x}', cannot be parsed as glob pattern.`);
|
|
75
|
-
re = null;
|
|
76
|
-
}
|
|
77
|
-
return re;
|
|
78
|
-
}
|
|
79
|
-
return x;
|
|
80
|
-
});
|
|
64
|
+
if (isStringAndNotEmpty(defaultCollectionName)) {
|
|
65
|
+
// ok
|
|
81
66
|
}
|
|
82
67
|
else {
|
|
83
|
-
errors.push('
|
|
68
|
+
errors.push('defaultCollectionName must be a non-empty string.');
|
|
84
69
|
}
|
|
85
70
|
}
|
|
86
|
-
|
|
87
|
-
|
|
71
|
+
return {
|
|
72
|
+
kvStoreName,
|
|
73
|
+
publishId,
|
|
74
|
+
defaultCollectionName,
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
export async function loadPublishContentConfigFile(configFile) {
|
|
78
|
+
let configRaw;
|
|
79
|
+
try {
|
|
80
|
+
const filePath = path.resolve(configFile);
|
|
81
|
+
configRaw = (await import(filePath)).default;
|
|
88
82
|
}
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
catch {
|
|
84
|
+
//
|
|
91
85
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (compression.some((x) => x !== 'br' && x !== 'gzip')) {
|
|
97
|
-
errors.push(`compression, if specified, must be null or an array and can only contain 'br' and 'gzip'.`);
|
|
98
|
-
}
|
|
86
|
+
if (configRaw == null) {
|
|
87
|
+
throw new LoadConfigError(configFile, [
|
|
88
|
+
'Unable to load ' + configFile,
|
|
89
|
+
]);
|
|
99
90
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (typeof spaFile === 'string' || spaFile === null) {
|
|
105
|
-
// ok
|
|
106
|
-
}
|
|
107
|
-
else if (spaFile === false) {
|
|
108
|
-
spaFile = null;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
errors.push('spaFile, if specified, must be a string value, false, or null');
|
|
112
|
-
}
|
|
91
|
+
const errors = [];
|
|
92
|
+
const config = normalizePublishContentConfig(configRaw, errors);
|
|
93
|
+
if (config == null) {
|
|
94
|
+
throw new LoadConfigError(configFile, errors);
|
|
113
95
|
}
|
|
114
|
-
|
|
115
|
-
|
|
96
|
+
return config;
|
|
97
|
+
}
|
|
98
|
+
const normalizeContentTypeDef = buildNormalizeFunctionForObject((config, errors) => {
|
|
99
|
+
let { test, contentType, text } = config;
|
|
100
|
+
if (typeof test === 'function' || test instanceof RegExp) {
|
|
101
|
+
// ok
|
|
116
102
|
}
|
|
117
103
|
else {
|
|
118
|
-
|
|
119
|
-
// ok
|
|
120
|
-
}
|
|
121
|
-
else if (notFoundPageFile === false) {
|
|
122
|
-
notFoundPageFile = null;
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
errors.push('notFoundPageFile, if specified, must be a string value, false, or null');
|
|
126
|
-
}
|
|
104
|
+
errors.push('test cannot be null.');
|
|
127
105
|
}
|
|
128
|
-
if (
|
|
129
|
-
|
|
106
|
+
if (isStringAndNotEmpty(contentType)) {
|
|
107
|
+
// ok
|
|
130
108
|
}
|
|
131
109
|
else {
|
|
132
|
-
|
|
133
|
-
// ok
|
|
134
|
-
}
|
|
135
|
-
else if (autoExt === false || autoExt === null) {
|
|
136
|
-
autoExt = [];
|
|
137
|
-
}
|
|
138
|
-
else if (typeof autoExt === 'string') {
|
|
139
|
-
autoExt = [autoExt];
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
errors.push('autoExt, if specified, must be an array of string values, a string value, false, or null');
|
|
143
|
-
}
|
|
110
|
+
errors.push('contentType must be a non-empty string.');
|
|
144
111
|
}
|
|
145
|
-
if (!isSpecified(config, '
|
|
146
|
-
|
|
112
|
+
if (!isSpecified(config, 'text')) {
|
|
113
|
+
text = true;
|
|
147
114
|
}
|
|
148
115
|
else {
|
|
149
|
-
if (
|
|
116
|
+
if (typeof text === 'boolean') {
|
|
150
117
|
// ok
|
|
151
118
|
}
|
|
152
|
-
else if (autoIndex === false || autoIndex === null) {
|
|
153
|
-
autoIndex = [];
|
|
154
|
-
}
|
|
155
|
-
else if (typeof autoIndex === 'string') {
|
|
156
|
-
autoIndex = [autoIndex];
|
|
157
|
-
}
|
|
158
119
|
else {
|
|
159
|
-
errors.push('
|
|
120
|
+
errors.push('text, if specified, must be a boolean value.');
|
|
160
121
|
}
|
|
161
122
|
}
|
|
162
123
|
if (errors.length > 0) {
|
|
163
124
|
return null;
|
|
164
125
|
}
|
|
165
126
|
return {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
spaFile,
|
|
170
|
-
notFoundPageFile,
|
|
171
|
-
autoExt,
|
|
172
|
-
autoIndex,
|
|
127
|
+
test,
|
|
128
|
+
contentType,
|
|
129
|
+
text,
|
|
173
130
|
};
|
|
174
131
|
});
|
|
175
|
-
const
|
|
176
|
-
|
|
132
|
+
const normalizeContentTypeDefs = buildNormalizeFunctionForArray((config, errors) => {
|
|
133
|
+
return normalizeContentTypeDef(config, errors);
|
|
134
|
+
});
|
|
135
|
+
export const normalizePublishContentConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
136
|
+
let { rootDir, staticPublisherWorkingDir, excludeDirs, excludeDotFiles, includeWellKnown, kvStoreAssetInclusionTest, contentCompression, contentTypes, server, } = config;
|
|
177
137
|
if (!isSpecified(config, 'rootDir')) {
|
|
178
138
|
errors.push('rootDir must be specified.');
|
|
179
139
|
}
|
|
@@ -185,34 +145,20 @@ const normalizeConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
|
185
145
|
errors.push('rootDir must be a non-empty string.');
|
|
186
146
|
}
|
|
187
147
|
}
|
|
188
|
-
if (!isSpecified(config, '
|
|
189
|
-
|
|
148
|
+
if (!isSpecified(config, 'staticPublisherWorkingDir')) {
|
|
149
|
+
errors.push('staticPublisherWorkingDir must be specified.');
|
|
190
150
|
}
|
|
191
151
|
else {
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
!
|
|
152
|
+
if (staticPublisherWorkingDir.startsWith('./') &&
|
|
153
|
+
staticPublisherWorkingDir !== './' &&
|
|
154
|
+
!staticPublisherWorkingDir.includes('//')) {
|
|
195
155
|
// ok
|
|
196
156
|
}
|
|
197
157
|
else {
|
|
198
|
-
errors.push('
|
|
199
|
-
}
|
|
200
|
-
while (staticContentRootDir.endsWith('/')) {
|
|
201
|
-
staticContentRootDir = staticContentRootDir.slice(0, -1);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (!isSpecified(config, 'kvStoreName')) {
|
|
205
|
-
kvStoreName = null;
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
if (isStringAndNotEmpty(kvStoreName) || kvStoreName === null) {
|
|
209
|
-
// ok
|
|
210
|
-
}
|
|
211
|
-
else if (kvStoreName === false) {
|
|
212
|
-
kvStoreName = null;
|
|
158
|
+
errors.push('staticPublisherWorkingDir must be a relative subdirectory.');
|
|
213
159
|
}
|
|
214
|
-
|
|
215
|
-
|
|
160
|
+
while (staticPublisherWorkingDir.endsWith('/')) {
|
|
161
|
+
staticPublisherWorkingDir = staticPublisherWorkingDir.slice(0, -1);
|
|
216
162
|
}
|
|
217
163
|
}
|
|
218
164
|
if (!isSpecified(config, 'excludeDotFiles')) {
|
|
@@ -274,22 +220,17 @@ const normalizeConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
|
274
220
|
if (excludeDirs.some((x) => x == null)) {
|
|
275
221
|
errors.push('excludeDirs, if specified, must be null, a string value, a RegExp, or an array of strings and RegExp values.');
|
|
276
222
|
}
|
|
277
|
-
if (!isSpecified(config, '
|
|
278
|
-
|
|
223
|
+
if (!isSpecified(config, 'kvStoreAssetInclusionTest')) {
|
|
224
|
+
kvStoreAssetInclusionTest = null;
|
|
279
225
|
}
|
|
280
|
-
else if (
|
|
226
|
+
else if (kvStoreAssetInclusionTest === null || typeof kvStoreAssetInclusionTest === 'function') {
|
|
281
227
|
// ok
|
|
282
228
|
}
|
|
283
229
|
else {
|
|
284
|
-
errors.push('
|
|
230
|
+
errors.push('kvStoreAssetInclusionTest, if specified, must be null or a function.');
|
|
285
231
|
}
|
|
286
232
|
if (!isSpecified(config, 'contentCompression')) {
|
|
287
|
-
|
|
288
|
-
contentCompression = ['br', 'gzip'];
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
contentCompression = [];
|
|
292
|
-
}
|
|
233
|
+
contentCompression = ['br', 'gzip'];
|
|
293
234
|
}
|
|
294
235
|
else if (contentCompression === null) {
|
|
295
236
|
contentCompression = [];
|
|
@@ -302,15 +243,6 @@ const normalizeConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
|
302
243
|
errors.push(`contentCompression, if specified, must be null or an array and can only contain 'br' and 'gzip'.`);
|
|
303
244
|
}
|
|
304
245
|
}
|
|
305
|
-
if (!isSpecified(config, 'moduleAssetInclusionTest')) {
|
|
306
|
-
moduleAssetInclusionTest = null;
|
|
307
|
-
}
|
|
308
|
-
else if (moduleAssetInclusionTest === null || typeof moduleAssetInclusionTest === 'function') {
|
|
309
|
-
// ok
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
errors.push('moduleAssetInclusionTest, if specified, must be null or a function.');
|
|
313
|
-
}
|
|
314
246
|
if (!isSpecified(config, 'contentTypes')) {
|
|
315
247
|
contentTypes = [];
|
|
316
248
|
}
|
|
@@ -352,31 +284,146 @@ const normalizeConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
|
352
284
|
}
|
|
353
285
|
return {
|
|
354
286
|
rootDir,
|
|
355
|
-
|
|
356
|
-
|
|
287
|
+
staticPublisherWorkingDir,
|
|
288
|
+
excludeDirs,
|
|
357
289
|
excludeDotFiles,
|
|
358
290
|
includeWellKnown,
|
|
359
|
-
|
|
360
|
-
contentAssetInclusionTest,
|
|
291
|
+
kvStoreAssetInclusionTest,
|
|
361
292
|
contentCompression,
|
|
362
|
-
moduleAssetInclusionTest,
|
|
363
293
|
contentTypes,
|
|
364
294
|
server,
|
|
365
295
|
};
|
|
366
296
|
});
|
|
367
|
-
export
|
|
368
|
-
let
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
try {
|
|
372
|
-
raw = (await import(staticPublishRcFileURL)).default;
|
|
297
|
+
export const normalizePublisherServerConfig = buildNormalizeFunctionForObject((config, errors) => {
|
|
298
|
+
let { publicDirPrefix, staticItems, allowedEncodings, spaFile, notFoundPageFile, autoExt, autoIndex, } = config;
|
|
299
|
+
if (!isSpecified(config, 'publicDirPrefix')) {
|
|
300
|
+
publicDirPrefix = '';
|
|
373
301
|
}
|
|
374
|
-
|
|
375
|
-
|
|
302
|
+
else {
|
|
303
|
+
if (typeof publicDirPrefix === 'string') {
|
|
304
|
+
// ok
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
errors.push('publicDirPrefix, if specified, must be a string value.');
|
|
308
|
+
}
|
|
376
309
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
normalized = normalizeConfig(raw, errors);
|
|
310
|
+
if (!isSpecified(config, 'staticItems')) {
|
|
311
|
+
staticItems = [];
|
|
380
312
|
}
|
|
381
|
-
|
|
382
|
-
|
|
313
|
+
else {
|
|
314
|
+
if (staticItems === null || staticItems === false) {
|
|
315
|
+
staticItems = [];
|
|
316
|
+
}
|
|
317
|
+
if (!Array.isArray(staticItems)) {
|
|
318
|
+
staticItems = [staticItems];
|
|
319
|
+
}
|
|
320
|
+
if (staticItems.every((x) => typeof x === 'string')) {
|
|
321
|
+
staticItems = staticItems.map((x, index) => {
|
|
322
|
+
if (x.includes('*')) {
|
|
323
|
+
let re;
|
|
324
|
+
try {
|
|
325
|
+
const regexp = globToRegExp(x, { globstar: true });
|
|
326
|
+
re = 're:' + String(regexp);
|
|
327
|
+
}
|
|
328
|
+
catch {
|
|
329
|
+
errors.push(`staticItems item at index ${index}, '${x}', cannot be parsed as glob pattern.`);
|
|
330
|
+
re = null;
|
|
331
|
+
}
|
|
332
|
+
return re;
|
|
333
|
+
}
|
|
334
|
+
return x;
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
errors.push('staticItems, if specified, must be a string value, an array of string values, false, or null');
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (!isSpecified(config, 'allowedEncodings')) {
|
|
342
|
+
allowedEncodings = ['br', 'gzip'];
|
|
343
|
+
}
|
|
344
|
+
else if (allowedEncodings === null) {
|
|
345
|
+
allowedEncodings = [];
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
if (!Array.isArray(allowedEncodings)) {
|
|
349
|
+
allowedEncodings = [allowedEncodings];
|
|
350
|
+
}
|
|
351
|
+
if (allowedEncodings.some((x) => x !== 'br' && x !== 'gzip')) {
|
|
352
|
+
errors.push(`allowedEncodings, if specified, must be null or an array and can only contain 'br' and 'gzip'.`);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (!isSpecified(config, 'spaFile')) {
|
|
356
|
+
spaFile = null;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
if (typeof spaFile === 'string' || spaFile === null) {
|
|
360
|
+
// ok
|
|
361
|
+
}
|
|
362
|
+
else if (spaFile === false) {
|
|
363
|
+
spaFile = null;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
errors.push('spaFile, if specified, must be a string value, false, or null');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
if (!isSpecified(config, 'notFoundPageFile')) {
|
|
370
|
+
notFoundPageFile = null;
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
if (typeof notFoundPageFile === 'string' || notFoundPageFile === null) {
|
|
374
|
+
// ok
|
|
375
|
+
}
|
|
376
|
+
else if (notFoundPageFile === false) {
|
|
377
|
+
notFoundPageFile = null;
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
errors.push('notFoundPageFile, if specified, must be a string value, false, or null');
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (!isSpecified(config, 'autoExt')) {
|
|
384
|
+
autoExt = [];
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
if (Array.isArray(autoExt) && autoExt.every(e => typeof e === 'string')) {
|
|
388
|
+
// ok
|
|
389
|
+
}
|
|
390
|
+
else if (autoExt === false || autoExt === null) {
|
|
391
|
+
autoExt = [];
|
|
392
|
+
}
|
|
393
|
+
else if (typeof autoExt === 'string') {
|
|
394
|
+
autoExt = [autoExt];
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
errors.push('autoExt, if specified, must be an array of string values, a string value, false, or null');
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (!isSpecified(config, 'autoIndex')) {
|
|
401
|
+
autoIndex = [];
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
if (Array.isArray(autoIndex) && autoIndex.every(e => typeof e === 'string')) {
|
|
405
|
+
// ok
|
|
406
|
+
}
|
|
407
|
+
else if (autoIndex === false || autoIndex === null) {
|
|
408
|
+
autoIndex = [];
|
|
409
|
+
}
|
|
410
|
+
else if (typeof autoIndex === 'string') {
|
|
411
|
+
autoIndex = [autoIndex];
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
errors.push('autoIndex, if specified, must be an array of string values, a string value, false, or null');
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
if (errors.length > 0) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
return {
|
|
421
|
+
publicDirPrefix,
|
|
422
|
+
staticItems,
|
|
423
|
+
allowedEncodings,
|
|
424
|
+
spaFile,
|
|
425
|
+
notFoundPageFile,
|
|
426
|
+
autoExt,
|
|
427
|
+
autoIndex,
|
|
428
|
+
};
|
|
429
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ContentTypeDef, ContentTypeTestResult } from
|
|
2
|
-
export declare function getDefaultContentTypes(): ContentTypeDef[];
|
|
1
|
+
import { type ContentTypeDef, type ContentTypeTestResult } from '../../models/config/publish-content-config.js';
|
|
3
2
|
export declare function mergeContentTypes(contentTypes: ContentTypeDef[]): ContentTypeDef[];
|
|
4
3
|
export declare function testFileContentType(contentTypes: ContentTypeDef[] | null | undefined, assetKey: string): ContentTypeTestResult | null;
|
|
5
4
|
//# sourceMappingURL=content-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-types.d.ts","sourceRoot":"","sources":["../../../src/cli/util/content-types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,+CAA+C,CAAC;AAqCvD,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,cAAc,EAAE,oBAmD/D;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAkBrI"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Fastly, Inc.
|
|
3
|
+
* Licensed under the MIT license. See LICENSE file for details.
|
|
4
|
+
*/
|
|
1
5
|
const defaultContentTypes = [
|
|
2
6
|
// Text formats
|
|
3
7
|
{ test: /\.txt$/, contentType: 'text/plain', text: true },
|
|
@@ -9,7 +13,7 @@ const defaultContentTypes = [
|
|
|
9
13
|
{ test: /\.css$/, contentType: 'text/css', text: true },
|
|
10
14
|
{ test: /\.svg$/, contentType: 'image/svg+xml', text: true },
|
|
11
15
|
// Binary formats
|
|
12
|
-
{ test: /\.bmp$/, contentType: 'image/bmp', text: false },
|
|
16
|
+
{ test: /\.bmp$/, contentType: 'image/bmp', text: false, precompressAsset: true, },
|
|
13
17
|
{ test: /\.png$/, contentType: 'image/png', text: false },
|
|
14
18
|
{ test: /\.gif$/, contentType: 'image/gif', text: false },
|
|
15
19
|
{ test: /\.jp(e)?g$/, contentType: 'image/jpeg', text: false },
|
|
@@ -23,7 +27,7 @@ const defaultContentTypes = [
|
|
|
23
27
|
{ test: /\.mpeg$/, contentType: 'video/mpeg', text: false },
|
|
24
28
|
{ test: /\.webm$/, contentType: 'video/webm', text: false },
|
|
25
29
|
{ test: /\.pdf$/, contentType: 'application/pdf', text: false },
|
|
26
|
-
{ test: /\.tar$/, contentType: 'application/x-tar', text: false },
|
|
30
|
+
{ test: /\.tar$/, contentType: 'application/x-tar', text: false, precompressAsset: true, },
|
|
27
31
|
{ test: /\.zip$/, contentType: 'application/zip', text: false },
|
|
28
32
|
{ test: /\.eot$/, contentType: 'application/vnd.ms-fontobject', text: false },
|
|
29
33
|
{ test: /\.otf$/, contentType: 'font/otf', text: false },
|
|
@@ -31,9 +35,6 @@ const defaultContentTypes = [
|
|
|
31
35
|
{ test: /\.woff$/, contentType: 'font/woff', text: false },
|
|
32
36
|
{ test: /\.woff2$/, contentType: 'font/woff2', text: false },
|
|
33
37
|
];
|
|
34
|
-
export function getDefaultContentTypes() {
|
|
35
|
-
return defaultContentTypes;
|
|
36
|
-
}
|
|
37
38
|
export function mergeContentTypes(contentTypes) {
|
|
38
39
|
const finalContentTypes = [];
|
|
39
40
|
if (!Array.isArray(contentTypes)) {
|
|
@@ -86,7 +87,11 @@ export function testFileContentType(contentTypes, assetKey) {
|
|
|
86
87
|
matched = contentType.test(assetKey);
|
|
87
88
|
}
|
|
88
89
|
if (matched) {
|
|
89
|
-
return {
|
|
90
|
+
return {
|
|
91
|
+
contentType: contentType.contentType,
|
|
92
|
+
text: Boolean(contentType.text ?? false),
|
|
93
|
+
precompressAsset: Boolean(contentType.precompressAsset ?? contentType.text ?? false)
|
|
94
|
+
};
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
return null;
|
package/build/cli/util/data.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type NormalizeAction<T> = (value:
|
|
2
|
-
export declare function buildNormalizeFunctionForObject<TObject>(action: NormalizeAction<TObject>): (obj:
|
|
3
|
-
export declare function buildNormalizeFunctionForArray<TEntry>(action: NormalizeAction<TEntry>): (obj:
|
|
1
|
+
export type NormalizeAction<T> = (value: Record<string, any>, errors: string[]) => T | null;
|
|
2
|
+
export declare function buildNormalizeFunctionForObject<TObject>(action: NormalizeAction<TObject>): (obj: unknown, errCtx?: string[]) => TObject | null;
|
|
3
|
+
export declare function buildNormalizeFunctionForArray<TEntry>(action: NormalizeAction<TEntry>): (obj: unknown, errCtx?: string[]) => TEntry[] | null;
|
|
4
4
|
export declare function isStringAndNotEmpty(str: unknown): str is string;
|
|
5
5
|
export declare function isSpecified(obj: any, key: string): boolean;
|
|
6
6
|
export declare function applyDefaults<T extends Record<string, unknown>>(data: Partial<T> | null, defaults: T): T & Partial<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/cli/util/data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/cli/util/data.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;AAE5F,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,IAE/E,KAAK,OAAO,EAAE,SAAQ,MAAM,EAAO,KAAG,OAAO,GAAG,IAAI,CAmB7D;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,IAE5E,KAAK,OAAO,EAAE,SAAQ,MAAM,EAAO,KAAG,MAAM,EAAE,GAAG,IAAI,CAgC9D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAE/D;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAC,GAAG,EAAE,GAAG,EAAE,MAAM,WAE/C;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,kBAYpG"}
|
package/build/cli/util/data.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Fastly, Inc.
|
|
3
|
+
* Licensed under the MIT license. See LICENSE file for details.
|
|
4
|
+
*/
|
|
1
5
|
export function buildNormalizeFunctionForObject(action) {
|
|
2
6
|
return (obj, errCtx = []) => {
|
|
3
|
-
if (obj == null) {
|
|
4
|
-
errCtx.push('obj
|
|
7
|
+
if (obj == null || typeof obj !== 'object') {
|
|
8
|
+
errCtx.push('obj must be an object.');
|
|
5
9
|
return null;
|
|
6
10
|
}
|
|
7
11
|
const errors = [];
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
export interface FilenameTest {
|
|
2
2
|
test(name: string): boolean;
|
|
3
3
|
}
|
|
4
|
-
export type
|
|
4
|
+
export type EnumerateFilesOpts = {
|
|
5
5
|
publicDirRoot: string;
|
|
6
6
|
excludeDirs: FilenameTest[];
|
|
7
7
|
excludeDotFiles: boolean;
|
|
8
8
|
includeWellKnown: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function enumerateFiles(opts: EnumerateFilesOpts): string[];
|
|
11
|
+
export declare function getFileSize(filePath: string): number;
|
|
12
|
+
export declare function directoryExists(dirPath: string): boolean;
|
|
13
|
+
export declare function calculateFileSizeAndHash(filePath: string): Promise<{
|
|
14
|
+
size: number;
|
|
15
|
+
hash: string;
|
|
16
|
+
}>;
|
|
17
|
+
export declare function rootRelative(itemPath: string): string;
|
|
18
|
+
export declare function dotRelative(from: string | null, to: string): string;
|
|
11
19
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/cli/util/files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/cli/util/files.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,YAAY,EAAE,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,YAItD;AAoCD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,UAG3C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,WAU9C;AAED,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM;UAQlC,MAAM;UAAQ,MAAM;GAgBhD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,UAE5C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,UAG1D"}
|