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
Merged
Show file tree
Hide file tree
Changes from 7 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
14 changes: 1 addition & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,6 @@ jobs:
steps:
- audit

test-node8:
executor:
name: node
browser: true
version: '8'
steps:
- test

test-node10:
executor:
name: node
Expand All @@ -149,7 +141,7 @@ jobs:
executor:
name: node
browser: true
version: '12.13.1' # Specify LTS version for development
version: '12.14.1' # Specify LTS version for development
steps:
- test

Expand All @@ -169,9 +161,6 @@ workflows:
test:
jobs:
- audit
- test-node8:
requires:
- audit
- test-node10:
requires:
- audit
Expand All @@ -180,7 +169,6 @@ workflows:
- audit
- docker-image-latest:
requires:
- test-node8
- test-node10
- test-node12
filters:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.13.1'
node-version: '12.14.1'
- name: Install with yarn
run: |
yarn policies set-version 1.21.1
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
fail-fast: false
matrix:
node-version:
- '^8.16.0'
- '^10.17.0'
- '12.13.1'
- '12.14.1'

steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.13.1
12.14.1
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.13.1-alpine
FROM node:12.14.1-alpine
LABEL maintainer "Marp team"

RUN apk update && apk upgrade && \
Expand Down
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"url": "https://github.com/marp-team/marp-cli"
},
"engines": {
"node": ">=8.16.0"
"node": ">=10"
},
"main": "lib/marp-cli.js",
"types": "types/src/marp-cli.d.ts",
Expand Down Expand Up @@ -63,22 +63,24 @@
"watch": "rollup -w -c"
},
"devDependencies": {
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-node-resolve": "^6.0.0",
"@rollup/plugin-replace": "^2.2.1",
"@rollup/plugin-url": "^4.0.0",
"@rollup/plugin-commonjs": "^11.0.1",
"@rollup/plugin-json": "^4.0.1",
"@rollup/plugin-node-resolve": "^7.0.0",
"@rollup/plugin-replace": "^2.3.0",
"@rollup/plugin-typescript": "^2.1.0",
"@rollup/plugin-url": "^4.0.1",
"@types/cheerio": "^0.22.15",
"@types/cosmiconfig": "^6.0.0",
"@types/express": "^4.17.2",
"@types/jest": "^24.0.23",
"@types/jest": "^24.9.0",
"@types/jest-plugin-context": "^2.9.2",
"@types/node": "^12.12.17",
"@types/node": "^12.12.24",
"@types/pug": "^2.0.4",
"@types/puppeteer": "^2.0.0",
"@types/supertest": "^2.0.8",
"@types/ws": "^6.0.4",
"@types/yargs": "^13.0.3",
"autoprefixer": "^9.7.3",
"@types/ws": "^7.2.0",
"@types/yargs": "^15.0.0",
"autoprefixer": "^9.7.4",
"bespoke": "bespokejs/bespoke",
"builtin-modules": "^3.1.0",
"cheerio": "^1.0.0-rc.3",
Expand All @@ -88,50 +90,48 @@
"jest": "^24.9.0",
"jest-junit": "^10.0.0",
"jest-plugin-context": "^2.9.0",
"nanoid": "^2.1.7",
"nanoid": "^2.1.9",
"npm-run-all": "^4.1.5",
"pkg": "^4.4.1",
"pkg": "^4.4.2",
"postcss-url": "^8.0.0",
"prettier": "^1.19.1",
"pug": "^2.0.4",
"rimraf": "^3.0.0",
"rollup": "^1.27.11",
"rollup-plugin-commonjs": "^10.1.0",
"rollup": "^1.29.0",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-pug": "^1.1.1",
"rollup-plugin-terser": "^5.1.3",
"rollup-plugin-typescript": "^1.0.1",
"sass": "^1.23.7",
"rollup-plugin-terser": "^5.2.0",
"sass": "^1.24.5",
"screenfull": "^5.0.0",
"stylelint": "^12.0.0",
"stylelint-config-prettier": "^8.0.0",
"stylelint": "^13.0.0",
"stylelint-config-prettier": "^8.0.1",
"stylelint-config-standard": "^19.0.0",
"stylelint-scss": "^3.13.0",
"supertest": "^4.0.2",
"tar-stream": "^2.1.0",
"ts-jest": "^24.2.0",
"ts-jest": "^24.3.0",
"ts-keycode-enum": "^1.0.6",
"tslib": "^1.10.0",
"tslint": "^5.20.1",
"tslint-config-airbnb": "^5.11.2",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.7.3",
"typescript": "^3.7.5",
"yauzl": "^2.10.0",
"zip-stream": "^2.1.2"
"zip-stream": "^2.1.3"
},
"dependencies": {
"@marp-team/marp-core": "^0.15.2",
"@marp-team/marpit": "^1.4.2",
"@marp-team/marp-core": "^1.0.1",
"@marp-team/marpit": "^1.5.0",
"@marp-team/pptx": "^0.1.0",
"carlo": "^0.9.46",
"chalk": "^3.0.0",
"chokidar": "^3.3.0",
"chokidar": "^3.3.1",
"chrome-launcher": "^0.12.0",
"cosmiconfig": "^6.0.0",
"express": "^4.17.1",
"file-url": "^3.0.0",
"get-stdin": "^7.0.0",
"globby": "^10.0.1",
"globby": "^11.0.0",
"import-from": "^3.0.0",
"is-wsl": "^2.1.1",
"mkdirp": "^0.5.1",
Expand All @@ -144,8 +144,8 @@
"tmp": "^0.1.0",
"v8-compile-cache": "^2.1.0",
"wrap-ansi": "^6.2.0",
"ws": "^7.2.0",
"yargs": "^15.0.2"
"ws": "^7.2.1",
"yargs": "^15.1.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import path from 'path'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import nodeResolve from '@rollup/plugin-node-resolve'
import replace from '@rollup/plugin-replace'
import url from '@rollup/plugin-url'
import typescript from '@rollup/plugin-typescript'
import autoprefixer from 'autoprefixer'
import builtinModules from 'builtin-modules'
import cssnano from 'cssnano'
import postcssUrl from 'postcss-url'
import commonjs from 'rollup-plugin-commonjs'
import postcss from 'rollup-plugin-postcss'
import pugPlugin from 'rollup-plugin-pug'
import { terser } from 'rollup-plugin-terser'
import typescript from 'rollup-plugin-typescript'
import { dependencies } from './package.json'

const external = [
Expand Down
2 changes: 1 addition & 1 deletion src/converter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { URL } from 'url'
import { MarpOptions } from '@marp-team/marp-core'
import { Marpit, MarpitOptions } from '@marp-team/marpit'
import { Marpit, Options as MarpitOptions } from '@marp-team/marpit'
import chalk from 'chalk'
import puppeteer from 'puppeteer-core'
import {
Expand Down
6 changes: 3 additions & 3 deletions src/templates/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarpitOptions, MarpitRenderResult, Element } from '@marp-team/marpit'
import { Element, Options, RenderResult } from '@marp-team/marpit'
import fs from 'fs'
import path from 'path'
import { promisify } from 'util'
Expand All @@ -9,7 +9,7 @@ import bespokeScss from './bespoke/bespoke.scss'

const readFile = promisify(fs.readFile)

type RendererResult = MarpitRenderResult &
type RendererResult = RenderResult &
TemplateMeta & {
length: number
size: RenderedSize
Expand All @@ -19,7 +19,7 @@ interface TemplateCoreOption {
base?: string
lang: string
notifyWS?: string
renderer: (tplOpts: MarpitOptions) => RendererResult
renderer: (tplOpts: Options) => RendererResult
}

export interface TemplateMeta {
Expand Down
3 changes: 2 additions & 1 deletion src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

try {
const stat: fs.Stats = await lstat(f)

Expand Down
4 changes: 2 additions & 2 deletions test/converter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Marp from '@marp-team/marp-core'
import { MarpitOptions } from '@marp-team/marpit'
import { Options } from '@marp-team/marpit'
import cheerio from 'cheerio'
import fs from 'fs'
import { imageSize } from 'image-size'
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('Converter', () => {
engine: Marp,
globalDirectives: { theme: 'default' },
lang: 'fr',
options: <MarpitOptions>{ html: true },
options: <Options>{ html: true },
server: false,
template: 'test-template',
templateOption: {},
Expand Down
8 changes: 6 additions & 2 deletions test/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

const resolvedEngine = await resolve(Marp)

expect(resolvedEngine.klass).toBe(Marp)
expect((await resolve('@marp-team/marp-core')).klass).toBe(
resolvedEngine.klass
)

// Return with the first resolved class
expect((await resolve(['__invalid_module__', Marp])).klass).toBe(Marp)
Expand Down
Loading