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

CI - Reuse organisation's workflows to lint, test, tag and publish #13

Merged
merged 4 commits into from
Nov 3, 2021

Commits on Nov 3, 2021

  1. build: update ember-cli to version 3.28.3

    ```
    ember-cli-update --to 3.28
    ```
    MrChocolatine committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    9d7e8e9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fc21ad8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    04a495f View commit details
    Browse the repository at this point in the history
  4. fix: fix Embroider test scenarios

    These changes aim to fix the following errors:
    https://github.com/peopledoc/ember-reading-time/actions/runs/1409500930
    
    _Extract of the error:_
    
    ```
      - broccoliBuilderErrorStack: ModuleNotFoundError: Module not found:
      Error: Can't resolve 'stream' in '/home/runner/work/ember-reading-time/ember-reading-time/node_modules/reading-time/lib/stream.js'
    Did you mean './stream'?
    Requests that should resolve in the current directory need to start with './'.
    Requests that start with a name are treated as module requests and resolve
    within module directories (node_modules).
    If changing the source code is not an option there is also a resolve
    options called 'preferRelative' which tries to resolve these kind of
    requests in the current directory too.
    
    BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core
    modules by default.
    This is no longer the case. Verify if you need this module and configure
    a polyfill for it.
    
    If you want to include a polyfill, you need to:
    	- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
    	- install 'stream-browserify'
    ```
    
    During the Embroider tests the Node.js module `stream` couldn't be found
    because, in these tests, Webpack v5 is used, instead of the v4 used by
    `ember-auto-import@v1` (see `yarn why webpack`).
    
    This code was telling Webpack to include the polyfill for `stream`:
    https://github.com/peopledoc/ember-reading-time/blob/v1.0.0/index.js#L7-L11
    
    But this was only understood by Webpack v4:
    - embroider-build/embroider#1004 (comment)
    - https://v4.webpack.js.org/configuration/node/#other-node-core-libraries
    
    In Webpack v5, Node.js polyfills are *NOT* automatically included:
    - https://gist.github.com/ef4/d2cf5672a93cf241fd47c020b9b3066a
    - https://github.com/ef4/ember-auto-import/blob/v2.2.3/docs/upgrade-guide-2.0.md#webpack-5-upgrade
    - https://webpack.js.org/configuration/node/
    
      > As of webpack 5, You can configure only `global`, `__filename` or
      > `__dirname` under `node` option. If you're looking for how to
      > polyfill `fs` alike in Node.js under webpack 5, please check
      > `resolve.fallback` for help.
    MrChocolatine committed Nov 3, 2021
    Configuration menu
    Copy the full SHA
    e0da4af View commit details
    Browse the repository at this point in the history