{"_id":"@abacus-insights/serverless-plugin-typescript","_rev":"2-1adaa11020062bc8c8450876aa5a6e38","name":"@abacus-insights/serverless-plugin-typescript","dist-tags":{"latest":"1.1.7-b"},"versions":{"1.1.7-a":{"name":"@abacus-insights/serverless-plugin-typescript","version":"1.1.7-a","license":"MIT","main":"dist/src/index.js","scripts":{"prepublish":"npm run build","precommit":"npm run test","build":"rimraf dist && tsc","pretest":"npm run lint","test":"jest","lint":"tslint -c tslint.json 'src/**/*.ts'"},"repository":{"type":"git","url":"git+https://github.com/Abacus-Insights/serverless-plugin-typescript.git"},"keywords":["serverless","serverless plugin","typescript","aws lambda"],"devDependencies":{"@types/fs-extra":"5.0.5","@types/jest":"24.0.11","@types/lodash":"4.14.123","jest":"24.5.0","mock-fs":"4.8.0","rimraf":"^2.6.3","ts-jest":"24.0.1","tslint":"5.14.0","typescript":"^3.4.1"},"dependencies":{"fs-extra":"^7.0.1","globby":"^9.2.0","lodash":"^4.17.11"},"peerDependencies":{"typescript":">=2.2.2"},"jest":{"preset":"ts-jest","testRegex":"(/__tests__/.*|\\.(test|spec))\\.ts$","moduleFileExtensions":["ts","tsx","js"]},"gitHead":"33077e5c0cb1db46c1c9b8b2b7eb7a22e4ec1874","description":"[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-plugin-typescript.svg)](https://badge.fury.io/js/serverless-plugin-typescript) [![Build Status](https://travis-ci.or","bugs":{"url":"https://github.com/Abacus-Insights/serverless-plugin-typescript/issues"},"homepage":"https://github.com/Abacus-Insights/serverless-plugin-typescript#readme","_id":"@abacus-insights/serverless-plugin-typescript@1.1.7-a","_nodeVersion":"12.12.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-NU0s3NULTHsKs2KvlTwznQosRJbQdA/vhNDfzx50ZjgEStgg0jWJ8/BX1ABo/nAye+bPfqSm891RB2bnYEOPLA==","shasum":"57f710d133a58034538b77478890586efadd3119","tarball":"https://registry.npmjs.org/@abacus-insights/serverless-plugin-typescript/-/serverless-plugin-typescript-1.1.7-a.tgz","fileCount":21,"unpackedSize":42717,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhZMZCRA9TVsSAnZWagAAc0MP/1Q/S3mJKaxbPywCQY+g\nZmpnbi9eGWdljyEFPNzB3PYI5JecTcJSmXJV4ASCiIf0NlvYVQ5rCXYCliiD\nF9/M6NnkyuO45N5Vfi4RLSp1xgr9QeQi6l4qxzexiDLnoB64VV7ZUcEw4r8X\nnYajX1DDjC17odQJLGd43Hgx6/++TgBF9g+pv/jgcAVIWojEF/yHNUBTzkZN\nu4aYXuP2Sop8sPBcnh4efl2KBrKHU9RukMElKTeeOPPRvYSDDJz86WU+2VfO\n8R/35isjoR5nz+vcuY6jKOdB8OzC3BONJKtPaBP11ahhCceZfF5w7FuHSzRA\nk1LHSkpFgjYnCHQ3+xEnJ2KeWLDCwsM2DXbhc34sctTexTkY8vQRVvWc5f4a\nfIHa2+SkSX6x2tCZcIRQasjKc733lEdcawvgdcqVgED8Pqho6G0WBY6IrlF8\nIg+4YQL5VlL3CeHJR3zVhxvd/FJtN+kppdm8qdB90vVVMlVRMnOnvo21l1bd\npwnEOslIRS9T/6NkmMhW7Mv+kgJUGmJ5ZfdalCpXYI/CYyEEMSMvShvBrjV8\nf0yLBS614ApbL82kcR4NHiRFFUBMQHkLKef5CjUBsPVv6wGA+1FZb1rG/U8R\nUyNhHbgB8xsQ0q24j5XgnCPuyrLNXC4bxJvHZq6rUdMCH562zTEC+gSR7udn\n8A0M\r\n=zqqO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCT//2F+ETTJzun6otBvxrTz96nbrYqV8i4zuZecA4MEAIgPjXC4rUdOWqU8EHgK5BnMCBtPv2GfkU9SCDcZMEUpVg="}]},"maintainers":[{"name":"abacus-insights","email":"gresko@abacusinsights.com"}],"_npmUser":{"name":"abacus-insights","email":"gresko@abacusinsights.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-plugin-typescript_1.1.7-a_1602589465282_0.9414399612356263"},"_hasShrinkwrap":false},"1.1.7-b":{"name":"@abacus-insights/serverless-plugin-typescript","version":"1.1.7-b","license":"MIT","main":"dist/src/index.js","scripts":{"prepublish":"npm run build","precommit":"npm run test","build":"rimraf dist && tsc","pretest":"npm run lint","test":"jest","lint":"tslint -c tslint.json 'src/**/*.ts'"},"repository":{"type":"git","url":"git+https://github.com/Abacus-Insights/serverless-plugin-typescript.git"},"keywords":["serverless","serverless plugin","typescript","aws lambda"],"devDependencies":{"@types/fs-extra":"5.0.5","@types/jest":"24.0.11","@types/lodash":"4.14.123","@types/node":"12.6.2","jest":"24.5.0","mock-fs":"4.9.0","rimraf":"2.6.3","ts-jest":"24.0.2","tslint":"5.14.0","typescript":"^3.4.1"},"dependencies":{"fs-extra":"^7.0.1","globby":"^9.2.0","lodash":"^4.17.11"},"peerDependencies":{"typescript":">=2.2.2"},"jest":{"preset":"ts-jest","testRegex":"(/__tests__/.*|\\.(test|spec))\\.ts$","moduleFileExtensions":["ts","tsx","js"]},"gitHead":"3169444cc2fa100c44b83832d6ec73c0f198bdc2","description":"[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-plugin-typescript.svg)](https://badge.fury.io/js/serverless-plugin-typescript) [![Build Status](https://travis-ci.or","bugs":{"url":"https://github.com/Abacus-Insights/serverless-plugin-typescript/issues"},"homepage":"https://github.com/Abacus-Insights/serverless-plugin-typescript#readme","_id":"@abacus-insights/serverless-plugin-typescript@1.1.7-b","_nodeVersion":"12.12.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-CeCaaA9rQG14KiTZjoBCSgqUQia3b0UPzIiVhoyvlGIYSkWaSYbwEeLtCuWxK1jrPR2ibkFqdx8VHEV2X3pGyw==","shasum":"712e5903725d671dbf79ebc0706601f55b537c27","tarball":"https://registry.npmjs.org/@abacus-insights/serverless-plugin-typescript/-/serverless-plugin-typescript-1.1.7-b.tgz","fileCount":21,"unpackedSize":45178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhZvcCRA9TVsSAnZWagAAungP/1uv1iif5VwVbC3Rrkgx\naJ0uVHx3BurCfBg2PArfxv6CFetjcb+imIr+IgDOp/LHA2+epQ23J7vIs4ON\nuetqXy5vstN04fqVDfY51I843fRwcBC1bIvTFtaH4qCnoqDdZlkgpoXRbWlR\nckr71wmJS/z2vMrcgPQsj1re6ng3iXF5bgdbW6i0pkuRZ4u4y33/C2IfFGp/\nY0D4jFZ0VqmoYWzxOF94Ch6subDcIdpx6yEvCKqGqJFlfIdIB0fmlBAj27pq\n+h4paagUe0XdedcatcsLAuKw8S9NolDqfUioFkUQKMk1bjhymcsk30OqW+/w\nWc6bqhp558Uq2b/OsLwPkBki8uRns6tSbUP7q1OS68yC8vAZh/UkDEJqIg1/\natFL/3jdw4JTh1b3yTkV0yVLDq7iOZnvgeUxGbuK7vAmuFyvId0EbDycbmK2\n4i3s3vFpx/2jMMv5ZsKdZDRodK/rIpWUJSr9ah4e/BfesuwY8lh/zJTY3yh+\nSs1SHwb6cXE6Qj4uPw3RfOY2XVHFm+X+T40c2Kw1+dOEQu3Xs3+BzuYoi7YH\nuC9FjQCc73jqi/ySQdHIPeBSScbkAPDqXt4Ddk9O9K/BX2Vkx/q/Y8BNOwG/\nErlSPV+yN4FtNUv5/4Y8D+LaR+XIUxUxmEHc5av2BS6V9KPhIlrUT+8bOU1a\nCzrJ\r\n=6cXh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCU/w4M0pdOrLqNxtsdIRK2xisC5jj8Pgshv41zcd1WBgIgLZTeA2LwAAceO8duSWUyCBj88FNNkI9N7XfaOe2SG5Q="}]},"maintainers":[{"name":"abacus-insights","email":"gresko@abacusinsights.com"}],"_npmUser":{"name":"abacus-insights","email":"gresko@abacusinsights.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-plugin-typescript_1.1.7-b_1602591707969_0.3942178725283907"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-13T11:44:25.241Z","1.1.7-a":"2020-10-13T11:44:25.423Z","modified":"2022-04-04T10:56:37.485Z","1.1.7-b":"2020-10-13T12:21:48.137Z"},"maintainers":[{"name":"abacus-insights","email":"gresko@abacusinsights.com"}],"description":"[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-plugin-typescript.svg)](https://badge.fury.io/js/serverless-plugin-typescript) [![Build Status](https://travis-ci.or","homepage":"https://github.com/Abacus-Insights/serverless-plugin-typescript#readme","keywords":["serverless","serverless plugin","typescript","aws lambda"],"repository":{"type":"git","url":"git+https://github.com/Abacus-Insights/serverless-plugin-typescript.git"},"bugs":{"url":"https://github.com/Abacus-Insights/serverless-plugin-typescript/issues"},"license":"MIT","readme":"# serverless-plugin-typescript\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-plugin-typescript.svg)](https://badge.fury.io/js/serverless-plugin-typescript) [![Build Status](https://travis-ci.org/prisma/serverless-plugin-typescript.svg?branch=master)](https://travis-ci.org/prisma/serverless-plugin-typescript)\n\nServerless plugin for zero-config Typescript support\n\n## Features\n\n* Zero-config: Works out of the box without the need to install any other compiler or plugins\n* Supports ES2015 syntax + features (`export`, `import`, `async`, `await`, `Promise`, ...)\n* Supports `sls package`, `sls deploy` and `sls deploy function`\n* Supports `sls invoke local` + `--watch` mode\n* Integrates nicely with [`serverless-offline`](https://github.com/dherault/serverless-offline)\n\n## Install\n\n```sh\nyarn add --dev serverless-plugin-typescript\n```\n\nAdd the following plugin to your `serverless.yml`:\n\n```yaml\nplugins:\n  - serverless-plugin-typescript\n```\n\n## Configure\n\nSee [example folder](example) for a minimal example.\n\n### `tsconfig.json`\n\nThe default `tsconfig.json` file used by the plugin looks like this:\n\n```json\n{\n  \"compilerOptions\": {\n    \"preserveConstEnums\": true,\n    \"strictNullChecks\": true,\n    \"sourceMap\": true,\n    \"target\": \"es5\",\n    \"outDir\": \".build\",\n    \"moduleResolution\": \"node\",\n    \"lib\": [\"es2015\"],\n    \"rootDir\": \"./\"\n  }\n}\n```\n\n> Note 1: The `outDir` and `rootDir` options cannot be overwritten.\n\n> Note 2: Don't confuse the [`tsconfig.json`](tsconfig.json) in this repository with the one mentioned above.\n\n### Including extra files\n\nAll files from `package/include` will be included in the final build file. See [Exclude/Include](https://serverless.com/framework/docs/providers/aws/guide/packaging#exclude--include)\n\n\n## Usage\n\n### Google Cloud Functions\n\nWhen using with Google Cloud Functions via the [serverless-google-cloudfunctions](https://github.com/serverless/serverless-google-cloudfunctions)\nplugin, you simply have to provide a `main` field in your `package.json`:\n\n```js\n{\n  // ...\n  \"main\": \"handler.js\",\n  // ..\n}\n```\n\nAnd this plugin will automatically compile your typescript correctly. Note\nthat the field must refer to the compiled file name, namely, ending with a `.js`\nextension.\n\nIf a `main` field was not found, then this plugin will use `index.js`. Before\ncompilation begins, it will check to see that the file indicated exists with a\n`.ts` extension before actually trying to compile it.\n\n### Automatic compilation\n\nThe normal Serverless deploy procedure will automatically compile with Typescript:\n\n- Create the Serverless project with `serverless create -t aws-nodejs`\n- Install Serverless Typescript as above\n- Deploy with `serverless deploy`\n\n### Usage with serverless-offline\n\nThe plugin integrates very well with [serverless-offline](https://github.com/dherault/serverless-offline) to\nsimulate AWS Lambda and AWS API Gateway locally.\n\nAdd the plugins to your `serverless.yml` file and make sure that `serverless-plugin-typescript`\nprecedes `serverless-offline` as the order is important:\n```yaml\n  plugins:\n    ...\n    - serverless-plugin-typescript\n    ...\n    - serverless-offline\n    ...\n```\n\nRun `serverless offline` or `serverless offline start` to start the Lambda/API simulation.\n\nIn comparison to `serverless offline`, the `start` command will fire an `init` and a `end` lifecycle hook which is needed for `serverless-offline` and e.g. `serverless-dynamodb-local` to switch off resources (see below)\n\n#### serverless-dynamodb-local\n\nConfigure your service the same as mentioned above, but additionally add the `serverless-dynamodb-local`\nplugin as follows:\n```yaml\n  plugins:\n    - serverless-plugin-typescript\n    - serverless-dynamodb-local\n    - serverless-offline\n```\n\nRun `serverless offline start`.\n\n#### Other useful options\n\nYou can reduce the clutter generated by `serverless-offline` with `--dontPrintOutput` and\ndisable timeouts with `--noTimeout`.\n\n### Run a function locally\n\nTo run your compiled functions locally you can:\n\n```bash\n$ serverless invoke local --function <function-name>\n```\n\nOptions are:\n\n- `--function` or `-f` (required) is the name of the function to run\n- `--watch` - recompile and run a function locally on source changes\n- `--path` or `-p` (optional) path to JSON or YAML file holding input data\n- `--data` or `-d` (optional) input data\n\n### Enabling source-maps\n\nYou can easily enable support for source-maps (making stacktraces easier to read) by installing and using the following plugin:\n\n```sh\nyarn add --dev source-map-support\n```\n\n```ts\n// inside of your function\nimport 'source-map-support/register'\n```\n\nIf you are using webpack (most likely). Add `devtool: 'source-map'` to `webpack.config.js`:\n```js\nmodule.exports = {\n  .... snip ....\n  devtool: 'source-map',\n  .... snip ....\n\n}\n```\n\n## Help & Community\n\nJoin our [Spectrum community](http://spectrum.chat/prisma) if you run into issues or have questions. We love talking to you!\n\n<p align=\"center\"><a href=\"https://oss.prisma.io\"><img src=\"https://imgur.com/IMU2ERq.png\" alt=\"Prisma\" height=\"170px\"></a></p>\n\n","readmeFilename":"README.md"}