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 #91

Merged
merged 4 commits into from
Apr 29, 2024
Merged

Deps #91

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
1 change: 0 additions & 1 deletion .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 @@

---

## [5.0.3] 2024-04-29

### Changed

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

---

## [5.0.2] 2024-03-25

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

module.exports = [
...arc,
{
ignores: [
'node_modules/',
'src/write-plugin/plugin.js',
],
},
]
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,32 @@
},
"scripts": {
"test": "npm run lint && npm run test:integration && npm run coverage",
"test:nolint": "npm run test:integration && npm run coverage",
"test:unit": "cross-env PORT=6666 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",
"lint": "eslint . --fix",
"rc": "npm version prerelease --preid RC"
},
"engines": {
"node": ">=14"
"node": ">=16"
},
"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",
"chalk": "4.1.2",
"lambda-runtimes": "~2.0.2",
"minimist": "~1.2.8"
},
"devDependencies": {
"@architect/eslint-config": "~2.1.2",
"@architect/eslint-config": "~3.0.0",
"cross-env": "~7.0.3",
"eslint": "~8.57.0",
"eslint": "~9.1.1",
"fs-extra": "~11.2.0",
"nyc": "~15.1.0",
"proxyquire": "^2.1.3",
"tap-arc": "^1.2.2",
"tape": "~5.7.5"
},
"eslintConfig": {
"extends": "@architect/eslint-config"
}
}
8 changes: 4 additions & 4 deletions src/bootstrap/_arc-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ module.exports = function arcPackage ({ name, folder }) {
version: '0.0.0',
description: 'A fresh new Architect project!',
scripts: {
start: 'npx sandbox'
start: 'npx sandbox',
},
devDependencies: {}
devDependencies: {},
}
writeFileSync(packageFile, JSON.stringify(package, null, 2))
return true
}
else {
let existing = JSON.parse(readFileSync(packageFile).toString())
if (existing.dependencies && existing.dependencies['@architect/architect'] ||
existing.devDependencies && existing.devDependencies['@architect/architect']) {
if ((existing.dependencies && existing.dependencies['@architect/architect']) ||
(existing.devDependencies && existing.devDependencies['@architect/architect'])) {
return false
}
return true
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function bootstrap (params) {
update.status(
'Bootstrapping new Architect project',
`Project name .. ${name}`,
`Creating in ... ${folder}`
`Creating in ... ${folder}`,
)
mkdirSync(folder, { recursive: true })
}
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ module.exports = async function create (params = {}, callback) {
process.exit(1)
}
// TODO: This blows up Node.js 12 running `npm init @architect` if required in global; move this back after 12 is EOL
// eslint-disable-next-line
let _inventory = require('@architect/inventory')

let promise
Expand Down
2 changes: 1 addition & 1 deletion src/write-functions/templates/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let node = {
esm: `// ${learn}
export async function handler (event) {${nodeBody}}`,
cjs: `// ${learn}
exports.handler = async function subscribe (event) {${nodeBody}}`
exports.handler = async function subscribe (event) {${nodeBody}}`,
}

let deno = `// ${learn}
Expand Down
2 changes: 1 addition & 1 deletion src/write-functions/templates/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ let node = {
esm: path => `// ${learn}
export async function handler (req) {${nodeBody(path)}}`,
cjs: path => `// ${learn}
exports.handler = async function http (req) {${nodeBody(path)}}`
exports.handler = async function http (req) {${nodeBody(path)}}`,
}

let ruby = path => `# ${learn}
Expand Down
2 changes: 1 addition & 1 deletion src/write-functions/templates/queues.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let node = {
esm: `// ${learn}
export async function handler (event) {${nodeBody}}`,
cjs: `// ${learn}
exports.handler = async function queue (event) {${nodeBody}}`
exports.handler = async function queue (event) {${nodeBody}}`,
}


Expand Down
2 changes: 1 addition & 1 deletion src/write-functions/templates/scheduled.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let node = {
esm: `// ${learn}
export async function handler (event) {${nodeBody}}`,
cjs: `// ${learn}
exports.handler = async function scheduled (event) {${nodeBody}}`
exports.handler = async function scheduled (event) {${nodeBody}}`,
}

let deno = `// ${learn}
Expand Down
2 changes: 1 addition & 1 deletion src/write-functions/templates/tables-streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let node = {
esm: `// ${learn}
export async function handler (event) {${nodeBody}}`,
cjs: `// ${learn}
exports.handler = async function tableStream (event) {${nodeBody}}`
exports.handler = async function tableStream (event) {${nodeBody}}`,
}

let deno = `// ${learn}
Expand Down
2 changes: 1 addition & 1 deletion src/write-functions/templates/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let node = {
esm: `// ${learn}
export async function handler (req) {${nodeBody}}`,
cjs: `// ${learn}
exports.handler = async function ws (req) {${nodeBody}}`
exports.handler = async function ws (req) {${nodeBody}}`,
}

let deno = `// ${learn}
Expand Down
2 changes: 1 addition & 1 deletion src/write-plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function writeNewPlugin (params, callback) {
writeFileSync(pluginFile, template)
update.status(
`Created new plugin at: ${join('src', 'plugins', plugin)}`,
`Add '${plugin}' to your project manifest's @plugins pragma`
`Add '${plugin}' to your project manifest's @plugins pragma`,
)
callback()
}
4 changes: 2 additions & 2 deletions test/unit/src/bootstrap/_arc-package-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ let fsStub = {
destination = dest
written = data
},
'@noCallThru': false
'@noCallThru': false,
}
let arcPackage = proxyquire('../../../../src/bootstrap/_arc-package', {
fs: fsStub
fs: fsStub,
})
let foo = 'foo'
let name = foo
Expand Down
8 changes: 4 additions & 4 deletions test/unit/src/write-functions/write-code-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ let fsStub = {
writeFileSync: (dest, data) => {
destination = dest
written = data
}
},
}
let sut = join(process.cwd(), 'src', 'write-functions', 'write-code')
let writeCode = proxyquire(sut, {
fs: fsStub
fs: fsStub,
})
let test = require('tape')

let inventory = {
inv: {
_project: {},
plugins: null,
}
},
}

test('Set up env', t => {
Expand All @@ -34,7 +34,7 @@ test('Should write template body if no body provided via argument', t => {
runtime: 'nodejs14.x',
},
handlerModuleSystem: 'cjs',
pragma: 'http'
pragma: 'http',
}, inventory)
t.equal(destination, 'src/http/get-catchall/index.js', 'Correct file location to be written to')
t.match(written, /async function http/, 'Correct argument-provided content written')
Expand Down