Skip to content

Commit

Permalink
Fix usage of default exports with TypeScript
Browse files Browse the repository at this point in the history
This is done by assigning the property `default` for all properties that are
exported using `export default` according to their type definitions.

Closes #1424
  • Loading branch information
remcohaszing committed Nov 10, 2020
1 parent 6fb712a commit 8741fdd
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/at-rule.js
Expand Up @@ -20,5 +20,6 @@ class AtRule extends Container {
}

module.exports = AtRule
AtRule.default = AtRule

Container.registerAtRule(AtRule)
1 change: 1 addition & 0 deletions lib/comment.js
Expand Up @@ -10,3 +10,4 @@ class Comment extends Node {
}

module.exports = Comment
Comment.default = Comment
1 change: 1 addition & 0 deletions lib/container.js
Expand Up @@ -426,3 +426,4 @@ Container.registerAtRule = dependant => {
}

module.exports = Container
Container.default = Container
1 change: 1 addition & 0 deletions lib/css-syntax-error.js
Expand Up @@ -89,3 +89,4 @@ class CssSyntaxError extends Error {
}

module.exports = CssSyntaxError
CssSyntaxError.default = CssSyntaxError
1 change: 1 addition & 0 deletions lib/declaration.js
Expand Up @@ -21,3 +21,4 @@ class Declaration extends Node {
}

module.exports = Declaration
Declaration.default = Declaration
1 change: 1 addition & 0 deletions lib/input.js
Expand Up @@ -139,6 +139,7 @@ class Input {
}

module.exports = Input
Input.default = Input

if (terminalHighlight && terminalHighlight.registerInput) {
terminalHighlight.registerInput(Input)
Expand Down
1 change: 1 addition & 0 deletions lib/lazy-result.js
Expand Up @@ -475,5 +475,6 @@ LazyResult.registerPostcss = dependant => {
}

module.exports = LazyResult
LazyResult.default = LazyResult

Root.registerLazyResult(LazyResult)
1 change: 1 addition & 0 deletions lib/list.js
Expand Up @@ -53,3 +53,4 @@ let list = {
}

module.exports = list
list.default = list
1 change: 1 addition & 0 deletions lib/node.js
Expand Up @@ -288,3 +288,4 @@ class Node {
}

module.exports = Node
Node.default = Node
1 change: 1 addition & 0 deletions lib/parse.js
Expand Up @@ -37,5 +37,6 @@ function parse (css, opts) {
}

module.exports = parse
parse.default = parse

Container.registerParse(parse)
1 change: 1 addition & 0 deletions lib/postcss.js
Expand Up @@ -85,3 +85,4 @@ postcss.Node = Node
LazyResult.registerPostcss(postcss)

module.exports = postcss
postcss.default = postcss
1 change: 1 addition & 0 deletions lib/previous-map.js
Expand Up @@ -140,3 +140,4 @@ class PreviousMap {
}

module.exports = PreviousMap
PreviousMap.default = PreviousMap
1 change: 1 addition & 0 deletions lib/processor.js
Expand Up @@ -65,5 +65,6 @@ class Processor {
}

module.exports = Processor
Processor.default = Processor

Root.registerProcessor(Processor)
1 change: 1 addition & 0 deletions lib/result.js
Expand Up @@ -39,3 +39,4 @@ class Result {
}

module.exports = Result
Result.default = Result
1 change: 1 addition & 0 deletions lib/root.js
Expand Up @@ -56,3 +56,4 @@ Root.registerProcessor = dependant => {
}

module.exports = Root
Root.default = Root
1 change: 1 addition & 0 deletions lib/rule.js
Expand Up @@ -22,5 +22,6 @@ class Rule extends Container {
}

module.exports = Rule
Rule.default = Rule

Container.registerRule(Rule)
5 changes: 4 additions & 1 deletion lib/stringify.js
Expand Up @@ -2,7 +2,10 @@

let Stringifier = require('./stringifier')

module.exports = function stringify (node, builder) {
function stringify (node, builder) {
let str = new Stringifier(builder)
str.stringify(node)
}

module.exports = stringify
stringify.default = stringify
1 change: 1 addition & 0 deletions lib/warning.js
Expand Up @@ -32,3 +32,4 @@ class Warning {
}

module.exports = Warning
Warning.default = Warning

0 comments on commit 8741fdd

Please sign in to comment.