turborepo-remote-cache 1.7.4 → 1.9.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/README.md +10 -10
- package/build/app.js +4 -4
- package/build/app.js.map +1 -1
- package/build/env.js +2 -2
- package/build/env.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/logger.js +1 -1
- package/build/logger.js.map +1 -1
- package/build/plugins/config.js +1 -1
- package/build/plugins/config.js.map +1 -1
- package/build/plugins/remote-cache/index.js +1 -0
- package/build/plugins/remote-cache/index.js.map +1 -1
- package/build/plugins/remote-cache/routes/get-status.js +14 -0
- package/build/plugins/remote-cache/routes/get-status.js.map +1 -0
- package/build/plugins/remote-cache/routes/index.js +3 -1
- package/build/plugins/remote-cache/routes/index.js.map +1 -1
- package/build/plugins/remote-cache/routes/status-schema.js +11 -0
- package/build/plugins/remote-cache/routes/status-schema.js.map +1 -0
- package/build/plugins/remote-cache/storage/local.js +1 -1
- package/build/plugins/remote-cache/storage/local.js.map +1 -1
- package/build/plugins/remote-cache/storage/s3.js +9 -3
- package/build/plugins/remote-cache/storage/s3.js.map +1 -1
- package/package.json +8 -12
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
 [](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/ci.yml) [](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/release.yml) [](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/docker.yml) [](https://coveralls.io/github/ducktors/turborepo-remote-cache?branch=main) [](https://hub.docker.com/r/fox1t/turborepo-remote-cache) [](
|
|
4
|
-
[](https://github.com/ducktors/turborepo-remote-cache/releases) [](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/ci.yml) [](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/release.yml) [](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/docker.yml) [](https://coveralls.io/github/ducktors/turborepo-remote-cache?branch=main) [](https://hub.docker.com/r/fox1t/turborepo-remote-cache) [](https://www.npmjs.com/package/turborepo-remote-cache) [](https://github.com/semantic-release/semantic-release) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
4
|
+
[](#contributors-)
|
|
5
5
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
6
6
|
|
|
7
7
|
|
|
@@ -18,24 +18,23 @@ It supports several storage providers and deploys environments. Moreover, the pr
|
|
|
18
18
|
- [x] AWS S3
|
|
19
19
|
- [x] Google Cloud Storage
|
|
20
20
|
- [ ] Azure Blob Storage (PR welcome)
|
|
21
|
-
- [ ] Google Drive Blobs (PR welcome)
|
|
22
21
|
|
|
23
22
|
[Full documentation is available here](https://ducktors.github.io/turborepo-remote-cache/supported-storage-providers)
|
|
24
23
|
|
|
25
24
|
## Contribute to this project
|
|
26
|
-
1. Clone this repository
|
|
25
|
+
1. Clone this repository
|
|
27
26
|
|
|
28
27
|
```git clone git@github.com:ducktors/turborepo-remote-cache.git```
|
|
29
28
|
|
|
30
|
-
2. Move inside repository folder
|
|
29
|
+
2. Move inside repository folder
|
|
31
30
|
|
|
32
31
|
```cd turborepo-remote-cache```
|
|
33
32
|
|
|
34
|
-
3. Install dependencies
|
|
33
|
+
3. Install dependencies
|
|
35
34
|
|
|
36
|
-
```
|
|
35
|
+
```pnpm install```
|
|
37
36
|
|
|
38
|
-
4. Copy example variables
|
|
37
|
+
4. Copy example variables
|
|
39
38
|
|
|
40
39
|
```cp .env.example .env```
|
|
41
40
|
|
|
@@ -43,11 +42,11 @@ It supports several storage providers and deploys environments. Moreover, the pr
|
|
|
43
42
|
|
|
44
43
|
6. Run the project in development mode
|
|
45
44
|
|
|
46
|
-
```
|
|
45
|
+
```pnpm dev```
|
|
47
46
|
|
|
48
47
|
## How to commit
|
|
49
48
|
|
|
50
|
-
This repo uses [Semantic Release](https://github.com/semantic-release/semantic-release) with Conventional Commits.
|
|
49
|
+
This repo uses [Semantic Release](https://github.com/semantic-release/semantic-release) with Conventional Commits.
|
|
51
50
|
Releases are automatically created based on the type of commit message: feat for minor and fix for patch.
|
|
52
51
|
|
|
53
52
|
```
|
|
@@ -77,6 +76,7 @@ fix: fix a bug ---> 1.0.x
|
|
|
77
76
|
<td align="center"><a href="http://www.andrewsnagy.com"><img src="https://avatars.githubusercontent.com/u/564256?v=4?s=100" width="100px;" alt="Andrew Nagy"/><br /><sub><b>Andrew Nagy</b></sub></a><br /><a href="https://github.com/ducktors/turborepo-remote-cache/commits?author=tm1000" title="Code">💻</a></td>
|
|
78
77
|
<td align="center"><a href="https://github.com/emalihin"><img src="https://avatars.githubusercontent.com/u/6379998?v=4?s=100" width="100px;" alt="Eugene Malihins"/><br /><sub><b>Eugene Malihins</b></sub></a><br /><a href="https://github.com/ducktors/turborepo-remote-cache/commits?author=emalihin" title="Code">💻</a></td>
|
|
79
78
|
<td align="center"><a href="http://joedevivo.com"><img src="https://avatars.githubusercontent.com/u/55951?v=4?s=100" width="100px;" alt="Joe DeVivo"/><br /><sub><b>Joe DeVivo</b></sub></a><br /><a href="#infra-joedevivo" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
79
|
+
<td align="center"><a href="http://www.aoe.com"><img src="https://avatars.githubusercontent.com/u/1044246?v=4?s=100" width="100px;" alt="Daniel Kopp"/><br /><sub><b>Daniel Kopp</b></sub></a><br /><a href="https://github.com/ducktors/turborepo-remote-cache/commits?author=devtribe" title="Code">💻</a></td>
|
|
80
80
|
</tr>
|
|
81
81
|
</tbody>
|
|
82
82
|
</table>
|
package/build/app.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createApp = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fastify_1 =
|
|
6
|
-
const hyperid_1 =
|
|
5
|
+
const fastify_1 = tslib_1.__importDefault(require("fastify"));
|
|
6
|
+
const hyperid_1 = tslib_1.__importDefault(require("hyperid"));
|
|
7
7
|
const boom_1 = require("@hapi/boom");
|
|
8
|
-
const remote_cache_1 =
|
|
9
|
-
const config_1 =
|
|
8
|
+
const remote_cache_1 = tslib_1.__importDefault(require("./plugins/remote-cache"));
|
|
9
|
+
const config_1 = tslib_1.__importDefault(require("./plugins/config"));
|
|
10
10
|
const logger_1 = require("./logger");
|
|
11
11
|
const uuid = (0, hyperid_1.default)({ urlSafe: true });
|
|
12
12
|
function createApp(options = {}) {
|
package/build/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;;AAAA,8DAAwE;AACxE,8DAA6B;AAC7B,qCAAmC;AACnC,kFAAgD;AAChD,sEAAqC;AACrC,qCAAiC;AAEjC,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;AAEvC,SAAgB,SAAS,CAAC,UAAgC,EAAE;IAC1D,MAAM,GAAG,GAAG,IAAA,iBAAO,EAAC;QAClB,MAAM,EAAN,eAAM;QACN,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE;QACtB,GAAG,OAAO;KACX,CAAC,CAAA;IAEF,GAAG,CAAC,QAAQ,CAAC,gBAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;QAC9B,GAAG,CAAC,QAAQ,CAAC,sBAAW,EAAE;YACxB,aAAa,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC;YAC1C,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,gBAAgB;SACtC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,GAAG,CAAC,eAAe,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC1C,IAAI,GAAG,CAAC,UAAU,EAAE;YAClB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACnB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;SAC/C;aAAM,IAAI,IAAA,aAAM,EAAC,GAAG,CAAC,EAAE;YACtB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACnB,KAAK;iBACF,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC;iBAC3B,IAAI,CACH,GAAG,CAAC,IAAI,IAAI,IAAI;gBACd,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,IAAI,EAAE;gBACvC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAC5C,CAAA;SACJ;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACtB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;SAC/C;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,GAAG,CAAA;AACZ,CAAC;AAlCD,8BAkCC","sourcesContent":["import Fastify, { FastifyInstance, FastifyServerOptions } from 'fastify'\nimport hyperid from 'hyperid'\nimport { isBoom } from '@hapi/boom'\nimport remoteCache from './plugins/remote-cache'\nimport config from './plugins/config'\nimport { logger } from './logger'\n\nconst uuid = hyperid({ urlSafe: true })\n\nexport function createApp(options: FastifyServerOptions = {}): FastifyInstance {\n const app = Fastify({\n logger,\n genReqId: () => uuid(),\n ...options,\n })\n\n app.register(config).after(() => {\n app.register(remoteCache, {\n allowedTokens: [...app.config.TURBO_TOKEN],\n provider: app.config.STORAGE_PROVIDER,\n })\n })\n\n app.setErrorHandler((err, request, reply) => {\n if (err.validation) {\n reply.log.warn(err)\n reply.code(400).send({ message: err.message })\n } else if (isBoom(err)) {\n reply.log.warn(err)\n reply\n .code(err.output.statusCode)\n .send(\n err.data != null\n ? { message: err.message, ...err.data }\n : { message: err.output.payload.message },\n )\n } else {\n request.log.error(err)\n reply.code(500).send({ message: err.message })\n }\n })\n\n return app\n}\n"]}
|
package/build/env.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.env = exports.STORAGE_PROVIDERS = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const ajv_1 =
|
|
6
|
-
const env_schema_1 =
|
|
5
|
+
const ajv_1 = tslib_1.__importDefault(require("ajv"));
|
|
6
|
+
const env_schema_1 = tslib_1.__importDefault(require("env-schema"));
|
|
7
7
|
const typebox_1 = require("@sinclair/typebox");
|
|
8
8
|
var NODE_ENVS;
|
|
9
9
|
(function (NODE_ENVS) {
|
package/build/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":";;;;AAAA,sDAAqB;AACrB,oEAAkC;AAClC,+CAAgD;AAEhD,IAAK,SAIJ;AAJD,WAAK,SAAS;IACZ,sCAAyB,CAAA;IACzB,wCAA2B,CAAA;IAC3B,0BAAa,CAAA;AACf,CAAC,EAJI,SAAS,KAAT,SAAS,QAIb;AAED,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,8BAAS,CAAA;IACT,8BAAS,CAAA;IACT,kEAA6C,CAAA;AAC/C,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AAED,MAAM,MAAM,GAAG,cAAI,CAAC,MAAM,CACxB;IACE,QAAQ,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;IAChF,WAAW,EAAE,cAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;IAC5C,IAAI,EAAE,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACpC,SAAS,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1D,gBAAgB,EAAE,cAAI,CAAC,QAAQ,CAC7B,cAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,iBAAiB,CAAC,KAAK,EAAE,CAAC,CACnE;IACD,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9D,YAAY,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAC1C,2BAA2B,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3E,iBAAiB,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAC/C,qBAAqB,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IACnD,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAExC,aAAa,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAC3C,aAAa,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAC3C,SAAS,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAEvC,WAAW,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAGzC,cAAc,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAC5C,gBAAgB,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAC9C,eAAe,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;CAC9C,EACD;IACE,oBAAoB,EAAE,KAAK;CAC5B,CACF,CAAA;AACY,QAAA,GAAG,GAAG,IAAA,oBAAS,EAAwB;IAClD,GAAG,EAAE,IAAI,aAAG,CAAC;QACX,gBAAgB,EAAE,IAAI;QACtB,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,oBAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;KACvE,CAAC;IACF,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;IACrE,MAAM;CACP,CAAC,CAAA","sourcesContent":["import Ajv from 'ajv'\nimport envSchema from 'env-schema'\nimport { Type, Static } from '@sinclair/typebox'\n\nenum NODE_ENVS {\n PRODUCTION = 'production',\n DEVELOPMENT = 'development',\n TEST = 'test',\n}\n\nexport enum STORAGE_PROVIDERS {\n LOCAL = 'local',\n S3 = 'S3',\n s3 = 's3',\n GOOGLE_CLOUD_STORAGE = 'google-cloud-storage',\n}\n\nconst schema = Type.Object(\n {\n NODE_ENV: Type.Optional(Type.Enum(NODE_ENVS, { default: NODE_ENVS.PRODUCTION })),\n TURBO_TOKEN: Type.String({ separator: ',' }),\n PORT: Type.Number({ default: 3000 }),\n LOG_LEVEL: Type.Optional(Type.String({ default: 'info' })),\n STORAGE_PROVIDER: Type.Optional(\n Type.Enum(STORAGE_PROVIDERS, { default: STORAGE_PROVIDERS.LOCAL }),\n ),\n BODY_LIMIT: Type.Optional(Type.Number({ default: 104857600 })),\n STORAGE_PATH: Type.Optional(Type.String()),\n STORAGE_PATH_USE_TMP_FOLDER: Type.Optional(Type.Boolean({ default: true })),\n // AWS_ env vars are used as aws-sdk defaults\n AWS_ACCESS_KEY_ID: Type.Optional(Type.String()),\n AWS_SECRET_ACCESS_KEY: Type.Optional(Type.String()),\n AWS_REGION: Type.Optional(Type.String()),\n // S3_ env vars are used by Vercel. ref: https://vercel.com/support/articles/how-can-i-use-aws-sdk-environment-variables-on-vercel\n S3_ACCESS_KEY: Type.Optional(Type.String()),\n S3_SECRET_KEY: Type.Optional(Type.String()),\n S3_REGION: Type.Optional(Type.String()),\n // S3_ENDPOINT is shared between are deployments type\n S3_ENDPOINT: Type.Optional(Type.String()),\n\n // Google Cloud Storage credentials\n GCS_PROJECT_ID: Type.Optional(Type.String()),\n GCS_CLIENT_EMAIL: Type.Optional(Type.String()),\n GCS_PRIVATE_KEY: Type.Optional(Type.String()),\n },\n {\n additionalProperties: false,\n },\n)\nexport const env = envSchema<Static<typeof schema>>({\n ajv: new Ajv({\n removeAdditional: true,\n useDefaults: true,\n coerceTypes: true,\n keywords: ['kind', 'RegExp', 'modifier', envSchema.keywords.separator],\n }),\n dotenv: process.env.NODE_ENV === NODE_ENVS.DEVELOPMENT ? true : false,\n schema,\n})\n"]}
|
package/build/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
require("make-promises-safe");
|
|
5
|
-
const close_with_grace_1 =
|
|
5
|
+
const close_with_grace_1 = tslib_1.__importDefault(require("close-with-grace"));
|
|
6
6
|
const app_1 = require("./app");
|
|
7
7
|
const env_1 = require("./env");
|
|
8
8
|
const app = (0, app_1.createApp)({
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8BAA2B;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8BAA2B;AAC3B,gFAA6C;AAE7C,+BAAiC;AACjC,+BAA2B;AAE3B,MAAM,GAAG,GAAG,IAAA,eAAS,EAAC;IACpB,UAAU,EAAE,IAAI;CACjB,CAAC,CAAA;AAEF,IAAA,0BAAc,EACZ,EAAE,KAAK,EAAE,KAAK,EAAE,EAChB,KAAK,WAAW,EAAE,GAAG,EAAE,MAAM,EAAoC;IAC/D,IAAI,GAAG,EAAE;QACP,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KACnB;IAED,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,2CAA2C,CAAC,CAAA;IAEnE,MAAM,GAAG,CAAC,KAAK,EAAE,CAAA;AACnB,CAAC,CACF,CAAA;AAED,GAAG,CAAC,MAAM,CAAC,SAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE;IACpC,IAAI,GAAG,EAAE;QACP,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;AACH,CAAC,CAAC,CAAA","sourcesContent":["import 'make-promises-safe'\nimport closeWithGrace from 'close-with-grace'\n\nimport { createApp } from './app'\nimport { env } from './env'\n\nconst app = createApp({\n trustProxy: true,\n})\n\ncloseWithGrace(\n { delay: 10000 },\n async function ({ err, signal }: { err?: Error; signal?: string }) {\n if (err) {\n app.log.error(err)\n }\n\n app.log.info(`[${signal}] Gracefully closing the server instance.`)\n\n await app.close()\n },\n)\n\napp.listen(env.PORT, '0.0.0.0', err => {\n if (err) {\n app.log.error(err)\n process.exit(1)\n }\n})\n"]}
|
package/build/logger.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.logger = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const pino_1 =
|
|
5
|
+
const pino_1 = tslib_1.__importDefault(require("pino"));
|
|
6
6
|
const env_1 = require("./env");
|
|
7
7
|
const PinoLevelToSeverityLookup = {
|
|
8
8
|
trace: 'DEBUG',
|
package/build/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;;AAAA,wDAAuB;AACvB,+BAA2B;AAC3B,MAAM,yBAAyB,GAAG;IAChC,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,UAAU;CACT,CAAA;AAEG,QAAA,MAAM,GAAG,IAAA,cAAI,EAAC;IACzB,KAAK,EAAE,SAAG,CAAC,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,CAAC,2BAA2B,CAAC;IACrC,UAAU,EAAE;QACV,KAAK,CAAC,KAAK,EAAE,MAAM;YACjB,OAAO;gBACL,QAAQ,EAAE,yBAAyB,CAAC,KAAK,CAAC,IAAI,yBAAyB,CAAC,MAAM,CAAC;gBAC/E,KAAK,EAAE,MAAM;aACd,CAAA;QACH,CAAC;KACF;CACF,CAAC,CAAA;AAEF,kBAAe,cAAM,CAAA","sourcesContent":["import Pino from 'pino'\nimport { env } from './env'\nconst PinoLevelToSeverityLookup = {\n trace: 'DEBUG',\n debug: 'DEBUG',\n info: 'INFO',\n warn: 'WARNING',\n error: 'ERROR',\n fatal: 'CRITICAL',\n} as const\n\nexport const logger = Pino({\n level: env.LOG_LEVEL,\n messageKey: 'message',\n redact: ['req.headers.authorization'],\n formatters: {\n level(label, number) {\n return {\n severity: PinoLevelToSeverityLookup[label] || PinoLevelToSeverityLookup['info'],\n level: number,\n }\n },\n },\n})\n\nexport default logger\n"]}
|
package/build/plugins/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fastify_plugin_1 =
|
|
4
|
+
const fastify_plugin_1 = tslib_1.__importDefault(require("fastify-plugin"));
|
|
5
5
|
const env_1 = require("../env");
|
|
6
6
|
exports.default = (0, fastify_plugin_1.default)(async function (fastify) {
|
|
7
7
|
fastify.decorate('config', env_1.env);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/plugins/config.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/plugins/config.ts"],"names":[],"mappings":";;;AAAA,4EAA+B;AAC/B,gCAA4B;AAE5B,kBAAe,IAAA,wBAAE,EACf,KAAK,WAAW,OAAO;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAG,CAAC,CAAA;AACjC,CAAC,EACD,EAAE,IAAI,EAAE,QAAQ,EAAE,CACnB,CAAA","sourcesContent":["import fp from 'fastify-plugin'\nimport { env } from '../env'\n\nexport default fp(\n async function (fastify) {\n fastify.decorate('config', env)\n },\n { name: 'config' },\n)\n\ndeclare module 'fastify' {\n interface FastifyInstance {\n config: typeof env\n }\n}\n"]}
|
|
@@ -41,6 +41,7 @@ async function turboRemoteCache(instance, options) {
|
|
|
41
41
|
i.route(routes_1.headArtifact);
|
|
42
42
|
i.route(routes_1.putArtifact);
|
|
43
43
|
i.route(routes_1.artifactsEvents);
|
|
44
|
+
i.route(routes_1.getStatus);
|
|
44
45
|
}, { prefix: `/${apiVersion}` });
|
|
45
46
|
}
|
|
46
47
|
exports.default = turboRemoteCache;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/remote-cache/index.ts"],"names":[],"mappings":";;AACA,qCAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/remote-cache/index.ts"],"names":[],"mappings":";;AACA,qCAAqD;AACrD,qCAA6F;AAC7F,uCAA0C;AAC1C,mCAA6C;AAE7C,KAAK,UAAU,gBAAgB,CAC7B,QAAyB,EACzB,OAIC;IAED,MAAM,SAAS,GAAW,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAA;IACpD,MAAM,EAAE,aAAa,EAAE,UAAU,GAAG,IAAI,EAAE,QAAQ,GAAG,uBAAiB,CAAC,KAAK,EAAE,GAAG,OAAO,CAAA;IACxF,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;QAC3D,MAAM,IAAI,KAAK,CACb,+CAA+C,OAAO,aAAa,mBAAmB,CACvF,CAAA;KACF;IAED,QAAQ,CAAC,oBAAoB,CAC3B,0BAA0B,EAC1B,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAChC,KAAK,UAAU,MAAM,CAAC,OAAO,EAAE,OAAO;QACpC,OAAO,OAAO,CAAA;IAChB,CAAC,CACF,CAAA;IAED,MAAM,MAAM,GAAG,IAAI,GAAG,CAAS,aAAa,CAAC,CAAA;IAC7C,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,WAAW,OAAO;QACnD,IAAI,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QACjD,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAA;QAEvE,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAA,iBAAU,EAAC,8BAA8B,CAAC,CAAA;SACjD;QACD,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC7C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACtB,MAAM,IAAA,mBAAY,EAAC,6BAA6B,CAAC,CAAA;SAClD;IACH,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,QAAQ,CACf,UAAU,EACV,IAAA,wBAAc,EAAC,QAAQ,EAAE;QACvB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa;QACxC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa;QACxC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY;QAClC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS;QACjC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW;QACrC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB;QAC7C,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;QAClE,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc;QACzC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,2BAA2B;KACtD,CAAC,CACH,CAAA;IAED,MAAM,QAAQ,CAAC,QAAQ,CACrB,KAAK,WAAW,CAAC;QACf,CAAC,CAAC,KAAK,CAAC,oBAAW,CAAC,CAAA;QACpB,CAAC,CAAC,KAAK,CAAC,qBAAY,CAAC,CAAA;QACrB,CAAC,CAAC,KAAK,CAAC,oBAAW,CAAC,CAAA;QACpB,CAAC,CAAC,KAAK,CAAC,wBAAe,CAAC,CAAA;QACxB,CAAC,CAAC,KAAK,CAAC,kBAAS,CAAC,CAAA;IACpB,CAAC,EACD,EAAE,MAAM,EAAE,IAAI,UAAU,EAAE,EAAE,CAC7B,CAAA;AACH,CAAC;AAED,kBAAe,gBAAgB,CAAA","sourcesContent":["import { FastifyInstance } from 'fastify'\nimport { badRequest, unauthorized } from '@hapi/boom'\nimport { getArtifact, putArtifact, artifactsEvents, headArtifact, getStatus } from './routes'\nimport { createLocation } from './storage'\nimport { STORAGE_PROVIDERS } from '../../env'\n\nasync function turboRemoteCache(\n instance: FastifyInstance,\n options: {\n allowedTokens: string[]\n apiVersion?: `v${number}`\n provider?: STORAGE_PROVIDERS\n },\n) {\n const bodyLimit = <number>instance.config.BODY_LIMIT\n const { allowedTokens, apiVersion = 'v8', provider = STORAGE_PROVIDERS.LOCAL } = options\n if (!(Array.isArray(allowedTokens) && allowedTokens.length)) {\n throw new Error(\n `'allowedTokens' options must be a string[], ${typeof allowedTokens} provided instead`,\n )\n }\n\n instance.addContentTypeParser<Buffer>(\n 'application/octet-stream',\n { parseAs: 'buffer', bodyLimit },\n async function parser(request, payload) {\n return payload\n },\n )\n\n const tokens = new Set<string>(allowedTokens)\n instance.addHook('onRequest', async function (request) {\n let authHeader = request.headers['authorization']\n authHeader = Array.isArray(authHeader) ? authHeader.join() : authHeader\n\n if (!authHeader) {\n throw badRequest(`Missing Authorization header`)\n }\n const [, token] = authHeader.split('Bearer ')\n if (!tokens.has(token)) {\n throw unauthorized(`Invalid authorization token`)\n }\n })\n\n instance.decorate(\n 'location',\n createLocation(provider, {\n accessKey: instance.config.S3_ACCESS_KEY,\n secretKey: instance.config.S3_SECRET_KEY,\n path: instance.config.STORAGE_PATH,\n region: instance.config.S3_REGION,\n endpoint: instance.config.S3_ENDPOINT,\n clientEmail: instance.config.GCS_CLIENT_EMAIL,\n privateKey: instance.config.GCS_PRIVATE_KEY?.replace(/\\\\n/g, '\\n'),\n projectId: instance.config.GCS_PROJECT_ID,\n useTmp: !!instance.config.STORAGE_PATH_USE_TMP_FOLDER,\n }),\n )\n\n await instance.register(\n async function (i) {\n i.route(getArtifact)\n i.route(headArtifact)\n i.route(putArtifact)\n i.route(artifactsEvents)\n i.route(getStatus)\n },\n { prefix: `/${apiVersion}` },\n )\n}\n\nexport default turboRemoteCache\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStatus = void 0;
|
|
4
|
+
const status_schema_1 = require("./status-schema");
|
|
5
|
+
exports.getStatus = {
|
|
6
|
+
method: 'GET',
|
|
7
|
+
url: '/artifacts/status',
|
|
8
|
+
schema: status_schema_1.statusRouteSchema,
|
|
9
|
+
logLevel: 'error',
|
|
10
|
+
async handler(req, reply) {
|
|
11
|
+
reply.send({ status: 'enabled' });
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=get-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-status.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/routes/get-status.ts"],"names":[],"mappings":";;;AAGA,mDAAmD;AAEtC,QAAA,SAAS,GAQlB;IACF,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,mBAAmB;IACxB,MAAM,EAAE,iCAAiB;IACzB,QAAQ,EAAE,OAAO;IACjB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK;QACtB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAA;IACnC,CAAC;CACF,CAAA","sourcesContent":["import type { Server } from 'http'\nimport type { RawReplyDefaultExpression, RawRequestDefaultExpression, RouteOptions } from 'fastify'\nimport { type Params, type Querystring } from './schema'\nimport { statusRouteSchema } from './status-schema'\n\nexport const getStatus: RouteOptions<\n Server,\n RawRequestDefaultExpression,\n RawReplyDefaultExpression,\n {\n Querystring: Querystring\n Params: Params\n }\n> = {\n method: 'GET',\n url: '/artifacts/status',\n schema: statusRouteSchema,\n logLevel: 'error',\n async handler(req, reply) {\n reply.send({ status: 'enabled' })\n },\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.artifactsEvents = exports.putArtifact = exports.headArtifact = exports.getArtifact = void 0;
|
|
3
|
+
exports.getStatus = exports.artifactsEvents = exports.putArtifact = exports.headArtifact = exports.getArtifact = void 0;
|
|
4
4
|
var get_artifact_1 = require("./get-artifact");
|
|
5
5
|
Object.defineProperty(exports, "getArtifact", { enumerable: true, get: function () { return get_artifact_1.getArtifact; } });
|
|
6
6
|
var head_artifact_1 = require("./head-artifact");
|
|
@@ -9,4 +9,6 @@ var put_artifact_1 = require("./put-artifact");
|
|
|
9
9
|
Object.defineProperty(exports, "putArtifact", { enumerable: true, get: function () { return put_artifact_1.putArtifact; } });
|
|
10
10
|
var artifacts_events_1 = require("./artifacts-events");
|
|
11
11
|
Object.defineProperty(exports, "artifactsEvents", { enumerable: true, get: function () { return artifacts_events_1.artifactsEvents; } });
|
|
12
|
+
var get_status_1 = require("./get-status");
|
|
13
|
+
Object.defineProperty(exports, "getStatus", { enumerable: true, get: function () { return get_status_1.getStatus; } });
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/routes/index.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAAnC,2GAAA,WAAW,OAAA;AACpB,iDAA8C;AAArC,6GAAA,YAAY,OAAA;AACrB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA;AACpB,uDAAoD;AAA3C,mHAAA,eAAe,OAAA","sourcesContent":["export { getArtifact } from './get-artifact'\nexport { headArtifact } from './head-artifact'\nexport { putArtifact } from './put-artifact'\nexport { artifactsEvents } from './artifacts-events'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/routes/index.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAAnC,2GAAA,WAAW,OAAA;AACpB,iDAA8C;AAArC,6GAAA,YAAY,OAAA;AACrB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA;AACpB,uDAAoD;AAA3C,mHAAA,eAAe,OAAA;AACxB,2CAAwC;AAA/B,uGAAA,SAAS,OAAA","sourcesContent":["export { getArtifact } from './get-artifact'\nexport { headArtifact } from './head-artifact'\nexport { putArtifact } from './put-artifact'\nexport { artifactsEvents } from './artifacts-events'\nexport { getStatus } from './get-status'\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusRouteSchema = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const querystring = typebox_1.Type.Object({}, { additionalParameters: false });
|
|
6
|
+
const params = typebox_1.Type.Object({}, { additionalParameters: false });
|
|
7
|
+
exports.statusRouteSchema = {
|
|
8
|
+
querystring,
|
|
9
|
+
params,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=status-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-schema.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/routes/status-schema.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAEhD,MAAM,WAAW,GAAG,cAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAA;AAGpE,MAAM,MAAM,GAAG,cAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAA;AAGlD,QAAA,iBAAiB,GAAG;IAC/B,WAAW;IACX,MAAM;CACP,CAAA","sourcesContent":["import { Static, Type } from '@sinclair/typebox'\n\nconst querystring = Type.Object({}, { additionalParameters: false })\nexport type Querystring = Static<typeof querystring>\n\nconst params = Type.Object({}, { additionalParameters: false })\nexport type Params = Static<typeof params>\n\nexport const statusRouteSchema = {\n querystring,\n params,\n}\n"]}
|
|
@@ -4,7 +4,7 @@ exports.createLocal = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
const path_1 = require("path");
|
|
7
|
-
const fs_blob_store_1 =
|
|
7
|
+
const fs_blob_store_1 = tslib_1.__importDefault(require("fs-blob-store"));
|
|
8
8
|
function createLocal({ path, useTmp }) {
|
|
9
9
|
const fullPath = useTmp ? (0, path_1.join)((0, os_1.tmpdir)(), path) : (0, path_1.normalize)(path);
|
|
10
10
|
return (0, fs_blob_store_1.default)(fullPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/storage/local.ts"],"names":[],"mappings":";;;;AAAA,2BAA2B;AAC3B,+BAAsC;AACtC
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/storage/local.ts"],"names":[],"mappings":";;;;AAAA,2BAA2B;AAC3B,+BAAsC;AACtC,0EAA8B;AAO9B,SAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAgB;IACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,IAAA,WAAI,EAAC,IAAA,WAAM,GAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,CAAA;IAChE,OAAO,IAAA,uBAAE,EAAC,QAAQ,CAAC,CAAA;AACrB,CAAC;AAHD,kCAGC","sourcesContent":["import { tmpdir } from 'os'\nimport { join, normalize } from 'path'\nimport fs from 'fs-blob-store'\n\nexport type LocalOptions = {\n path: string\n useTmp: boolean\n}\n\nexport function createLocal({ path, useTmp }: LocalOptions) {\n const fullPath = useTmp ? join(tmpdir(), path) : normalize(path)\n return fs(fullPath)\n}\n"]}
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createS3 = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const s3_blob_store_1 =
|
|
6
|
-
const aws_sdk_1 =
|
|
5
|
+
const s3_blob_store_1 = tslib_1.__importDefault(require("s3-blob-store"));
|
|
6
|
+
const aws_sdk_1 = tslib_1.__importDefault(require("aws-sdk"));
|
|
7
7
|
function createS3({ accessKey = process.env.AWS_ACCESS_KEY_ID || process.env.S3_ACCESS_KEY, secretKey = process.env.AWS_SECRET_ACCESS_KEY || process.env.S3_SECRET_KEY, bucket, region = process.env.AWS_REGION || process.env.S3_REGION, endpoint, }) {
|
|
8
8
|
const client = new aws_sdk_1.default.S3({
|
|
9
9
|
...(accessKey && secretKey
|
|
10
|
-
? {
|
|
10
|
+
? {
|
|
11
|
+
credentials: {
|
|
12
|
+
accessKeyId: accessKey,
|
|
13
|
+
secretAccessKey: secretKey,
|
|
14
|
+
sessionToken: process.env.AWS_SESSION_TOKEN,
|
|
15
|
+
},
|
|
16
|
+
}
|
|
11
17
|
: {}),
|
|
12
18
|
...(region ? { region } : {}),
|
|
13
19
|
...(endpoint ? { endpoint: new aws_sdk_1.default.Endpoint(endpoint) } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/storage/s3.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../../../src/plugins/remote-cache/storage/s3.ts"],"names":[],"mappings":";;;;AAAA,0EAA8B;AAC9B,8DAAyB;AAWzB,SAAgB,QAAQ,CAAC,EACvB,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EACtE,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAC1E,MAAM,EACN,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,EACxD,QAAQ,GACE;IACV,MAAM,MAAM,GAAG,IAAI,iBAAG,CAAC,EAAE,CAAC;QACxB,GAAG,CAAC,SAAS,IAAI,SAAS;YACxB,CAAC,CAAC;gBACE,WAAW,EAAE;oBACX,WAAW,EAAE,SAAS;oBACtB,eAAe,EAAE,SAAS;oBAC1B,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;iBAC5C;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,iBAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7D,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1F,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,IAAA,uBAAE,EAAC;QAClB,MAAM;QACN,MAAM;KACP,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC;AA5BD,4BA4BC","sourcesContent":["import s3 from 's3-blob-store'\nimport aws from 'aws-sdk'\n\nexport interface S3Options {\n accessKey?: string\n secretKey?: string\n region?: string\n endpoint?: string\n bucket: string\n}\n\n// AWS_ envs are default for aws-sdk\nexport function createS3({\n accessKey = process.env.AWS_ACCESS_KEY_ID || process.env.S3_ACCESS_KEY,\n secretKey = process.env.AWS_SECRET_ACCESS_KEY || process.env.S3_SECRET_KEY,\n bucket,\n region = process.env.AWS_REGION || process.env.S3_REGION,\n endpoint,\n}: S3Options) {\n const client = new aws.S3({\n ...(accessKey && secretKey\n ? {\n credentials: {\n accessKeyId: accessKey,\n secretAccessKey: secretKey,\n sessionToken: process.env.AWS_SESSION_TOKEN,\n },\n }\n : {}),\n ...(region ? { region } : {}),\n ...(endpoint ? { endpoint: new aws.Endpoint(endpoint) } : {}),\n ...(process.env.NODE_ENV === 'test' ? { sslEnabled: false, s3ForcePathStyle: true } : {}),\n })\n\n const location = s3({\n client,\n bucket,\n })\n\n return location\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turborepo-remote-cache",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Turborepo remote cache server",
|
|
5
5
|
"main": "build",
|
|
6
6
|
"author": "Maksim Sinik <maksim@sinik.it>",
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
"turborepo-remote-cache": "./build/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
-
"
|
|
12
|
+
"preinstall": "npx only-allow pnpm",
|
|
13
|
+
"prebuild": "pnpm lint && rimraf ./build",
|
|
13
14
|
"build": "tsc -p ./tsconfig.json",
|
|
14
15
|
"start": "node --enable-source-maps build/index.js",
|
|
15
|
-
"update": "npx npm-check -u",
|
|
16
16
|
"lint": "eslint --ext .ts --no-error-on-unmatched-pattern \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
17
17
|
"dev": "tsup --watch --onSuccess \"run-p dev:start check:types\"",
|
|
18
18
|
"dev:start": "node --inspect -r @cspotcode/source-map-support/register -r dotenv/config build/index.js",
|
|
19
19
|
"check:types": "tsc -p ./tsconfig.json --noEmit",
|
|
20
20
|
"test": "cross-env TS_NODE_PROJECT=./test/tsconfig.json tap --ts",
|
|
21
21
|
"posttest": "tap --coverage-report=lcov --no-browser",
|
|
22
|
-
"test:watch": "
|
|
23
|
-
"test:report": "
|
|
22
|
+
"test:watch": "pnpm test -- --watch",
|
|
23
|
+
"test:report": "pnpm test -- --output-file=out.tap && tap-mocha-reporter xunit < out.tap > junit-testresults.xml",
|
|
24
24
|
"commitlint": "commitlint",
|
|
25
25
|
"semantic-release": "semantic-release",
|
|
26
26
|
"commit": "npx git-cz",
|
|
@@ -31,15 +31,16 @@
|
|
|
31
31
|
"url": "git+https://github.com/ducktors/turborepo-remote-cache.git"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"@commitlint/lint": "^17.2.0",
|
|
34
35
|
"@google-cloud/storage": "6.4.1",
|
|
35
36
|
"@hapi/boom": "9.1.4",
|
|
36
37
|
"@sinclair/typebox": "0.23.1",
|
|
37
38
|
"@vercel/node": "1.12.1",
|
|
38
|
-
"ajv": "8.
|
|
39
|
+
"ajv": "8.11.0",
|
|
39
40
|
"aws-sdk": "2.1053.0",
|
|
40
41
|
"boom": "7.3.0",
|
|
41
42
|
"close-with-grace": "1.1.0",
|
|
42
|
-
"env-schema": "
|
|
43
|
+
"env-schema": "5.1.0",
|
|
43
44
|
"fastify": "3.25.0",
|
|
44
45
|
"fastify-autoload": "3.9.0",
|
|
45
46
|
"fastify-plugin": "3.0.0",
|
|
@@ -89,11 +90,6 @@
|
|
|
89
90
|
"tsup": "^5.11.6",
|
|
90
91
|
"typescript": "^4.5.4"
|
|
91
92
|
},
|
|
92
|
-
"config": {
|
|
93
|
-
"commitizen": {
|
|
94
|
-
"path": "./node_modules/cz-conventional-changelog"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
93
|
"bugs": {
|
|
98
94
|
"url": "https://github.com/ducktors/turborepo-remote-cache/issues"
|
|
99
95
|
},
|