Merged
Show file tree
Hide file tree
Changes from all commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
const prettierConfig = require('./.prettierrc');
const prettierConfig = require('./.prettierrc.json');

module.exports = {
root: true,
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
name: Build & Test

on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
on: [push]

jobs:
lint:
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
.eslintignore
.eslintrc
.eslintrc.cjs
.
.gitignore
.travis.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
{
"arrowParens": "avoid",
"singleQuote": true
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,18 +7,18 @@
{
"type": "node",
"request": "launch",
"name": "Run tests",
"name": "Run unit tests",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test"],
"runtimeArgs": ["test"],
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "Run current test file",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test"],
"args": ["--", "-i", "${relativeFile}", "--testPathIgnorePatterns"],
"runtimeExecutable": "npx",
"runtimeArgs": ["jest"],
"args": ["-i", "${relativeFile}", "--testPathIgnorePatterns"],
Copy link
Member Author

Choose a reason for hiding this comment

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

These scripts were out of date. Now you can run them in VS Code! Give it a try!

"console": "integratedTerminal"
},
{
Expand All@@ -41,10 +41,9 @@
"type": "node",
"request": "launch",
"name": "Update current test file snapshot(s)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test"],
"runtimeExecutable": "npx",
"runtimeArgs": ["jest"],
"args": [
"--",
"-i",
"${relativeFile}",
"--updateSnapshot",
Expand All@@ -56,8 +55,8 @@
"type": "node",
"request": "launch",
"name": "Update selected test name snapshot(s)",
"runtimeExecutable": "npm",
"runtimeArgs": ["run-script", "test"],
"runtimeExecutable": "npx",
"runtimeArgs": ["jest"],
"args": [
"--",
"-i",
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,7 +32,10 @@
- [`develop` branch preview](https://docsify-preview.vercel.app/)
- [Documentation](https://docsify.js.org)
- [CLI](https://.com/docsifyjs/docsify-cli)
- CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify)
- CDN:
- [UNPKG](https://unpkg.com/docsify/)
- [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/)
- [cdnjs](https://cdnjs.com/libraries/docsify)
- [Awesome docsify](https://.com/docsifyjs/awesome-docsify)
- [Community chat](https://discord.gg/3NwKFyR)

Expand Down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
const rollup = require('rollup')
const buble = require('rollup-plugin-buble')
const commonjs = require('rollup-plugin-commonjs')
const nodeResolve = require('rollup-plugin-node-resolve')
const { uglify } = require('rollup-plugin-uglify')
const replace = require('rollup-plugin-replace')
const isProd = process.env.NODE_ENV === 'production'
const version = process.env.VERSION || require('../package.json').version
const chokidar = require('chokidar')
const path = require('path')
import rollup from 'rollup';
import buble from 'rollup-plugin-buble';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import { uglify } from 'rollup-plugin-uglify';
import replace from 'rollup-plugin-replace';
import chokidar from 'chokidar';
import path from 'path';
import { relative } from './util.js';
import { promises as fs } from 'fs';

const pkgPath = relative(import.meta, '..', 'package.json');
const pkgString = (await fs.readFile(pkgPath)).toString();
const pkg = JSON.parse(pkgString);
const isProd = process.env.NODE_ENV === 'production';
const version = process.env.VERSION || pkg.version;

/**
* @param {{
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
var fs = require('fs')
var read = fs.readFileSync
var write = fs.writeFileSync
var version = process.env.VERSION || require('../package.json').version
import fs from 'fs';
import { relative } from './util.js';
var read = fs.readFileSync;
var write = fs.writeFileSync;
const pkgPath = relative(import.meta, '..', 'package.json');
const pkg = JSON.parse(read(pkgPath).toString());
var version = process.env.VERSION || pkg.version;

var file = __dirname + '/../docs/_coverpage.md'
var cover = read(file, 'utf8').toString()
var file = relative(import.meta, '..', 'docs', '_coverpage.md');
var cover = read(file, 'utf8').toString();

console.log('Replace version number in cover page...')
console.log('Replace version number in cover page...');
cover = cover.replace(
/<small>(\S+)?<\/small>/g,
'<small>' + version + '</small>'
)
write(file, cover)
);
write(file, cover);
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
const fs = require('fs')
const path = require('path')
const {spawn} = require('child_process')
import fs from 'fs'
import path from 'path'
import {spawn} from 'child_process'

const relative = path => new URL(path, import.meta.url);
const args = process.argv.slice(2)
fs.readdir(path.join(__dirname, '../src/themes'), (err, files) => {
fs.readdir(relative('../src/themes'), (err, files) => {
if (err) {
console.error('err', err)
process.exit(1)
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
const axios = require('axios');
const fs = require('fs');
const path = require('path');
import axios from 'axios';
import fs from 'fs';
import path from 'path';

const filePaths = {
emojiMarkdown: path.resolve(process.cwd(), 'docs', 'emoji.md'),
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
const cssnano = require('cssnano').process
const path = require('path')
const fs = require('fs')
import cssnano from 'cssnano';
import path from 'path'
import fs from 'fs'

files = fs.readdirSync(path.resolve('lib/themes'))
const files = fs.readdirSync(path.resolve('lib/themes'))

files.forEach(file => {
file = path.resolve('lib/themes', file)
cssnano(fs.readFileSync(file)).then(result => {
cssnano.process(fs.readFileSync(file)).then(result => {
fs.writeFileSync(file, result.css)
}).catch(e => {
console.error(e)
Expand Down
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
import url from 'url';
import path from 'path';

/** Get a new path relative to the current module (pass import.meta). */
export const relative = (meta, ...to) =>
path.resolve(path.dirname(url.fileURLToPath(meta.url)), ...to);
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
const { TEST_HOST } = require('./test/config/server.js');
import { TEST_HOST } from './test/config/server.js';

const sharedConfig = {
errorOnDeprecated: true,
Expand All@@ -11,7 +11,8 @@ const sharedConfig = {
testURL: `${TEST_HOST}/_blank.html`,
};

module.exports = {
export default {
transform: {},
projects: [
// Unit Tests
{
Expand Down
Loading