Skip to content

Commit

Permalink
Merge pull request #224 from marp-team/upgrade-node-and-dependent-pac…
Browse files Browse the repository at this point in the history
…kages

Upgrade Node and dependent packages to the latest version
  • Loading branch information
yhatt authored Mar 15, 2020
2 parents 8fc5ae6 + 89f61ca commit 59e1c7c
Show file tree
Hide file tree
Showing 9 changed files with 2,235 additions and 1,893 deletions.
13 changes: 6 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,24 @@ commands:
default: []
yarn:
type: string
default: 1.21.1
default: 1.22.4
steps:
- run:
name: Upgrade yarn for current user
command: cd ~ && yarn policies set-version << parameters.yarn >>

- restore_cache:
keys:
- v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }}
- v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-
- v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}-
- v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }}
- v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-
- v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}-

- run: yarn install
- steps: << parameters.postinstall >>

- save_cache:
key: v2.1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }}
key: v2.2-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}-{{ .Branch }}
paths:
- node_modules
- ~/.cache/yarn

audit:
Expand Down Expand Up @@ -96,7 +95,7 @@ jobs:
test-node12:
executor:
name: node
version: '12.14.1' # Specify LTS version for development
version: '12.16.1' # Specify LTS version for development
steps:
- test

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.14.1
12.16.1
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

### Changed

- On the basis of [the YAML specification](https://yaml.org/spec/1.2/spec.html#id2760395), 3 dots `...` can use as an alternative to indicate the end of YAML front-matter ([#224](https://github.com/marp-team/marpit/pull/224))
- Upgrade Node and dependent packages to the latest version ([#224](https://github.com/marp-team/marpit/pull/224))

## v1.5.0 - 2020-01-12

### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Marp team ([email protected])
Copyright (c) 2018- Marp team ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 18 additions & 18 deletions docsify/build.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
const fs = require('fs')
const path = require('path')
const { promisify } = require('util')
const autoprefixer = require('autoprefixer')
const cssnano = require('cssnano')
const fs = require('fs')
const mkdirp = require('mkdirp')
const postcss = require('postcss')
const path = require('path')
const sass = require('sass')

const from = path.join(__dirname, './docsify.scss')
const to = path.join(__dirname, '../docs/style/docsify.css')

const { css } = sass.renderSync({
file: from,
outFile: to,
sourceMap: true,
sourceMapEmbed: true,
})

postcss([
autoprefixer,
cssnano({ preset: ['default', { mergeLonghand: false }] }),
])
.process(css, { from, to, map: { annotation: false, inline: false } })
.then(ret => {
mkdirp.sync(path.dirname(to))
fs.writeFileSync(to, ret.css)
;(async () => {
const { css: cssBuf } = await promisify(sass.render)({
file: from,
outFile: to,
sourceMap: true,
sourceMapEmbed: true,
})

const { css } = await postcss([
autoprefixer,
cssnano({ preset: ['default', { mergeLonghand: false }] }),
]).process(cssBuf, { from, to, map: { annotation: false, inline: false } })

await promisify(fs.mkdir)(path.dirname(to), { recursive: true })
await promisify(fs.writeFile)(to, css)
})()
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
coverageThreshold: { global: { lines: 95 } },
restoreMocks: true,
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'node',
testRegex: '(/(test|__tests__)/(?!_).*|(\\.|/)(test|spec))\\.js$',
testURL: 'http://localhost',
moduleFileExtensions: ['js', 'json', 'node'],
Expand Down
49 changes: 23 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,49 +57,46 @@
"watch": "babel src --out-dir lib -w --verbose"
},
"devDependencies": {
"@babel/cli": "^7.8.0",
"@babel/core": "^7.8.0",
"@babel/plugin-proposal-class-properties": "^7.8.0",
"@babel/plugin-proposal-object-rest-spread": "^7.8.0",
"@babel/plugin-proposal-private-methods": "^7.8.0",
"@babel/preset-env": "^7.8.0",
"autoprefixer": "^9.7.3",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.7",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-proposal-private-methods": "^7.8.3",
"@babel/preset-env": "^7.8.7",
"autoprefixer": "^9.7.4",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.1.0",
"browser-sync": "^2.26.7",
"cheerio": "^1.0.0-rc.3",
"codecov": "^3.6.1",
"cross-env": "^6.0.3",
"codecov": "^3.6.5",
"cssnano": "^4.1.10",
"dedent": "^0.7.0",
"docsify-themeable": "^0.7.2",
"docsify-themeable": "^0.8.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "14.0.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-import": "^2.20.0",
"jest": "^24.9.0",
"eslint-config-airbnb-base": "14.1.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"jest": "^25.1.0",
"jest-junit": "^10.0.0",
"jsdoc": "^3.6.3",
"minami": "^1.2.3",
"mkdirp": "^0.5.1",
"nodemon": "^2.0.2",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"rimraf": "^3.0.0",
"sass": "^1.24.4",
"stylelint": "^12.0.1",
"stylelint-config-prettier": "^8.0.0",
"stylelint-config-standard": "^19.0.0",
"stylelint-scss": "^3.13.0"
"rimraf": "^3.0.2",
"sass": "1.26.3",
"stylelint": "^13.2.1",
"stylelint-config-prettier": "^8.0.1",
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.14.2"
},
"dependencies": {
"color-string": "^1.5.3",
"js-yaml": "^3.13.0",
"lodash.kebabcase": "^4.1.1",
"markdown-it": "^10.0.0",
"markdown-it-front-matter": "^0.1.2",
"postcss": "^7.0.26"
"markdown-it-front-matter": "^0.2.1",
"postcss": "^7.0.27"
},
"publishConfig": {
"access": "public"
Expand Down
34 changes: 19 additions & 15 deletions test/markdown/directives/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ describe('Marpit directives parse plugin', () => {
}

context('with frontMatter option', () => {
const text = dedent`
const text = (end = '---') => dedent`
---
theme: test_theme
class: all
_class: first
---
${end}
***
`

it('does not parse front-matter when option is false', () => {
const parsed = md({ frontMatter: false }).parse(text)
const parsed = md({ frontMatter: false }).parse(text())

parsed.forEach(t => {
if (t.type === 'marpit_slide_open')
Expand All @@ -43,18 +43,22 @@ describe('Marpit directives parse plugin', () => {
})

it('parses front-matter when option is true', () => {
const parsed = md({ frontMatter: true }).parse(text)
const slideTokens = parsed.filter(t => t.type === 'marpit_slide_open')

expect(slideTokens).toHaveLength(2)
expect(slideTokens[0].meta.marpitDirectives).toStrictEqual({
theme: 'test_theme',
class: 'first',
})
expect(slideTokens[1].meta.marpitDirectives).toStrictEqual({
theme: 'test_theme',
class: 'all',
})
// NOTE: Three-dots are an alternative to indicate the end of YAML
// frontmatter: https://yaml.org/spec/1.2/spec.html#id2760395
for (const txt of [text(), text('...')]) {
const parsed = md({ frontMatter: true }).parse(txt)
const slideTokens = parsed.filter(t => t.type === 'marpit_slide_open')

expect(slideTokens).toHaveLength(2)
expect(slideTokens[0].meta.marpitDirectives).toStrictEqual({
theme: 'test_theme',
class: 'first',
})
expect(slideTokens[1].meta.marpitDirectives).toStrictEqual({
theme: 'test_theme',
class: 'all',
})
}
})
})

Expand Down
Loading

0 comments on commit 59e1c7c

Please sign in to comment.