@rushstack/rush-amazon-s3-build-cache-plugin 5.97.1 → 5.98.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.
@@ -1 +1 @@
1
- {"version":3,"file":"RushAmazonS3BuildCachePlugin.d.ts","sourceRoot":"","sources":["../src/RushAmazonS3BuildCachePlugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAcvF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IACvD,UAAU,EAAE,MAAM,CAAe;IAEjC,KAAK,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI;CAoD5E"}
1
+ {"version":3,"file":"RushAmazonS3BuildCachePlugin.d.ts","sourceRoot":"","sources":["../src/RushAmazonS3BuildCachePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQvF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IACvD,UAAU,EAAE,MAAM,CAAe;IAEjC,KAAK,CAAC,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI;CAmD5E"}
@@ -1,10 +1,31 @@
1
1
  "use strict";
2
2
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
3
  // See LICENSE in the project root for license information.
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
4
27
  Object.defineProperty(exports, "__esModule", { value: true });
5
28
  exports.RushAmazonS3BuildCachePlugin = void 0;
6
- const node_core_library_1 = require("@rushstack/node-core-library");
7
- const AmazonS3BuildCacheProviderModule = node_core_library_1.Import.lazy('./AmazonS3BuildCacheProvider', require);
8
29
  const PLUGIN_NAME = 'AmazonS3BuildCachePlugin';
9
30
  /**
10
31
  * @public
@@ -15,7 +36,7 @@ class RushAmazonS3BuildCachePlugin {
15
36
  }
16
37
  apply(rushSession, rushConfig) {
17
38
  rushSession.hooks.initialize.tap(PLUGIN_NAME, () => {
18
- rushSession.registerCloudBuildCacheProviderFactory('amazon-s3', (buildCacheConfig) => {
39
+ rushSession.registerCloudBuildCacheProviderFactory('amazon-s3', async (buildCacheConfig) => {
19
40
  const { amazonS3Configuration } = buildCacheConfig;
20
41
  let options;
21
42
  const { s3Endpoint, s3Bucket, s3Region } = amazonS3Configuration;
@@ -49,7 +70,8 @@ class RushAmazonS3BuildCachePlugin {
49
70
  if (!options) {
50
71
  throw new Error('You must provide either an s3Endpoint or s3Bucket');
51
72
  }
52
- return new AmazonS3BuildCacheProviderModule.AmazonS3BuildCacheProvider(options, rushSession);
73
+ const { AmazonS3BuildCacheProvider } = await Promise.resolve().then(() => __importStar(require('./AmazonS3BuildCacheProvider')));
74
+ return new AmazonS3BuildCacheProvider(options, rushSession);
53
75
  });
54
76
  });
55
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RushAmazonS3BuildCachePlugin.js","sourceRoot":"","sources":["../src/RushAmazonS3BuildCachePlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,oEAAsD;AAQtD,MAAM,gCAAgC,GAAkD,0BAAM,CAAC,IAAI,CACjG,8BAA8B,EAC9B,OAAO,CACR,CAAC;AAEF,MAAM,WAAW,GAAW,0BAA0B,CAAC;AAgCvD;;GAEG;AACH,MAAa,4BAA4B;IAAzC;QACS,eAAU,GAAW,WAAW,CAAC;IAsD1C,CAAC;IApDQ,KAAK,CAAC,WAAwB,EAAE,UAA6B;QAClE,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE;YACjD,WAAW,CAAC,sCAAsC,CAChD,WAAW,EACX,CAAC,gBAAgB,EAA8B,EAAE;gBAI/C,MAAM,EAAE,qBAAqB,EAAE,GAAG,gBAA+B,CAAC;gBAClE,IAAI,OAGS,CAAC;gBACd,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,qBAAqB,CAAC;gBACjE,MAAM,QAAQ,GAAuB,qBAAqB,CAAC,QAAQ,IAAI,SAAS,CAAC;gBACjF,MAAM,mBAAmB,GAAY,CAAC,CAAC,qBAAqB,CAAC,mBAAmB,CAAC;gBAEjF,IAAI,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACnC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;iBACzD;gBAED,qBAAqB;gBACrB,IAAI,QAAQ,IAAI,UAAU,EAAE;oBAC1B,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;iBAC7E;gBAED,IAAI,UAAU,EAAE;oBACd,OAAO,GAAG;wBACR,6CAA6C;wBAC7C,QAAQ;wBACR,UAAU;wBACV,QAAQ;wBACR,mBAAmB;qBACpB,CAAC;iBACH;gBACD,IAAI,QAAQ,EAAE;oBACZ,OAAO,GAAG;wBACR,2CAA2C;wBAC3C,QAAQ;wBACR,QAAQ;wBACR,QAAQ;wBACR,mBAAmB;qBACpB,CAAC;iBACH;gBACD,IAAI,CAAC,OAAO,EAAE;oBACZ,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;iBACtE;gBACD,OAAO,IAAI,gCAAgC,CAAC,0BAA0B,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAC/F,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvDD,oEAuDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { Import } from '@rushstack/node-core-library';\nimport type { IRushPlugin, RushSession, RushConfiguration } from '@rushstack/rush-sdk';\nimport type {\n AmazonS3BuildCacheProvider,\n IAmazonS3BuildCacheProviderOptionsAdvanced,\n IAmazonS3BuildCacheProviderOptionsSimple\n} from './AmazonS3BuildCacheProvider';\n\nconst AmazonS3BuildCacheProviderModule: typeof import('./AmazonS3BuildCacheProvider') = Import.lazy(\n './AmazonS3BuildCacheProvider',\n require\n);\n\nconst PLUGIN_NAME: string = 'AmazonS3BuildCachePlugin';\n\n/**\n * @public\n */\nexport interface IAmazonS3ConfigurationJson {\n /**\n * (Required unless s3Endpoint is specified) The name of the bucket to use for build cache (e.g. \"my-bucket\").\n */\n s3Bucket?: string;\n\n /**\n * (Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache (e.g. \"my-bucket.s3.us-east-2.amazonaws.com\" or \"http://localhost:9000\").\n */\n s3Endpoint?: string;\n\n /**\n * The Amazon S3 region of the bucket to use for build cache (e.g. \"us-east-1\").\n */\n s3Region: string;\n\n /**\n * An optional prefix (\"folder\") for cache items.\n */\n s3Prefix?: string;\n\n /**\n * If set to true, allow writing to the cache. Defaults to false.\n */\n isCacheWriteAllowed?: boolean;\n}\n\n/**\n * @public\n */\nexport class RushAmazonS3BuildCachePlugin implements IRushPlugin {\n public pluginName: string = PLUGIN_NAME;\n\n public apply(rushSession: RushSession, rushConfig: RushConfiguration): void {\n rushSession.hooks.initialize.tap(PLUGIN_NAME, () => {\n rushSession.registerCloudBuildCacheProviderFactory(\n 'amazon-s3',\n (buildCacheConfig): AmazonS3BuildCacheProvider => {\n type IBuildCache = typeof buildCacheConfig & {\n amazonS3Configuration: IAmazonS3ConfigurationJson;\n };\n const { amazonS3Configuration } = buildCacheConfig as IBuildCache;\n let options:\n | IAmazonS3BuildCacheProviderOptionsAdvanced\n | IAmazonS3BuildCacheProviderOptionsSimple\n | undefined;\n const { s3Endpoint, s3Bucket, s3Region } = amazonS3Configuration;\n const s3Prefix: undefined | string = amazonS3Configuration.s3Prefix || undefined;\n const isCacheWriteAllowed: boolean = !!amazonS3Configuration.isCacheWriteAllowed;\n\n if (s3Prefix && s3Prefix[0] === '/') {\n throw new Error('s3Prefix should not have a leading /');\n }\n\n // mutually exclusive\n if (s3Bucket && s3Endpoint) {\n throw new Error('Only one of \"s3Bucket\" or \"s3Endpoint\" must be provided.');\n }\n\n if (s3Endpoint) {\n options = {\n // IAmazonS3BuildCacheProviderOptionsAdvanced\n s3Region,\n s3Endpoint,\n s3Prefix,\n isCacheWriteAllowed\n };\n }\n if (s3Bucket) {\n options = {\n // IAmazonS3BuildCacheProviderOptionsSimple\n s3Region,\n s3Bucket,\n s3Prefix,\n isCacheWriteAllowed\n };\n }\n if (!options) {\n throw new Error('You must provide either an s3Endpoint or s3Bucket');\n }\n return new AmazonS3BuildCacheProviderModule.AmazonS3BuildCacheProvider(options, rushSession);\n }\n );\n });\n }\n}\n"]}
1
+ {"version":3,"file":"RushAmazonS3BuildCachePlugin.js","sourceRoot":"","sources":["../src/RushAmazonS3BuildCachePlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAQ3D,MAAM,WAAW,GAAW,0BAA0B,CAAC;AAgCvD;;GAEG;AACH,MAAa,4BAA4B;IAAzC;QACS,eAAU,GAAW,WAAW,CAAC;IAqD1C,CAAC;IAnDQ,KAAK,CAAC,WAAwB,EAAE,UAA6B;QAClE,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE;YACjD,WAAW,CAAC,sCAAsC,CAAC,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE;gBAIzF,MAAM,EAAE,qBAAqB,EAAE,GAAG,gBAA+B,CAAC;gBAClE,IAAI,OAGS,CAAC;gBACd,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,qBAAqB,CAAC;gBACjE,MAAM,QAAQ,GAAuB,qBAAqB,CAAC,QAAQ,IAAI,SAAS,CAAC;gBACjF,MAAM,mBAAmB,GAAY,CAAC,CAAC,qBAAqB,CAAC,mBAAmB,CAAC;gBAEjF,IAAI,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACnC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;iBACzD;gBAED,qBAAqB;gBACrB,IAAI,QAAQ,IAAI,UAAU,EAAE;oBAC1B,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;iBAC7E;gBAED,IAAI,UAAU,EAAE;oBACd,OAAO,GAAG;wBACR,6CAA6C;wBAC7C,QAAQ;wBACR,UAAU;wBACV,QAAQ;wBACR,mBAAmB;qBACpB,CAAC;iBACH;gBACD,IAAI,QAAQ,EAAE;oBACZ,OAAO,GAAG;wBACR,2CAA2C;wBAC3C,QAAQ;wBACR,QAAQ;wBACR,QAAQ;wBACR,mBAAmB;qBACpB,CAAC;iBACH;gBACD,IAAI,CAAC,OAAO,EAAE;oBACZ,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;iBACtE;gBAED,MAAM,EAAE,0BAA0B,EAAE,GAAG,wDAAa,8BAA8B,GAAC,CAAC;gBACpF,OAAO,IAAI,0BAA0B,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;YAC9D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtDD,oEAsDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { IRushPlugin, RushSession, RushConfiguration } from '@rushstack/rush-sdk';\nimport type {\n IAmazonS3BuildCacheProviderOptionsAdvanced,\n IAmazonS3BuildCacheProviderOptionsSimple\n} from './AmazonS3BuildCacheProvider';\n\nconst PLUGIN_NAME: string = 'AmazonS3BuildCachePlugin';\n\n/**\n * @public\n */\nexport interface IAmazonS3ConfigurationJson {\n /**\n * (Required unless s3Endpoint is specified) The name of the bucket to use for build cache (e.g. \"my-bucket\").\n */\n s3Bucket?: string;\n\n /**\n * (Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache (e.g. \"my-bucket.s3.us-east-2.amazonaws.com\" or \"http://localhost:9000\").\n */\n s3Endpoint?: string;\n\n /**\n * The Amazon S3 region of the bucket to use for build cache (e.g. \"us-east-1\").\n */\n s3Region: string;\n\n /**\n * An optional prefix (\"folder\") for cache items.\n */\n s3Prefix?: string;\n\n /**\n * If set to true, allow writing to the cache. Defaults to false.\n */\n isCacheWriteAllowed?: boolean;\n}\n\n/**\n * @public\n */\nexport class RushAmazonS3BuildCachePlugin implements IRushPlugin {\n public pluginName: string = PLUGIN_NAME;\n\n public apply(rushSession: RushSession, rushConfig: RushConfiguration): void {\n rushSession.hooks.initialize.tap(PLUGIN_NAME, () => {\n rushSession.registerCloudBuildCacheProviderFactory('amazon-s3', async (buildCacheConfig) => {\n type IBuildCache = typeof buildCacheConfig & {\n amazonS3Configuration: IAmazonS3ConfigurationJson;\n };\n const { amazonS3Configuration } = buildCacheConfig as IBuildCache;\n let options:\n | IAmazonS3BuildCacheProviderOptionsAdvanced\n | IAmazonS3BuildCacheProviderOptionsSimple\n | undefined;\n const { s3Endpoint, s3Bucket, s3Region } = amazonS3Configuration;\n const s3Prefix: undefined | string = amazonS3Configuration.s3Prefix || undefined;\n const isCacheWriteAllowed: boolean = !!amazonS3Configuration.isCacheWriteAllowed;\n\n if (s3Prefix && s3Prefix[0] === '/') {\n throw new Error('s3Prefix should not have a leading /');\n }\n\n // mutually exclusive\n if (s3Bucket && s3Endpoint) {\n throw new Error('Only one of \"s3Bucket\" or \"s3Endpoint\" must be provided.');\n }\n\n if (s3Endpoint) {\n options = {\n // IAmazonS3BuildCacheProviderOptionsAdvanced\n s3Region,\n s3Endpoint,\n s3Prefix,\n isCacheWriteAllowed\n };\n }\n if (s3Bucket) {\n options = {\n // IAmazonS3BuildCacheProviderOptionsSimple\n s3Region,\n s3Bucket,\n s3Prefix,\n isCacheWriteAllowed\n };\n }\n if (!options) {\n throw new Error('You must provide either an s3Endpoint or s3Bucket');\n }\n\n const { AmazonS3BuildCacheProvider } = await import('./AmazonS3BuildCacheProvider');\n return new AmazonS3BuildCacheProvider(options, rushSession);\n });\n });\n }\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.4"
8
+ "packageVersion": "7.34.9"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-amazon-s3-build-cache-plugin",
3
- "version": "5.97.1",
3
+ "version": "5.98.0",
4
4
  "description": "Rush plugin for Amazon S3 cloud build cache",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,17 +14,17 @@
14
14
  "dependencies": {
15
15
  "https-proxy-agent": "~5.0.0",
16
16
  "node-fetch": "2.6.7",
17
- "@rushstack/node-core-library": "3.55.2",
18
- "@rushstack/rush-sdk": "5.97.1"
17
+ "@rushstack/node-core-library": "3.59.0",
18
+ "@rushstack/rush-sdk": "5.98.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/heft-jest": "1.0.1",
22
22
  "@types/node": "14.18.36",
23
23
  "@types/node-fetch": "2.6.2",
24
- "@microsoft/rush-lib": "5.97.1",
24
+ "@microsoft/rush-lib": "5.98.0",
25
25
  "@rushstack/eslint-config": "3.2.0",
26
- "@rushstack/heft": "0.50.0",
27
- "@rushstack/heft-node-rig": "1.12.6"
26
+ "@rushstack/heft": "0.50.5",
27
+ "@rushstack/heft-node-rig": "1.12.11"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "heft build --clean",