Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two issues for symbolic linking issues with Windows (EPERM: operation not permitted, scandir/symlink) #103

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 22 additions & 6 deletions README.md
@@ -1,8 +1,20 @@
# serverless-plugin-typescript
[![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/graphcool/serverless-plugin-typescript.svg?branch=master)](https://travis-ci.org/graphcool/serverless-plugin-typescript)
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)

Serverless plugin for zero-config Typescript support

## HEWMEN Update
Original NPM Module: http://www.npmjs.com/package/serverless-plugin-typescript

This version of `serverless-typescript-plugin` fixes symbolic link issues with Windows OS resulting in the following errors:

> 1) EPERM: operation not permitted, scandir...
> 2) EPERM: operation not permitted, symlink...

When attaching the "node_modules" folder to the build

Created PR for original plugin: http://www.github.com/prismagraphql/serverless-plugin-typescript/pull/103

## Features

* Zero-config: Works out of the box without the need to install any other compiler or plugins
Expand All @@ -14,14 +26,18 @@ Serverless plugin for zero-config Typescript support
## Install

```sh
yarn add --dev serverless-plugin-typescript
yarn add --dev @hewmen/serverless-plugin-typescript
```
or
```
npm install --save-dev @hewmen/serverless-plugin-typescript
```

Add the following plugin to your `serverless.yml`:

```yaml
plugins:
- serverless-plugin-typescript
- '@hewmen/serverless-plugin-typescript'
```

## Configure
Expand Down Expand Up @@ -92,12 +108,12 @@ The normal Serverless deploy procedure will automatically compile with Typescrip
The plugin integrates very well with [serverless-offline](https://github.com/dherault/serverless-offline) to
simulate AWS Lambda and AWS API Gateway locally.

Add the plugins to your `serverless.yml` file and make sure that `serverless-plugin-typescript`
Add the plugins to your `serverless.yml` file and make sure that `@hewmen/serverless-plugin-typescript`
precedes `serverless-offline` as the order is important:
```yaml
plugins:
...
- serverless-plugin-typescript
- '@hewmen/serverless-plugin-typescript'
...
- serverless-offline
...
Expand All @@ -113,7 +129,7 @@ Configure your service the same as mentioned above, but additionally add the `se
plugin as follows:
```yaml
plugins:
- serverless-plugin-typescript
- '@hewmen/serverless-plugin-typescript'
- serverless-dynamodb-local
- serverless-offline
```
Expand Down
6 changes: 3 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "serverless-plugin-typescript",
"version": "0.0.0-semantic-release",
"name": "@hewmen/serverless-plugin-typescript",
"version": "1.1.17",
"main": "dist/src/index.js",
"files": [
"dist",
Expand All @@ -17,7 +17,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/graphcool/serverless-plugin-typescript.git"
"url": "git+https://github.com/hewmen/serverless-plugin-typescript.git"
},
"keywords": [
"serverless",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Expand Up @@ -138,12 +138,12 @@ export class TypeScriptPlugin {
async copyExtras() {
// include node_modules into build
if (!fs.existsSync(path.resolve(path.join(buildFolder, 'node_modules')))) {
fs.symlinkSync(path.resolve('node_modules'), path.resolve(path.join(buildFolder, 'node_modules')))
fs.symlinkSync(path.resolve('node_modules'), path.resolve(path.join(buildFolder, 'node_modules')), 'junction')
}

// include package.json into build so Serverless can exlcude devDeps during packaging
if (!fs.existsSync(path.resolve(path.join(buildFolder, 'package.json')))) {
fs.symlinkSync(path.resolve('package.json'), path.resolve(path.join(buildFolder, 'package.json')))
fs.symlinkSync(path.resolve('package.json'), path.resolve(path.join(buildFolder, 'package.json')), 'file')
}

// include any "extras" from the "include" section
Expand Down