hapijs / hapi.dev

The hapi.dev developer portal
53 stars 68 forks source link

Build script is broken after `hapijs/.github` changes #509

Closed chalkpe closed 2 years ago

chalkpe commented 2 years ago

Support plan

Context

What are you trying to achieve or the steps to reproduce?

What was the result you got?

npm run dev

> hapi.dev@1.0.0 dev
> cross-env NODE_ENV=development nodemon server/index.js --watch server

 ERROR  Failed to compile with 2 errors

This dependency was not found:

* ~/static/lib/hapiInfo.json in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/api.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save ~/static/lib/hapiInfo.json

This relative module was not found:

* ../../static/lib/hapiInfo.json in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/resources/status.vue?vue&type=script&lang=js&

npm run generate:

> hapi.dev@1.0.0 generate
> node assets/js/getModuleInfo && nuxt generate

/Users/chalk/Documents/hapi.dev/assets/js/getModuleInfo.js:122
  let nodeGlobalVersions = Yaml.load(nodeYaml.data).jobs.test.strategy.matrix.node.reverse().filter(e=> e !== "*");
                                                                                   ^

TypeError: Yaml.load(...).jobs.test.strategy.matrix.node.reverse is not a function
    at getInfo (/Users/chalk/Documents/hapi.dev/assets/js/getModuleInfo.js:122:84)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Adding console.error(nodeYaml.data) before getModuleInfo.js:122:

...
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu, windows, macos]
        node: ${{ inputs.min-node-version == 14 && fromJSON('["*", "16", "14"]') || fromJSON('["16", "14", "12"]') }}
...

What result did you expect?

Required data is generated and page is built successfully.

Nargonath commented 2 years ago

Thank @ChalkPE for the detailed report. It seems we forgot that the website was leveraging the CI configuration to determine the supported node version and we didn't update it after the recent changes.

I expect though that Node 12 support will be dropped once it reaches EOL at the end of this month. I'm not sure we want to work on a fix for something that is likely to disappear in 2 weeks. Do you have an opinion on this @lloydbenson?