Skip to content

Commit

Permalink
Default runtime is now nodejs14.x; remove support for Architect 5
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Jul 22, 2021
1 parent 6fa3be8 commit d6cab32
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 29 deletions.
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

---

## [2.0.0 - 2.0.1] 2021-07-22
## [2.0.0 - 2.0.2] 2021-07-22

### Added
### Changed

- Default runtime is now `nodejs14.x`
- Breaking change: removed support for Node.js 10.x (now EOL, and no longer available to created in AWS Lambda)
- Breaking change: removed support for Architect 5 WebSocket folder paths (prepended by `ws-`)
- Updated dependencies

---
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@architect/asap": "~3.13.8",
"@architect/parser": "~4.0.0",
"@architect/utils": "~3.0.0"
"@architect/utils": "~3.0.1"
},
"devDependencies": {
"@architect/eslint-config": "~1.0.0",
Expand Down
3 changes: 1 addition & 2 deletions src/config/pragmas/populate-lambda/_websockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ module.exports = function populateWebSockets ({ item, dir, cwd, errors }) {
if (typeof item === 'string') {
let name = item
let route = name // Same as name, just what AWS calls it
let folder = process.env.DEPRECATED ? `ws-${name}` : name
let src = join(cwd, dir, folder)
let src = join(cwd, dir, name)
return { name, route, src }
}
else if (typeof item === 'object' && !Array.isArray(item)) {
Expand Down
2 changes: 1 addition & 1 deletion src/defaults/function-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = function createDefaultFunctionConfig () {
return {
timeout: 5,
memory: 1152,
runtime: 'nodejs12.x', // TODO add runtime validation
runtime: 'nodejs14.x', // TODO add runtime validation
handler: 'index.handler',
state: 'n/a',
concurrency: 'unthrottled',
Expand Down
23 changes: 0 additions & 23 deletions test/unit/src/config/pragmas/ws-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,6 @@ ${complexValues.join('\n')}
})
})

test(`@ws population: deprecated mode (prepends 'ws-')`, t => {
t.plan(14)
process.env.DEPRECATED = true
let defaults = [ 'connect', 'default', 'disconnect' ]
let arc = parse(`
@ws
${defaults.join('\n')}
`)
let ws = populateWS({ arc, inventory })
t.equal(ws.length, defaults.length, 'Got correct number of routes back')
defaults.forEach(val => {
t.ok(ws.some(route => route.name === val), `Got route.name: ${val}`)
t.ok(ws.some(route => route.route === val), `Got route.route: ${val}`)
})
ws.forEach(route => {
let { name, handlerFile, src } = route
t.equal(src, join(wsDir, 'ws-' + name), `Route configured with correct source dir: ${src}`)
t.ok(handlerFile.startsWith(src), `Handler file is in the correct source dir`)
})
delete process.env.DEPRECATED
t.notOk(process.env.DEPRECATED, 'Cleaned up deprecated status')
})

test('@ws population: invalid paths errors', t => {
t.plan(3)
let arc
Expand Down

0 comments on commit d6cab32

Please sign in to comment.