first commit
This commit is contained in:
7
node_modules/hexo-cli/LICENSE
generated
vendored
Normal file
7
node_modules/hexo-cli/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2015 Tommy Chen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
24
node_modules/hexo-cli/README.md
generated
vendored
Normal file
24
node_modules/hexo-cli/README.md
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# hexo-cli
|
||||
|
||||
[](https://github.com/hexojs/hexo-cli/actions/workflows/ci.yml)
|
||||
[](https://www.npmjs.com/package/hexo-cli)
|
||||
[](https://coveralls.io/github/hexojs/hexo-cli)
|
||||
|
||||
Command line interface for Hexo.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install hexo-cli -g
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
1. Fork this project
|
||||
2. `$ git clone https://github.com/user/hexo-cli --recurse-submodules && cd hexo-cli/`
|
||||
3. `$ npm install`
|
||||
4. `$ npm test`
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
7
node_modules/hexo-cli/assets/.github/dependabot.yml
generated
vendored
Normal file
7
node_modules/hexo-cli/assets/.github/dependabot.yml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 20
|
||||
0
node_modules/hexo-cli/assets/_config.landscape.yml
generated
vendored
Normal file
0
node_modules/hexo-cli/assets/_config.landscape.yml
generated
vendored
Normal file
104
node_modules/hexo-cli/assets/_config.yml
generated
vendored
Normal file
104
node_modules/hexo-cli/assets/_config.yml
generated
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
# Hexo Configuration
|
||||
## Docs: https://hexo.io/docs/configuration.html
|
||||
## Source: https://github.com/hexojs/hexo/
|
||||
|
||||
# Site
|
||||
title: Hexo
|
||||
subtitle: ''
|
||||
description: ''
|
||||
keywords:
|
||||
author: John Doe
|
||||
language: en
|
||||
timezone: ''
|
||||
|
||||
# URL
|
||||
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
|
||||
url: http://example.com
|
||||
permalink: :year/:month/:day/:title/
|
||||
permalink_defaults:
|
||||
pretty_urls:
|
||||
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
|
||||
trailing_html: true # Set to false to remove trailing '.html' from permalinks
|
||||
|
||||
# Directory
|
||||
source_dir: source
|
||||
public_dir: public
|
||||
tag_dir: tags
|
||||
archive_dir: archives
|
||||
category_dir: categories
|
||||
code_dir: downloads/code
|
||||
i18n_dir: :lang
|
||||
skip_render:
|
||||
|
||||
# Writing
|
||||
new_post_name: :title.md # File name of new posts
|
||||
default_layout: post
|
||||
titlecase: false # Transform title into titlecase
|
||||
external_link:
|
||||
enable: true # Open external links in new tab
|
||||
field: site # Apply to the whole site
|
||||
exclude: ''
|
||||
filename_case: 0
|
||||
render_drafts: false
|
||||
post_asset_folder: false
|
||||
relative_link: false
|
||||
future: true
|
||||
syntax_highlighter: highlight.js
|
||||
highlight:
|
||||
line_number: true
|
||||
auto_detect: false
|
||||
tab_replace: ''
|
||||
wrap: true
|
||||
hljs: false
|
||||
prismjs:
|
||||
preprocess: true
|
||||
line_number: true
|
||||
tab_replace: ''
|
||||
|
||||
# Home page setting
|
||||
# path: Root path for your blogs index page. (default = '')
|
||||
# per_page: Posts displayed per page. (0 = disable pagination)
|
||||
# order_by: Posts order. (Order by date descending by default)
|
||||
index_generator:
|
||||
path: ''
|
||||
per_page: 10
|
||||
order_by: -date
|
||||
|
||||
# Category & Tag
|
||||
default_category: uncategorized
|
||||
category_map:
|
||||
tag_map:
|
||||
|
||||
# Metadata elements
|
||||
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
||||
meta_generator: true
|
||||
|
||||
# Date / Time format
|
||||
## Hexo uses Moment.js to parse and display date
|
||||
## You can customize the date format as defined in
|
||||
## http://momentjs.com/docs/#/displaying/format/
|
||||
date_format: YYYY-MM-DD
|
||||
time_format: HH:mm:ss
|
||||
## updated_option supports 'mtime', 'date', 'empty'
|
||||
updated_option: 'mtime'
|
||||
|
||||
# Pagination
|
||||
## Set per_page to 0 to disable pagination
|
||||
per_page: 10
|
||||
pagination_dir: page
|
||||
|
||||
# Include / Exclude file(s)
|
||||
## include:/exclude: options only apply to the 'source/' folder
|
||||
include:
|
||||
exclude:
|
||||
ignore:
|
||||
|
||||
# Extensions
|
||||
## Plugins: https://hexo.io/plugins/
|
||||
## Themes: https://hexo.io/themes/
|
||||
theme: landscape
|
||||
|
||||
# Deployment
|
||||
## Docs: https://hexo.io/docs/one-command-deployment
|
||||
deploy:
|
||||
type: ''
|
||||
26
node_modules/hexo-cli/assets/package.json
generated
vendored
Normal file
26
node_modules/hexo-cli/assets/package.json
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "hexo-site",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "hexo generate",
|
||||
"clean": "hexo clean",
|
||||
"deploy": "hexo deploy",
|
||||
"server": "hexo server"
|
||||
},
|
||||
"hexo": {
|
||||
"version": ""
|
||||
},
|
||||
"dependencies": {
|
||||
"hexo": "^7.0.0",
|
||||
"hexo-generator-archive": "^2.0.0",
|
||||
"hexo-generator-category": "^2.0.0",
|
||||
"hexo-generator-index": "^3.0.0",
|
||||
"hexo-generator-tag": "^2.0.0",
|
||||
"hexo-renderer-ejs": "^2.0.0",
|
||||
"hexo-renderer-marked": "^6.0.0",
|
||||
"hexo-renderer-stylus": "^3.0.0",
|
||||
"hexo-server": "^3.0.0",
|
||||
"hexo-theme-landscape": "^1.0.0"
|
||||
}
|
||||
}
|
||||
4
node_modules/hexo-cli/assets/scaffolds/draft.md
generated
vendored
Normal file
4
node_modules/hexo-cli/assets/scaffolds/draft.md
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
tags:
|
||||
---
|
||||
4
node_modules/hexo-cli/assets/scaffolds/page.md
generated
vendored
Normal file
4
node_modules/hexo-cli/assets/scaffolds/page.md
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
date: {{ date }}
|
||||
---
|
||||
5
node_modules/hexo-cli/assets/scaffolds/post.md
generated
vendored
Normal file
5
node_modules/hexo-cli/assets/scaffolds/post.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
date: {{ date }}
|
||||
tags:
|
||||
---
|
||||
38
node_modules/hexo-cli/assets/source/_posts/hello-world.md
generated
vendored
Normal file
38
node_modules/hexo-cli/assets/source/_posts/hello-world.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: Hello World
|
||||
---
|
||||
Welcome to [Hexo](https://hexo.io/)! This is your very first post. Check [documentation](https://hexo.io/docs/) for more info. If you get any problems when using Hexo, you can find the answer in [troubleshooting](https://hexo.io/docs/troubleshooting.html) or you can ask me on [GitHub](https://github.com/hexojs/hexo/issues).
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Create a new post
|
||||
|
||||
``` bash
|
||||
$ hexo new "My New Post"
|
||||
```
|
||||
|
||||
More info: [Writing](https://hexo.io/docs/writing.html)
|
||||
|
||||
### Run server
|
||||
|
||||
``` bash
|
||||
$ hexo server
|
||||
```
|
||||
|
||||
More info: [Server](https://hexo.io/docs/server.html)
|
||||
|
||||
### Generate static files
|
||||
|
||||
``` bash
|
||||
$ hexo generate
|
||||
```
|
||||
|
||||
More info: [Generating](https://hexo.io/docs/generating.html)
|
||||
|
||||
### Deploy to remote sites
|
||||
|
||||
``` bash
|
||||
$ hexo deploy
|
||||
```
|
||||
|
||||
More info: [Deployment](https://hexo.io/docs/one-command-deployment.html)
|
||||
0
node_modules/hexo-cli/assets/themes/.gitkeep
generated
vendored
Normal file
0
node_modules/hexo-cli/assets/themes/.gitkeep
generated
vendored
Normal file
5
node_modules/hexo-cli/bin/hexo
generated
vendored
Executable file
5
node_modules/hexo-cli/bin/hexo
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
'use strict';
|
||||
|
||||
require('../dist/hexo')();
|
||||
25
node_modules/hexo-cli/completion/README.md
generated
vendored
Normal file
25
node_modules/hexo-cli/completion/README.md
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# Completion for Hexo
|
||||
|
||||
## Bash
|
||||
|
||||
Add the following snippet to `~/.bashrc`.
|
||||
|
||||
``` sh
|
||||
eval "$(hexo --completion=bash)"
|
||||
```
|
||||
|
||||
## Zsh
|
||||
|
||||
Add the following snippet to `~/.zshrc`.
|
||||
|
||||
``` sh
|
||||
eval "$(hexo --completion=zsh)"
|
||||
```
|
||||
|
||||
## Fish
|
||||
|
||||
Add the following snippet to `~/.config/fish/config.fish`.
|
||||
|
||||
``` sh
|
||||
hexo --completion=fish | source
|
||||
```
|
||||
25
node_modules/hexo-cli/completion/bash
generated
vendored
Normal file
25
node_modules/hexo-cli/completion/bash
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Borrowed from grunt-cli
|
||||
# https://gruntjs.com/
|
||||
#
|
||||
# Copyright (c) 2012 Tyler Kellen, contributors
|
||||
# Licensed under the MIT license.
|
||||
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# To enable bash <tab> completion for hexo, add the following line (minus the
|
||||
# leading #, which is the bash comment character) to your ~/.bashrc file:
|
||||
#
|
||||
# eval "$(hexo --completion=bash)"
|
||||
|
||||
# Enable bash autocompletion.
|
||||
function _hexo_completions() {
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
local compls=$(hexo --console-list)
|
||||
|
||||
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
|
||||
}
|
||||
|
||||
complete -o default -F _hexo_completions hexo
|
||||
10
node_modules/hexo-cli/completion/fish
generated
vendored
Normal file
10
node_modules/hexo-cli/completion/fish
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# To enable fish <tab> completion for hexo, add the following line to
|
||||
# your ~/.config/fish/config.fish file:
|
||||
#
|
||||
# hexo --completion=fish | source
|
||||
|
||||
complete -c hexo -a "(hexo --console-list)" -f
|
||||
24
node_modules/hexo-cli/completion/zsh
generated
vendored
Normal file
24
node_modules/hexo-cli/completion/zsh
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Borrowed from grunt-cli
|
||||
# https://gruntjs.com/
|
||||
#
|
||||
# Copyright (c) 2012 Tyler Kellen, contributors
|
||||
# Licensed under the MIT license.
|
||||
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# To enable zsh <tab> completion for hexo, add the following line (minus the
|
||||
# leading #, which is the zsh comment character) to your ~/.zshrc file:
|
||||
#
|
||||
# eval "$(hexo --completion=zsh)"
|
||||
|
||||
# Enable zsh autocompletion.
|
||||
function _hexo_completion() {
|
||||
compls=$(hexo --console-list)
|
||||
completions=(${=compls})
|
||||
compadd -- $completions
|
||||
}
|
||||
|
||||
compdef _hexo_completion hexo
|
||||
10
node_modules/hexo-cli/dist/console/help.d.ts
generated
vendored
Normal file
10
node_modules/hexo-cli/dist/console/help.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type Context from '../context';
|
||||
interface HelpArgs {
|
||||
_: string[];
|
||||
v?: boolean;
|
||||
version?: boolean;
|
||||
consoleList?: boolean;
|
||||
completion?: string;
|
||||
}
|
||||
declare function helpConsole(this: Context, args: HelpArgs): any;
|
||||
export = helpConsole;
|
||||
99
node_modules/hexo-cli/dist/console/help.js
generated
vendored
Normal file
99
node_modules/hexo-cli/dist/console/help.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const picocolors_1 = require("picocolors");
|
||||
const hexo_fs_1 = require("hexo-fs");
|
||||
const path_1 = require("path");
|
||||
const bluebird_1 = __importDefault(require("bluebird"));
|
||||
const COMPLETION_DIR = (0, path_1.join)(__dirname, '../../completion');
|
||||
function helpConsole(args) {
|
||||
if (args.v || args.version) {
|
||||
return this.call('version');
|
||||
}
|
||||
else if (args.consoleList) {
|
||||
return printConsoleList(this.extend.console.list());
|
||||
}
|
||||
else if (typeof args.completion === 'string') {
|
||||
return printCompletion(args.completion);
|
||||
}
|
||||
const command = args._[0];
|
||||
if (typeof command === 'string' && command !== 'help') {
|
||||
const c = this.extend.console.get(command);
|
||||
if (c)
|
||||
return printHelpForCommand(this.extend.console.alias[command], c);
|
||||
}
|
||||
return printAllHelp(this.extend.console.list());
|
||||
}
|
||||
function printHelpForCommand(command, data) {
|
||||
const { options } = data;
|
||||
const desc = options.description || options.desc || data.description || data.desc;
|
||||
console.log('Usage: hexo', command, options.usage || '');
|
||||
console.log('\nDescription:');
|
||||
console.log(`${desc}\n`);
|
||||
if (options.arguments)
|
||||
printList('Arguments', options.arguments);
|
||||
if (options.commands)
|
||||
printList('Commands', options.commands);
|
||||
if (options.options)
|
||||
printList('Options', options.options);
|
||||
return bluebird_1.default.resolve();
|
||||
}
|
||||
function printAllHelp(list) {
|
||||
const keys = Object.keys(list);
|
||||
const commands = [];
|
||||
const { length } = keys;
|
||||
for (let i = 0; i < length; i++) {
|
||||
const key = keys[i];
|
||||
commands.push({
|
||||
name: key,
|
||||
desc: list[key].desc
|
||||
});
|
||||
}
|
||||
console.log('Usage: hexo <command>\n');
|
||||
printList('Commands', commands);
|
||||
printList('Global Options', [
|
||||
{ name: '--config', desc: 'Specify config file instead of using _config.yml' },
|
||||
{ name: '--cwd', desc: 'Specify the CWD' },
|
||||
{ name: '--debug', desc: 'Display all verbose messages in the terminal' },
|
||||
{ name: '--draft', desc: 'Display draft posts' },
|
||||
{ name: '--safe', desc: 'Disable all plugins and scripts' },
|
||||
{ name: '--silent', desc: 'Hide output on console' }
|
||||
]);
|
||||
console.log('For more help, you can use \'hexo help [command]\' for the detailed information');
|
||||
console.log('or you can check the docs:', (0, picocolors_1.underline)('https://hexo.io/docs/'));
|
||||
return bluebird_1.default.resolve();
|
||||
}
|
||||
function printList(title, list) {
|
||||
list.sort((a, b) => {
|
||||
const nameA = a.name;
|
||||
const nameB = b.name;
|
||||
if (nameA < nameB)
|
||||
return -1;
|
||||
if (nameA > nameB)
|
||||
return 1;
|
||||
return 0;
|
||||
});
|
||||
const lengths = list.map(item => item.name.length);
|
||||
const maxLen = lengths.reduce((prev, current) => Math.max(prev, current));
|
||||
let str = `${title}:\n`;
|
||||
const { length } = list;
|
||||
for (let i = 0; i < length; i++) {
|
||||
const { description = list[i].desc } = list[i];
|
||||
const pad = ' '.repeat(maxLen - lengths[i] + 2);
|
||||
str += ` ${(0, picocolors_1.bold)(list[i].name)}${pad}${description}\n`;
|
||||
}
|
||||
console.log(str);
|
||||
return bluebird_1.default.resolve();
|
||||
}
|
||||
function printConsoleList(list) {
|
||||
console.log(Object.keys(list).join('\n'));
|
||||
return bluebird_1.default.resolve();
|
||||
}
|
||||
function printCompletion(type) {
|
||||
return (0, hexo_fs_1.readFile)((0, path_1.join)(COMPLETION_DIR, type)).then(content => {
|
||||
console.log(content);
|
||||
});
|
||||
}
|
||||
module.exports = helpConsole;
|
||||
//# sourceMappingURL=help.js.map
|
||||
1
node_modules/hexo-cli/dist/console/help.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/console/help.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../lib/console/help.ts"],"names":[],"mappings":";;;;AAAA,2CAA6C;AAC7C,qCAAmC;AACnC,+BAA4B;AAC5B,wDAA+B;AAI/B,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAU3D,SAAS,WAAW,CAAgB,IAAc;IAChD,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,OAAO,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;SAAM,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC/C,OAAO,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK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I,CAAC,CAAC,CAAC;IAE1C,OAAO,kBAAO,CAAC,OAAO,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAA,kBAAQ,EAAC,IAAA,WAAI,EAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QACzD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,iBAAS,WAAW,CAAC"}
|
||||
3
node_modules/hexo-cli/dist/console/index.d.ts
generated
vendored
Normal file
3
node_modules/hexo-cli/dist/console/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type Context from '../context';
|
||||
declare const _default: (ctx: Context) => void;
|
||||
export = _default;
|
||||
24
node_modules/hexo-cli/dist/console/index.js
generated
vendored
Normal file
24
node_modules/hexo-cli/dist/console/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const help_1 = __importDefault(require("./help"));
|
||||
const init_1 = __importDefault(require("./init"));
|
||||
const version_1 = __importDefault(require("./version"));
|
||||
module.exports = function (ctx) {
|
||||
const { console } = ctx.extend;
|
||||
console.register('help', 'Get help on a command.', {}, help_1.default);
|
||||
console.register('init', 'Create a new Hexo folder.', {
|
||||
desc: 'Create a new Hexo folder at the specified path or the current directory.',
|
||||
usage: '[destination]',
|
||||
arguments: [
|
||||
{ name: 'destination', desc: 'Folder path. Initialize in current folder if not specified' }
|
||||
],
|
||||
options: [
|
||||
{ name: '--no-clone', desc: 'Copy files instead of cloning from GitHub' },
|
||||
{ name: '--no-install', desc: 'Skip npm install' }
|
||||
]
|
||||
}, init_1.default);
|
||||
console.register('version', 'Display version information.', {}, version_1.default);
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/hexo-cli/dist/console/index.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/console/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/console/index.ts"],"names":[],"mappings":";;;;AACA,kDAAiC;AACjC,kDAAiC;AACjC,wDAAuC;AAEvC,iBAAS,UAAS,GAAY;IAC5B,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IAE/B,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,wBAAwB,EAAE,EAAE,EAAE,cAAW,CAAC,CAAC;IAEpE,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,2BAA2B,EAAE;QACpD,IAAI,EAAE,0EAA0E;QAChF,KAAK,EAAE,eAAe;QACtB,SAAS,EAAE;YACT,EAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,4DAA4D,EAAC;SAC1F;QACD,OAAO,EAAE;YACP,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,2CAA2C,EAAC;YACvE,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,kBAAkB,EAAC;SACjD;KACF,EAAE,cAAW,CAAC,CAAC;IAEhB,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,8BAA8B,EAAE,EAAE,EAAE,iBAAc,CAAC,CAAC;AAClF,CAAC,CAAC"}
|
||||
8
node_modules/hexo-cli/dist/console/init.d.ts
generated
vendored
Normal file
8
node_modules/hexo-cli/dist/console/init.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type Context from '../context';
|
||||
interface InitArgs {
|
||||
_: string[];
|
||||
install?: boolean;
|
||||
clone?: boolean;
|
||||
}
|
||||
declare function initConsole(this: Context, args: InitArgs): Promise<void>;
|
||||
export = initConsole;
|
||||
126
node_modules/hexo-cli/dist/console/init.js
generated
vendored
Normal file
126
node_modules/hexo-cli/dist/console/init.js
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const bluebird_1 = __importDefault(require("bluebird"));
|
||||
const path_1 = require("path");
|
||||
const picocolors_1 = require("picocolors");
|
||||
const hexo_fs_1 = require("hexo-fs");
|
||||
const tildify_1 = __importDefault(require("tildify"));
|
||||
const spawn_1 = __importDefault(require("hexo-util/dist/spawn")); // for rewire
|
||||
const command_exists_1 = require("command-exists");
|
||||
const ASSET_DIR = (0, path_1.join)(__dirname, '../../assets');
|
||||
const GIT_REPO_URL = 'https://github.com/hexojs/hexo-starter.git';
|
||||
function initConsole(args) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
args = Object.assign({ install: true, clone: true }, args);
|
||||
const baseDir = this.base_dir;
|
||||
const target = args._[0] ? (0, path_1.resolve)(baseDir, args._[0]) : baseDir;
|
||||
const { log } = this;
|
||||
if ((0, hexo_fs_1.existsSync)(target) && (0, hexo_fs_1.readdirSync)(target).length !== 0) {
|
||||
log.fatal(`${(0, picocolors_1.magenta)((0, tildify_1.default)(target))} not empty, please run \`hexo init\` on an empty folder and then copy your files into it`);
|
||||
yield bluebird_1.default.reject(new Error('target not empty'));
|
||||
}
|
||||
log.info('Cloning hexo-starter', GIT_REPO_URL);
|
||||
if (args.clone) {
|
||||
try {
|
||||
yield (0, spawn_1.default)('git', ['clone', '--recurse-submodules', '--depth=1', '--quiet', GIT_REPO_URL, target], {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
log.warn('git clone failed. Copying data instead');
|
||||
yield copyAsset(target);
|
||||
}
|
||||
}
|
||||
else {
|
||||
yield copyAsset(target);
|
||||
}
|
||||
yield bluebird_1.default.all([
|
||||
removeGitDir(target),
|
||||
removeGitModules(target)
|
||||
]);
|
||||
if (!args.install)
|
||||
return;
|
||||
log.info('Install dependencies');
|
||||
let npmCommand = 'npm';
|
||||
if ((0, command_exists_1.sync)('yarn')) {
|
||||
npmCommand = 'yarn';
|
||||
}
|
||||
else if ((0, command_exists_1.sync)('pnpm')) {
|
||||
npmCommand = 'pnpm';
|
||||
}
|
||||
try {
|
||||
if (npmCommand === 'yarn') {
|
||||
const yarnVer = yield (0, spawn_1.default)(npmCommand, ['--version'], {
|
||||
cwd: target
|
||||
});
|
||||
if (typeof yarnVer === 'string' && yarnVer.startsWith('1')) {
|
||||
yield (0, spawn_1.default)(npmCommand, ['install', '--production', '--ignore-optional', '--silent'], {
|
||||
cwd: target,
|
||||
stdio: 'inherit'
|
||||
});
|
||||
}
|
||||
else {
|
||||
npmCommand = 'npm';
|
||||
}
|
||||
}
|
||||
else if (npmCommand === 'pnpm') {
|
||||
yield (0, spawn_1.default)(npmCommand, ['install', '--prod', '--no-optional', '--silent'], {
|
||||
cwd: target,
|
||||
stdio: 'inherit'
|
||||
});
|
||||
}
|
||||
if (npmCommand === 'npm') {
|
||||
yield (0, spawn_1.default)(npmCommand, ['install', '--only=production', '--optional=false', '--silent'], {
|
||||
cwd: target,
|
||||
stdio: 'inherit'
|
||||
});
|
||||
}
|
||||
log.info('Start blogging with Hexo!');
|
||||
}
|
||||
catch (err) {
|
||||
log.warn(`Failed to install dependencies. Please run 'npm install' in "${target}" folder.`);
|
||||
}
|
||||
});
|
||||
}
|
||||
function copyAsset(target) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield (0, hexo_fs_1.copyDir)(ASSET_DIR, target, { ignoreHidden: false });
|
||||
});
|
||||
}
|
||||
function removeGitDir(target) {
|
||||
const gitDir = (0, path_1.join)(target, '.git');
|
||||
return (0, hexo_fs_1.stat)(gitDir).catch(err => {
|
||||
if (err && err.code === 'ENOENT')
|
||||
return;
|
||||
throw err;
|
||||
}).then(stats => {
|
||||
if (stats) {
|
||||
return stats.isDirectory() ? (0, hexo_fs_1.rmdir)(gitDir) : (0, hexo_fs_1.unlink)(gitDir);
|
||||
}
|
||||
}).then(() => (0, hexo_fs_1.readdir)(target)).map(path => (0, path_1.join)(target, path)).filter(path => (0, hexo_fs_1.stat)(path).then(stats => stats.isDirectory())).each(removeGitDir);
|
||||
}
|
||||
function removeGitModules(target) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
yield (0, hexo_fs_1.unlink)((0, path_1.join)(target, '.gitmodules'));
|
||||
}
|
||||
catch (err) {
|
||||
if (err && err.code === 'ENOENT')
|
||||
return;
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
module.exports = initConsole;
|
||||
//# sourceMappingURL=init.js.map
|
||||
1
node_modules/hexo-cli/dist/console/init.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/console/init.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../lib/console/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wDAAuC;AACvC,+BAAqC;AACrC,2CAAqC;AACrC,qCAAyF;AACzF,sDAA8B;AAC9B,iEAAyC,CAAC,aAAa;AACvD,mDAA2D;AAG3D,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AAClD,MAAM,YAAY,GAAG,4CAA4C,CAAC;AAQlE,SAAe,WAAW,CAAgB,IAAc;;QACtD,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE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,CAAC,IAAA,cAAI,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAClJ,CAAC;AAED,SAAe,gBAAgB,CAAC,MAAc;;QAC5C,IAAI,CAAC;YACH,MAAM,IAAA,gBAAM,EAAC,IAAA,WAAI,EAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;gBAAE,OAAO;YACzC,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CAAA;AAED,iBAAS,WAAW,CAAC"}
|
||||
3
node_modules/hexo-cli/dist/console/version.d.ts
generated
vendored
Normal file
3
node_modules/hexo-cli/dist/console/version.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type Context from '../context';
|
||||
declare function versionConsole(this: Context): Promise<void>;
|
||||
export = versionConsole;
|
||||
46
node_modules/hexo-cli/dist/console/version.js
generated
vendored
Normal file
46
node_modules/hexo-cli/dist/console/version.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const os_1 = __importDefault(require("os"));
|
||||
const pkg = require('../../package.json');
|
||||
const bluebird_1 = __importDefault(require("bluebird"));
|
||||
const hexo_util_1 = require("hexo-util");
|
||||
function versionConsole() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const { versions, platform } = process;
|
||||
const keys = Object.keys(versions);
|
||||
if (this.version) {
|
||||
console.log('hexo:', this.version);
|
||||
}
|
||||
console.log('hexo-cli:', pkg.version);
|
||||
let osInfo;
|
||||
if (platform === 'darwin')
|
||||
osInfo = yield (0, hexo_util_1.spawn)('sw_vers', '-productVersion');
|
||||
else if (platform === 'linux') {
|
||||
const v = yield (0, hexo_util_1.spawn)('cat', '/etc/os-release');
|
||||
const distro = String(v || '').match(/NAME="(.+)"/);
|
||||
const versionInfo = String(v || '').match(/VERSION="(.+)"/) || ['', ''];
|
||||
const versionStr = versionInfo !== null ? versionInfo[1] : '';
|
||||
osInfo = `${distro[1]} ${versionStr}`.trim() || '';
|
||||
}
|
||||
osInfo = `${os_1.default.platform()} ${os_1.default.release()} ${osInfo}`;
|
||||
console.log('os:', osInfo);
|
||||
for (let i = 0, len = keys.length; i < len; i++) {
|
||||
const key = keys[i];
|
||||
console.log('%s: %s', key, versions[key]);
|
||||
}
|
||||
yield bluebird_1.default.resolve();
|
||||
});
|
||||
}
|
||||
module.exports = versionConsole;
|
||||
//# sourceMappingURL=version.js.map
|
||||
1
node_modules/hexo-cli/dist/console/version.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/console/version.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../lib/console/version.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,4CAAoB;AACpB,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC1C,wDAAuC;AACvC,yCAAkC;AAGlC,SAAe,cAAc;;QAC3B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,O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M,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5C,CAAC;QAED,MAAM,kBAAe,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;CAAA;AAED,iBAAS,cAAc,CAAC"}
|
||||
19
node_modules/hexo-cli/dist/context.d.ts
generated
vendored
Normal file
19
node_modules/hexo-cli/dist/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import logger from 'hexo-log';
|
||||
import Promise from 'bluebird';
|
||||
import ConsoleExtend from './extend/console';
|
||||
type Callback = (err?: any, value?: any) => void;
|
||||
declare class Context {
|
||||
base_dir: string;
|
||||
log: ReturnType<typeof logger>;
|
||||
extend: {
|
||||
console: ConsoleExtend;
|
||||
};
|
||||
version?: string | null;
|
||||
constructor(base?: string, args?: {});
|
||||
init(): void;
|
||||
call(name: string, args: object, callback?: Callback): any;
|
||||
call(name: string, callback?: Callback): any;
|
||||
exit(err?: Error): Promise<void>;
|
||||
unwatch(): void;
|
||||
}
|
||||
export = Context;
|
||||
46
node_modules/hexo-cli/dist/context.js
generated
vendored
Normal file
46
node_modules/hexo-cli/dist/context.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const hexo_log_1 = __importDefault(require("hexo-log"));
|
||||
const picocolors_1 = require("picocolors");
|
||||
const bluebird_1 = __importDefault(require("bluebird"));
|
||||
const console_1 = __importDefault(require("./extend/console"));
|
||||
class Context {
|
||||
constructor(base = process.cwd(), args = {}) {
|
||||
this.base_dir = base;
|
||||
this.log = (0, hexo_log_1.default)(args);
|
||||
this.extend = {
|
||||
console: new console_1.default()
|
||||
};
|
||||
}
|
||||
init() {
|
||||
// Do nothing
|
||||
}
|
||||
call(name, args, callback) {
|
||||
if (!callback && typeof args === 'function') {
|
||||
callback = args;
|
||||
args = {};
|
||||
}
|
||||
return new bluebird_1.default((resolve, reject) => {
|
||||
const c = this.extend.console.get(name);
|
||||
if (c) {
|
||||
c.call(this, args).then(resolve, reject);
|
||||
}
|
||||
else {
|
||||
reject(new Error(`Console \`${name}\` has not been registered yet!`));
|
||||
}
|
||||
}).asCallback(callback);
|
||||
}
|
||||
exit(err) {
|
||||
if (err) {
|
||||
this.log.fatal({ err }, 'Something\'s wrong. Maybe you can find the solution here: %s', (0, picocolors_1.underline)('https://hexo.io/docs/troubleshooting.html'));
|
||||
}
|
||||
return bluebird_1.default.resolve();
|
||||
}
|
||||
unwatch() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
module.exports = Context;
|
||||
//# sourceMappingURL=context.js.map
|
||||
1
node_modules/hexo-cli/dist/context.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/context.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"context.js","sourceRoot":"","sources":["../lib/context.ts"],"names":[],"mappings":";;;;AAAA,wDAA8B;AAC9B,2CAAuC;AACvC,wDAA+B;AAC/B,+DAA6C;AAO7C,MAAM,OAAO;IAQX,YAAY,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,IAAA,kBAAM,EAAC,IAAI,CAAC,CAAC;QAExB,IAAI,CAAC,MAAM,GAAG;YACZ,OAAO,EAAE,IAAI,iBAAa,EAAE;SAC7B,CAAC;IACJ,CAAC;IAED,IAAI;QACF,aAAa;IACf,CAAC;IAID,IAAI,CAAC,IAAY,EAAE,IAAwB,EAAE,QAAmB;QAC9D,IAAI,CAAC,QAAQ,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;YAC5C,QAAQ,GAAG,IAAgB,CAAC;YAC5B,IAAI,GAAG,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,IAAI,kBAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAExC,IAAI,CAAC,EAAE,CAAC;gBACN,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,KAAK,CAAC,aAAa,IAAI,iCAAiC,CAAC,CAAC,CAAC;YACxE,CAAC;QACH,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,GAAW;QACd,IAAI,GAAG,EAAE,CAAC;YACR,IAAI,CAAC,GAAG,CAAC,KAAK,CACZ,EAAC,GAAG,EAAC,EACL,8DAA8D,EAC9D,IAAA,sBAAS,EAAC,2CAA2C,CAAC,CACvD,CAAC;QACJ,CAAC;QAED,OAAO,kBAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,aAAa;IACf,CAAC;CACF;AAED,iBAAS,OAAO,CAAC"}
|
||||
13
node_modules/hexo-cli/dist/extend/console.d.ts
generated
vendored
Normal file
13
node_modules/hexo-cli/dist/extend/console.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Options, Callback, Store, Alias } from '../types';
|
||||
declare class Console {
|
||||
store: Store;
|
||||
alias: Alias;
|
||||
constructor();
|
||||
get(name: string): Callback;
|
||||
list(): Store;
|
||||
register(name: string, desc: string, options: Options, fn: Callback): void;
|
||||
register(name: string, options: Options, fn: Callback): void;
|
||||
register(name: string, desc: string, fn: Callback): void;
|
||||
register(name: string, fn: Callback): void;
|
||||
}
|
||||
export = Console;
|
||||
64
node_modules/hexo-cli/dist/extend/console.js
generated
vendored
Normal file
64
node_modules/hexo-cli/dist/extend/console.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const bluebird_1 = __importDefault(require("bluebird"));
|
||||
const abbrev_1 = __importDefault(require("abbrev"));
|
||||
class Console {
|
||||
constructor() {
|
||||
this.store = {};
|
||||
this.alias = {};
|
||||
}
|
||||
get(name) {
|
||||
name = name.toLowerCase();
|
||||
return this.store[this.alias[name]];
|
||||
}
|
||||
list() {
|
||||
return this.store;
|
||||
}
|
||||
register(name, desc, options, fn) {
|
||||
if (!name)
|
||||
throw new TypeError('name is required');
|
||||
if (!fn) {
|
||||
if (options) {
|
||||
if (typeof options === 'function') {
|
||||
fn = options;
|
||||
if (typeof desc === 'object') { // name, options, fn
|
||||
options = desc;
|
||||
desc = '';
|
||||
}
|
||||
else { // name, desc, fn
|
||||
options = {};
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new TypeError('fn must be a function');
|
||||
}
|
||||
}
|
||||
else {
|
||||
// name, fn
|
||||
if (typeof desc === 'function') {
|
||||
fn = desc;
|
||||
options = {};
|
||||
desc = '';
|
||||
}
|
||||
else {
|
||||
throw new TypeError('fn must be a function');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fn.length > 1) {
|
||||
fn = bluebird_1.default.promisify(fn);
|
||||
}
|
||||
else {
|
||||
fn = bluebird_1.default.method(fn);
|
||||
}
|
||||
this.store[name.toLowerCase()] = fn;
|
||||
const c = fn;
|
||||
c.options = options;
|
||||
c.desc = desc;
|
||||
this.alias = (0, abbrev_1.default)(Object.keys(this.store));
|
||||
}
|
||||
}
|
||||
module.exports = Console;
|
||||
//# sourceMappingURL=console.js.map
|
||||
1
node_modules/hexo-cli/dist/extend/console.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/extend/console.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"console.js","sourceRoot":"","sources":["../../lib/extend/console.ts"],"names":[],"mappings":";;;;AAAA,wDAA+B;AAC/B,oDAA4B;AAG5B,MAAM,OAAO;IAIX;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,GAAG,CAAC,IAAY;QACd,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAMD,QAAQ,CAAC,IAAY,EAAE,IAAiC,EAAE,OAA4B,EAAE,EAAa;QACnG,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,SAAS,CAAC,kBAAkB,CAAC,CAAC;QAEnD,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;oBAClC,EAAE,GAAG,OAAmB,CAAC;oBAEzB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC,CAAC,oBAAoB;wBAClD,OAAO,GAAG,IAAI,CAAC;wBACf,IAAI,GAAG,EAAE,CAAC;oBACZ,CAAC;yBAAM,CAAC,CAAC,iBAAiB;wBACxB,OAAO,GAAG,EAAE,CAAC;oBACf,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,SAAS,CAAC,uBAAuB,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,WAAW;gBACX,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;oBAC/B,EAAE,GAAG,IAAgB,CAAC;oBACtB,OAAO,GAAG,EAAE,CAAC;oBACb,IAAI,GAAG,EAAE,CAAC;gBACZ,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,SAAS,CAAC,uBAAuB,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClB,EAAE,GAAG,kBAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,EAAE,GAAG,kBAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,CAAC,GAAG,EAAE,CAAC;QACb,CAAC,CAAC,OAAO,GAAG,OAAkB,CAAC;QAC/B,CAAC,CAAC,IAAI,GAAG,IAAc,CAAC;QAExB,IAAI,CAAC,KAAK,GAAG,IAAA,gBAAM,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;CACF;AAED,iBAAS,OAAO,CAAC"}
|
||||
5
node_modules/hexo-cli/dist/find_pkg.d.ts
generated
vendored
Normal file
5
node_modules/hexo-cli/dist/find_pkg.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
interface findPkgArgs {
|
||||
cwd?: string;
|
||||
}
|
||||
declare function findPkg(cwd: string, args?: findPkgArgs): any;
|
||||
export = findPkg;
|
||||
27
node_modules/hexo-cli/dist/find_pkg.js
generated
vendored
Normal file
27
node_modules/hexo-cli/dist/find_pkg.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
const path_1 = require("path");
|
||||
const hexo_fs_1 = require("hexo-fs");
|
||||
function findPkg(cwd, args = {}) {
|
||||
if (args.cwd) {
|
||||
cwd = (0, path_1.resolve)(cwd, args.cwd);
|
||||
}
|
||||
return checkPkg(cwd);
|
||||
}
|
||||
function checkPkg(path) {
|
||||
const pkgPath = (0, path_1.join)(path, 'package.json');
|
||||
return (0, hexo_fs_1.readFile)(pkgPath).then(content => {
|
||||
const json = JSON.parse(content);
|
||||
if (typeof json.hexo === 'object')
|
||||
return path;
|
||||
}).catch(err => {
|
||||
if (err && err.code === 'ENOENT') {
|
||||
const parent = (0, path_1.dirname)(path);
|
||||
if (parent === path)
|
||||
return;
|
||||
return checkPkg(parent);
|
||||
}
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
module.exports = findPkg;
|
||||
//# sourceMappingURL=find_pkg.js.map
|
||||
1
node_modules/hexo-cli/dist/find_pkg.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/find_pkg.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"find_pkg.js","sourceRoot":"","sources":["../lib/find_pkg.ts"],"names":[],"mappings":";AAAA,+BAA8C;AAC9C,qCAAmC;AAMnC,SAAS,OAAO,CAAC,GAAW,EAAE,OAAoB,EAAE;IAClD,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,GAAG,GAAG,IAAA,cAAO,EAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,MAAM,OAAO,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAE3C,OAAO,IAAA,kBAAQ,EAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAiB,CAAC,CAAC;QAC3C,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;IACjD,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACb,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACjC,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;YAE7B,IAAI,MAAM,KAAK,IAAI;gBAAE,OAAO;YAC5B,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;QAED,MAAM,GAAG,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,iBAAS,OAAO,CAAC"}
|
||||
2
node_modules/hexo-cli/dist/goodbye.d.ts
generated
vendored
Normal file
2
node_modules/hexo-cli/dist/goodbye.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: () => string;
|
||||
export = _default;
|
||||
11
node_modules/hexo-cli/dist/goodbye.js
generated
vendored
Normal file
11
node_modules/hexo-cli/dist/goodbye.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
const byeWords = [
|
||||
'Good bye',
|
||||
'See you again',
|
||||
'Farewell',
|
||||
'Have a nice day',
|
||||
'Bye!',
|
||||
'Catch you later'
|
||||
];
|
||||
module.exports = () => byeWords[(Math.random() * byeWords.length) | 0];
|
||||
//# sourceMappingURL=goodbye.js.map
|
||||
1
node_modules/hexo-cli/dist/goodbye.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/goodbye.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"goodbye.js","sourceRoot":"","sources":["../lib/goodbye.ts"],"names":[],"mappings":";AAAA,MAAM,QAAQ,GAAG;IACf,UAAU;IACV,eAAe;IACf,UAAU;IACV,iBAAiB;IACjB,MAAM;IACN,iBAAiB;CAClB,CAAC;AAEF,iBAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
||||
13
node_modules/hexo-cli/dist/hexo.d.ts
generated
vendored
Normal file
13
node_modules/hexo-cli/dist/hexo.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import helpConsole from './console/help';
|
||||
import initConsole from './console/init';
|
||||
import versionConsole from './console/version';
|
||||
declare function entry(cwd: string, args: any): any;
|
||||
declare namespace entry {
|
||||
var console: {
|
||||
init: typeof initConsole;
|
||||
help: typeof helpConsole;
|
||||
version: typeof versionConsole;
|
||||
};
|
||||
var version: string;
|
||||
}
|
||||
export = entry;
|
||||
86
node_modules/hexo-cli/dist/hexo.js
generated
vendored
Normal file
86
node_modules/hexo-cli/dist/hexo.js
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
const picocolors_1 = require("picocolors");
|
||||
const tildify_1 = __importDefault(require("tildify"));
|
||||
const bluebird_1 = __importDefault(require("bluebird"));
|
||||
const context_1 = __importDefault(require("./context"));
|
||||
const find_pkg_1 = __importDefault(require("./find_pkg"));
|
||||
const goodbye_1 = __importDefault(require("./goodbye"));
|
||||
const minimist_1 = __importDefault(require("minimist"));
|
||||
const resolve_1 = __importDefault(require("resolve"));
|
||||
const hexo_util_1 = require("hexo-util");
|
||||
const console_1 = __importDefault(require("./console"));
|
||||
const help_1 = __importDefault(require("./console/help"));
|
||||
const init_1 = __importDefault(require("./console/init"));
|
||||
const version_1 = __importDefault(require("./console/version"));
|
||||
class HexoNotFoundError extends Error {
|
||||
}
|
||||
function entry(cwd = process.cwd(), args) {
|
||||
args = (0, hexo_util_1.camelCaseKeys)(args || (0, minimist_1.default)(process.argv.slice(2), { string: ['_', 'p', 'path', 's', 'slug'] }));
|
||||
let hexo = new context_1.default(cwd, args);
|
||||
let { log } = hexo;
|
||||
// Change the title in console
|
||||
process.title = 'hexo';
|
||||
function handleError(err) {
|
||||
if (err && !(err instanceof HexoNotFoundError)) {
|
||||
log.fatal(err);
|
||||
}
|
||||
process.exitCode = 2;
|
||||
}
|
||||
return (0, find_pkg_1.default)(cwd, args).then(path => {
|
||||
if (!path)
|
||||
return;
|
||||
hexo.base_dir = path;
|
||||
return loadModule(path, args).catch(err => {
|
||||
log.error(err.message);
|
||||
log.error('Local hexo loading failed in %s', (0, picocolors_1.magenta)((0, tildify_1.default)(path)));
|
||||
log.error('Try running: \'rm -rf node_modules && npm install --force\'');
|
||||
throw new HexoNotFoundError();
|
||||
});
|
||||
}).then(mod => {
|
||||
if (mod)
|
||||
hexo = mod;
|
||||
log = hexo.log;
|
||||
(0, console_1.default)(hexo);
|
||||
return hexo.init();
|
||||
}).then(() => {
|
||||
let cmd = 'help';
|
||||
if (!args.h && !args.help) {
|
||||
const c = args._.shift();
|
||||
if (c && hexo.extend.console.get(c))
|
||||
cmd = c;
|
||||
}
|
||||
watchSignal(hexo);
|
||||
return hexo.call(cmd, args).then(() => hexo.exit()).catch(err => hexo.exit(err).then(() => {
|
||||
// `hexo.exit()` already dumped `err`
|
||||
handleError(null);
|
||||
}));
|
||||
}).catch(handleError);
|
||||
}
|
||||
entry.console = {
|
||||
init: init_1.default,
|
||||
help: help_1.default,
|
||||
version: version_1.default
|
||||
};
|
||||
entry.version = require('../package.json').version;
|
||||
function loadModule(path, args) {
|
||||
return bluebird_1.default.try(() => {
|
||||
const modulePath = resolve_1.default.sync('hexo', { basedir: path });
|
||||
const Hexo = require(modulePath);
|
||||
return new Hexo(path, args);
|
||||
});
|
||||
}
|
||||
function watchSignal(hexo) {
|
||||
process.on('SIGINT', () => {
|
||||
hexo.log.info((0, goodbye_1.default)());
|
||||
hexo.unwatch();
|
||||
hexo.exit().then(() => {
|
||||
// eslint-disable-next-line no-process-exit
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
}
|
||||
module.exports = entry;
|
||||
//# sourceMappingURL=hexo.js.map
|
||||
1
node_modules/hexo-cli/dist/hexo.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/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C;YACrC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACxB,CAAC;AAED,KAAK,CAAC,OAAO,GAAG;IACd,IAAI,EAAE,cAAW;IACjB,IAAI,EAAE,cAAW;IACjB,OAAO,EAAE,iBAAc;CACxB,CAAC;AAEF,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAiB,CAAC;AAE7D,SAAS,UAAU,CAAC,IAAI,EAAE,IAAI;IAC5B,OAAO,kBAAO,CAAC,GAAG,CAAC,GAAG,EAAE;QACtB,MAAM,UAAU,GAAG,iBAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QAEjC,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,IAAa;IAChC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,iBAAO,GAAE,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QAEf,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACpB,2CAA2C;YAC3C,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,iBAAS,KAAK,CAAC"}
|
||||
25
node_modules/hexo-cli/dist/types.d.ts
generated
vendored
Normal file
25
node_modules/hexo-cli/dist/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
export interface Command {
|
||||
name: string;
|
||||
desc: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface Options {
|
||||
desc?: string;
|
||||
description?: string;
|
||||
usage?: string;
|
||||
arguments?: Command[];
|
||||
options?: Command[];
|
||||
commands?: Command[];
|
||||
}
|
||||
export interface Callback {
|
||||
(args?: object): any;
|
||||
options?: Options;
|
||||
desc?: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface Store {
|
||||
[key: string]: Callback;
|
||||
}
|
||||
export interface Alias {
|
||||
[key: string]: string;
|
||||
}
|
||||
3
node_modules/hexo-cli/dist/types.js
generated
vendored
Normal file
3
node_modules/hexo-cli/dist/types.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/hexo-cli/dist/types.js.map
generated
vendored
Normal file
1
node_modules/hexo-cli/dist/types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":""}
|
||||
79
node_modules/hexo-cli/package.json
generated
vendored
Normal file
79
node_modules/hexo-cli/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"name": "hexo-cli",
|
||||
"version": "4.3.2",
|
||||
"description": "Command line interface for Hexo",
|
||||
"main": "dist/hexo",
|
||||
"bin": {
|
||||
"hexo": "./bin/hexo"
|
||||
},
|
||||
"files": [
|
||||
"dist/**",
|
||||
"completion",
|
||||
"bin",
|
||||
"assets"
|
||||
],
|
||||
"types": "./dist/hexo.d.ts",
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm install && npm run clean && npm run build",
|
||||
"build": "tsc -b",
|
||||
"clean": "tsc -b --clean",
|
||||
"eslint": "eslint .",
|
||||
"pretest": "npm run clean && npm run build",
|
||||
"test": "mocha test/**/*.ts --require ts-node/register",
|
||||
"test-cov": "nyc --reporter=lcovonly npm test",
|
||||
"prepare": "git submodule init && git submodule update && git submodule foreach git pull origin master"
|
||||
},
|
||||
"repository": "hexojs/hexo-cli",
|
||||
"homepage": "https://hexo.io/",
|
||||
"keywords": [
|
||||
"website",
|
||||
"blog",
|
||||
"cms",
|
||||
"framework",
|
||||
"hexo",
|
||||
"cli"
|
||||
],
|
||||
"author": "Tommy Chen <tommy351@gmail.com> (https://zespia.tw)",
|
||||
"maintainers": [
|
||||
"Abner Chou <hi@abnerchou.me> (https://abnerchou.me)"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"abbrev": "^2.0.0",
|
||||
"bluebird": "^3.7.2",
|
||||
"command-exists": "^1.2.9",
|
||||
"hexo-fs": "^4.1.1",
|
||||
"hexo-log": "^4.0.1",
|
||||
"hexo-util": "^3.3.0",
|
||||
"minimist": "^1.2.5",
|
||||
"picocolors": "^1.0.0",
|
||||
"resolve": "^1.20.0",
|
||||
"tildify": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/abbrev": "^1.1.5",
|
||||
"@types/bluebird": "^3.5.37",
|
||||
"@types/chai": "^4.3.14",
|
||||
"@types/command-exists": "^1.2.3",
|
||||
"@types/minimist": "^1.2.5",
|
||||
"@types/mocha": "^10.0.6",
|
||||
"@types/node": "^18.11.8",
|
||||
"@types/proxyquire": "^1.3.31",
|
||||
"@types/rewire": "^2.5.30",
|
||||
"@types/sinon": "^17.0.3",
|
||||
"chai": "^4.3.4",
|
||||
"eslint": "^8.2.0",
|
||||
"eslint-config-hexo": "^5.0.0",
|
||||
"hexo-renderer-marked": "^6.0.0",
|
||||
"mocha": "^10.0.0",
|
||||
"nyc": "^15.1.0",
|
||||
"proxyquire": "^2.1.3",
|
||||
"rewire": "^6.0.0",
|
||||
"sinon": "^17.0.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user