Skip to content

Commit

Permalink
Merge pull request #229 from marp-team/upgrade-dependencies
Browse files Browse the repository at this point in the history
Upgrade dependent packages to the latest version
  • Loading branch information
yhatt authored Jun 8, 2020
2 parents 50083a2 + d0bcf03 commit efc0a81
Show file tree
Hide file tree
Showing 17 changed files with 1,919 additions and 1,207 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ commands:
default: []
yarn:
type: string
default: 1.22.0
default: '^1.22.4'
steps:
- run:
name: Upgrade yarn for current user
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ on:
tags:
- v*

env:
YARN_VERSION: '^1.22.4'

jobs:
github-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: marp-team/actions@v1
with:
task: release
Expand All @@ -28,22 +31,24 @@ jobs:
- macOS-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Detect Node version from .nvmrc
id: node_version
run: echo "::set-output name=nvmrc::$(cat .nvmrc)"
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.16.1'
- name: Install with yarn
run: |
yarn policies set-version 1.22.0
yarn install
node-version: ${{ steps.node_version.outputs.nvmrc }}
- name: Install yarn
run: cd $HOME && yarn policies set-version $YARN_VERSION
- run: yarn install
- name: Build and create standalone binaries
run: yarn build:standalone
- name: Create package
run: yarn standalone:pack
env:
MATRIX_OS: ${{ matrix.os }}
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v2
with:
name: assets
path: dist
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
- pull_request
- push

env:
YARN_VERSION: '^1.22.4'

jobs:
validate:
runs-on: ubuntu-latest
if: "! ( contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]') )"
if: ${{ github.ref == 'refs/heads/master' || !startsWith(github.event.head_commit.message, '[ci skip]') }}
steps:
- run: echo "${{ github.event.head_commit.message }}"

Expand All @@ -23,26 +26,23 @@ jobs:
- '12.16.1'

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install yarn
run: yarn policies set-version 1.22.0

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
id: yarn
run: |
cd $HOME && yarn policies set-version $YARN_VERSION
echo "::set-output name=cache_dir::$(yarn cache dir)"
- name: Cache yarn
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
path: ${{ steps.yarn.outputs.cache_dir }}
key: yarn_cache-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn_cache-${{ runner.os }}-${{ matrix.node-version }}-
Expand All @@ -56,7 +56,7 @@ jobs:
env:
CI: true

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
### Fixed

- Add a trailing slash to the directory links on server index page to avoid broken path resolution ([#221](https://github.com/marp-team/marp-cli/pull/221) by [@n-ari](https://github.com/n-ari))
- Revert `@rollup/plugin-typescript` to v3 ([#223](https://github.com/marp-team/marp-cli/pull/223))

### Changed

- Upgrade [Marpit v1.6.2](https://github.com/marp-team/marpit/releases/tag/v1.6.2) and [Marp Core v1.2.0](https://github.com/marp-team/marp-core/releases/tag/v1.2.0) ([#229](https://github.com/marp-team/marp-cli/pull/229))
- Upgrade dependent packages to the latest version ([#229](https://github.com/marp-team/marp-cli/pull/229))

## v0.17.4 - 2020-04-18

Expand Down
89 changes: 45 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,88 +63,89 @@
"watch": "rollup -w -c"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-json": "^4.0.2",
"@rollup/plugin-node-resolve": "^7.1.3",
"@rollup/plugin-replace": "^2.3.1",
"@rollup/plugin-typescript": "^3.1.0",
"@rollup/plugin-url": "^4.0.2",
"@types/cheerio": "^0.22.17",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-typescript": "^4.1.2",
"@rollup/plugin-url": "^5.0.1",
"@types/cheerio": "^0.22.18",
"@types/express": "^4.17.6",
"@types/jest": "^25.2.1",
"@types/jest": "^25.2.3",
"@types/jest-plugin-context": "^2.9.3",
"@types/node": "~12.12.36",
"@types/node": "~12.12.44",
"@types/pug": "^2.0.4",
"@types/puppeteer": "^2.0.1",
"@types/supertest": "^2.0.8",
"@types/ws": "^7.2.4",
"@types/yargs": "^15.0.4",
"autoprefixer": "^9.7.6",
"@types/puppeteer": "^3.0.0",
"@types/supertest": "^2.0.9",
"@types/ws": "^7.2.5",
"@types/yargs": "^15.0.5",
"autoprefixer": "^9.8.0",
"bespoke": "bespokejs/bespoke",
"builtin-modules": "^3.1.0",
"cheerio": "^1.0.0-rc.3",
"codecov": "^3.6.1",
"codecov": "^3.7.0",
"cssnano": "^4.1.10",
"image-size": "^0.8.3",
"jest": "^25.3.0",
"jest": "^26.0.1",
"jest-environment-jsdom-fifteen": "^1.0.2",
"jest-junit": "^10.0.0",
"jest-plugin-context": "^2.9.0",
"nanoid": "^3.1.3",
"nanoid": "^3.1.9",
"npm-run-all": "^4.1.5",
"pkg": "^4.4.7",
"pkg": "^4.4.8",
"postcss-url": "^8.0.0",
"prettier": "^2.0.4",
"pug": "^2.0.4",
"prettier": "^2.0.5",
"pug": "^3.0.0",
"rimraf": "^3.0.2",
"rollup": "^2.6.1",
"rollup-plugin-postcss": "^2.6.4",
"rollup": "^2.15.0",
"rollup-plugin-postcss": "^3.1.2",
"rollup-plugin-pug": "^1.1.1",
"rollup-plugin-terser": "^5.3.0",
"sass": "^1.26.3",
"rollup-plugin-terser": "^6.1.0",
"sass": "^1.26.8",
"screenfull": "^5.0.2",
"stylelint": "^13.3.2",
"stylelint": "^13.6.0",
"stylelint-config-prettier": "^8.0.1",
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.17.0",
"stylelint-scss": "^3.17.2",
"supertest": "^4.0.2",
"tar-stream": "^2.1.2",
"ts-jest": "^25.4.0",
"ts-jest": "^26.1.0",
"ts-keycode-enum": "^1.0.6",
"tslib": "^1.11.1",
"tslint": "^6.1.1",
"tslib": "^2.0.0",
"tslint": "^6.1.2",
"tslint-config-airbnb": "^5.11.2",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.8.3",
"typescript": "^3.9.5",
"vhtml": "^2.2.0",
"yauzl": "^2.10.0",
"zip-stream": "^3.0.1"
},
"dependencies": {
"@marp-team/marp-core": "^1.1.1",
"@marp-team/marpit": "^1.5.2",
"@marp-team/marp-core": "^1.2.0",
"@marp-team/marpit": "^1.6.2",
"carlo": "^0.9.46",
"chalk": "^4.0.0",
"chokidar": "^3.3.1",
"chrome-launcher": "^0.13.1",
"chokidar": "^3.4.0",
"chrome-launcher": "^0.13.3",
"cosmiconfig": "^6.0.0",
"express": "^4.17.1",
"file-url": "^3.0.0",
"get-stdin": "^7.0.0",
"globby": "^11.0.0",
"get-stdin": "^8.0.0",
"globby": "^11.0.1",
"import-from": "^3.0.0",
"is-wsl": "^2.1.1",
"is-wsl": "^2.2.0",
"mkdirp": "^1.0.4",
"os-locale": "^5.0.0",
"pkg-up": "^3.1.0",
"portfinder": "^1.0.25",
"pptxgenjs": "^3.1.1",
"puppeteer-core": "~3.0.0",
"portfinder": "^1.0.26",
"pptxgenjs": "^3.2.1",
"puppeteer-core": "~3.3.0",
"serve-index": "^1.9.1",
"strip-ansi": "^6.0.0",
"tmp": "^0.1.0",
"v8-compile-cache": "^2.1.0",
"wrap-ansi": "^6.2.0",
"ws": "^7.2.3",
"tmp": "^0.2.1",
"v8-compile-cache": "^2.1.1",
"wrap-ansi": "^7.0.0",
"ws": "^7.3.0",
"yargs": "^15.3.1"
},
"publishConfig": {
Expand Down
9 changes: 5 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import pugPlugin from 'rollup-plugin-pug'
import { terser } from 'rollup-plugin-terser'
import { dependencies } from './package.json'

const external = [...Object.keys(dependencies), 'yargs/yargs']
const external = (deps) => (id) =>
deps.some((dep) => dep === id || id.startsWith(`${dep}/`))

const plugins = (opts = {}) => [
json({ preferConst: true }),
Expand All @@ -24,7 +25,7 @@ const plugins = (opts = {}) => [
}),
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
commonjs(),
typescript(),
typescript({ noEmitOnError: false }),
postcss({
inject: false,
plugins: [
Expand All @@ -43,12 +44,12 @@ const plugins = (opts = {}) => [
]

const browser = {
external,
external: external(Object.keys(dependencies)),
plugins: plugins({ browser: true }),
}

const cli = {
external: [...builtinModules, ...external],
external: external([...builtinModules, ...Object.keys(dependencies)]),
plugins: plugins(),
}

Expand Down
2 changes: 1 addition & 1 deletion src/__mocks__/watcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const watcher = require.requireActual('../watcher')
const watcher = jest.requireActual('../watcher')

watcher.notifier.start = jest.fn()
watcher.notifier.sendTo = jest.fn()
Expand Down
6 changes: 3 additions & 3 deletions src/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ export class Converter {
data: `data:image/png;base64,${imageFile.buffer!.toString('base64')}`,
})

const [img] = slide.relsMedia
slide.bkgdImgRid = img.rId
slide.data = []
const [img] = slide['relsMedia']
slide['bkgdImgRid'] = img.rId
slide['data'] = []

const notes = tpl.rendered.comments[page - 1].join('\n\n')
if (notes) slide.addNotes(notes)
Expand Down
2 changes: 1 addition & 1 deletion src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class ResolvedEngine {
// NOTE: It cannot test because of overriding `require` in Jest context.
private findClassPath(klass) {
for (const moduleId in require.cache) {
const expt = require.cache[moduleId].exports
const expt = require.cache[moduleId]!.exports

if (
expt === klass ||
Expand Down
2 changes: 1 addition & 1 deletion src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class File {

private async saveToFile(savePath: string = this.path) {
await mkdirp(path.dirname(path.resolve(savePath)))
await writeFile(savePath, this.buffer)
await writeFile(savePath, this.buffer!)
}

private static stdinBuffer?: Buffer
Expand Down
2 changes: 1 addition & 1 deletion test/__mocks__/express.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const express = require.requireActual('express')
const express = jest.requireActual('express')

express.application.listen = jest.fn((port) => {})
express.application.listen.mockReturnValue({
Expand Down
2 changes: 1 addition & 1 deletion test/__mocks__/fs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { promisify } from 'util'

const fs = require.requireActual('fs')
const fs = jest.requireActual('fs')

fs.writeFile[promisify.custom] = (path, data) =>
new Promise((resolve, reject) =>
Expand Down
2 changes: 1 addition & 1 deletion test/__mocks__/path.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let mode: string | undefined

const path = require.requireActual('path')
const path = jest.requireActual('path')
const pathMock: any = {
posix: () => (mode = 'posix'),
win32: () => (mode = 'win32'),
Expand Down
3 changes: 2 additions & 1 deletion test/server/server-index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @jest-environment jsdom */
/** @jest-environment jsdom-fifteen */
// TODO: Use Jest built-in jsdom environment if https://github.com/jsdom/jsdom/issues/2961 was fixed
import serverIndex, { showAllKey } from '../../src/server/server-index'

afterEach(() => jest.restoreAllMocks())
Expand Down
3 changes: 2 additions & 1 deletion test/templates/bespoke.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @jest-environment jsdom */
/** @jest-environment jsdom-fifteen */
// TODO: Use Jest built-in jsdom environment if https://github.com/jsdom/jsdom/issues/2961 was fixed
import Marp from '@marp-team/marp-core'
import { Element as MarpitElement } from '@marp-team/marpit'
import { default as screenfull, Screenfull } from 'screenfull'
Expand Down
3 changes: 2 additions & 1 deletion test/templates/watch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/** @jest-environment jsdom */
/** @jest-environment jsdom-fifteen */
// TODO: Use Jest built-in jsdom environment if https://github.com/jsdom/jsdom/issues/2961 was fixed
import portfinder from 'portfinder'
import { Server } from 'ws'
import watch from '../../src/templates/watch/watch'
Expand Down
Loading

0 comments on commit efc0a81

Please sign in to comment.