Skip to content

Commit

Permalink
Merge pull request #228 from spiltcoffee/fix-import-paths
Browse files Browse the repository at this point in the history
fix: changed internal relative paths to external package paths so that exports key is used
  • Loading branch information
spiltcoffee authored Apr 26, 2021
2 parents 9752609 + 09b4a1d commit 2370ba7
Show file tree
Hide file tree
Showing 37 changed files with 122 additions and 122 deletions.
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/astNode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "./astType";
import { ASTRaws } from "./astRaws";
import { ASTType } from "@postdfm/ast/astType";
import { ASTRaws } from "@postdfm/ast/astRaws";

export class ASTNode<R extends ASTRaws = ASTRaws> {
public astType: ASTType;
Expand Down
54 changes: 27 additions & 27 deletions packages/@postdfm/ast/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
export { ASTType } from "./astType";
export { ASTRaws } from "./astRaws";
export { ASTNode } from "./astNode";
export { ASTType } from "@postdfm/ast/astType";
export { ASTRaws } from "@postdfm/ast/astRaws";
export { ASTNode } from "@postdfm/ast/astNode";

export { Keywords } from "./keywords";
export { Keywords } from "@postdfm/ast/keywords";

export { Value } from "./value/value";
export { StringValue } from "./value/stringValue";
export { ControlString } from "./value/controlString";
export { LiteralString } from "./value/literalString";
export { BinaryStringValue } from "./value/binaryStringValue";
export { IntegerValue } from "./value/integerValue";
export { HexCodeValue } from "./value/hexCodeValue";
export { DoubleValue } from "./value/doubleValue";
export { SingleValue } from "./value/singleValue";
export { CurrencyValue } from "./value/currencyValue";
export { DateTimeValue } from "./value/dateTimeValue";
export { BooleanValue } from "./value/booleanValue";
export { IdentifierValue } from "./value/identifierValue";
export { Value } from "@postdfm/ast/value/value";
export { StringValue } from "@postdfm/ast/value/stringValue";
export { ControlString } from "@postdfm/ast/value/controlString";
export { LiteralString } from "@postdfm/ast/value/literalString";
export { BinaryStringValue } from "@postdfm/ast/value/binaryStringValue";
export { IntegerValue } from "@postdfm/ast/value/integerValue";
export { HexCodeValue } from "@postdfm/ast/value/hexCodeValue";
export { DoubleValue } from "@postdfm/ast/value/doubleValue";
export { SingleValue } from "@postdfm/ast/value/singleValue";
export { CurrencyValue } from "@postdfm/ast/value/currencyValue";
export { DateTimeValue } from "@postdfm/ast/value/dateTimeValue";
export { BooleanValue } from "@postdfm/ast/value/booleanValue";
export { IdentifierValue } from "@postdfm/ast/value/identifierValue";

export { Item } from "./item";
export { Item } from "@postdfm/ast/item";

export { List } from "./list/list";
export { BinaryStringList } from "./list/binaryStringList";
export { IdentifierList } from "./list/identifierList";
export { VariantList } from "./list/variantList";
export { ItemList } from "./list/itemList";
export { List } from "@postdfm/ast/list/list";
export { BinaryStringList } from "@postdfm/ast/list/binaryStringList";
export { IdentifierList } from "@postdfm/ast/list/identifierList";
export { VariantList } from "@postdfm/ast/list/variantList";
export { ItemList } from "@postdfm/ast/list/itemList";

export { Property } from "./property";
export { Property } from "@postdfm/ast/property";

export { ObjectKind } from "./objectKind";
export { ObjectKind } from "@postdfm/ast/objectKind";

export { DObject } from "./object";
export { DObject } from "@postdfm/ast/object";

export { Root } from "./root";
export { Root } from "@postdfm/ast/root";
8 changes: 4 additions & 4 deletions packages/@postdfm/ast/src/item.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ASTNode } from "./astNode";
import { ASTRaws } from "./astRaws";
import { ASTType } from "./astType";
import { Property } from "./property";
import { ASTNode } from "@postdfm/ast/astNode";
import { ASTRaws } from "@postdfm/ast/astRaws";
import { ASTType } from "@postdfm/ast/astType";
import { Property } from "@postdfm/ast/property";

interface ItemRaws extends ASTRaws {
afterItem?: string;
Expand Down
8 changes: 4 additions & 4 deletions packages/@postdfm/ast/src/list/anyList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BinaryStringList } from "./binaryStringList";
import { IdentifierList } from "./identifierList";
import { VariantList } from "./variantList";
import { ItemList } from "./itemList";
import { BinaryStringList } from "@postdfm/ast/list/binaryStringList";
import { IdentifierList } from "@postdfm/ast/list/identifierList";
import { VariantList } from "@postdfm/ast/list/variantList";
import { ItemList } from "@postdfm/ast/list/itemList";

export type AnyList =
| BinaryStringList
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/list/binaryStringList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { BinaryStringValue } from "../value/binaryStringValue";
import { List } from "./list";
import { ASTType } from "@postdfm/ast/astType";
import { BinaryStringValue } from "@postdfm/ast/value/binaryStringValue";
import { List } from "@postdfm/ast/list/list";

export class BinaryStringList extends List<BinaryStringValue> {
constructor(values?: BinaryStringValue[]) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/list/identifierList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { IdentifierValue } from "../value/identifierValue";
import { List } from "./list";
import { ASTType } from "@postdfm/ast/astType";
import { IdentifierValue } from "@postdfm/ast/value/identifierValue";
import { List } from "@postdfm/ast/list/list";

export class IdentifierList extends List<IdentifierValue> {
constructor(values?: IdentifierValue[]) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/list/itemList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { Item } from "../item";
import { List } from "./list";
import { ASTType } from "@postdfm/ast/astType";
import { Item } from "@postdfm/ast/item";
import { List } from "@postdfm/ast/list/list";

export class ItemList extends List<Item> {
constructor(values?: Item[]) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/list/list.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTNode } from "../astNode";
import { ASTRaws } from "../astRaws";
import { ASTType } from "../astType";
import { ASTNode } from "@postdfm/ast/astNode";
import { ASTRaws } from "@postdfm/ast/astRaws";
import { ASTType } from "@postdfm/ast/astType";

interface ListRaws extends ASTRaws {
afterOpen?: string;
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/list/variantList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { VariantValue } from "../value/variantValue";
import { List } from "./list";
import { ASTType } from "@postdfm/ast/astType";
import { VariantValue } from "@postdfm/ast/value/variantValue";
import { List } from "@postdfm/ast/list/list";

export class VariantList extends List<VariantValue> {
constructor(values?: Array<VariantValue>) {
Expand Down
10 changes: 5 additions & 5 deletions packages/@postdfm/ast/src/object.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ASTNode } from "./astNode";
import { ASTRaws } from "./astRaws";
import { ASTType } from "./astType";
import { ObjectKind } from "./objectKind";
import { Property } from "./property";
import { ASTNode } from "@postdfm/ast/astNode";
import { ASTRaws } from "@postdfm/ast/astRaws";
import { ASTType } from "@postdfm/ast/astType";
import { ObjectKind } from "@postdfm/ast/objectKind";
import { Property } from "@postdfm/ast/property";

interface ObjectRaws extends ASTRaws {
beforeDef?: string;
Expand Down
10 changes: 5 additions & 5 deletions packages/@postdfm/ast/src/property.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ASTNode } from "./astNode";
import { ASTRaws } from "./astRaws";
import { ASTType } from "./astType";
import { AnyList } from "./list/anyList";
import { VariantValue } from "./value/variantValue";
import { ASTNode } from "@postdfm/ast/astNode";
import { ASTRaws } from "@postdfm/ast/astRaws";
import { ASTType } from "@postdfm/ast/astType";
import { AnyList } from "@postdfm/ast/list/anyList";
import { VariantValue } from "@postdfm/ast/value/variantValue";

interface PropertyRaws extends ASTRaws {
afterName?: string;
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/root.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTNode } from "./astNode";
import { ASTType } from "./astType";
import { DObject } from "./object";
import { ASTNode } from "@postdfm/ast/astNode";
import { ASTType } from "@postdfm/ast/astType";
import { DObject } from "@postdfm/ast/object";

export class Root extends ASTNode {
public child?: DObject;
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/binaryStringValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Value } from "@postdfm/ast/value/value";

export class BinaryStringValue extends Value<string> {
constructor(value?: string) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/booleanValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Value } from "@postdfm/ast/value/value";

export class BooleanValue extends Value<boolean> {
constructor(value: boolean) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/controlString.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { StringValuePart } from "./stringValuePart";
import { ASTType } from "@postdfm/ast/astType";
import { StringValuePart } from "@postdfm/ast/value/stringValuePart";

export class ControlString extends StringValuePart {
constructor(value?: string) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/value/currencyValue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { Float } from "./float";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Float } from "@postdfm/ast/value/float";
import { Value } from "@postdfm/ast/value/value";

export class CurrencyValue extends Value<Float> {
constructor(value?: Float) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/value/dateTimeValue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { Float } from "./float";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Float } from "@postdfm/ast/value/float";
import { Value } from "@postdfm/ast/value/value";

export class DateTimeValue extends Value<Float> {
constructor(value?: Float) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/value/doubleValue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { Float } from "./float";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Float } from "@postdfm/ast/value/float";
import { Value } from "@postdfm/ast/value/value";

export class DoubleValue extends Value<Float> {
constructor(value?: Float) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/hexCodeValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Value } from "@postdfm/ast/value/value";

export class HexCodeValue extends Value<string> {
constructor(value?: string) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/identifierValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Value } from "@postdfm/ast/value/value";

export class IdentifierValue extends Value<string> {
constructor(value: string) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/integerValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Value } from "@postdfm/ast/value/value";

export class IntegerValue extends Value<number> {
constructor(value?: number) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/literalString.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { StringValuePart } from "./stringValuePart";
import { ASTType } from "@postdfm/ast/astType";
import { StringValuePart } from "@postdfm/ast/value/stringValuePart";

export class LiteralString extends StringValuePart {
constructor(value?: string) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/value/singleValue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { Float } from "./float";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Float } from "@postdfm/ast/value/float";
import { Value } from "@postdfm/ast/value/value";

export class SingleValue extends Value<Float> {
constructor(value?: Float) {
Expand Down
6 changes: 3 additions & 3 deletions packages/@postdfm/ast/src/value/stringValue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ASTType } from "../astType";
import { StringValuePart } from "./stringValuePart";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { StringValuePart } from "@postdfm/ast/value/stringValuePart";
import { Value } from "@postdfm/ast/value/value";

export class StringValue extends Value<StringValuePart[]> {
constructor(value?: StringValuePart[]) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/stringValuePart.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTType } from "../astType";
import { Value } from "./value";
import { ASTType } from "@postdfm/ast/astType";
import { Value } from "@postdfm/ast/value/value";

export class StringValuePart extends Value<string> {
constructor(astType: ASTType, value?: string) {
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/ast/src/value/value.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ASTNode } from "../astNode";
import { ASTType } from "../astType";
import { ASTNode } from "@postdfm/ast/astNode";
import { ASTType } from "@postdfm/ast/astType";

export class Value<T> extends ASTNode {
public value: T;
Expand Down
26 changes: 13 additions & 13 deletions packages/@postdfm/ast/src/value/variantValue.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { BinaryStringValue } from "./binaryStringValue";
import { BooleanValue } from "./booleanValue";
import { ControlString } from "./controlString";
import { CurrencyValue } from "./currencyValue";
import { DateTimeValue } from "./dateTimeValue";
import { DoubleValue } from "./doubleValue";
import { HexCodeValue } from "./hexCodeValue";
import { IdentifierValue } from "./identifierValue";
import { IntegerValue } from "./integerValue";
import { LiteralString } from "./literalString";
import { SingleValue } from "./singleValue";
import { StringValue } from "./stringValue";
import { StringValuePart } from "./stringValuePart";
import { BinaryStringValue } from "@postdfm/ast/value/binaryStringValue";
import { BooleanValue } from "@postdfm/ast/value/booleanValue";
import { ControlString } from "@postdfm/ast/value/controlString";
import { CurrencyValue } from "@postdfm/ast/value/currencyValue";
import { DateTimeValue } from "@postdfm/ast/value/dateTimeValue";
import { DoubleValue } from "@postdfm/ast/value/doubleValue";
import { HexCodeValue } from "@postdfm/ast/value/hexCodeValue";
import { IdentifierValue } from "@postdfm/ast/value/identifierValue";
import { IntegerValue } from "@postdfm/ast/value/integerValue";
import { LiteralString } from "@postdfm/ast/value/literalString";
import { SingleValue } from "@postdfm/ast/value/singleValue";
import { StringValue } from "@postdfm/ast/value/stringValue";
import { StringValuePart } from "@postdfm/ast/value/stringValuePart";

export type VariantValue =
| BinaryStringValue
Expand Down
2 changes: 1 addition & 1 deletion packages/@postdfm/ast/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"baseUrl": ".",
"outDir": "dist",
"paths": {
"*": ["./src/*"]
"@postdfm/ast/*": ["./src/*"]
}
},
"include": ["src/**/*"]
Expand Down
2 changes: 1 addition & 1 deletion packages/@postdfm/ast2dfm/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Root } from "@postdfm/ast";
import Stringifier from "./stringifier";
import Stringifier from "@postdfm/ast2dfm/stringifier";

function stringify(ast: Root): string {
const stringifier = new Stringifier();
Expand Down
2 changes: 1 addition & 1 deletion packages/@postdfm/ast2dfm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"baseUrl": ".",
"outDir": "dist",
"paths": {
"*": ["./src/*"]
"@postdfm/ast2dfm/*": ["./src/*"]
}
},
"include": ["src/**/*"]
Expand Down
2 changes: 1 addition & 1 deletion packages/@postdfm/dfm2ast/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { Parser, Grammar } = (<
{ default: { Parser: typeof ParserType; Grammar: typeof GrammarType } }
>(<unknown>nearleyPkg)).default;

import grammar from "./grammar";
import grammar from "@postdfm/dfm2ast/grammar";

function parse(dfm: string): Root {
const parser = new Parser(Grammar.fromCompiled(grammar));
Expand Down
2 changes: 1 addition & 1 deletion packages/@postdfm/dfm2ast/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"baseUrl": ".",
"outDir": "dist",
"paths": {
"*": ["./src/*"]
"@postdfm/dfm2ast/*": ["./src/*"]
}
},
"include": ["src/**/*"]
Expand Down
4 changes: 2 additions & 2 deletions packages/@postdfm/plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { Hooks } from "./hooks";
export { Plugin } from "./plugin";
export { Hooks } from "@postdfm/plugin/hooks";
export { Plugin } from "@postdfm/plugin/plugin";
2 changes: 1 addition & 1 deletion packages/@postdfm/plugin/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Hooks } from "./hooks";
import type { Hooks } from "@postdfm/plugin/hooks";

export abstract class Plugin {
abstract install(hooks: Hooks): void;
Expand Down
2 changes: 1 addition & 1 deletion packages/@postdfm/plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"baseUrl": ".",
"outDir": "dist",
"paths": {
"*": ["./src/*"]
"@postdfm/plugin/*": ["./src/*"]
}
},
"include": ["src/**/*"]
Expand Down
Loading

0 comments on commit 2370ba7

Please sign in to comment.