actionhero / next-in-actionhero

An example project that runs the Next.JS react server inside of ActionHero
4 stars 0 forks source link

Update actionhero to the latest version 🚀 #30

Closed greenkeeper[bot] closed 5 years ago

greenkeeper[bot] commented 5 years ago

The dependency actionhero was updated from 19.2.2 to 20.0.0.

This version is not covered by your current version range.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.


Publisher: evantahler License: Apache-2.0

Release Notes for v20.0.0

Always prefer actionhero in node_modules

Related to actionhero/ah-swagger-plugin#6

We have changed how Actionhero loads itself to always prefer components in node_modules relative to the cwd (current working directory):

Pros

  • There is no change to the behavior or a normal actionhero project
  • Globally installed Actionhero (npm install -g actionhero) is now resistant to minor version changes between projects
  • Allows plugins to install a version of actionhero as a devDependancy, and for us to boot the project and not have conflicting paths to source actionhero from. You can now just npm start (./node_modules/.bin/actionhero) in your plugins to start a server to run your plugins

Cons

  • If you start actoinhero from a dameon (like forever) without first cd-ing to the proper directory first things might not work depending on your load paths.
  • Slightly slower boot time (as we are checking if files exist before trying to load them).
  • Things (may) weird with yarn/lerna workspaces

This is a breaking change

Via #1338

Create tests for actions and tasks when generating via CLI

Completes #1005

When generating a new action or task via the CLI, a template test will also now be creates in __tests__. This will help encourage better testing of your actionhero projects. Of course, you can always delete the test files if you don't want it.

Adds api.config.general.paths.test as setting in ./config/api.js which defaults to [path.join(__dirname, '/../__tests__')]

This is a breaking change due to the new path

Via #1332

Add custom http status code with error object

Currently, we have to add the custom error response code like this:
data.connection.rawConnection.responseHttpCode = 404
We can use the error.code that already exists in the error object

Now in action, you can do something like this :

const raiseNotFound = <your-condition>
if(raiseNotFound) {
  const notFoundError = new Error(<msg>)
  notFoundError.code = 404
   throw notFoundError
}

via #1334

findEnqueuedTasks

Adds api.specHelper.findEnqueuedTasks to write tests that check that task was enqueued!

describe('task testing', () => {
  beforeEach(async () => {
    await api.resque.queue.connection.redis.flushdb()
  })

  test('detect that a task was enqueued to run now', async () => {
    await api.tasks.enqueue('regularTask', { word: 'testing' })
    const found = await api.specHelper.findEnqueuedTasks('regularTask')
    expect(found.length).toEqual(1)
    expect(found[0].args[0].word).toEqual('testing')
    expect(found[0].timestamp).toBeNull()
  })
})

via #1331

Misc

  • Testing Actionhero should be less flaky now!
    • CircleCI fixes (via #1328)
    • When possible, start tests with a clean redis DB (via #1333)
    • Ensure we are running in NODE_ENV=test (via #1336)
Commits

The new version differs by 20 commits.

  • f7e2d75 v20.0.0
  • 5f5acc4 Fix Generate plugin (#1339)
  • c025acf Always prefer actionhero in node_modules (#1338)
  • 1febe1e Update deps (#1337)
  • 0354b06 add a test for the NODE_ENV (#1336)
  • 86a2f7b feature: add custom http status code with error object (#1334)
  • 709fa27 update node-resque
  • a0be681 Merge pull request #1332 from actionhero/generated-tests
  • 524e349 Merge branch 'master' into generated-tests
  • e0e9c28 when possible, start tests with a clean redis DB (#1333)
  • b447dd9 more robust checking for silly jest stderr writing
  • 0ede563 update position of example status test in new project
  • 0d0e6fe create tests for actions and tasks when generating via CLI
  • 9344d4c update browser_fingreprint
  • 9dae93f Merge pull request #1331 from actionhero/test-task-enqueue

There are 20 commits in total.

See the full diff


FAQ and help There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).

Your Greenkeeper bot :palm_tree: