Skip to content

Commit

Permalink
2.0.0-rc.5 (doczjs#1029)
Browse files Browse the repository at this point in the history
* fix(gatsby-theme-docz): add missing source sans pro font (doczjs#991)

* fix(gatsby-theme-docz): replace fragment tag to the short syntax (doczjs#992)

* fix(docz-example-basic): add explicit dependency to scheduler

* fix(docz): make scheduler dependency explicit

* docs(docz-example-basic): add instructions to quickly run the example

* fix(docz-example-typescript): add scheduler dep and docs doczjs#1020

* fix(docz-example-typescript): add scheduler dep and docs

* fix(docz-example-flow): add @babel/preset-flow with onCreateBabelConfig

* docs(docz-example-flow): add setup instructions

* Fix flow example, add setup doc (doczjs#1021)

* fix(docz-example-basic): add explicit dependency to scheduler

* fix(docz): make scheduler dependency explicit

* docs(docz-example-basic): add instructions to quickly run the example

* fix(docz-example-typescript): add scheduler dep and docs

* fix(docz-example-flow): add @babel/preset-flow with onCreateBabelConfig

* docs(docz-example-flow): add setup instructions

* Update Gatsby example (doczjs#1022)

* fix(docz-example-basic): add explicit dependency to scheduler

* fix(docz): make scheduler dependency explicit

* docs(docz-example-basic): add instructions to quickly run the example

* fix(docz-example-typescript): add scheduler dep and docs

* fix(docz-example-flow): add @babel/preset-flow with onCreateBabelConfig

* docs(docz-example-flow): add setup instructions

* fix(docz-example-gatsby): make gatsby example runnable outside repo

* docs(docz-example-gatsby): add setup instructions

* fix(docz): remove window check from useCurrentDoc fixes doczjs#985 (doczjs#1023)

* feat(docz-core): setup jest and add first test

* test(docz): add tests for states.config and states.entries

* ci(docz): add circleci tests (doczjs#1027)

* fix(gatsby-theme-docz): fix minor linting issue

* feat(docz): add circleci

* chore(docz): add bootstrap to ci

* ci(docz): clear cache

* ci(docz): add build step to install

* ci(docz): build only

* ci(docz-core): try without build

* ci(docz-core): remove __tests__ from include

* ci(docz-core): add build

* ci(docz-core): back to packages

* fix(docz-example-typescript): add externally usable tsconfig

* fix(docz-example-typescript): add extension of tsx file in mdx

* docs(docz): add link to v1

* docs(docz): add create-docz-app to examples

* fix(docz-example-flow): add scheduler dep

* fix(docz-example-styled-components): add scheduler and remove caaf

* docs(docz-example-react-native): add scheduler temp

* docs(docz-example-images): add scheduler temp

* fix(docz-core): wait for app to be ready before opening the browser

* fix(docz-core): extend base config instead of overwriting user config (doczjs#1028)

* chore(docz-core): typo

* chore(docz): bump version to 2.0.0-rc.2

* test(docz): loosen up test temporarily

* chore(docz-core): prefix scripts with yarn

* chore(docz): add release:next script

* chore(docz): lerna version fix

* v2.0.0-rc.2

* chore(docz): bump to 2.0.0-rc.3

* 2.0.0-rc.4

* 2.0.0-rc.5
  • Loading branch information
rakannimer authored Aug 28, 2019
1 parent dd09a9a commit e2286ac
Show file tree
Hide file tree
Showing 47 changed files with 3,434 additions and 339 deletions.
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/node:8.12
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v4-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v4-dependencies-

- run: yarn install && yarn bs && yarn packages

- save_cache:
paths:
- node_modules
key: v3-dependencies-{{ checksum "package.json" }}

# run tests!
- run: yarn ci
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0-rc.2](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-08-28)


### Bug Fixes

* **docz:** make scheduler dependency explicit ([84918d8](https://github.com/pedronauck/docz/commit/84918d8))
* **docz:** remove window check from useCurrentDoc fixes [#985](https://github.com/pedronauck/docz/issues/985) ([#1023](https://github.com/pedronauck/docz/issues/1023)) ([b90ea82](https://github.com/pedronauck/docz/commit/b90ea82))
* **docz-core:** extend base config instead of overwriting user config ([#1028](https://github.com/pedronauck/docz/issues/1028)) ([7b46c2b](https://github.com/pedronauck/docz/commit/7b46c2b))
* **docz-core:** wait for app to be ready before opening the browser ([c5cd14d](https://github.com/pedronauck/docz/commit/c5cd14d))
* **docz-example-basic:** add explicit dependency to scheduler ([a4c5f9c](https://github.com/pedronauck/docz/commit/a4c5f9c))
* **docz-example-flow:** add scheduler dep ([5063fc2](https://github.com/pedronauck/docz/commit/5063fc2))
* **docz-example-styled-components:** add scheduler and remove caaf ([1d66cad](https://github.com/pedronauck/docz/commit/1d66cad))
* **docz-example-typescript:** add extension of tsx file in mdx ([f43f454](https://github.com/pedronauck/docz/commit/f43f454))
* **docz-example-typescript:** add externally usable tsconfig ([1806abb](https://github.com/pedronauck/docz/commit/1806abb))
* **docz-example-typescript:** add scheduler dep and docs [#1020](https://github.com/pedronauck/docz/issues/1020) ([fbc8e89](https://github.com/pedronauck/docz/commit/fbc8e89))
* **gatsby-theme-docz:** add missing source sans pro font ([#991](https://github.com/pedronauck/docz/issues/991)) ([51240df](https://github.com/pedronauck/docz/commit/51240df))
* **gatsby-theme-docz:** replace fragment tag to the short syntax ([#992](https://github.com/pedronauck/docz/issues/992)) ([044f351](https://github.com/pedronauck/docz/commit/044f351))


### Features

* **docz-core:** setup jest and add first test ([bf02ac1](https://github.com/pedronauck/docz/commit/bf02ac1))





# [2.0.0-rc.1](https://github.com/pedronauck/docz/compare/v1.2.0...v2.0.0-rc.1) (2019-07-18)


Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

This documentation is for Docz [v2](https://github.com/pedronauck/docz/pull/950). Follow our [migration guide](/MIGRATION_GUIDE.md) if you haven't upgraded your project yet.

## 📕 v1 docs

If you're still using v1, you can find the docs [here](https://docz-v1.surge.sh).

## 🎩   Features

- 🔩 **Powered by Gatsby.** Bundling and ecosystem powered by [Gatsby](https://gatsbyjs.org).
Expand Down
13 changes: 12 additions & 1 deletion core/docz-core/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{
"plugins": ["lodash"]
"plugins": ["lodash"],
"presets": [
"@babel/preset-typescript",
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
17 changes: 17 additions & 0 deletions core/docz-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0-rc.2](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-08-28)


### Bug Fixes

* **docz-core:** extend base config instead of overwriting user config ([#1028](https://github.com/pedronauck/docz/issues/1028)) ([7b46c2b](https://github.com/pedronauck/docz/commit/7b46c2b))
* **docz-core:** wait for app to be ready before opening the browser ([c5cd14d](https://github.com/pedronauck/docz/commit/c5cd14d))


### Features

* **docz-core:** setup jest and add first test ([bf02ac1](https://github.com/pedronauck/docz/commit/bf02ac1))





# [2.0.0-rc.1](https://github.com/pedronauck/docz/compare/v1.2.0...v2.0.0-rc.1) (2019-07-18)


Expand Down
18 changes: 18 additions & 0 deletions core/docz-core/__tests__/config.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { setArgs } from '../src/config/argv'
import { getBaseConfig } from '../src/config/docz'
describe('config.argv & config.docz', () => {
test('works', () => {
const yargs = {
argv: {},
option: jest.fn().mockImplementation((key, value) => {
yargs.argv[value.alias ? value.alias : key] = value
return yargs
}),
}
const { argv } = setArgs(yargs)
// expect(argv).toMatchInlineSnapshot(`undefined`)
//@ts-ignore
getBaseConfig(argv, {})
// expect(c)
})
})
59 changes: 59 additions & 0 deletions core/docz-core/__tests__/states.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import * as states from '../src/states/index'
import { createConfigStateInput } from '../src/test-utils/data-bank'
import { getBaseConfig } from '../src/config/docz'
import * as paths from '../src/config/paths'
import { Entries } from '../src/lib/Entries'
import { setArgs } from '../src/config/argv'

describe('states', () => {
test('exports', () => {
expect(states).toBeDefined()
expect(typeof states.config).toEqual('function')
expect(typeof states.entries).toEqual('function')
expect(typeof states.props).toEqual('function')
})
})

describe('states.config', () => {
test('config returns valid state', () => {
const state = states.config({})
expect(typeof state.close).toEqual('function')
expect(typeof state.start).toEqual('function')
expect(state.id).toEqual('config')
state.close()
})
test('config state writes config to state when started', async () => {
const config = createConfigStateInput()
const setState = jest.fn()
const getState = jest.fn()
const state = states.config(config)
await state.start({ getState, setState })
delete config.paths
delete config.src
expect(setState).toBeCalledWith('config', expect.objectContaining(config))
state.close()
})
})

describe('states.entries', () => {
test('entries returns start-able state', async () => {
const yargs = {
argv: {},
option: jest.fn().mockImplementation((key, value) => {
yargs.argv[value.alias ? value.alias : key] = value.default
return yargs
}),
}
const { argv } = setArgs(yargs)
//@ts-ignore
const config = { ...getBaseConfig(argv), paths }
const entries = new Entries(config)
const state = states.entries(entries, config)
const setState = jest.fn()
const getState = jest.fn()
await state.start({ getState, setState })
expect(getState).toBeCalledWith()
// expect(setState).toBeCalledWith('entries', [])
state.close()
})
})
13 changes: 8 additions & 5 deletions core/docz-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docz-core",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.5",
"description": "All docz core logic of bundle and parsing is included on this package",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -12,11 +12,12 @@
"README.md"
],
"scripts": {
"dev": "cross-env NODE_ENV=development yarn build -w",
"build": "cross-env NODE_ENV=production rollup -c",
"build": "yarn cross-env NODE_ENV=production rollup -c",
"dev": "yarn cross-env NODE_ENV=development yarn build -w",
"fix": "yarn lint --fix",
"lint": "eslint . --ext .ts,.tsx",
"precommit": "lint-staged"
"lint": "yarn eslint . --ext .ts,.tsx",
"precommit": "lint-staged",
"test": "yarn jest"
},
"dependencies": {
"@sindresorhus/slugify": "^0.9.1",
Expand Down Expand Up @@ -46,6 +47,7 @@
"signale": "^1.4.0",
"titleize": "^2.1.0",
"typescript": "3.5.3",
"wait-on": "^3.3.0",
"xstate": "^4.6.7",
"yargs": "^13.3.0"
},
Expand All @@ -54,6 +56,7 @@
"@types/resolve": "^0.0.8",
"@types/shelljs": "^0.8.5",
"@types/signale": "^1.2.1",
"@types/wait-on": "^3.2.0",
"cpy": "^7.3.0",
"docz-rollup": "^2.0.0-rc.1",
"eslint-config-docz-ts": "^2.0.0-rc.1"
Expand Down
13 changes: 11 additions & 2 deletions core/docz-core/src/bundler/machine/services/exec-dev-command.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import spawn from 'cross-spawn'
import sh from 'shelljs'

import waitOn from 'wait-on'
import { ServerMachineCtx } from '../context'
import { openBrowser } from '../../../utils/open-browser'
import * as paths from '../../../config/paths'

export const execDevCommand = async ({ args }: ServerMachineCtx) => {
sh.cd(paths.docz)
spawn('yarn', ['dev', '--port', `${args.port}`], { stdio: 'inherit' })
openBrowser(`http://${args.host}:${args.port}`)
const url = `http://${args.host}:${args.port}`
console.log()
console.log('Building app')
await waitOn({
resources: [url],
timeout: 30000,
})
console.log()
console.log('App ready on ' + url)
openBrowser(url)
}
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 @@ -33,7 +33,7 @@ export const getBaseConfig = (
custom?: Partial<Config>
): Config => {
const initial = omit<Arguments<Argv>, any>(toOmit, argv)
const base = { ...initial, ...doczRcBaseConfig, paths }
const base = { ...doczRcBaseConfig, ...initial, paths }
return merge(base, custom) as Config
}

Expand Down
15 changes: 15 additions & 0 deletions core/docz-core/src/test-utils/data-bank.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Config } from '../config/argv'
import * as paths from '../config/paths'
// let a: Config
export const createConfigStateInput = () => {
return ({
title: 'test-tile',
description: 'test-desc',
menu: [{ name: 'menu-name' }],
paths,
native: undefined,
themeConfig: undefined,
separator: undefined,
src: 'src/',
} as unknown) as Config
}
12 changes: 12 additions & 0 deletions core/docz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0-rc.2](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-08-28)


### Bug Fixes

* **docz:** make scheduler dependency explicit ([84918d8](https://github.com/pedronauck/docz/commit/84918d8))
* **docz:** remove window check from useCurrentDoc fixes [#985](https://github.com/pedronauck/docz/issues/985) ([#1023](https://github.com/pedronauck/docz/issues/1023)) ([b90ea82](https://github.com/pedronauck/docz/commit/b90ea82))





# [2.0.0-rc.1](https://github.com/pedronauck/docz/compare/v1.2.0...v2.0.0-rc.1) (2019-07-18)


Expand Down
5 changes: 3 additions & 2 deletions core/docz/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docz",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.5",
"description": "It's has never been so easy to documents your things!",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -26,13 +26,14 @@
"@mdx-js/react": "^1.0.27",
"array-sort": "^1.0.0",
"capitalize": "^2.0.0",
"docz-core": "^2.0.0-rc.1",
"docz-core": "2.0.0-rc.3",
"fast-deep-equal": "^2.0.1",
"gatsby": "^2.13.27",
"lodash": "^4.17.14",
"marksy": "^8.0.0",
"match-sorter": "^3.1.1",
"prop-types": "^15.7.2",
"scheduler": "^0.15.0",
"ulid": "^2.3.0",
"yargs": "^13.3.0"
},
Expand Down
1 change: 0 additions & 1 deletion core/docz/src/hooks/useCurrentDoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { get } from 'lodash/fp'
import { doczState } from '../state'

export const useCurrentDoc = () => {
if (typeof window === 'undefined') return null
const state = useContext(doczState.context)
return get('currentEntry.value', state)
}
12 changes: 12 additions & 0 deletions core/gatsby-theme-docz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.0.0-rc.2](https://github.com/pedronauck/docz/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-08-28)


### Bug Fixes

* **gatsby-theme-docz:** add missing source sans pro font ([#991](https://github.com/pedronauck/docz/issues/991)) ([51240df](https://github.com/pedronauck/docz/commit/51240df))
* **gatsby-theme-docz:** replace fragment tag to the short syntax ([#992](https://github.com/pedronauck/docz/issues/992)) ([044f351](https://github.com/pedronauck/docz/commit/044f351))





# [2.0.0-rc.1](https://github.com/pedronauck/docz/compare/v1.2.0...v2.0.0-rc.1) (2019-07-18)


Expand Down
9 changes: 5 additions & 4 deletions core/gatsby-theme-docz/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gatsby-theme-docz",
"version": "2.0.0-rc.1",
"version": "2.0.0-rc.5",
"description": "Gatsby theme created to use Docz",
"license": "MIT",
"author": "Pedro Nauck ([email protected])",
Expand All @@ -23,8 +23,8 @@
"@theme-ui/typography": "^0.2.5",
"babel-plugin-export-metadata": "^2.0.0-rc.1",
"copy-text-to-clipboard": "^2.1.0",
"docz": "^2.0.0-rc.1",
"docz-core": "^2.0.0-rc.1",
"docz": "2.0.0-rc.2",
"docz-core": "2.0.0-rc.2",
"emotion-theming": "^10.0.14",
"fs-extra": "^8.1.0",
"gatsby": "^2.13.27",
Expand Down Expand Up @@ -59,5 +59,6 @@
"peerDependencies": {
"react": "^16.8.0",
"react-dom": "^16.8.0"
}
},
"gitHead": "74932cd67112bacd1e29780a202d466acdd79535"
}
Loading

0 comments on commit e2286ac

Please sign in to comment.