Skip to content

Commit

Permalink
docs(data-point): add @Class tags (#431)
Browse files Browse the repository at this point in the history
- Replaced @alias tags with @Class and @classdesc tags. Added DataPoint temporary favicon.
- Updated Docusaurus primary color to match jsdoc theme. Added a note for unstable version.

closes #422
  • Loading branch information
csarnataro authored and acatl committed Sep 19, 2019
1 parent c85c526 commit e7b0b3f
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 10 deletions.
2 changes: 2 additions & 0 deletions documentation/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: Getting Started
sidebar_label: Getting Started
---

> ⚠️ WARNING: the version of DataPoint documented here is version 6.x-canary, it's an unstable version and as such it must not be considered production-ready
**DataPoint is a JavaScript Utility for collecting, processing and transforming data.**

DataPoint helps you reason with and streamline your data processing layer. With it you can collect, process, and transform data from multiple sources, and deliver the output in a tailored format to your end consumer.
Expand Down
2 changes: 2 additions & 0 deletions documentation/website/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# DataPoint API reference

> ⚠️ **WARNING**: the version of DataPoint documented here is version 6.x-canary, it's an unstable version and as such it must not be considered production-ready
This is the API reference for [Datapoint](https://github.com/ViacomInc/data-point), a JavaScript Utility for collecting, processing and transforming data.

You can explore the API using the menu on the left.
Expand Down
11 changes: 10 additions & 1 deletion documentation/website/jsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"opts": {
"template": "./node_modules/docdash",
"encoding": "utf8",
"destination": "docs/",
"recurse": true,
"verbose": true
},
Expand All @@ -25,6 +24,16 @@
"static": true,
"sort": true,
"disqus": "",
"sectionOrder": [
"Tutorials",
"Classes",
"Modules",
"Externals",
"Events",
"Namespaces",
"Mixins",
"Interfaces"
],
"openGraph": {
"title": "Docdash",
"type": "website",
Expand Down
2 changes: 1 addition & 1 deletion documentation/website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const siteConfig = {

/* Colors for website */
colors: {
primaryColor: "#250e23",
primaryColor: "#6d426d",
secondaryColor: "#190918"
},

Expand Down
Binary file modified documentation/website/static/img/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/data-point/src/Accumulator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @alias Accumulator
* @class
*/
class Accumulator {
constructor(options = {}) {
Expand Down
3 changes: 3 additions & 0 deletions packages/data-point/src/Cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ function isValidCacheMethod(callback) {
return typeof callback === "function" || callback === undefined;
}

/**
* @class
*/
class Cache {
constructor() {
/**
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/DataPoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ function validateTracer(tracer) {
}
}

/**
* @class
* @classdesc DataPoint main class
*/
class DataPoint {
constructor() {
Object.defineProperty(this, "cache", {
Expand Down
8 changes: 4 additions & 4 deletions packages/data-point/src/Reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ function normalizeName(name) {
}

/**
* @alias Reducer
* @class
* @classdesc This class is never instantiated directly, it is used to create
* reducers DataPoint can use to process a given input.
*
* @protected
* This class is never instantiated directly, it is used to create reducers
* DataPoint can use to process a given input.
*/
class Reducer {
/**
Expand All @@ -19,7 +20,6 @@ class Reducer {
/**
* @type {string} Normalized reducer's id
* @name Reducer#id
* @property
* @readonly
*/
Object.defineProperty(this, "id", {
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/ReducerEntity.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const { createReducer } = require("./create-reducer");
const { Reducer } = require("./Reducer");

/**
* @class
* @extends Reducer
*/
class ReducerEntity extends Reducer {
constructor(spec) {
super(spec.name, spec);
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/ReducerFunction.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const { Reducer } = require("./Reducer");

/**
* @class
* @extends Reducer
*/
class ReducerFunction extends Reducer {
constructor(spec) {
super(spec.name || "anonymous", spec);
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/ReducerList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const { Reducer } = require("./Reducer");

/**
* @class
* @extends Reducer
*/
class ReducerList extends Reducer {
constructor(spec, createReducer) {
super(undefined, spec);
Expand Down
3 changes: 3 additions & 0 deletions packages/data-point/src/ReducerNative.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { Reducer } = require("./Reducer");

/**
* @class
*/
class ReducerNative extends Reducer {
static isType() {
throw new Error("must be implemented");
Expand Down
3 changes: 2 additions & 1 deletion packages/data-point/src/ReducerObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function getObjectProperties(
}

/**
* **IMPORTANT:** This class is meant to be only called internally by DataPoint.
* @class
* @classdesc **IMPORTANT:** This class is meant to be only called internally by DataPoint.
* @protected
* @extends {Reducer}
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/data-point/src/ReducerPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ function resolvePath(accumulator, compiledPath) {
}

/**
* Reducer that crawls a data path (using dot notation) from the accumulator
* @class
* @classdesc Reducer that crawls a data path (using dot notation) from the accumulator
* @extends {Reducer}
*/
class ReducerPath extends Reducer {
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/reducer-entities/model/model.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const { ReducerEntity } = require("../../ReducerEntity");

/**
* @class
* @extends ReducerEntity
*/
class ReducerModel extends ReducerEntity {
static create(spec) {
return new ReducerModel(spec);
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/reducer-helpers/assign/assign.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const { Reducer } = require("../../Reducer");
const { createReducer } = require("../../create-reducer");

/**
* @class
* @extends Reducer
*/
class ReducerAssign extends Reducer {
constructor(spec) {
super(undefined, spec);
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/reducer-helpers/constant/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ function cloneObject(isObject, value) {
return isObject ? cloneDeep(value) : value;
}

/**
* @class
* @extends Reducer
*/
class ReducerConstant extends Reducer {
constructor(spec) {
super(undefined, spec);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ function parseIfElse(spec) {
};
}

/**
* @class
* @extends Reducer
*/
class ReducerIfThenElse extends Reducer {
constructor(spec) {
super(undefined, spec);
Expand Down
2 changes: 2 additions & 0 deletions packages/data-point/src/reducer-helpers/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const { Reducer } = require("../../Reducer");
const { createReducer } = require("../../create-reducer");

/**
* @class
* @classdesc
* Creates an array of values by running each element in collection thru
* iterateeReducer.
*
Expand Down
4 changes: 4 additions & 0 deletions packages/data-point/src/reducer-helpers/parallel/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ const { Reducer } = require("../../Reducer");
const { createReducer } = require("../../create-reducer");

/**
* @class
* @classdesc
* Runs in parallel a set of provided reducers against the provided input.
*
* @extends Reducer
*/
class ReducerParallel extends Reducer {
constructor(spec) {
Expand Down
2 changes: 2 additions & 0 deletions packages/data-point/src/reducer-helpers/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ async function getMatchingCaseStatement(caseStatements, acc, resolveReducer) {
}

/**
* @class
* @classdesc
* Mirrors a simplified behaviour of the `switch` statement in javascript.
* It creates a reducer which accepts the form of:
*
Expand Down
2 changes: 1 addition & 1 deletion packages/data-point/src/tracing/Span.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function getHighResolutionTime() {
}

/**
* @alias Span
* @class
*/
class Span {
constructor(name, options, tracer) {
Expand Down
3 changes: 3 additions & 0 deletions packages/data-point/src/tracing/Tracer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { Span } = require("./Span");

/**
* @class
*/
class Tracer {
constructor(handlers) {
this.handlers = handlers;
Expand Down

0 comments on commit e7b0b3f

Please # to comment.