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

Commit

Permalink
fix: docs font size
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jul 22, 2018
1 parent 5ed4490 commit 86199c5
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 78 deletions.
8 changes: 4 additions & 4 deletions docs/config.md
Expand Up @@ -50,28 +50,28 @@ These methods are for accessing and mutating bundle configuration.

The `key` argument can use dot-notation.

### `get(key: string): ?any`
#### `get(key: string): ?any`

Get a value from the config object.

Returns `undefined` when the key does not exist.

Throws if the key tries to access a defined non-object.

### `set(key: string, value: any): this`
#### `set(key: string, value: any): this`

Set a property in the config object.

Throws if the key tries to mutate a defined non-object.

### `merge(key: string, values: Object|Array): this`
#### `merge(key: string, values: Object|Array): this`

Merge `values` into a property.

When the existing value is not the same type as the given `values`, it is overwritten. The given object is no longer yours at this point.

Otherwise, the given `values` are merged into the existing value. When `values` is an array, it's concatenated to the end of the existing array. When `values` is an object, it's deeply merged into the existing object.

### `merge(values: Object): this`
#### `merge(values: Object): this`

Deeply merge `values` into the top-level config.
14 changes: 7 additions & 7 deletions docs/formats.md
Expand Up @@ -41,17 +41,17 @@ Custom formats must export a class that extends the `cush.Bundle` class.

### Class Properties

### `id: string`
#### `id: string`

Your format's unique identifier (short, camel case, and first letter lowercase).

### `exts: ?string[]`
#### `exts: ?string[]`

Extensions used to resolve a dependency when no extension exists in a file reference. Also used to resolve the format of a bundle when no format is explicitly defined.

*Note:* Values must start with a period.

### `plugins: ?(string|Function|Object)[]`
#### `plugins: ?(string|Function|Object)[]`

The list of default plugins, used by every bundle of this format.

Expand All @@ -63,29 +63,29 @@ These plugins run before any user-defined plugins by default.

### Methods

### `async _concat(assets: Asset[], packages: Package[]): string`
#### `async _concat(assets: Asset[], packages: Package[]): string`

Returns the string of concatenated assets.

The `assets` and `packages` array are in order of appearance.

**Must override this.**

### `_wrapSourceMapURL(url: string): string`
#### `_wrapSourceMapURL(url: string): string`

Returns the `sourceMappingURL=` comment appended to the result of `_concat`.

**Must override this.**

### `_getInitialConfig(): Object`
#### `_getInitialConfig(): Object`

Create the initial `_config` object (used by `get`, `set`, and `merge`).

This is called before any plugins are loaded.

*Note:* Always call `super` in this method.

### `_onConfigure(): void`
#### `_onConfigure(): void`

Do whatever after all plugins have been loaded.

Expand Down
94 changes: 47 additions & 47 deletions docs/fs.md
Expand Up @@ -35,55 +35,55 @@ require('cush/lib/Bundle')

### Properties

### `id: string`
#### `id: string`

The unique identifier. Generated from a hash of the main module's absolute path. The target is attached to the end, as well as `.dev` if the `dev` option is true.

### `dev: boolean`
#### `dev: boolean`

*No description*

### `root: Package`
#### `root: Package`

The package containing the main module.

### `main: Asset`
#### `main: Asset`

The main module

### `target: string`
#### `target: string`

The target platform. (eg: `web`)

### `assets: Asset[]`
#### `assets: Asset[]`

The assets used in the bundle, in order of appearance.

### `packages: Object`
#### `packages: Object`

The packages used in the bundle, in order of appearance.

### `plugins: Array`
#### `plugins: Array`

The array of plugins that you passed to `cush.bundle`.

If you mutate this after calling `read` at least once, you must call `unload` to reset the bundle.

### `parsers: string[]`
#### `parsers: string[]`

The array of parsers that you passed to `cush.bundle`.

If you mutate this after calling `read` at least once, you must call `unload` to reset the bundle.

### `project: Project`
#### `project: Project`

The project that owns this bundle.

### `valid: boolean`
#### `valid: boolean`

Equals `false` if a new build is required on the next read.

### `state: Object`
#### `state: Object`

The bundle state that is reset at the start of every build.

Expand All @@ -93,7 +93,7 @@ Its `missing` property is an array of unresolved dependencies, where each value

This object can be used by plugins to keep state that should be released when a new build starts.

### `time: number`
#### `time: number`

The timestamp of when the last (successful) build started.

Expand All @@ -103,51 +103,51 @@ The timestamp of when the last (successful) build started.

These methods are also available:

### `relative(path: string): string`
#### `relative(path: string): string`

Strip `this.root.path` from the start of the given `path`.

### `resolve(name: string): string`
#### `resolve(name: string): string`

Join the given `name` with `this.root.path` and resolve any `..` parts.

### `async read(): string`
#### `async read(): string`

Get the generated bundle.

If `this.valid` is true, the cached result is returned.

### `async use(plugins: string|Function|Object|Array): void`
#### `async use(plugins: string|Function|Object|Array): void`

Load the given plugins. These plugins are *not* added to `this.plugins`.

Only callable within a plugin or your `cush.config.js` module.

[Learn more](./plugins.md) about plugin values.

### `worker(arg: string|Function): void`
#### `worker(arg: string|Function): void`

Extend the worker farm with a plugin.

If you pass a function, it should be declared where it's passed in. Otherwise, it won't be as easily debuggable. The function won't have access to anything outside it.

[Learn more](./workers.md) about workers.

### `getSourceMapURL(arg: string|SourceMap): string`
#### `getSourceMapURL(arg: string|SourceMap): string`

Generates a `sourceMappingURL=` comment.

Pass a string to use as the relative file path to the source map. The `.map` extension is added to the end for you.

Pass a `SourceMap` object (or any object with a `toUrl` method) to generate an inline source map (encoded in base64).

### `unload(): void`
#### `unload(): void`

Reset the bundle to be as if you just constructed it.

All assets, packages, and plugins will be reloaded on the next `read` call.

### `destroy(): void`
#### `destroy(): void`

Destroy the bundle when it isn't needed anymore.

Expand All @@ -159,11 +159,11 @@ You *must* call this to properly clean up the worker farm and stop any file watc

Here are hooks provided by the bundler by default. Remember that plugins and bundle formats can provide their own hooks, so read their documentation too.

### `asset(asset: Asset, state: Object)`
#### `asset(asset: Asset, state: Object)`

Called on every build for every asset used by the bundle. The asset may have been in the previous build or entirely new. The `state` object is equivalent to `asset.owner.bundle.state`, which is reset at the start of every build.

### `package(pack: Package, state: Object)`
#### `package(pack: Package, state: Object)`

The same as the `asset` hook, but for packages. This hook is called before the `asset` hook when an asset new to the bundle is owned by a package new to the bundle.

Expand All @@ -181,23 +181,23 @@ Symlinks in `node_modules` are supported. These packages are considered locally

### Properties

### `path: string`
#### `path: string`

The absolute path to the package directory.

### `data: Object`
#### `data: Object`

The parsed contents of the `package.json` module.

Watched packages have this property kept updated.

### `main: ?Asset`
#### `main: ?Asset`

The main module of this package.

Equals `null` until used by an asset in the bundle.

### `assets: Object`
#### `assets: Object`

The asset map where keys are filenames relative to `this.path` and values are `Asset` objects, strings, or `true`.

Expand All @@ -207,53 +207,53 @@ A string value means the asset is a symlink to another asset within the same pac

Paths to nested packages (eg: `node_modules/foo`) won't exist until they are used by an asset in the bundle.

### `users: Set`
#### `users: Set`

Packages that require one or more of our assets.

### `owner: ?Package`
#### `owner: ?Package`

The package containing us.

### `bundle: Bundle`
#### `bundle: Bundle`

The bundle using us.

### `worker: ChildProcess`
#### `worker: ChildProcess`

The worker process dedicated to this package.

### `crawled: boolean`
#### `crawled: boolean`

Equals `true` if this package has been crawled, which means the `assets` object contains all existing files that are owned by this package.

### `watcher: ?Readable`
#### `watcher: ?Readable`

The event stream for file changes in this package. [Learn more](https://github.com/aleclarson/wch#wchstreamdir-string-query-object-readable)

### `skip: string[]`
#### `skip: string[]`

An array of globs that will be ignored while crawling and watching this package. The glob syntax is described [here](https://github.com/aleclarson/recrawl#pattern-syntax).

Globs ignored by default are found [here.](../src/utils/ignored.coffee)

### Methods

### `relative(path: string): string`
#### `relative(path: string): string`

Strip `this.path` from the start of the given `path`.

### `resolve(name: string): string`
#### `resolve(name: string): string`

Join the given `name` with `this.path` and resolve any `..` parts.

### `crawl(): this`
#### `crawl(): this`

Populate the `assets` object of this package.

Uses [recrawl](https://github.com/aleclarson/recrawl) under the hood. Symlinks are only followed one level deep.

### `search(name: string, target: string, exts: string[]): ?Asset`
#### `search(name: string, target: string, exts: string[]): ?Asset`

Try loading an `Asset` that matches the given arguments. The asset may have been loaded before.

Expand All @@ -268,7 +268,7 @@ Known extensions are defined by calling `Bundle#merge('known exts', [])`. Likewi

Some extensions are known by default, as defined in [this package.](https://github.com/cushJS/known-exts)

### `require(name: string): ?Package`
#### `require(name: string): ?Package`

Try loading a `Package` that exists in the `node_modules` directory of this package. The package may have been loaded before.

Expand All @@ -288,25 +288,25 @@ require('cush/lib/Bundle').Asset

### Properties

### `id: number`
#### `id: number`

An integer unique to the bundle.

### `name: string`
#### `name: string`

The file path relative to `this.owner.path`.

### `owner: Package`
#### `owner: Package`

The package containing us.

### `content: string`
#### `content: string`

The content after being transformed by plugins.

If no plugins were used, this is the original content and `map` will be null.

### `deps: ?Object[]`
#### `deps: ?Object[]`

The parsed dependencies, in order of appearance.

Expand All @@ -316,18 +316,18 @@ The objects are shaped like `{ref, start, end, asset}`.

The `asset` property is where the resolved asset is cached.

### `map: ?Object`
#### `map: ?Object`

The source map.

### `time: number`
#### `time: number`

When this asset was last updated.

Set this to `Date.now()` to invalidate dependencies that resolved to this asset.

### Methods

### `path(): string`
#### `path(): string`

The absolute path.

0 comments on commit 86199c5

Please sign in to comment.