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

Deps #167

Merged
merged 4 commits into from
Apr 29, 2024
Merged

Deps #167

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To maintain a high standard of quality in our releases, before merging every pull request we ask that you've completed the following:

- [ ] Forked the repo and created your branch from `master`
- [ ] Forked the repo and created your branch from `main`
- [ ] Made sure tests pass (run `npm it` from the repo root)
- [ ] Expanded test coverage related to your changes:
- [ ] Added and/or updated unit tests (if appropriate)
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
# Go
steps:
- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -40,7 +40,14 @@ jobs:
- name: Install
run: npm install

- name: Test (Node.js <= 16.x)
if: matrix.node-version <= '16.x'
run: npm run test:nolint
env:
CI: true

- name: Test
if: matrix.node-version > '16.x'
run: npm test
env:
CI: true
Expand All @@ -67,10 +74,10 @@ jobs:
# Go
steps:
- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
Expand Down
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

---

## [9.0.3] 2024-04-29

### Changed

- Updated dependencies
- Updated `package.json` `engines.node` property to reflect changes from vX

---

## [9.0.2] 2024-03-25

### Changed
Expand Down
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const arc = require('@architect/eslint-config')

module.exports = [
...arc,
{
ignores: [
'.nyc_output/',
'coverage/',
'test/slow/mock/',
'vendor/arc-proxy-*',
],
},
]
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"main": "src/index.js",
"scripts": {
"lint": "eslint . --fix",
"test": "npm run lint && npm run coverage",
"test:nolint": "npm run coverage",
"test:unit": "cross-env tape 'test/unit/**/*-test.js' | tap-arc",
"test:integration": "cross-env tape 'test/integration/**/*-test.js' | tap-arc",
"coverage": "nyc --reporter=lcov --reporter=text npm run test:unit",
"test": "npm run lint && npm run coverage",
"rc": "npm version prerelease --preid RC"
},
"engines": {
"node": ">=14"
"node": ">=16"
},
"repository": {
"type": "git",
Expand All @@ -21,16 +22,16 @@
"author": "Brian LeRoux <b@brian.io>",
"license": "Apache-2.0",
"dependencies": {
"@architect/inventory": "~4.0.4",
"@architect/utils": "~4.0.4"
"@architect/inventory": "~4.0.5",
"@architect/utils": "~4.0.6"
},
"devDependencies": {
"@architect/eslint-config": "~2.1.2",
"@aws-lite/client": "^0.20.0",
"@aws-lite/s3": "^0.1.20",
"@architect/eslint-config": "~3.0.0",
"@aws-lite/client": "^0.21.1",
"@aws-lite/s3": "^0.1.21",
"cross-env": "^7.0.3",
"eslint": "~8.57.0",
"mock-tmp": "~0.0.3",
"eslint": "~9.1.1",
"mock-tmp": "~0.0.4",
"nyc": "^15.1.0",
"run-parallel": "~1.2.0",
"tap-arc": "~1.2.2",
Expand Down
4 changes: 2 additions & 2 deletions scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module.exports = function deploy (params = {}, callback) {
'--template-file', `${appname}-cfn.yaml`,
'--stack-name', name,
'--s3-bucket', bucket,
'--capabilities', 'CAPABILITY_AUTO_EXPAND', 'CAPABILITY_IAM'
'--capabilities', 'CAPABILITY_AUTO_EXPAND', 'CAPABILITY_IAM',
], { log, verbose }, callback)
},

Expand All @@ -152,7 +152,7 @@ module.exports = function deploy (params = {}, callback) {
else {
callback()
}
}
},

], callback)
return promise
Expand Down
2 changes: 1 addition & 1 deletion scripts/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module.exports = function samPackage ({ filename, bucket, log, verbose }, callba
'--output-template-file',
filename.replace('json', 'yaml'),
'--s3-bucket',
bucket
bucket,
], { log, verbose }, callback)
}
4 changes: 2 additions & 2 deletions scripts/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ module.exports = function pretty ({ log, verbose }) {
if (!log) return
let check = chalk.green('✓')
let msg = chalk.grey('Deployed')
let time = chalk.green.bold((Date.now() - ts) / 1000 + ' seconds')
let time = chalk.green.bold(((Date.now() - ts) / 1000) + ' seconds')
console.log(check, msg, time)
}
},
}
}
8 changes: 4 additions & 4 deletions src/visitors/events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ module.exports = function visitEvents (inventory, template) {
template.Resources[eventLambda].Properties.Events[eventEvent] = {
Type: 'SNS',
Properties: {
Topic: { Ref: eventTopic }
}
Topic: { Ref: eventTopic },
},
}

// Create the SNS topic
template.Resources[eventTopic] = {
Type: 'AWS::SNS::Topic',
Properties: {
DisplayName: name,
Subscription: []
}
Subscription: [],
},
}

template.Outputs[eventTopic] = {
Expand Down
58 changes: 29 additions & 29 deletions src/visitors/globals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ module.exports = function visitGlobals (inventory, template) {
Statement: [ {
Effect: 'Allow',
Principal: {
Service: 'lambda.amazonaws.com'
Service: 'lambda.amazonaws.com',
},
Action: 'sts:AssumeRole'
} ]
Action: 'sts:AssumeRole',
} ],
},
Policies: []
}
Policies: [],
},
}

// Enables logs and capability reflection
Expand All @@ -38,11 +38,11 @@ module.exports = function visitGlobals (inventory, template) {
'logs:CreateLogGroup',
'logs:CreateLogStream',
'logs:PutLogEvents',
'logs:DescribeLogStreams'
'logs:DescribeLogStreams',
],
Resource: 'arn:aws:logs:*:*:*'
} ]
}
Resource: 'arn:aws:logs:*:*:*',
} ],
},
})

// allow lambdas read/write on the static bucket
Expand All @@ -66,17 +66,17 @@ module.exports = function visitGlobals (inventory, template) {
Resource: [ {
'Fn::Sub': [
'arn:aws:s3:::${bukkit}',
{ bukkit }
]
{ bukkit },
],
},
{
'Fn::Sub': [
'arn:aws:s3:::${bukkit}/*',
{ bukkit }
]
} ]
} ]
}
{ bukkit },
],
} ],
} ],
},
})
}

Expand All @@ -98,23 +98,23 @@ module.exports = function visitGlobals (inventory, template) {
'Fn::Sub': 'arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*',
},
},
]
}
],
},
})
function getTableArns (tables) {
return tables.map(table => {
let name = `${toLogicalID(table.name)}Table`
return [ {
'Fn::Sub': [
'arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}',
{ tablename: { Ref: name } }
]
{ tablename: { Ref: name } },
],
},
{
'Fn::Sub': [
'arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}/*',
{ tablename: { Ref: name } }
]
{ tablename: { Ref: name } },
],
} ]
}).reduce((a, b) => a.concat(b), [])
}
Expand All @@ -131,15 +131,15 @@ module.exports = function visitGlobals (inventory, template) {
'sns:Publish',
],
Resource: getTopicArn(),
} ]
}
} ],
},
})
function getTopicArn () {
return {
'Fn::Sub': [
'arn:aws:sns:${AWS::Region}:${AWS::AccountId}:${AWS::StackName}*',
{}
]
{},
],
}
}
}
Expand All @@ -158,9 +158,9 @@ module.exports = function visitGlobals (inventory, template) {
'sqs:DeleteMessage',
'sqs:GetQueueAttributes',
],
Resource: '*'
} ]
}
Resource: '*',
} ],
},
})
}

Expand Down
Loading