Skip to content

Commit

Permalink
style: use floydspace opinionated prettier rules; use strict node eng…
Browse files Browse the repository at this point in the history
…ine v16 development version
  • Loading branch information
floydspace committed Sep 24, 2022
1 parent d976e9f commit 774a4bc
Show file tree
Hide file tree
Showing 26 changed files with 404 additions and 301 deletions.
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior. If you have an example repository that would be even better:

1. Set X to `true`
2. Run `sls package`

Expand All @@ -22,9 +22,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots or logs to help explain your problem.

**Versions (please complete the following information):**
- OS: [e.g. Linux, Mac, Windows]
- Serverless Framework Version: [e.g. 3.0.0]
- Plugin Version: [e.g. 1.25.0]

- OS: [e.g. Linux, Mac, Windows]
- Serverless Framework Version: [e.g. 3.0.0]
- Plugin Version: [e.g. 1.25.0]

**Additional context**
Add any other context about the problem here.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ The following `esbuild` options are automatically set.

#### Watch Options

| Option | Description | Default |
| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `pattern` | An [anymatch-compatible definition](https://github.com/es128/anymatch) for the watcher to respond to | `./\*_/_.(js\|ts)` (watches all `.js` and `.ts` files) |
| `ignore` | An [anymatch-compatible definition](https://github.com/es128/anymatch) for the watcher to ignore | `'.esbuild', 'dist', 'node_modules', '.build']` |
| Option | Description | Default |
| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `pattern` | An [anymatch-compatible definition](https://github.com/es128/anymatch) for the watcher to respond to | `./\*_/_.(js\|ts)` (watches all `.js` and `.ts` files) |
| `ignore` | An [anymatch-compatible definition](https://github.com/es128/anymatch) for the watcher to ignore | `'.esbuild', 'dist', 'node_modules', '.build']` |

## Supported Runtimes

Expand Down
12 changes: 6 additions & 6 deletions examples/complete/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "complete",
"version": "0.1.0",
"scripts": {
"start": "sls offline"
},
"dependencies": {
"isin-validator": "^1.1.1"
},
"devDependencies": {
"@types/node": "^11.13.0",
"esbuild": "^0.14.2",
Expand All @@ -9,11 +15,5 @@
"serverless-offline": "^6.4.0",
"ts-node": "^8.1.0",
"typescript": "~3.9.7"
},
"dependencies": {
"isin-validator": "^1.1.1"
},
"scripts": {
"start": "sls offline"
}
}
10 changes: 4 additions & 6 deletions examples/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ module.exports = () => {
minify: true,
sourcemap: false,
keepNames: true,
external: [
'lodash'
],
external: ['lodash'],
plugins: [
{
name: 'log-lodash',
setup(build) {
// test interception : log all lodash imports
build.onResolve({ filter: /^lodash$/ }, args => {
build.onResolve({ filter: /^lodash$/ }, (args) => {
console.log(args);
});
},
}
]
},
],
};
};
6 changes: 3 additions & 3 deletions examples/config/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"main": "handler.js",
"scripts": {
"start": "sls offline"
},
"dependencies": {
"lodash": "^4.17.4"
},
Expand All @@ -10,8 +13,5 @@
"serverless": "^2.36.0",
"serverless-esbuild": "file:../..",
"serverless-offline": "^6.4.0"
},
"scripts": {
"start": "sls offline"
}
}
1 change: 0 additions & 1 deletion examples/individually/hello1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as _ from 'lodash';

// modern module syntax
export async function handler(event, context, callback) {

// dependencies work as expected
console.log(_.VERSION);

Expand Down
1 change: 0 additions & 1 deletion examples/individually/hello2.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// modern module syntax
export async function handler(event, context, callback) {
// async/await also works out of the box
Expand Down
6 changes: 3 additions & 3 deletions examples/individually/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"main": "handler.js",
"scripts": {
"start": "sls offline"
},
"dependencies": {
"lodash": "^4.17.4"
},
Expand All @@ -10,8 +13,5 @@
"serverless": "^2.36.0",
"serverless-esbuild": "^1.26.1",
"serverless-offline": "^6.4.0"
},
"scripts": {
"start": "sls offline"
}
}
2 changes: 1 addition & 1 deletion examples/individually/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let envPlugin = {
name: 'log-lodash',
setup(build) {
// test interception : log all lodash imports
build.onResolve({ filter: /^lodash$/ }, args => {
build.onResolve({ filter: /^lodash$/ }, (args) => {
console.log(args);
});
},
Expand Down
3 changes: 1 addition & 2 deletions examples/individually/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ provider:

custom:
esbuild:
plugins : ./plugins.js
plugins: ./plugins.js
packager: yarn
bundle: true
minify: true
Expand All @@ -22,7 +22,6 @@ custom:
external:
- lodash


functions:
hello1:
handler: hello1.handler
Expand Down
12 changes: 6 additions & 6 deletions examples/minimal/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "minimal",
"version": "0.1.0",
"scripts": {
"start": "sls offline"
},
"dependencies": {
"isin-validator": "^1.1.1"
},
"devDependencies": {
"@types/node": "^11.13.0",
"esbuild": "^0.14.2",
"serverless": "^2.17.0",
"serverless-esbuild": "^1.26.1",
"serverless-offline": "^6.4.0"
},
"dependencies": {
"isin-validator": "^1.1.1"
},
"scripts": {
"start": "sls offline"
}
}
Loading

0 comments on commit 774a4bc

Please sign in to comment.