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

Upgrade Node and dependent packages to the latest version #198

Merged
merged 8 commits into from
Jan 17, 2020

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jan 17, 2020

This PR will upgrade Node LTS and dependent packages to the latest version via yarn upgrade --latest.

Notable changes

Node

  • Node 8 had reached EOL. Marp CLI would no longer support Node 8.
  • Node LTS version has been bumped to v12.14.1.

Dependent packages

  • Upgrade Marpit to v1.5.0 and Marp Core v1.0.1.
    • Both of Marp module have some breaking changes about type definition.
  • Migration of rollup official plugins into monorepo is still in progress.
    • rollup-plugin-commonjs => @rollup/plugin-commonjs
    • rollup-plugin-typescript => @rollup/plugin-typescript

@yhatt
Copy link
Member Author

yhatt commented Jan 17, 2020

A bumped Marp Core v1.0.0 seems not to work.
https://app.circleci.com/jobs/github/marp-team/marp-cli/2811/parallel-runs/0/steps/0-111

$ jest --coverage --ci -i --reporters=default --reporters=jest-junit
 FAIL  test/marp-cli.ts
  ● Test suite failed to run

    TypeError: z is not a function



      at Object.<anonymous> (node_modules/@marp-team/marp-core/lib/marp.js:1:1030)
      at Object.<anonymous> (src/config.ts:6022:26)

Same issue has reported to marp-team/marp-react#19 by user.

@@ -4,8 +4,12 @@ import resolve from '../src/engine'
describe('Engine', () => {
describe('.resolve', () => {
it('returns ResolvedEngine class with resolved class', async () => {
expect((await resolve(Marp)).klass).toBe(Marp)
expect((await resolve('@marp-team/marp-core')).klass.name).toBe('Marp')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of Marp class provided by Marp Core v1.0.1 has applied minification by bumped terser.

Marp CLI will use name defined in package.json but won't use engine name. We updated test case, to confirm matching a resolved class with imported Marp Core.

@@ -125,7 +125,8 @@ export class ThemeSet {
const fnForWatch: Set<string> = new Set(found.map(f => path.resolve(f)))

for (const f of fn) {
if (!hasMagic(f)) {
// globby's hasMagic (backed by fast-glob) always recognizes "\\" (Windows path separator) as the escape character.
if (!hasMagic(f.split(path.sep).join('/'))) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

globby v11 provides hasMagic() backed by fast-glob instead of node-glob. fast-glob will recognize \ (Windows path separator) as a magic character for escape, so we have to normalize it for watching theme directory correctly.

@yhatt yhatt merged commit 8f13d60 into master Jan 17, 2020
@yhatt yhatt deleted the upgrade-node-and-dependencies branch January 17, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant