Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
chore(docz-core): change package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Dec 28, 2018
1 parent 36fd839 commit c935af5
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typings/
.yarn-integrity
.env
es
lib
core/docz-utils/lib
stats.html
build
dist
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as plugins from './plugins'
import * as paths from '../config/paths'
import { BabelRC } from '../config/babel'
import { minifier } from './minifier'
import { ServerHooks } from '../Bundler'
import { ServerHooks } from '../lib/Bundler'
import { Config as Args, Env } from '../config/argv'

export const createConfig = (args: Args, env: Env) => async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ignoredFiles from 'react-dev-utils/ignoredFiles'

import * as paths from '../config/paths'
import { Config as Args } from '../config/argv'
import { ServerHooks } from '../Bundler'
import { ServerHooks } from '../lib/Bundler'

export const devServerConfig = (hooks: ServerHooks, args: Args) => {
const srcPath = path.resolve(paths.root, args.src)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Configuration as CFG } from 'webpack'

import { Bundler } from '../Bundler'
import { Bundler } from '../lib/Bundler'
import { Config as Args, Env } from '../config/argv'

import { createConfig } from './config'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import WebpackDevServer from 'webpack-dev-server'
import * as paths from '../config/paths'
import { devServerConfig } from './devserver'
import { Config as Args } from '../config/argv'
import { ServerHooks as Hooks } from '../Bundler'
import { ServerHooks as Hooks } from '../lib/Bundler'
import * as serverUtils from 'react-dev-utils/WebpackDevServerUtils'

export const server = (args: Args) => async (config: Config, hooks: Hooks) => {
Expand Down
8 changes: 4 additions & 4 deletions core/docz-core/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Arguments } from 'yargs'
import logger from 'signale'
import envDotProp from 'env-dot-prop'

import { Plugin } from '../Plugin'
import { Entries } from '../Entries'
import { DataServer } from '../DataServer'
import { Plugin } from '../lib/Plugin'
import { Entries } from '../lib/Entries'
import { DataServer } from '../lib/DataServer'
import { parseConfig } from '../config/docz'
import { bundler as webpack } from '../webpack'
import { bundler as webpack } from '../bundler'
import * as states from '../states'

export const build = async (args: Arguments) => {
Expand Down
6 changes: 3 additions & 3 deletions core/docz-core/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { Arguments } from 'yargs'
import logger from 'signale'
import envDotProp from 'env-dot-prop'

import { Entries } from '../Entries'
import { DataServer } from '../DataServer'
import { Entries } from '../lib/Entries'
import { DataServer } from '../lib/DataServer'
import { parseConfig } from '../config/docz'
import { onSignal } from '../utils/on-signal'
import { bundler as webpack } from '../webpack'
import { bundler as webpack } from '../bundler'
import * as states from '../states'

export const dev = async (args: Arguments) => {
Expand Down
2 changes: 1 addition & 1 deletion core/docz-core/src/config/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import humanize from 'humanize-string'
import titleize from 'titleize'
import get from 'lodash/get'

import { Plugin } from '../Plugin'
import { Plugin } from '../lib/Plugin'
import { BabelRC } from '../config/babel'
import * as paths from '../config/paths'

Expand Down
2 changes: 1 addition & 1 deletion core/docz-core/src/config/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import merge from 'deepmerge'
import getCacheIdentifier from 'react-dev-utils/getCacheIdentifier'

import { Config, Env } from '../config/argv'
import { Plugin } from '../Plugin'
import { Plugin } from '../lib/Plugin'

export interface BabelRC {
presets: any[]
Expand Down
2 changes: 1 addition & 1 deletion core/docz-core/src/config/docz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import detectPort from 'detect-port'
import * as paths from '../config/paths'
import { BabelRC } from '../config/babel'
import { Config } from '../config/argv'
import { Plugin } from '../Plugin'
import { Plugin } from '../lib/Plugin'

const toOmit = ['_', '$0', 'version', 'help']
const htmlContext = {
Expand Down
8 changes: 4 additions & 4 deletions core/docz-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { cli } from './cli'
export { Config } from './config/argv'
export { BabelRC } from './config/babel'
export { Plugin, createPlugin } from './Plugin'
export { DataServer } from './DataServer'
export { Entries } from './Entries'
export { Entry } from './Entry'
export { Plugin, createPlugin } from './lib/Plugin'
export { DataServer } from './lib/DataServer'
export { Entries } from './lib/Entries'
export { Entry } from './lib/Entry'
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import * as http from 'http'
import logger from 'signale'

import { Plugin } from './Plugin'
import { Config as Args, Env } from './config/argv'
import { getBabelConfig, BabelRC } from './config/babel'
import * as paths from './config/paths'
import { Config as Args, Env } from '../config/argv'
import { getBabelConfig, BabelRC } from '../config/babel'
import * as paths from '../config/paths'

export interface ServerHooks {
onCreateWebpackChain<C>(config: C, dev: boolean, args: Args): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as fs from 'fs-extra'
import WS from 'ws'
import { isFunction } from 'lodash/fp'

import * as paths from './config/paths'
import { onSignal } from './utils/on-signal'
import * as paths from '../config/paths'
import { onSignal } from '../utils/on-signal'

export type Send = (type: string, payload: any) => void
export type On = (type: string) => Promise<any>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { mdast } from 'docz-utils'
import { touch, compiled } from 'docz-utils/lib/fs'
import glob from 'fast-glob'

import * as paths from './config/paths'
import * as paths from '../config/paths'

import { Entry, EntryObj } from './Entry'
import { Plugin } from './Plugin'
import { Config } from './config/argv'
import { getRepoEditUrl } from './utils/repo-info'
import { Config } from '../config/argv'
import { getRepoEditUrl } from '../utils/repo-info'

export const fromTemplates = (file: string) => path.join(paths.templates, file)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import slugify from '@sindresorhus/slugify'
import humanize from 'humanize-string'
import { mdast } from 'docz-utils'

import * as paths from './config/paths'
import * as paths from '../config/paths'

const createId = (file: string) =>
crypto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import pReduce from 'p-reduce'
import WebpackChainConfig from 'webpack-chain'
import { get, isFunction } from 'lodash/fp'

import { Config } from './config/argv'
import { BabelRC } from './config/babel'
import { Config } from '../config/argv'
import { BabelRC } from '../config/babel'

export type SetConfig = (config: Config) => Config | Promise<Config>

Expand Down
2 changes: 1 addition & 1 deletion core/docz-core/src/states/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import chokidar from 'chokidar'
import get from 'lodash/get'

import * as paths from '../config/paths'
import { Params, State } from '../DataServer'
import { Params, State } from '../lib/DataServer'
import { Config, Menu, ThemeConfig } from '../config/argv'
import { getRepoUrl } from '../utils/repo-info'

Expand Down
4 changes: 2 additions & 2 deletions core/docz-core/src/states/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import chokidar from 'chokidar'
import equal from 'fast-deep-equal'
import { touch, compiled } from 'docz-utils/lib/fs'

import { Params, State } from '../DataServer'
import { Entries, EntryMap, fromTemplates } from '../Entries'
import { Params, State } from '../lib/DataServer'
import { Entries, EntryMap, fromTemplates } from '../lib/Entries'
import { Config } from '../config/argv'
import * as paths from '../config/paths'

Expand Down
2 changes: 1 addition & 1 deletion core/docz-core/src/states/props.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chokidar from 'chokidar'
import equal from 'fast-deep-equal'
import fastglob from 'fast-glob'
import { State, Params } from '../DataServer'
import { State, Params } from '../lib/DataServer'
import { get, omit } from 'lodash/fp'

import * as paths from '../config/paths'
Expand Down
2 changes: 1 addition & 1 deletion core/docz-core/src/utils/parse-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {

import * as paths from '../config/paths'
import { Config } from '../config/argv'
import { fromTemplates } from '../Entries'
import { fromTemplates } from '../lib/Entries'

const wrapItems = (item: any) =>
Object.keys(item)
Expand Down

0 comments on commit c935af5

Please sign in to comment.