Skip to content

Commit

Permalink
chore: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 27, 2021
1 parent 221cb76 commit 18a8ae3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@types/cli-progress": "^3.9.1",
"@types/codemirror": "^5.60.0",
"@types/connect": "^3.4.34",
"@types/debug": "^4.1.5",
"@types/file-saver": "^2.0.2",
"@types/fs-extra": "^9.0.11",
"@types/jest": "^26.0.23",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/windi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default defineConfig({
'!opacity-0',
],
shortcuts: {
'abs-t': 'absolute bottom-0 left-0 right-0',
'bg-main': 'bg-white text-[#181818] dark:(bg-[#121212] text-[#ddd])',
'abs-tl': 'absolute top-0 left-0',
'abs-tr': 'absolute top-0 right-0',
'abs-b': 'absolute bottom-0 left-0 right-0',
Expand Down
20 changes: 18 additions & 2 deletions packages/slidev/node/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import RemoteAssets from 'vite-plugin-remote-assets'
import { ArgumentsType, uniq } from '@antfu/utils'
import { SlidevMarkdown } from '@slidev/types'
import * as parser from '@slidev/parser/fs'
import _debug from 'debug'
import { resolveImportPath } from './utils'
import { packageExists, promptForThemeInstallation, resolveThemeName } from './themes'

const debug = _debug('slidev:options')

export interface SlidevEntryOptions {
/**
* Markdown entry
Expand Down Expand Up @@ -89,9 +92,10 @@ export async function resolveOptions(
promptForInstallation = true,
): Promise<ResolvedSlidevOptions> {
const {
entry = 'slides.md',
entry: rawEntry = 'slides.md',
userRoot = process.cwd(),
} = options
const entry = resolve(userRoot, rawEntry)
const data = await parser.load(entry)
const theme = resolveThemeName(options.theme || data.config.theme)

Expand All @@ -112,10 +116,22 @@ export async function resolveOptions(
const themeRoots = getThemeRoots(theme, entry)
const roots = uniq([clientRoot, ...themeRoots, userRoot])

debug({
config: data.config,
mode,
entry,
theme,
userRoot,
clientRoot,
cliRoot,
themeRoots,
roots,
})

return {
data,
mode,
entry: resolve(userRoot, entry),
entry,
theme,
userRoot,
clientRoot,
Expand Down
1 change: 1 addition & 0 deletions packages/slidev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"cli-progress": "^3.9.0",
"codemirror": "^5.61.1",
"connect": "^3.7.0",
"debug": "^4.3.1",
"fast-glob": "^3.2.5",
"fs-extra": "^10.0.0",
"is-installed-globally": "^0.4.0",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18a8ae3

Please sign in to comment.