Skip to content

Commit

Permalink
Merge pull request #427 from marp-team/upgrade-depndencies
Browse files Browse the repository at this point in the history
Upgrade dependent packages to the latest version
  • Loading branch information
yhatt authored Aug 4, 2023
2 parents 5dbd243 + 6d2e90d commit 8c37d76
Show file tree
Hide file tree
Showing 58 changed files with 7,348 additions and 5,984 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic',
'plugin:import/typescript',
'prettier',
],
Expand All @@ -26,6 +27,10 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
},
{
files: ['**/*.test.js', '**/*.test.ts'],
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.19.1
16.20.1
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

### Changed

- Upgrade Marp Core to [v3.8.0](https://github.com/marp-team/marp-core/releases/tag/v3.8.0) ([#427](https://github.com/marp-team/marp-vscode/pull/427))
- Support `paginate: skip` and `paginate: hold` from Marpit framework [v2.5.0](https://github.com/marp-team/marpit/releases/v2.5.0)
- Upgrade Marp CLI to [v3.2.0](https://github.com/marp-team/marp-cli/releases/tag/v3.2.0) ([#427](https://github.com/marp-team/marp-vscode/pull/427))

## v2.6.0 - 2023-04-16

### Added
Expand Down
12,669 changes: 7,010 additions & 5,659 deletions package-lock.json

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,61 +276,61 @@
"watch:web": "webpack --watch --env target=web,preview"
},
"devDependencies": {
"@babel/preset-env": "^7.21.4",
"@marp-team/marp-core": "^3.6.0",
"@babel/preset-env": "^7.22.9",
"@marp-team/marp-core": "^3.8.0",
"@types/color-string": "^1.5.2",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.0",
"@types/jest": "^29.5.3",
"@types/lodash.debounce": "^4.0.7",
"@types/markdown-it": "^12.2.3",
"@types/vscode": "~1.72.0",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vscode/test-web": "^0.0.42",
"@vscode/vsce": "^2.19.0",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"@vscode/test-web": "^0.0.44",
"@vscode/vsce": "^2.20.1",
"abort-controller": "^3.0.0",
"color-string": "^1.9.1",
"dedent": "^0.7.0",
"esbuild": "^0.17.16",
"esbuild-loader": "^3.0.1",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"dedent": "^1.5.1",
"esbuild": "^0.18.17",
"esbuild-loader": "^3.1.0",
"eslint": "^8.46.0",
"eslint-config-prettier": "^8.10.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^27.2.3",
"express": "^4.18.2",
"fetch-ponyfill": "^7.1.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest-junit": "^16.0.0",
"lodash.debounce": "^4.0.8",
"markdown-it": "^13.0.1",
"nanoid": "^4.0.2",
"npm-check-updates": "^16.10.8",
"npm-check-updates": "^16.10.17",
"npm-run-all": "^4.1.5",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"portfinder": "1.0.32",
"prettier": "^2.8.7",
"prettier": "^3.0.1",
"process": "^0.11.10",
"rehype-parse": "^8.0.4",
"remark-math": "^5.1.1",
"remark-parse": "^10.0.1",
"stylelint": "^15.5.0",
"stylelint-config-standard": "^33.0.0",
"ts-jest": "^29.1.0",
"tslib": "^2.5.0",
"remark-parse": "^10.0.2",
"stylelint": "^15.10.2",
"stylelint-config-standard": "^34.0.0",
"ts-jest": "^29.1.1",
"tslib": "^2.6.1",
"typed-emitter": "^2.1.0",
"typescript": "^5.0.4",
"typescript": "^5.1.6",
"unified": "^10.1.2",
"unist-util-visit": "^4.1.2",
"unist-util-visit": "^5.0.0",
"util": "^0.12.5",
"vscode-uri": "^3.0.7",
"webpack": "^5.79.0",
"webpack-cli": "^5.0.1",
"yaml": "^2.2.1"
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"yaml": "^2.3.1"
},
"dependencies": {
"@marp-team/marp-cli": "^2.5.0"
"@marp-team/marp-cli": "^3.2.0"
}
}
28 changes: 20 additions & 8 deletions src/__mocks__/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export class CodeAction {
edit?: WorkspaceEdit
isPreferred?: boolean

constructor(public title: string, public kind?: CodeActionKind) {}
constructor(
public title: string,
public kind?: CodeActionKind,
) {}
}

export class CodeActionKind {
Expand Down Expand Up @@ -52,7 +55,7 @@ export class Diagnostic {
constructor(
public range: Range,
public message: string,
public severity?: DiagnosticSeverity
public severity?: DiagnosticSeverity,
) {}
}

Expand All @@ -77,23 +80,29 @@ export class Position {
}
return new Position(
this.line + (args[0] ?? 0),
this.character + (args[1] ?? 0)
this.character + (args[1] ?? 0),
)
}

isEqual(other: Position) {
return this.line === other.line && this.character === other.character
}

constructor(readonly line: number, readonly character: number) {}
constructor(
readonly line: number,
readonly character: number,
) {}
}

export const ProgressLocation = {
Notification: 'notification',
}

export class Range {
constructor(readonly start: Position, readonly end: Position) {}
constructor(
readonly start: Position,
readonly end: Position,
) {}

contains(position: Position) {
return !(
Expand Down Expand Up @@ -158,7 +167,10 @@ export enum FileType {
}

export class Hover {
constructor(public contents: string, public range?: Range) {}
constructor(
public contents: string,
public range?: Range,
) {}
}

export const languages = {
Expand All @@ -182,7 +194,7 @@ export class MarkdownString {
}

export class Memento {
private _map: Map<string, any> = new Map()
private _map = new Map<string, any>()

get(key: string) {
return this._map.get(key)
Expand Down Expand Up @@ -228,7 +240,7 @@ export const workspace = {
getConfiguration: jest.fn((section?: string) => ({
get: jest.fn(
(subSection?: string) =>
currentConf[[section, subSection].filter((s) => s).join('.')]
currentConf[[section, subSection].filter((s) => s).join('.')],
),
})),
getWorkspaceFolder: jest.fn(),
Expand Down
30 changes: 15 additions & 15 deletions src/commands/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ describe('Export command', () => {
describe('when reacted with "Manage Workspace Trust..."', () => {
beforeEach(() => {
;(window.showErrorMessage as any).mockResolvedValue(
exportModule.ITEM_MANAGE_WORKSPACE_TRUST
exportModule.ITEM_MANAGE_WORKSPACE_TRUST,
)
})

it('executes "workbench.trust.manage" command when reacted on the prompt', async () => {
await exportCommand()
expect(commands.executeCommand).toHaveBeenCalledWith(
'workbench.trust.manage'
'workbench.trust.manage',
)
})
})
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('#saveDialog', () => {
expect(window.showSaveDialog).toHaveBeenCalledWith(
expect.objectContaining({
defaultUri: expect.objectContaining({ fsPath: '/tmp/test.pdf' }),
})
}),
)
})

Expand All @@ -120,7 +120,7 @@ describe('#saveDialog', () => {
expect(window.showSaveDialog).toHaveBeenCalledWith(
expect.objectContaining({
defaultUri: expect.objectContaining({ path: '/untitled.pdf' }),
})
}),
)
})

Expand All @@ -134,7 +134,7 @@ describe('#saveDialog', () => {
.calls[0][0]

expect(defaultUri).toStrictEqual(
expect.objectContaining({ fsPath: '/tmp/test.pptx' })
expect.objectContaining({ fsPath: '/tmp/test.pptx' }),
)
expect(Object.values(filters)[0]).toStrictEqual(['pptx'])
})
Expand All @@ -158,7 +158,7 @@ describe('#saveDialog', () => {
await exportModule.saveDialog(document)
expect(window.withProgress).toHaveBeenCalledWith(
expect.objectContaining({ title: expect.stringContaining('PATH') }),
expect.any(Function)
expect.any(Function),
)
;(window.withProgress as any).mock.calls[0][1]()
expect(doExportMock).toHaveBeenCalledWith(saveURI, document)
Expand Down Expand Up @@ -208,31 +208,31 @@ describe('#doExport', () => {
await exportModule.doExport(saveURI(), document)

expect(window.showErrorMessage).toHaveBeenCalledWith(
expect.stringContaining('MarpCLIError')
expect.stringContaining('MarpCLIError'),
)

// Error object
marpCliSpy.mockRejectedValueOnce(new Error('ERROR'))
await exportModule.doExport(saveURI(), document)

expect(window.showErrorMessage).toHaveBeenCalledWith(
expect.stringContaining('[Error] ERROR')
expect.stringContaining('[Error] ERROR'),
)

// Unknown error (via toString())
marpCliSpy.mockRejectedValueOnce('UNKNOWN ERROR!')
await exportModule.doExport(saveURI(), document)

expect(window.showErrorMessage).toHaveBeenCalledWith(
expect.stringContaining('UNKNOWN ERROR!')
expect.stringContaining('UNKNOWN ERROR!'),
)

// WTF
marpCliSpy.mockRejectedValueOnce(null)
await exportModule.doExport(saveURI(), document)

expect(window.showErrorMessage).toHaveBeenCalledWith(
'Failure to export by unknown error.'
'Failure to export by unknown error.',
)
} finally {
marpCliSpy.mockRestore()
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('#doExport', () => {

expect(optionGeneratorSpy).toHaveBeenCalledWith(
document,
expect.objectContaining({ pdfNotes: true })
expect.objectContaining({ pdfNotes: true }),
)
})

Expand All @@ -312,7 +312,7 @@ describe('#doExport', () => {

expect(optionGeneratorSpy).toHaveBeenCalledWith(
document,
expect.objectContaining({ pdfNotes: false })
expect.objectContaining({ pdfNotes: false }),
)
})
})
Expand Down Expand Up @@ -341,7 +341,7 @@ describe('#doExport', () => {
expect(target).toBe(saveURIinstance)

expect(window.showInformationMessage).toHaveBeenCalledWith(
'Marp slide deck was successfully exported to unknown-scheme:///tmp/to.pdf.'
'Marp slide deck was successfully exported to unknown-scheme:///tmp/to.pdf.',
)
} finally {
isWritableFileSystemMock.mockRestore()
Expand All @@ -361,7 +361,7 @@ describe('#doExport', () => {
await exportModule.doExport(saveURI('readonly', 'pdf'), document)

expect(window.showErrorMessage).toHaveBeenCalledWith(
expect.stringContaining('Could not write to readonly file system.')
expect.stringContaining('Could not write to readonly file system.'),
)
} finally {
isWritableFileSystemMock.mockRestore()
Expand Down Expand Up @@ -406,7 +406,7 @@ describe('#doExport', () => {
try {
await exportModule.doExport(saveURI(), vfsDocument)
expect(createWorkspaceProxyServer).toHaveBeenCalledWith(
virtualWorkspace
virtualWorkspace,
)

// dispose method
Expand Down
Loading

0 comments on commit 8c37d76

Please sign in to comment.