Permalink
Browse files

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.
  • Loading branch information...
amiller-gh committed Apr 13, 2018
1 parent 77cf0b9 commit 59c85a3b73e1879c53600a9df6cc058bef1cd29b
Showing 347 changed files with 964 additions and 533 deletions.
@@ -31,4 +31,4 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
* **rewriter:** Raise an error if there's any stray references to a block variable. ([53b0cea](https://github.com/css-blocks/css-blocks/commit/53b0cea))
* Allow css assets to be processed after concatenation. ([8d5ff5a](https://github.com/css-blocks/css-blocks/commit/8d5ff5a))
* Allow styles to be set to className properties for dynamic change to the class attribute. ([5df7a7e](https://github.com/css-blocks/css-blocks/commit/5df7a7e))
* **webpack-plugin:** Extract webpack rewriting to its own plugin so that a single analysis can be used in other builds -- eg for SSR builds. ([77d6398](https://github.com/css-blocks/css-blocks/commit/77d6398))
* **webpack:** Extract webpack rewriting to its own plugin so that a single analysis can be used in other builds -- eg for SSR builds. ([77d6398](https://github.com/css-blocks/css-blocks/commit/77d6398))
@@ -1,22 +1,25 @@
{
"folders": [
{
"path": "packages/css-blocks"
"path": "packages/@css-blocks/broccoli"
},
{
"path": "packages/glimmer-templates"
"path": "packages/@css-blocks/code-style"
},
{
"path": "packages/jsx"
"path": "packages/@css-blocks/core"
},
{
"path": "packages/runtime"
"path": "packages/@css-blocks/glimmer"
},
{
"path": "packages/webpack-plugin"
"path": "packages/@css-blocks/jsx"
},
{
"path": "packages/code-style"
"path": "packages/@css-blocks/runtime"
},
{
"path": "packages/@css-blocks/webpack"
},
{
"path": ".",
@@ -2,7 +2,8 @@
"private": true,
"scripts": {
"commitmsg": "commitlint --edit $GIT_PARAMS",
"ci": "lerna run test"
"ci": "lerna run test",
"docs": "typedoc"
},
"devDependencies": {
"@commitlint/cli": "^6.1.0",
@@ -16,10 +17,12 @@
"@types/babylon": "^6.16.1",
"@types/chai": "^3.5.2",
"@types/debug": "0.0.29",
"@types/loader-utils": "^1.1.3",
"@types/minimatch": "^2.0.29",
"@types/mocha": "^2.2.41",
"@types/node": "^8.0.0",
"@types/prettier": "^1.8.0",
"@types/tapable": "0.2.4",
"chai": "^3.5.0",
"husky": "^0.14.3",
"istanbul": "^0.4.5",
@@ -38,11 +41,12 @@
"test-console": "^1.1.0",
"ts-node": "^3.0.4",
"tslint": "^5.9.1",
"typedoc": "^0.7.1",
"typedoc": "^0.11.0",
"typescript": "^2.8.1",
"typedoc-plugin-external-module-map": "amiller-gh/typedoc-plugin-external-module-map#prebuilt",
"watch": "^1.0.2"
},
"workspaces": [
"packages/*"
"packages/@css-blocks/*"
]
}
@@ -5,7 +5,11 @@
"main": "dist/src/index.js",
"author": "Adam Miller <ammiller@linkedin.com>",
"license": "MIT",
"keywords": ["css-blocks", "css blocks", "broccoli-plugin"],
"keywords": [
"css-blocks",
"css blocks",
"broccoli-plugin"
],
"scripts": {
"test": "mocha --opts test/mocha.opts dist/test",
"compile": "rm -rf dist && tsc -p tsconfig.json",
@@ -15,32 +19,31 @@
"lint": "tslint -t msbuild --project . -c tslint.cli.json",
"lintall": "tslint -t msbuild --project . -c tslint.release.json",
"lintfix": "tslint -t msbuild --project . -c tslint.cli.json --fix",
"coverage":
"istanbul cover -i dist/src/**/*.js --dir ./build/coverage node_modules/mocha/bin/_mocha -- dist/test --opts test/mocha.opts",
"remap":
"remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
"coverage": "istanbul cover -i dist/src/**/*.js --dir ./build/coverage node_modules/mocha/bin/_mocha -- dist/test --opts test/mocha.opts",
"remap": "remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
"docs": "typedoc --out ./docs .",
"watch": "watch 'yarn run test' src test types-local --wait=1"
},
"devDependencies": {
"@css-blocks/code-style": "^0.17.0",
"@css-blocks/glimmer-templates": "^0.17.0"
"@css-blocks/glimmer": "^0.17.0"
},
"dependencies": {
"@css-blocks/core": "^0.17.0",
"@glimmer/compiler": "^0.33.0",
"@glimmer/syntax": "^0.33.0",
"@opticss/template-api": "file:../../../../opticss/packages/template-api",
"@types/recursive-readdir": "^2.2.0",
"broccoli-funnel": "^2.0.1",
"broccoli-merge-trees": "^3.0.0",
"broccoli-plugin": "^1.3.0",
"broccoli-test-helper": "^1.2.0",
"colors": "^1.2.1",
"css-blocks": "^0.17.0",
"debug": "^3.1.0",
"fs-extra": "^5.0.0",
"opticss": "file:../../../opticss/packages/opticss",
"opticss": "file:../../../../opticss/packages/opticss",
"postcss": "^6.0.21",
"recursive-readdir": "^2.2.2",
"walk-sync": "^0.3.2"
}
}
}
@@ -1,13 +1,12 @@
import * as fs from "fs-extra";
import * as path from "path";
import { Analyzer, BlockCompiler, StyleMapping } from "css-blocks";
import { Analyzer, BlockCompiler, StyleMapping } from "@css-blocks/core";
import { TemplateTypes } from "@opticss/template-api";
import { Optimizer } from "opticss";
import * as postcss from "postcss";
import * as readdir from "recursive-readdir";
import { TemplateTypes } from "@opticss/template-api";
import { BroccoliPlugin } from "./utils";
export interface BroccoliOptions {
@@ -1,10 +1,10 @@
import { GlimmerAnalyzer } from "@css-blocks/glimmer-templates";
import { GlimmerAnalyzer } from "@css-blocks/glimmer";
import * as assert from "assert";
import { TempDir, buildOutput, createTempDir } from "broccoli-test-helper";
import { BroccoliCSSBlocks } from "../src/index";
describe("Broccoli Plugin Test", function() {
describe("Broccoli Plugin Test", function () {
let input: TempDir;
beforeEach(async () => {
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"baseUrl": "dist"
@@ -1,3 +1,3 @@
{
"extends": "@css-blocks/code-style/configs/tslint.cli.json"
}
}
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/css-blocks/css-blocks/tree/master/packages/code-style",
"dependencies": {
"@opticss/code-style": "file:../../../opticss/packages/code-style"
"@opticss/code-style": "file:../../../../opticss/packages/code-style"
},
"engines": {
"node": ">=8"
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../../tsconfig.json",
"include": [
"src"
],
@@ -1,20 +1,20 @@
{
"name": "css-blocks",
"name": "@css-blocks/core",
"version": "0.17.0",
"description": "Fast, maintainable, optimal, component-oriented CSS.",
"main": "dist/src/index.js",
"scripts": {
"compile": "../../node_modules/.bin/tsc --version && rm -rf dist && ../../node_modules/.bin/tsc",
"compile": "tsc --version && rm -rf dist && tsc",
"pretest": "yarn run compile",
"test": "../../node_modules/.bin/mocha dist/test --opts test/mocha.opts",
"test": "mocha dist/test --opts test/mocha.opts",
"posttest": "yarn run lint",
"prepublish": "yarn run compile && yarn run lintall",
"lint": "../../node_modules/.bin/tslint -t msbuild --project . -c tslint.cli.json",
"lintall": "../../node_modules/.bin/tslint -t msbuild --project . -c tslint.release.json",
"lintfix": "../../node_modules/.bin/tslint -t msbuild --project . -c tslint.cli.json --fix",
"coverage": "../../node_modules/.bin/istanbul cover -i \"dist/src/**/*.js\" --dir ./build/coverage node_modules/.bin/_mocha -- dist/test --opts test/mocha.opts",
"remap": "../../node_modules/.bin/remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
"docs": "../../node_modules/.bin/typedoc --out ./docs .",
"lint": "tslint -t msbuild --project . -c tslint.cli.json",
"lintall": "tslint -t msbuild --project . -c tslint.release.json",
"lintfix": "tslint -t msbuild --project . -c tslint.cli.json --fix",
"coverage": "istanbul cover -i \"dist/src/**/*.js\" --dir ./build/coverage node_modules/.bin/_mocha -- dist/test --opts test/mocha.opts",
"remap": "remap-istanbul -i build/coverage/coverage.json -o coverage -t html",
"docs": "typedoc --out ./docs .",
"watch": "watch 'yarn run test' './src' './test' --wait=3"
},
"repository": {
@@ -41,10 +41,10 @@
"@css-blocks/code-style": "^0.17.0"
},
"dependencies": {
"@opticss/element-analysis": "file:../../../opticss/packages/element-analysis",
"opticss": "file:../../../opticss/packages/opticss",
"@opticss/template-api": "file:../../../opticss/packages/template-api",
"@opticss/util": "file:../../../opticss/packages/util",
"@opticss/element-analysis": "file:../../../../opticss/packages/element-analysis",
"opticss": "file:../../../../opticss/packages/opticss",
"@opticss/template-api": "file:../../../../opticss/packages/template-api",
"@opticss/util": "file:../../../../opticss/packages/util",
"@types/async": "^2.0.40",
"@types/debug": "0.0.29",
"async": "^2.5.0",
@@ -1,6 +1,5 @@
import {
TemplateAnalysis as OptimizationAnalysis,
TemplateInfo,
TemplateIntegrationOptions,
TemplateTypes,
} from "@opticss/template-api";
@@ -64,7 +63,7 @@ export abstract class Analyzer<K extends keyof TemplateTypes> {
this.blockFactory.reset();
}
newAnalysis(info: TemplateInfo<K>): Analysis<K> {
newAnalysis(info: TemplateTypes[K]): Analysis<K> {
let analysis = new Analysis<K>(this, info, this.validatorOptions);
this.analysisMap.set(info.identifier, analysis);
return analysis;
@@ -8,8 +8,6 @@
* generics they are forced to provide when extending. By the time this abstract class
* is exposed to the outside world, all typing holes have been plugged and we are left
* with a fully typed tree structure.
*
* @module Block/BlockTree/Inheritable
*/
import { ObjectDictionary } from "@opticss/util";
import { ParsedSelector, SelectorFactory, parseSelector, postcss } from "opticss";
@@ -5,8 +5,6 @@
* Every `Style` object has a `RulesetContainer`. A `Style` object's behavior may be defined
* by multiple rulesets, and may have multiple stylable targets (ex: `::self`, `::before`,
* `::after`). Every ruleset may provide resolution guidance against another `Style` object.
*
* @module Block/BlockTree/RulesetContainer
*/
import { MultiMap, TwoKeyMultiMap } from "@opticss/util";
import * as propParser from "css-property-parser";
@@ -1,4 +1,3 @@
export interface ErrorLocation {
filename?: string;
line?: number;
@@ -1,18 +1,17 @@
{
"extends": "../../tsconfig.json",
"extends": "../../../tsconfig.json",
"compilerOptions": {
// output options
"outDir": "dist",
"baseUrl": "dist",
"paths": {
"perfectionist": [
"../types-local/perfectionist"
"../../../../types-local/perfectionist"
],
"regexpu-core": [
"../types-local/regexpu-core"
"../../../../types-local/regexpu-core"
],
"inline-source-map-comment": [
"../types-local/inline-source-map-comment"
"../../../../types-local/inline-source-map-comment"
]
}
},
@@ -5,13 +5,13 @@ The css-blocks Rewriter and Analyzer for Glimmer templates.
## Installation
```
yarn add @css-blocks/glimmer-templates
yarn add @css-blocks/glimmer
```
or
```
npm install --save-dev @css-blocks/glimmer-templates
npm install --save-dev @css-blocks/glimmer
```
## Usage
@@ -75,7 +75,7 @@ import {
Project,
Rewriter,
HandlebarsTransitiveStyleAnalyzer as Analyzer
} from "@css-blocks/glimmer-templates";
} from "@css-blocks/glimmer";
import projectConfig from "./projectConfig";
let projectDir = path.resolve(__dirname, "..");
let project = new Project(projectDir, projectConfig);
@@ -132,13 +132,13 @@ with your specific build system will be required.
import * as path from "path";
import {
StyleMapping
} from "css-blocks";
} from "@css-blocks/core";
import {
Project,
Rewriter,
RewriterOptions,
HandlebarsStyleAnalyzer as Analyzer,
} from "@css-blocks/glimmer-templates";
} from "@css-blocks/glimmer";
import {
precompile
} from "@glimmer/compiler";
@@ -1,5 +1,5 @@
{
"name": "@css-blocks/glimmer-templates",
"name": "@css-blocks/glimmer",
"version": "0.17.0",
"description": "Statically analyze & rewrite the css-block styles in Handlebars templates.",
"main": "dist/src/index.js",
@@ -32,7 +32,7 @@
"static",
"analysis",
"handlebars",
"css-blocks",
"@css-blocks/core",
"css",
"optimizer"
],
@@ -47,7 +47,7 @@
"engines": {
"node": ">=8"
},
"homepage": "https://github.com/css-blocks/css-blocks/tree/master/packages/glimmer-templates#readme",
"homepage": "https://github.com/css-blocks/css-blocks/tree/master/packages/@css-blocks/glimmer#readme",
"devDependencies": {
"@css-blocks/code-style": "^0.17.0"
},
@@ -56,11 +56,11 @@
"@glimmer/resolution-map-builder": "0.5.1",
"@glimmer/resolver": "^0.4.3",
"@glimmer/syntax": "^0.33.0",
"@opticss/element-analysis": "file:../../../opticss/packages/element-analysis",
"@opticss/template-api": "file:../../../opticss/packages/template-api",
"@opticss/util": "file:../../../opticss/packages/util",
"@opticss/element-analysis": "file:../../../../opticss/packages/element-analysis",
"@opticss/template-api": "file:../../../../opticss/packages/template-api",
"@opticss/util": "file:../../../../opticss/packages/util",
"@types/glob": "^5.0.30",
"css-blocks": "^0.17.0",
"@css-blocks/core": "^0.17.0",
"debug": "^2.6.8",
"glimmer-analyzer": "^0.2.0",
"glob": "^7.1.2",
Oops, something went wrong.

0 comments on commit 59c85a3

Please sign in to comment.