Skip to content

Commit 59c85a3

Browse files
committed
feat: Enable root-level typedoc generation for the project.
- All local types have been pulled out to the project directory. - Packages moved to /packages/@css-blocks for module name generation. - typedoc.js configuration file added. - packages/css-blocks => packages/@css-blocks/core - packages/webpack-plugin => packages/@css-blocks/webpack. - packages/glimmer-templates => packages/@css-blocks/glimmer. - packages/runtime/src/runtime.ts => packages/@css-blocks/runtime/src/index.ts. - yarn run docs will generate a typedoc site at /docs. - TODO: Uses pre-built forked version of typedoc-plugin-external-module-map. Remove when merged.
1 parent 77cf0b9 commit 59c85a3

File tree

347 files changed

+964
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+964
-533
lines changed

CHANGELOG.md

+1-1

css-blocks.code-workspace

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
{
22
"folders": [
33
{
4-
"path": "packages/css-blocks"
4+
"path": "packages/@css-blocks/broccoli"
55
},
66
{
7-
"path": "packages/glimmer-templates"
7+
"path": "packages/@css-blocks/code-style"
88
},
99
{
10-
"path": "packages/jsx"
10+
"path": "packages/@css-blocks/core"
1111
},
1212
{
13-
"path": "packages/runtime"
13+
"path": "packages/@css-blocks/glimmer"
1414
},
1515
{
16-
"path": "packages/webpack-plugin"
16+
"path": "packages/@css-blocks/jsx"
1717
},
1818
{
19-
"path": "packages/code-style"
19+
"path": "packages/@css-blocks/runtime"
20+
},
21+
{
22+
"path": "packages/@css-blocks/webpack"
2023
},
2124
{
2225
"path": ".",

package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"private": true,
33
"scripts": {
44
"commitmsg": "commitlint --edit $GIT_PARAMS",
5-
"ci": "lerna run test"
5+
"ci": "lerna run test",
6+
"docs": "typedoc"
67
},
78
"devDependencies": {
89
"@commitlint/cli": "^6.1.0",
@@ -16,10 +17,12 @@
1617
"@types/babylon": "^6.16.1",
1718
"@types/chai": "^3.5.2",
1819
"@types/debug": "0.0.29",
20+
"@types/loader-utils": "^1.1.3",
1921
"@types/minimatch": "^2.0.29",
2022
"@types/mocha": "^2.2.41",
2123
"@types/node": "^8.0.0",
2224
"@types/prettier": "^1.8.0",
25+
"@types/tapable": "0.2.4",
2326
"chai": "^3.5.0",
2427
"husky": "^0.14.3",
2528
"istanbul": "^0.4.5",
@@ -38,11 +41,12 @@
3841
"test-console": "^1.1.0",
3942
"ts-node": "^3.0.4",
4043
"tslint": "^5.9.1",
41-
"typedoc": "^0.7.1",
44+
"typedoc": "^0.11.0",
4245
"typescript": "^2.8.1",
46+
"typedoc-plugin-external-module-map": "amiller-gh/typedoc-plugin-external-module-map#prebuilt",
4347
"watch": "^1.0.2"
4448
},
4549
"workspaces": [
46-
"packages/*"
50+
"packages/@css-blocks/*"
4751
]
4852
}

packages/broccoli-css-blocks/package.json packages/@css-blocks/broccoli/package.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
"main": "dist/src/index.js",
66
"author": "Adam Miller <[email protected]>",
77
"license": "MIT",
8-
"keywords": ["css-blocks", "css blocks", "broccoli-plugin"],
8+
"keywords": [
9+
"css-blocks",
10+
"css blocks",
11+
"broccoli-plugin"
12+
],
913
"scripts": {
1014
"test": "mocha --opts test/mocha.opts dist/test",
1115
"compile": "rm -rf dist && tsc -p tsconfig.json",
@@ -15,32 +19,31 @@
1519
"lint": "tslint -t msbuild --project . -c tslint.cli.json",
1620
"lintall": "tslint -t msbuild --project . -c tslint.release.json",
1721
"lintfix": "tslint -t msbuild --project . -c tslint.cli.json --fix",
18-
"coverage":
19-
"istanbul cover -i dist/src/**/*.js --dir ./build/coverage node_modules/mocha/bin/_mocha -- dist/test --opts test/mocha.opts",
20-
"remap":
21-
"remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
22+
"coverage": "istanbul cover -i dist/src/**/*.js --dir ./build/coverage node_modules/mocha/bin/_mocha -- dist/test --opts test/mocha.opts",
23+
"remap": "remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
2224
"docs": "typedoc --out ./docs .",
2325
"watch": "watch 'yarn run test' src test types-local --wait=1"
2426
},
2527
"devDependencies": {
2628
"@css-blocks/code-style": "^0.17.0",
27-
"@css-blocks/glimmer-templates": "^0.17.0"
29+
"@css-blocks/glimmer": "^0.17.0"
2830
},
2931
"dependencies": {
32+
"@css-blocks/core": "^0.17.0",
3033
"@glimmer/compiler": "^0.33.0",
3134
"@glimmer/syntax": "^0.33.0",
35+
"@opticss/template-api": "file:../../../../opticss/packages/template-api",
3236
"@types/recursive-readdir": "^2.2.0",
3337
"broccoli-funnel": "^2.0.1",
3438
"broccoli-merge-trees": "^3.0.0",
3539
"broccoli-plugin": "^1.3.0",
3640
"broccoli-test-helper": "^1.2.0",
3741
"colors": "^1.2.1",
38-
"css-blocks": "^0.17.0",
3942
"debug": "^3.1.0",
4043
"fs-extra": "^5.0.0",
41-
"opticss": "file:../../../opticss/packages/opticss",
44+
"opticss": "file:../../../../opticss/packages/opticss",
4245
"postcss": "^6.0.21",
4346
"recursive-readdir": "^2.2.2",
4447
"walk-sync": "^0.3.2"
4548
}
46-
}
49+
}

packages/broccoli-css-blocks/src/index.ts packages/@css-blocks/broccoli/src/index.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import * as fs from "fs-extra";
22
import * as path from "path";
33

4-
import { Analyzer, BlockCompiler, StyleMapping } from "css-blocks";
4+
import { Analyzer, BlockCompiler, StyleMapping } from "@css-blocks/core";
5+
import { TemplateTypes } from "@opticss/template-api";
56
import { Optimizer } from "opticss";
67
import * as postcss from "postcss";
78
import * as readdir from "recursive-readdir";
89

9-
import { TemplateTypes } from "@opticss/template-api";
10-
1110
import { BroccoliPlugin } from "./utils";
1211

1312
export interface BroccoliOptions {

packages/broccoli-css-blocks/test/plugin-test.ts packages/@css-blocks/broccoli/test/plugin-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { GlimmerAnalyzer } from "@css-blocks/glimmer-templates";
1+
import { GlimmerAnalyzer } from "@css-blocks/glimmer";
22
import * as assert from "assert";
33
import { TempDir, buildOutput, createTempDir } from "broccoli-test-helper";
44

55
import { BroccoliCSSBlocks } from "../src/index";
66

7-
describe("Broccoli Plugin Test", function() {
7+
describe("Broccoli Plugin Test", function () {
88
let input: TempDir;
99

1010
beforeEach(async () => {

packages/broccoli-css-blocks/tsconfig.json packages/@css-blocks/broccoli/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
55
"baseUrl": "dist"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"extends": "@css-blocks/code-style/configs/tslint.cli.json"
3-
}
3+
}

packages/code-style/package.json packages/@css-blocks/code-style/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"homepage": "https://github.com/css-blocks/css-blocks/tree/master/packages/code-style",
3030
"dependencies": {
31-
"@opticss/code-style": "file:../../../opticss/packages/code-style"
31+
"@opticss/code-style": "file:../../../../opticss/packages/code-style"
3232
},
3333
"engines": {
3434
"node": ">=8"

packages/code-style/tsconfig.json packages/@css-blocks/code-style/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../../tsconfig.json",
33
"include": [
44
"src"
55
],
File renamed without changes.

packages/css-blocks/package.json packages/@css-blocks/core/package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"name": "css-blocks",
2+
"name": "@css-blocks/core",
33
"version": "0.17.0",
44
"description": "Fast, maintainable, optimal, component-oriented CSS.",
55
"main": "dist/src/index.js",
66
"scripts": {
7-
"compile": "../../node_modules/.bin/tsc --version && rm -rf dist && ../../node_modules/.bin/tsc",
7+
"compile": "tsc --version && rm -rf dist && tsc",
88
"pretest": "yarn run compile",
9-
"test": "../../node_modules/.bin/mocha dist/test --opts test/mocha.opts",
9+
"test": "mocha dist/test --opts test/mocha.opts",
1010
"posttest": "yarn run lint",
1111
"prepublish": "yarn run compile && yarn run lintall",
12-
"lint": "../../node_modules/.bin/tslint -t msbuild --project . -c tslint.cli.json",
13-
"lintall": "../../node_modules/.bin/tslint -t msbuild --project . -c tslint.release.json",
14-
"lintfix": "../../node_modules/.bin/tslint -t msbuild --project . -c tslint.cli.json --fix",
15-
"coverage": "../../node_modules/.bin/istanbul cover -i \"dist/src/**/*.js\" --dir ./build/coverage node_modules/.bin/_mocha -- dist/test --opts test/mocha.opts",
16-
"remap": "../../node_modules/.bin/remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
17-
"docs": "../../node_modules/.bin/typedoc --out ./docs .",
12+
"lint": "tslint -t msbuild --project . -c tslint.cli.json",
13+
"lintall": "tslint -t msbuild --project . -c tslint.release.json",
14+
"lintfix": "tslint -t msbuild --project . -c tslint.cli.json --fix",
15+
"coverage": "istanbul cover -i \"dist/src/**/*.js\" --dir ./build/coverage node_modules/.bin/_mocha -- dist/test --opts test/mocha.opts",
16+
"remap": "remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
17+
"docs": "typedoc --out ./docs .",
1818
"watch": "watch 'yarn run test' './src' './test' --wait=3"
1919
},
2020
"repository": {
@@ -41,10 +41,10 @@
4141
"@css-blocks/code-style": "^0.17.0"
4242
},
4343
"dependencies": {
44-
"@opticss/element-analysis": "file:../../../opticss/packages/element-analysis",
45-
"opticss": "file:../../../opticss/packages/opticss",
46-
"@opticss/template-api": "file:../../../opticss/packages/template-api",
47-
"@opticss/util": "file:../../../opticss/packages/util",
44+
"@opticss/element-analysis": "file:../../../../opticss/packages/element-analysis",
45+
"opticss": "file:../../../../opticss/packages/opticss",
46+
"@opticss/template-api": "file:../../../../opticss/packages/template-api",
47+
"@opticss/util": "file:../../../../opticss/packages/util",
4848
"@types/async": "^2.0.40",
4949
"@types/debug": "0.0.29",
5050
"async": "^2.5.0",

packages/css-blocks/src/Analyzer/Analyzer.ts packages/@css-blocks/core/src/Analyzer/Analyzer.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
TemplateAnalysis as OptimizationAnalysis,
3-
TemplateInfo,
43
TemplateIntegrationOptions,
54
TemplateTypes,
65
} from "@opticss/template-api";
@@ -64,7 +63,7 @@ export abstract class Analyzer<K extends keyof TemplateTypes> {
6463
this.blockFactory.reset();
6564
}
6665

67-
newAnalysis(info: TemplateInfo<K>): Analysis<K> {
66+
newAnalysis(info: TemplateTypes[K]): Analysis<K> {
6867
let analysis = new Analysis<K>(this, info, this.validatorOptions);
6968
this.analysisMap.set(info.identifier, analysis);
7069
return analysis;

packages/css-blocks/src/BlockTree/Inheritable.ts packages/@css-blocks/core/src/BlockTree/Inheritable.ts

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
* generics they are forced to provide when extending. By the time this abstract class
99
* is exposed to the outside world, all typing holes have been plugged and we are left
1010
* with a fully typed tree structure.
11-
*
12-
* @module Block/BlockTree/Inheritable
1311
*/
1412
import { ObjectDictionary } from "@opticss/util";
1513
import { ParsedSelector, SelectorFactory, parseSelector, postcss } from "opticss";

packages/css-blocks/src/BlockTree/RulesetContainer.ts packages/@css-blocks/core/src/BlockTree/RulesetContainer.ts

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* Every `Style` object has a `RulesetContainer`. A `Style` object's behavior may be defined
66
* by multiple rulesets, and may have multiple stylable targets (ex: `::self`, `::before`,
77
* `::after`). Every ruleset may provide resolution guidance against another `Style` object.
8-
*
9-
* @module Block/BlockTree/RulesetContainer
108
*/
119
import { MultiMap, TwoKeyMultiMap } from "@opticss/util";
1210
import * as propParser from "css-property-parser";
File renamed without changes.

packages/css-blocks/src/errors.ts packages/@css-blocks/core/src/errors.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export interface ErrorLocation {
32
filename?: string;
43
line?: number;
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/css-blocks/tsconfig.json packages/@css-blocks/core/tsconfig.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
4-
// output options
54
"outDir": "dist",
65
"baseUrl": "dist",
76
"paths": {
87
"perfectionist": [
9-
"../types-local/perfectionist"
8+
"../../../../types-local/perfectionist"
109
],
1110
"regexpu-core": [
12-
"../types-local/regexpu-core"
11+
"../../../../types-local/regexpu-core"
1312
],
1413
"inline-source-map-comment": [
15-
"../types-local/inline-source-map-comment"
14+
"../../../../types-local/inline-source-map-comment"
1615
]
1716
}
1817
},
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/glimmer-templates/README.md packages/@css-blocks/glimmer/README.md

+5-5

packages/glimmer-templates/package.json packages/@css-blocks/glimmer/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@css-blocks/glimmer-templates",
2+
"name": "@css-blocks/glimmer",
33
"version": "0.17.0",
44
"description": "Statically analyze & rewrite the css-block styles in Handlebars templates.",
55
"main": "dist/src/index.js",
@@ -32,7 +32,7 @@
3232
"static",
3333
"analysis",
3434
"handlebars",
35-
"css-blocks",
35+
"@css-blocks/core",
3636
"css",
3737
"optimizer"
3838
],
@@ -47,7 +47,7 @@
4747
"engines": {
4848
"node": ">=8"
4949
},
50-
"homepage": "https://github.com/css-blocks/css-blocks/tree/master/packages/glimmer-templates#readme",
50+
"homepage": "https://github.com/css-blocks/css-blocks/tree/master/packages/@css-blocks/glimmer#readme",
5151
"devDependencies": {
5252
"@css-blocks/code-style": "^0.17.0"
5353
},
@@ -56,11 +56,11 @@
5656
"@glimmer/resolution-map-builder": "0.5.1",
5757
"@glimmer/resolver": "^0.4.3",
5858
"@glimmer/syntax": "^0.33.0",
59-
"@opticss/element-analysis": "file:../../../opticss/packages/element-analysis",
60-
"@opticss/template-api": "file:../../../opticss/packages/template-api",
61-
"@opticss/util": "file:../../../opticss/packages/util",
59+
"@opticss/element-analysis": "file:../../../../opticss/packages/element-analysis",
60+
"@opticss/template-api": "file:../../../../opticss/packages/template-api",
61+
"@opticss/util": "file:../../../../opticss/packages/util",
6262
"@types/glob": "^5.0.30",
63-
"css-blocks": "^0.17.0",
63+
"@css-blocks/core": "^0.17.0",
6464
"debug": "^2.6.8",
6565
"glimmer-analyzer": "^0.2.0",
6666
"glob": "^7.1.2",

0 commit comments

Comments
 (0)