Skip to content

Commit d68eb4d

Browse files
committed
chore: Upgrade to TypeScript 3.4, OptiCSS 0.6.
1 parent c622d42 commit d68eb4d

Some content is hidden

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

51 files changed

+133
-141
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"tslint": "^5.9.1",
4949
"typedoc": "^0.11.0",
5050
"typedoc-plugin-monorepo": "^0.1.0",
51-
"typescript": "~3.1.6",
51+
"typescript": "~3.4.4",
5252
"watch": "^1.0.2"
5353
},
5454
"workspaces": [

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@css-blocks/core": "^0.21.0",
4141
"@glimmer/compiler": "^0.33.0",
4242
"@glimmer/syntax": "^0.33.0",
43-
"@opticss/template-api": "^0.4.0",
43+
"@opticss/template-api": "^0.6.0",
4444
"broccoli-funnel": "^2.0.1",
4545
"broccoli-merge-trees": "^3.0.0",
4646
"broccoli-plugin": "^1.3.0",
@@ -49,8 +49,8 @@
4949
"fs-extra": "^5.0.0",
5050
"fs-tree-diff": "^0.5.9",
5151
"glob": "^7.1.2",
52-
"opticss": "^0.4.0",
52+
"opticss": "^0.6.0",
5353
"symlink-or-copy": "^1.2.0",
5454
"walk-sync": "^0.3.3"
5555
}
56-
}
56+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class CSSBlocksAggregate extends BroccoliPlugin {
3030
* @param transport Magical shared-memory Transport object shared with the aggregator and Template transformer.
3131
* @param out Output file name.
3232
*/
33-
// tslint:disable-next-line:prefer-whatever-to-any
33+
// tslint:disable-next-line:prefer-unknown-to-any
3434
constructor(inputNodes: any[], transport: Transport, out: string) {
3535
super(inputNodes, {
3636
name: "broccoli-css-blocks-aggregate",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class CSSBlocksAnalyze extends BroccoliPlugin {
4646
* @param transport Magical shared-memory Transport object shared with the aggregator and Template transformer.
4747
* @param options Analysis options.
4848
*/
49-
// tslint:disable-next-line:prefer-whatever-to-any
49+
// tslint:disable-next-line:prefer-unknown-to-any
5050
constructor(inputNode: any, transport: Transport, options: BroccoliOptions) {
5151
super([inputNode], {
5252
name: "broccoli-css-blocks-analyze",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"access": "public"
3030
},
3131
"dependencies": {
32-
"@opticss/code-style": "^0.4.0"
32+
"@opticss/code-style": "^0.6.0"
3333
},
3434
"engines": {
3535
"node": "6.* || 8.* || >= 10.*"
@@ -38,4 +38,4 @@
3838
"configs",
3939
"*.md"
4040
]
41-
}
41+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"@css-blocks/code-style": "^0.21.0"
4242
},
4343
"dependencies": {
44-
"@opticss/element-analysis": "^0.4.0",
45-
"@opticss/template-api": "^0.4.0",
46-
"@opticss/util": "^0.4.0",
44+
"@opticss/element-analysis": "^0.6.0",
45+
"@opticss/template-api": "^0.6.0",
46+
"@opticss/util": "^0.6.0",
4747
"@types/async": "^2.0.40",
4848
"@types/debug": "0.0.29",
4949
"async": "^2.5.0",
@@ -52,7 +52,7 @@
5252
"inline-source-map-comment": "^1.0.5",
5353
"json-parse-better-errors": "^1.0.1",
5454
"object.values": "^1.0.4",
55-
"opticss": "^0.4.0",
55+
"opticss": "^0.6.0",
5656
"regexpu-core": "^4.0.11",
5757
"source-map": "^0.6.1",
5858
"watch": "^1.0.2"
@@ -61,4 +61,4 @@
6161
"node": "6.* || 8.* || >= 10.*"
6262
},
6363
"engineStrict": true
64-
}
64+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class Analysis<K extends keyof TemplateTypes> {
5353
* A per-element correlation of styles used. The current correlation is added
5454
* to this list when [[endElement]] is called.
5555
*/
56-
// tslint:disable-next-line:prefer-whatever-to-any
56+
// tslint:disable-next-line:prefer-unknown-to-any
5757
elements: Map<string, ElementAnalysis<any, any, any>>;
5858

5959
/**
@@ -67,7 +67,7 @@ export class Analysis<K extends keyof TemplateTypes> {
6767
* The current element, created when calling [[startElement]].
6868
* The current element is unset after calling [[endElement]].
6969
*/
70-
// tslint:disable-next-line:prefer-whatever-to-any
70+
// tslint:disable-next-line:prefer-unknown-to-any
7171
private currentElement: ElementAnalysis<any, any, any> | undefined;
7272

7373
/**
@@ -367,7 +367,7 @@ export class Analysis<K extends keyof TemplateTypes> {
367367
analysis.elements.set(elID, element);
368368
});
369369

370-
// tslint:disable-next-line:prefer-whatever-to-any
370+
// tslint:disable-next-line:prefer-unknown-to-any
371371
return analysis;
372372
}
373373

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
TemplateIntegrationOptions,
44
TemplateTypes,
55
} from "@opticss/template-api";
6-
import { MultiMap, whatever } from "@opticss/util";
6+
import { MultiMap } from "@opticss/util";
77
import * as debugGenerator from "debug";
88

99
import { BlockFactory } from "../BlockParser";
@@ -87,7 +87,7 @@ export abstract class Analyzer<K extends keyof TemplateTypes> {
8787

8888
analysisCount(): number { return this.analysisMap.size; }
8989

90-
eachAnalysis(cb: (v: Analysis<K>) => whatever) { this.analysisMap.forEach(cb); }
90+
eachAnalysis(cb: (v: Analysis<K>) => unknown) { this.analysisMap.forEach(cb); }
9191

9292
analyses(): Analysis<K>[] {
9393
let analyses: Analysis<K>[] = [];

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
MultiMap,
1818
ObjectDictionary,
1919
objectValues,
20-
whatever,
2120
} from "@opticss/util";
2221

2322
import {
@@ -74,7 +73,7 @@ export interface Switch<StringExpression> {
7473
disallowFalsy?: boolean;
7574
}
7675

77-
export function isSwitch(o: object): o is Switch<whatever> {
76+
export function isSwitch(o: object): o is Switch<unknown> {
7877
return o.hasOwnProperty("stringExpression");
7978
}
8079

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { TemplateTypes } from "@opticss/template-api";
2-
import { whatever } from "@opticss/util";
32

43
import { Analysis } from "../Analysis";
54
import { ElementAnalysis } from "../ElementAnalysis";
65

76
export type ErrorCallback = (str: string, loc?: null, details?: string) => void;
8-
export type Validator = (analysis: ElementAnalysis<whatever, whatever, whatever>, templateAnalysis: Analysis<keyof TemplateTypes>, err: ErrorCallback) => void;
7+
export type Validator = (analysis: ElementAnalysis<unknown, unknown, unknown>, templateAnalysis: Analysis<keyof TemplateTypes>, err: ErrorCallback) => void;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class TemplateValidator {
9595
* @param correlations The correlations object for a given element.
9696
* @param locInfo Location info for the elements being validated.
9797
*/
98-
// tslint:disable-next-line:prefer-whatever-to-any
98+
// tslint:disable-next-line:prefer-unknown-to-any
9999
validate(templateAnalysis: Analysis<keyof TemplateTypes>, element: ElementAnalysis<any, any, any>) {
100100

101101
function err (message: string, locInfo?: errors.ErrorLocation | undefined | null, details?: string) {

packages/@css-blocks/core/src/Analyzer/validations/property-conflict-validator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MultiMap, TwoKeyMultiMap, objectValues, whatever } from "@opticss/util";
1+
import { MultiMap, TwoKeyMultiMap, objectValues } from "@opticss/util";
22
import * as propParser from "css-property-parser";
33
import { postcss } from "opticss";
44

@@ -125,7 +125,7 @@ function printRulesetConflict(prop: string, rule: Ruleset) {
125125

126126
function inStylesheetComposition(
127127
blockClass: BlockClass,
128-
analysis: ElementAnalysis<whatever, whatever, whatever>,
128+
analysis: ElementAnalysis<unknown, unknown, unknown>,
129129
conflicts: ConflictMap,
130130
allConditions: PropMap,
131131
) {

packages/@css-blocks/core/src/BlockParser/block-intermediates.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertNever, whatever } from "@opticss/util";
1+
import { assertNever } from "@opticss/util";
22
import { CompoundSelector, postcssSelectorParser as selectorParser } from "opticss";
33

44
import { ATTR_PRESENT, AttrToken, ROOT_CLASS, STATE_NAMESPACE } from "../BlockSyntax";
@@ -114,7 +114,7 @@ export function isClassLevelObject(object: NodeAndType): object is ClassAttribut
114114
/**
115115
* Check if given selector node is targeting the root block node
116116
*/
117-
export function isRootNode(node: whatever): node is selectorParser.Pseudo {
117+
export function isRootNode(node: unknown): node is selectorParser.Pseudo {
118118
return selectorParser.isPseudoClass(node) && node.value === ROOT_CLASS;
119119
}
120120

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as crypto from "crypto";
22

33
import { MultiMap, ObjectDictionary } from "@opticss/util";
4-
import { whatever } from "@opticss/util";
54
import {
65
CompoundSelector,
76
ParsedSelector,
@@ -227,7 +226,7 @@ export class Block
227226
return this.all().find(e => e.asSource() === sourceName);
228227
}
229228

230-
eachBlockReference(callback: (name: string, block: Block) => whatever) {
229+
eachBlockReference(callback: (name: string, block: Block) => unknown) {
231230
for (let name of Object.keys(this._blockReferences)) {
232231
callback(name, this._blockReferences[name]);
233232
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import { ObjectDictionary } from "@opticss/util";
1313
import { ParsedSelector, SelectorFactory, parseSelector, postcss } from "opticss";
1414

15-
/* tslint:disable:prefer-whatever-to-any */
15+
/* tslint:disable:prefer-unknown-to-any */
1616
export type AnyNode = Inheritable<any, any, any, any, any>;
1717

1818
export abstract class Inheritable<
@@ -25,7 +25,7 @@ export abstract class Inheritable<
2525

2626
protected abstract get ChildConstructor(): { new(token: any, parent: Self): Child } | never;
2727

28-
/* tslint:enable:prefer-whatever-to-any */
28+
/* tslint:enable:prefer-unknown-to-any */
2929

3030
private readonly parsedRuleSelectors: WeakMap<postcss.Rule, ParsedSelector[]> | null;
3131

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export { RulesetContainer, Resolution, Ruleset } from "./RulesetContainer";
1010
* Abstract class that serves as the base for all Styles. Contains basic
1111
* properties and abstract methods that extenders must implement.
1212
*/
13-
/* tslint:disable:prefer-whatever-to-any */
13+
/* tslint:disable:prefer-unknown-to-any */
1414

1515
export abstract class Style<
1616
Self extends Style<Self, Root, Parent, Child, Token>,
@@ -19,12 +19,12 @@ export abstract class Style<
1919
Child extends Inheritable<any, Root, Self, AnyNode | never, any> | never,
2020
Token extends any = string,
2121
> extends Inheritable<Self, Root, Parent, Child> {
22-
/* tslint:enable:prefer-whatever-to-any */
22+
/* tslint:enable:prefer-unknown-to-any */
2323

2424
/** cache of resolveStyles() */
2525
private _resolvedStyles: Set<Self> | undefined;
2626

27-
// tslint:disable-next-line:prefer-whatever-to-any
27+
// tslint:disable-next-line:prefer-unknown-to-any
2828
public abstract readonly rulesets: RulesetContainer<any>;
2929

3030
/**
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isObject, whatever } from "@opticss/util";
1+
import { isObject } from "@opticss/util";
22

33
import { AttrValue, isAttrValue } from "./AttrValue";
44
import { BlockClass, isBlockClass } from "./BlockClass";
@@ -7,6 +7,6 @@ export { BlockClass } from "./BlockClass";
77
export { AttrValue } from "./AttrValue";
88
export type Styles = AttrValue | BlockClass;
99

10-
export function isStyle(o: whatever): o is Styles {
10+
export function isStyle(o: unknown): o is Styles {
1111
return isObject(o) && (isBlockClass(o) || isAttrValue(o));
1212
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class CssBlockError extends Error {
2828
let line = loc.line ? `:${loc.line}` : "";
2929
let column = loc.column ? `:${loc.column}` : "";
3030
let locMessage = ` (${filename}${line}${column})`;
31-
// tslint:disable-next-line:prefer-whatever-to-any
31+
// tslint:disable-next-line:prefer-unknown-to-any
3232
return `[css-blocks] ${(this.constructor as any).prefix}: ${this.origMessage}${locMessage}`;
3333
}
3434

packages/@css-blocks/core/src/importing/Importer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ObjectDictionary, whatever } from "@opticss/util";
1+
import { ObjectDictionary } from "@opticss/util";
22

33
import { Syntax } from "../BlockParser";
44
import { ResolvedConfiguration } from "../configuration";
@@ -8,10 +8,10 @@ import { ResolvedConfiguration } from "../configuration";
88
* options hash where custom importers can request for additional importer configuration
99
* to be passed. All `Importer` methods are passed the configuration hash.
1010
*/
11-
export type ImporterData = ObjectDictionary<whatever>;
11+
export type ImporterData = ObjectDictionary<unknown>;
1212

1313
/**
14-
* A FileIdentifier is a string with a whatever internal encoding is needed to uniquely resolve
14+
* A FileIdentifier is a string with a unknown internal encoding is needed to uniquely resolve
1515
* a file or relative importPath against the identifier by an importer. FileIdentifiers may be
1616
* serialized across processes and should not encode any transient state. If an importer
1717
* wraps another importer, it is responsible for mangling and de-mangling the import identifier to

packages/@css-blocks/core/src/util/PromiseQueue.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// tslint:disable:no-floating-promises
2-
import { whatever } from "@opticss/util";
32
import * as async from "async";
43
import * as debugGenerator from "debug";
54

@@ -29,15 +28,15 @@ export class PromiseQueue<WorkItem, Result> {
2928
this.jobId = 0;
3029
}
3130

32-
private processWork(work: PendingWork<WorkItem, Result>, callback: (err?: whatever) => void) {
31+
private processWork(work: PendingWork<WorkItem, Result>, callback: (err?: unknown) => void) {
3332
this.debug(`[Job:${work.id}] Starting job.`);
3433
this.promiseProcessor(work.item).then(
3534
(result: Result) => {
3635
this.debug(`[Job:${work.id}] Finished. Recording result.`);
3736
work.result = result;
3837
callback();
3938
},
40-
(error: whatever) => {
39+
(error: unknown) => {
4140
this.debug(`[Job:${work.id}] Errored.`);
4241
callback(error);
4342
});

packages/@css-blocks/core/test/Block/inheritable-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class TestSink extends Inheritable<
9090
get ChildConstructor(): never { return assertNeverCalled(); }
9191
get parent(): SinkNode["parent"] { return this._parent!; }
9292
get root(): SinkNode["root"] { return this.parent.root; }
93-
// tslint:disable-next-line:prefer-whatever-to-any
93+
// tslint:disable-next-line:prefer-unknown-to-any
9494
public lookup(_path: string, _errLoc?: SourceLocation | undefined): Inheritable<any, any, any, any> | undefined {
9595
throw new Error("Method not implemented.");
9696
}

packages/@css-blocks/core/test/opticss-test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "@opticss/template-api";
88
import {
99
clean,
10-
whatever,
1110
} from "@opticss/util";
1211
import { assert } from "chai";
1312
import { suite, test } from "mocha-typescript";
@@ -24,7 +23,7 @@ import { StyleMapping } from "../src/TemplateRewriter/StyleMapping";
2423
@suite("Optimization")
2524
export class TemplateAnalysisTests {
2625

27-
private useAttrs(element: ElementAnalysis<whatever, whatever, whatever>, klass: BlockClass) {
26+
private useAttrs(element: ElementAnalysis<unknown, unknown, unknown>, klass: BlockClass) {
2827
for (let attribute of klass.getAttributes()) {
2928
if (attribute.hasResolvedValues()) {
3029
element.addDynamicGroup(klass, attribute, null);
@@ -36,7 +35,7 @@ export class TemplateAnalysisTests {
3635
}
3736
private useBlockStyles(
3837
analysis: Analysis<"Opticss.Template">, block: Block, blockName: string,
39-
useAttrsCallback?: (container: BlockClass, element: ElementAnalysis<whatever, whatever, whatever>) => void,
38+
useAttrsCallback?: (container: BlockClass, element: ElementAnalysis<unknown, unknown, unknown>) => void,
4039
) {
4140
analysis.addBlock(blockName, block);
4241

packages/@css-blocks/core/test/util/assertError.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { whatever } from "@opticss/util";
21
import { assert } from "chai";
32
import { postcss } from "opticss";
43

@@ -15,7 +14,7 @@ export function assertError(errorType: typeof cssBlocks.CssBlockError, message:
1514
});
1615
}
1716

18-
export function assertParseError(errorType: typeof cssBlocks.CssBlockError, message: string, promise: Promise<whatever>) {
17+
export function assertParseError(errorType: typeof cssBlocks.CssBlockError, message: string, promise: Promise<unknown>) {
1918
return promise.then(
2019
() => {
2120
assert(false, `Error ${errorType.name} was not raised.`);

packages/@css-blocks/core/test/util/indented.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// import { whatever } from "@opticss/util";
1+
// import { unknown } from "@opticss/util";
22
import { outdent } from "outdent";
33
// function getFirstIndentedString(strings: string[][]): string | undefined {
44
// for (let group of strings) {

packages/@css-blocks/ember-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@
7878
"tests/dummy/lib/in-repo-lazy-engine"
7979
]
8080
}
81-
}
81+
}

0 commit comments

Comments
 (0)