{"_id":"@bluelibs/serverless-plugin-typescript","_rev":"1-cd74f9a8397a0a14603a64689f6e8b20","name":"@bluelibs/serverless-plugin-typescript","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bluelibs/serverless-plugin-typescript","version":"1.0.0","license":"MIT","main":"dist/src/index.js","scripts":{"build":"rimraf dist && tsc","lint":"tslint -c tslint.json 'src/**/*.ts'","prepare-release":"standard-version","prepublish":"npm run build","precommit":"npm run test","pretest":"npm run lint","test":"jest"},"standard-version":{"skip":{"commit":true,"tag":true},"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"perf","section":"Performance Improvements"},{"type":"refactor","section":"Maintenance Improvements"}]},"repository":{"type":"git","url":"git+https://github.com/serverless/serverless-plugin-typescript.git"},"keywords":["serverless","serverless plugin","typescript","aws lambda"],"devDependencies":{"@types/fs-extra":"5.0.5","@types/jest":"24.0.12","@types/lodash":"4.14.123","@types/node":"12.6.2","jest":"24.5.0","mock-fs":"4.9.0","rimraf":"2.6.3","standard-version":"^9.3.2","ts-jest":"24.0.2","tslint":"5.14.0","typescript":"^3.9.10"},"dependencies":{"fs-extra":"^7.0.1","globby":"^10.0.2","lodash":"^4.17.21"},"peerDependencies":{"serverless":"2 || 3","typescript":">=2.2.2"},"jest":{"preset":"ts-jest","testRegex":"(/__tests__/.*|\\.(test|spec))\\.ts$","moduleFileExtensions":["ts","tsx","js"]},"engines":{"node":">=10.0"},"gitHead":"e2c32e2ff5a1bd060bd595728340f7806541cbba","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/serverless/serverless-plugin-typescript/issues"},"homepage":"https://github.com/serverless/serverless-plugin-typescript#readme","_id":"@bluelibs/serverless-plugin-typescript@1.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-tH2KnQmXGzq9dcXYO8PFo1h9EApy/aZZU+aMZDmFcM8bGJQUIpK0ZkBnCvNmukutqrZrSiyE1YoRicLfDRldig==","shasum":"85ede537ab94df1b643072959cfdcdf7f3430cba","tarball":"https://registry.npmjs.org/@bluelibs/serverless-plugin-typescript/-/serverless-plugin-typescript-1.0.0.tgz","fileCount":21,"unpackedSize":50725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiOwwrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqX9A/8CgEbb8OuCznhXFoSBVKkgPUxMpUYtZ4LFIx+4bJ0sZtjGC66\r\nS8NprUiJLsHQZ6iTnrMXn+fYLxgRUdR9jTXs4sZx2F5tNkIsTLZu47tJ5Zii\r\npL0GRKqAc0StHZouyyMC1skuUXFfFsd2ZBbGs7KTbhzNNcKi/7dyxlwtJzvX\r\nrDTiYIyr+snFFy2wsE8KpB/EYOYJaiN2TqKqV3sLbnD3KL0daCBmfLW4bNsK\r\nTVV0l1htHF6VARSiEK5jC5pv4lKK3R9VfYVTT3MPZ8TAA3jV0LKzNf/w6Htj\r\nbZ19brifQ2WdMcwcAQjlbYYKQNxDLSWuh6tAvoSz7bwwmAuT5Y4a/zPtRIVl\r\n36qys+w90HKOwUHEWeRo0kuq5pBGW/yNQsuPJc2rqp7ZL2aq00V2tP57ia4E\r\n4VgALwQ/gcsOUOaeqXsup6kr3qX2pJVQS2qAiBWtgqG02RwuNhA4VM/GajH1\r\nniAIIDdbL0nmxYyXAwAHwx1MkkAxwPG9x4b8xITCS2Tc3F2OShzEImbWtZjp\r\nIGYYcFTS1yEayTIGl8EGp2WScpSqjk4MjBYZAZEvdV+kz0hW5wlaiB6QwtMz\r\nG+4hdt4xV5MNtTgfVHNJXRSkMzYw3DejNyUY4Na1Q6oCbUB6EsJ9YvFz4ZcS\r\nd/6bi96huWNi379dgCo6o15gJuqbgoTs3Ek=\r\n=Z8Wh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqOyEupPRbMZsZ8Ttnzw1z6qzm1f92i1oeLhXxAByhswIhAOF9zDxlFWtcNbkdA927NO137ggLQFVoJEMq2CNY6O9R"}]},"_npmUser":{"name":"theodordiaconu","email":"diaconu.theodor@gmail.com"},"directories":{},"maintainers":[{"name":"theodordiaconu","email":"diaconu.theodor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-plugin-typescript_1.0.0_1648036907245_0.6628551455097016"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-23T12:01:47.189Z","1.0.0":"2022-03-23T12:01:47.381Z","modified":"2022-04-04T19:48:54.112Z"},"maintainers":[{"name":"theodordiaconu","email":"diaconu.theodor@gmail.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/serverless/serverless-plugin-typescript#readme","keywords":["serverless","serverless plugin","typescript","aws lambda"],"repository":{"type":"git","url":"git+https://github.com/serverless/serverless-plugin-typescript.git"},"bugs":{"url":"https://github.com/serverless/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\n_Originally developed by [Prisma Labs](https://github.com/prisma-labs/), now maintained in scope of [Serverless, Inc](https://www.serverless.com/)_\n\nServerless plugin for zero-config Typescript support\n\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 typescript\n# or\nnpm install -D serverless-plugin-typescript 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    \"allowJs\": 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### Non-standard tsconfig.json locations\nOverride what tsconfig.json to use with the following snippet in your severless.yaml\n```\ncustom:\n  serverlessPluginTypescript:\n    tsConfigFileLocation: './tsconfig.build.json'\n\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","readmeFilename":"README.md"}