@skeptools/skep-organization-project 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.jsii +138 -3
  2. package/API.md +137 -44
  3. package/lib/skep-organization-project.js +1 -1
  4. package/node_modules/liquidjs/README.md +29 -17
  5. package/node_modules/liquidjs/dist/context/context.d.ts +13 -4
  6. package/node_modules/liquidjs/dist/drop/blank-drop.d.ts +1 -0
  7. package/node_modules/liquidjs/dist/drop/drop.d.ts +1 -1
  8. package/node_modules/liquidjs/dist/drop/empty-drop.d.ts +1 -0
  9. package/node_modules/liquidjs/dist/filters/array.d.ts +14 -14
  10. package/node_modules/liquidjs/dist/filters/html.d.ts +6 -5
  11. package/node_modules/liquidjs/dist/filters/math.d.ts +9 -9
  12. package/node_modules/liquidjs/dist/filters/string.d.ts +22 -21
  13. package/node_modules/liquidjs/dist/fs/map-fs.d.ts +13 -0
  14. package/node_modules/liquidjs/dist/fs/node-require.d.ts +1 -2
  15. package/node_modules/liquidjs/dist/index.d.ts +3 -3
  16. package/node_modules/liquidjs/dist/liquid-options.d.ts +30 -2
  17. package/node_modules/liquidjs/dist/liquid.browser.min.js +1 -1
  18. package/node_modules/liquidjs/dist/liquid.browser.min.js.map +1 -1
  19. package/node_modules/liquidjs/dist/{liquid.browser.esm.js → liquid.browser.mjs} +1147 -264
  20. package/node_modules/liquidjs/dist/liquid.browser.umd.js +2072 -478
  21. package/node_modules/liquidjs/dist/liquid.browser.umd.js.map +1 -1
  22. package/node_modules/liquidjs/dist/liquid.d.ts +32 -1
  23. package/node_modules/liquidjs/dist/{liquid.node.cjs.js → liquid.node.js} +1123 -264
  24. package/node_modules/liquidjs/dist/{liquid.node.esm.js → liquid.node.mjs} +1152 -265
  25. package/node_modules/liquidjs/dist/parser/parser.d.ts +1 -0
  26. package/node_modules/liquidjs/dist/parser/parser.spec.d.ts +1 -0
  27. package/node_modules/liquidjs/dist/parser/tokenizer.d.ts +4 -3
  28. package/node_modules/liquidjs/dist/render/expression.d.ts +1 -1
  29. package/node_modules/liquidjs/dist/render/operator.d.ts +1 -0
  30. package/node_modules/liquidjs/dist/tags/assign.d.ts +5 -0
  31. package/node_modules/liquidjs/dist/tags/block.d.ts +4 -1
  32. package/node_modules/liquidjs/dist/tags/break.d.ts +1 -1
  33. package/node_modules/liquidjs/dist/tags/capture.d.ts +7 -2
  34. package/node_modules/liquidjs/dist/tags/case.d.ts +5 -1
  35. package/node_modules/liquidjs/dist/tags/continue.d.ts +1 -1
  36. package/node_modules/liquidjs/dist/tags/cycle.d.ts +2 -0
  37. package/node_modules/liquidjs/dist/tags/decrement.d.ts +3 -0
  38. package/node_modules/liquidjs/dist/tags/echo.d.ts +2 -0
  39. package/node_modules/liquidjs/dist/tags/for.d.ts +6 -1
  40. package/node_modules/liquidjs/dist/tags/if.d.ts +6 -2
  41. package/node_modules/liquidjs/dist/tags/include.d.ts +7 -2
  42. package/node_modules/liquidjs/dist/tags/increment.d.ts +3 -0
  43. package/node_modules/liquidjs/dist/tags/layout.d.ts +6 -1
  44. package/node_modules/liquidjs/dist/tags/liquid.d.ts +3 -1
  45. package/node_modules/liquidjs/dist/tags/render.d.ts +7 -2
  46. package/node_modules/liquidjs/dist/tags/tablerow.d.ts +6 -1
  47. package/node_modules/liquidjs/dist/tags/unless.d.ts +5 -1
  48. package/node_modules/liquidjs/dist/template/analysis.d.ts +85 -0
  49. package/node_modules/liquidjs/dist/template/analysis.spec.d.ts +1 -0
  50. package/node_modules/liquidjs/dist/template/filter-impl-options.d.ts +2 -0
  51. package/node_modules/liquidjs/dist/template/filter.d.ts +3 -1
  52. package/node_modules/liquidjs/dist/template/hash.d.ts +2 -1
  53. package/node_modules/liquidjs/dist/template/index.d.ts +1 -0
  54. package/node_modules/liquidjs/dist/template/output.d.ts +2 -1
  55. package/node_modules/liquidjs/dist/template/tag.d.ts +2 -2
  56. package/node_modules/liquidjs/dist/template/template.d.ts +29 -0
  57. package/node_modules/liquidjs/dist/tokens/identifier-token.d.ts +0 -1
  58. package/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts +1 -1
  59. package/node_modules/liquidjs/dist/util/assert.d.ts +1 -0
  60. package/node_modules/liquidjs/dist/util/error.d.ts +7 -2
  61. package/node_modules/liquidjs/dist/util/error.spec.d.ts +1 -0
  62. package/node_modules/liquidjs/dist/util/index.d.ts +2 -1
  63. package/node_modules/liquidjs/dist/util/intl.d.ts +6 -0
  64. package/node_modules/liquidjs/dist/util/limiter.d.ts +8 -0
  65. package/node_modules/liquidjs/dist/util/liquid-date.d.ts +39 -7
  66. package/node_modules/liquidjs/dist/util/liquid-date.spec.d.ts +1 -0
  67. package/node_modules/liquidjs/dist/util/performance.d.ts +5 -0
  68. package/node_modules/liquidjs/dist/util/performance.spec.d.ts +1 -0
  69. package/node_modules/liquidjs/dist/util/type-guards.d.ts +2 -1
  70. package/node_modules/liquidjs/dist/util/type-guards.spec.d.ts +1 -0
  71. package/node_modules/liquidjs/dist/util/underscore.d.ts +5 -1
  72. package/node_modules/liquidjs/package.json +11 -7
  73. package/package.json +17 -13
  74. package/node_modules/liquidjs/dist/util/timezone-date.d.ts +0 -44
  75. /package/node_modules/liquidjs/dist/{util/timezone-date.spec.d.ts → fs/map-fs.spec.d.ts} +0 -0
@@ -9,6 +9,7 @@ export declare class Parser {
9
9
  private fs;
10
10
  private cache?;
11
11
  private loader;
12
+ private parseLimit;
12
13
  constructor(liquid: Liquid);
13
14
  parse(html: string, filepath?: string): Template[];
14
15
  parseTokens(tokens: TopLevelToken[]): Template[];
@@ -0,0 +1 @@
1
+ export {};
@@ -23,7 +23,7 @@ export declare class Tokenizer {
23
23
  readTopLevelTokens(options?: NormalizedFullOptions): TopLevelToken[];
24
24
  readTopLevelToken(options: NormalizedFullOptions): TopLevelToken;
25
25
  readHTMLToken(stopStrings: string[]): HTMLToken;
26
- readTagToken(options?: NormalizedFullOptions): TagToken;
26
+ readTagToken(options: NormalizedFullOptions): TagToken;
27
27
  readToDelimiter(delimiter: string, respectQuoted?: boolean): number;
28
28
  readOutputToken(options?: NormalizedFullOptions): OutputToken;
29
29
  readEndrawOrRawContent(options: NormalizedFullOptions): HTMLToken | TagToken;
@@ -39,11 +39,12 @@ export declare class Tokenizer {
39
39
  readIdentifier(): IdentifierToken;
40
40
  readNonEmptyIdentifier(): IdentifierToken | undefined;
41
41
  readTagName(): string;
42
- readHashes(jekyllStyle?: boolean): HashToken[];
43
- readHash(jekyllStyle?: boolean): HashToken | undefined;
42
+ readHashes(jekyllStyle?: boolean | string): HashToken[];
43
+ readHash(jekyllStyle?: boolean | string): HashToken | undefined;
44
44
  remaining(): string;
45
45
  advance(step?: number): void;
46
46
  end(): boolean;
47
+ read(): string;
47
48
  readTo(end: string): number;
48
49
  readValue(): ValueToken | undefined;
49
50
  readScopeValue(): ValueToken | undefined;
@@ -1,7 +1,7 @@
1
1
  import { QuotedToken, Token } from '../tokens';
2
2
  import type { Context } from '../context';
3
3
  export declare class Expression {
4
- private postfix;
4
+ readonly postfix: Token[];
5
5
  constructor(tokens: IterableIterator<Token>);
6
6
  evaluate(ctx: Context, lenient?: boolean): Generator<unknown, unknown, unknown>;
7
7
  valid(): boolean;
@@ -5,3 +5,4 @@ export type OperatorHandler = UnaryOperatorHandler | BinaryOperatorHandler;
5
5
  export type Operators = Record<string, OperatorHandler>;
6
6
  export declare const defaultOperators: Operators;
7
7
  export declare function equals(lhs: any, rhs: any): boolean;
8
+ export declare function arrayIncludes(arr: any[], item: any): boolean;
@@ -1,7 +1,12 @@
1
1
  import { Liquid, TopLevelToken, TagToken, Context, Tag } from '..';
2
+ import { Arguments } from '../template';
3
+ import { IdentifierToken } from '../tokens';
2
4
  export default class extends Tag {
3
5
  private key;
4
6
  private value;
7
+ private identifier;
5
8
  constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
6
9
  render(ctx: Context): Generator<unknown, void, unknown>;
10
+ arguments(): Arguments;
11
+ localScope(): Iterable<IdentifierToken>;
7
12
  }
@@ -1,8 +1,11 @@
1
1
  import { Liquid, TagToken, TopLevelToken, Template, Context, Emitter, Tag } from '..';
2
+ import { Parser } from '../parser';
2
3
  export default class extends Tag {
3
4
  block: string;
4
5
  templates: Template[];
5
- constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
6
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
6
7
  render(ctx: Context, emitter: Emitter): Generator<any, void, unknown>;
7
8
  private getBlockRender;
9
+ children(): Generator<unknown, Template[]>;
10
+ blockScope(): Iterable<string>;
8
11
  }
@@ -1,4 +1,4 @@
1
1
  import { Context, Emitter, Tag } from '..';
2
2
  export default class extends Tag {
3
- render(ctx: Context, emitter: Emitter): void;
3
+ render(ctx: Context, _emitter: Emitter): void;
4
4
  }
@@ -1,8 +1,13 @@
1
1
  import { Liquid, Tag, Template, Context, TagToken, TopLevelToken } from '..';
2
+ import { Parser } from '../parser';
3
+ import { IdentifierToken, QuotedToken } from '../tokens';
2
4
  export default class extends Tag {
5
+ identifier: IdentifierToken | QuotedToken;
3
6
  variable: string;
4
7
  templates: Template[];
5
- constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
8
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
9
+ private readVariable;
6
10
  render(ctx: Context): Generator<unknown, void, string>;
7
- private readVariableName;
11
+ children(): Generator<unknown, Template[]>;
12
+ localScope(): Iterable<string | IdentifierToken | QuotedToken>;
8
13
  }
@@ -1,4 +1,6 @@
1
1
  import { ValueToken, Liquid, Value, Emitter, TagToken, TopLevelToken, Context, Template, Tag } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
2
4
  export default class extends Tag {
3
5
  value: Value;
4
6
  branches: {
@@ -6,6 +8,8 @@ export default class extends Tag {
6
8
  templates: Template[];
7
9
  }[];
8
10
  elseTemplates: Template[];
9
- constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
11
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
10
12
  render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
13
+ arguments(): Arguments;
14
+ children(): Generator<unknown, Template[]>;
11
15
  }
@@ -1,4 +1,4 @@
1
1
  import { Tag, Emitter, Context } from '..';
2
2
  export default class extends Tag {
3
- render(ctx: Context, emitter: Emitter): void;
3
+ render(ctx: Context, _emitter: Emitter): void;
4
4
  }
@@ -1,7 +1,9 @@
1
1
  import { TopLevelToken, Liquid, Emitter, TagToken, Context, Tag } from '..';
2
+ import { Arguments } from '../template';
2
3
  export default class extends Tag {
3
4
  private candidates;
4
5
  private group?;
5
6
  constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
6
7
  render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
8
+ arguments(): Arguments;
7
9
  }
@@ -1,6 +1,9 @@
1
1
  import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..';
2
+ import { IdentifierToken } from '../tokens';
2
3
  export default class extends Tag {
4
+ private identifier;
3
5
  private variable;
4
6
  constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
5
7
  render(context: Context, emitter: Emitter): void;
8
+ localScope(): Iterable<string | IdentifierToken>;
6
9
  }
@@ -1,6 +1,8 @@
1
1
  import { Liquid, TopLevelToken, Emitter, TagToken, Context, Tag } from '..';
2
+ import { Arguments } from '../template';
2
3
  export default class extends Tag {
3
4
  private value?;
4
5
  constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
5
6
  render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
7
+ arguments(): Arguments;
6
8
  }
@@ -1,10 +1,15 @@
1
1
  import { Hash, ValueToken, Liquid, Tag, Emitter, TagToken, TopLevelToken, Context, Template } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
2
4
  export default class extends Tag {
3
5
  variable: string;
4
6
  collection: ValueToken;
5
7
  hash: Hash;
6
8
  templates: Template[];
7
9
  elseTemplates: Template[];
8
- constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
10
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
9
11
  render(ctx: Context, emitter: Emitter): Generator<unknown, void | string, Template[]>;
12
+ children(): Generator<unknown, Template[]>;
13
+ arguments(): Arguments;
14
+ blockScope(): Iterable<string>;
10
15
  }
@@ -1,10 +1,14 @@
1
1
  import { Liquid, Tag, Value, Emitter, TagToken, TopLevelToken, Context, Template } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
2
4
  export default class extends Tag {
3
5
  branches: {
4
6
  value: Value;
5
7
  templates: Template[];
6
8
  }[];
7
- elseTemplates: Template[];
8
- constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
9
+ elseTemplates: Template[] | undefined;
10
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
9
11
  render(ctx: Context, emitter: Emitter): Generator<unknown, void, string>;
12
+ children(): Generator<unknown, Template[]>;
13
+ arguments(): Arguments;
10
14
  }
@@ -1,7 +1,12 @@
1
- import { TopLevelToken, Liquid, Tag, Emitter, TagToken, Context } from '..';
1
+ import { Template, TopLevelToken, Liquid, Tag, Emitter, TagToken, Context } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments, PartialScope } from '../template';
2
4
  export default class extends Tag {
3
5
  private withVar?;
4
6
  private hash;
5
- constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
7
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
6
8
  render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
9
+ children(partials: boolean, sync: boolean): Generator<unknown, Template[]>;
10
+ partialScope(): PartialScope | undefined;
11
+ arguments(): Arguments;
7
12
  }
@@ -1,6 +1,9 @@
1
1
  import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..';
2
+ import { IdentifierToken } from '../tokens';
2
3
  export default class extends Tag {
4
+ private identifier;
3
5
  private variable;
4
6
  constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
5
7
  render(context: Context, emitter: Emitter): void;
8
+ localScope(): Iterable<string | IdentifierToken>;
6
9
  }
@@ -1,9 +1,14 @@
1
1
  import { Template, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context } from '..';
2
2
  import { ParsedFileName } from './render';
3
+ import { Parser } from '../parser';
4
+ import { Arguments, PartialScope } from '../template';
3
5
  export default class extends Tag {
4
6
  args: Hash;
5
7
  templates: Template[];
6
8
  file?: ParsedFileName;
7
- constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
9
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
8
10
  render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
11
+ children(partials: boolean): Generator<unknown, Template[]>;
12
+ arguments(): Arguments;
13
+ partialScope(): PartialScope | undefined;
9
14
  }
@@ -1,6 +1,8 @@
1
1
  import { Template, Emitter, Liquid, TopLevelToken, TagToken, Context, Tag } from '..';
2
+ import { Parser } from '../parser';
2
3
  export default class extends Tag {
3
4
  templates: Template[];
4
- constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
5
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
5
6
  render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
7
+ children(): Generator<unknown, Template[]>;
6
8
  }
@@ -1,11 +1,16 @@
1
1
  import { TopLevelToken, Liquid, Token, Template, Tokenizer, Emitter, TagToken, Context, Tag } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments, PartialScope } from '../template';
2
4
  export type ParsedFileName = Template[] | Token | string | undefined;
3
5
  export default class extends Tag {
4
6
  private file;
5
7
  private currentFile?;
6
8
  private hash;
7
- constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
9
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
8
10
  render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
11
+ children(partials: boolean, sync: boolean): Generator<unknown, Template[]>;
12
+ partialScope(): PartialScope | undefined;
13
+ arguments(): Arguments;
9
14
  }
10
15
  /**
11
16
  * @return null for "none",
@@ -13,5 +18,5 @@ export default class extends Tag {
13
18
  * @return Token for expression (not quoted)
14
19
  * @throws TypeError if cannot read next token
15
20
  */
16
- export declare function parseFilePath(tokenizer: Tokenizer, liquid: Liquid): ParsedFileName;
21
+ export declare function parseFilePath(tokenizer: Tokenizer, liquid: Liquid, parser: Parser): ParsedFileName;
17
22
  export declare function renderFilePath(file: ParsedFileName, ctx: Context, liquid: Liquid): IterableIterator<unknown>;
@@ -1,9 +1,14 @@
1
1
  import { ValueToken, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context, Template } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
2
4
  export default class extends Tag {
3
5
  variable: string;
4
6
  args: Hash;
5
7
  templates: Template[];
6
8
  collection: ValueToken;
7
- constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
9
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
8
10
  render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
11
+ children(): Generator<unknown, Template[]>;
12
+ arguments(): Arguments;
13
+ blockScope(): string[];
9
14
  }
@@ -1,4 +1,6 @@
1
1
  import { Liquid, Tag, Value, TopLevelToken, Template, Emitter, Context, TagToken } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
2
4
  export default class extends Tag {
3
5
  branches: {
4
6
  value: Value;
@@ -6,6 +8,8 @@ export default class extends Tag {
6
8
  templates: Template[];
7
9
  }[];
8
10
  elseTemplates: Template[];
9
- constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
11
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
10
12
  render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
13
+ children(): Generator<unknown, Template[]>;
14
+ arguments(): Arguments;
11
15
  }
@@ -0,0 +1,85 @@
1
+ import { Template } from '.';
2
+ /**
3
+ * Row, column and file name where a variable was found.
4
+ */
5
+ export interface VariableLocation {
6
+ row: number;
7
+ col: number;
8
+ file?: string;
9
+ }
10
+ /**
11
+ * A variable's segments as an array, possibly with nested arrays of segments.
12
+ */
13
+ export type SegmentArray = Array<string | number | SegmentArray>;
14
+ /**
15
+ * A variable's segments and location, which can be coerced to a string.
16
+ */
17
+ export declare class Variable {
18
+ readonly segments: Array<string | number | Variable>;
19
+ readonly location: VariableLocation;
20
+ constructor(segments: Array<string | number | Variable>, location: VariableLocation);
21
+ toString(): string;
22
+ /** Return this variable's segments as an array, possibly with nested arrays for nested paths. */
23
+ toArray(): SegmentArray;
24
+ }
25
+ /**
26
+ * Property names and array indexes that make up a path to a variable.
27
+ */
28
+ export type VariableSegments = Array<string | number | Variable>;
29
+ /**
30
+ * A mapping of variable names to an array of locations at which the variable was found.
31
+ */
32
+ export type Variables = {
33
+ [key: string]: Variable[];
34
+ };
35
+ /**
36
+ * Group variables by the string representation of their root segment.
37
+ */
38
+ export declare class VariableMap {
39
+ private map;
40
+ constructor();
41
+ get(key: Variable): Variable[];
42
+ has(key: Variable): boolean;
43
+ push(variable: Variable): void;
44
+ asObject(): Variables;
45
+ }
46
+ /**
47
+ * The result of calling `analyze()` or `analyzeSync()`.
48
+ */
49
+ export interface StaticAnalysis {
50
+ /**
51
+ * All variables, whether they are in scope or not. Including references to names
52
+ * such as `forloop` from the `for` tag.
53
+ */
54
+ variables: Variables;
55
+ /**
56
+ * Variables that are not in scope. These could be a "global" variables that are
57
+ * expected to be provided by the application developer, or possible mistakes
58
+ * from the template author.
59
+ *
60
+ * If a variable is referenced before and after assignment, you should expect
61
+ * that variable to be included in `globals`, `variables` and `locals`, each with
62
+ * a different location.
63
+ */
64
+ globals: Variables;
65
+ /**
66
+ * Template variables that are added to the template local scope using tags like
67
+ * `assign`, `capture` or `increment`.
68
+ */
69
+ locals: Variables;
70
+ }
71
+ export interface StaticAnalysisOptions {
72
+ /**
73
+ * When `true` (the default), try to load partial templates and analyze them too.
74
+ */
75
+ partials?: boolean;
76
+ }
77
+ export declare const defaultStaticAnalysisOptions: StaticAnalysisOptions;
78
+ /**
79
+ * Statically analyze a template and report variable usage.
80
+ */
81
+ export declare function analyze(template: Template[], options?: StaticAnalysisOptions): Promise<StaticAnalysis>;
82
+ /**
83
+ * Statically analyze a template and report variable usage.
84
+ */
85
+ export declare function analyzeSync(template: Template[], options?: StaticAnalysisOptions): StaticAnalysis;
@@ -1,7 +1,9 @@
1
1
  import type { Context } from '../context';
2
2
  import type { Liquid } from '../liquid';
3
+ import type { FilterToken } from '../tokens';
3
4
  export interface FilterImpl {
4
5
  context: Context;
6
+ token: FilterToken;
5
7
  liquid: Liquid;
6
8
  }
7
9
  export type FilterHandler = (this: FilterImpl, value: any, ...args: any[]) => any;
@@ -2,12 +2,14 @@ import { Context } from '../context';
2
2
  import { FilterImplOptions } from './filter-impl-options';
3
3
  import { FilterArg } from '../parser/filter-arg';
4
4
  import { Liquid } from '../liquid';
5
+ import { FilterToken } from '../tokens';
5
6
  export declare class Filter {
6
7
  name: string;
7
8
  args: FilterArg[];
8
9
  readonly raw: boolean;
9
10
  private handler;
10
11
  private liquid;
11
- constructor(name: string, options: FilterImplOptions | undefined, args: FilterArg[], liquid: Liquid);
12
+ private token;
13
+ constructor(token: FilterToken, options: FilterImplOptions | undefined, liquid: Liquid);
12
14
  render(value: any, context: Context): IterableIterator<unknown>;
13
15
  }
@@ -1,4 +1,5 @@
1
1
  import { Context } from '../context/context';
2
+ import { Tokenizer } from '../parser/tokenizer';
2
3
  import { Token } from '../tokens/token';
3
4
  type HashValueTokens = Record<string, Token | undefined>;
4
5
  /**
@@ -11,7 +12,7 @@ type HashValueTokens = Record<string, Token | undefined>;
11
12
  */
12
13
  export declare class Hash {
13
14
  hash: HashValueTokens;
14
- constructor(markup: string, jekyllStyle?: boolean);
15
+ constructor(input: string | Tokenizer, jekyllStyle?: boolean | string);
15
16
  render(ctx: Context): Generator<unknown, Record<string, any>, unknown>;
16
17
  }
17
18
  export {};
@@ -8,3 +8,4 @@ export * from './hash';
8
8
  export * from './value';
9
9
  export * from './output';
10
10
  export * from './html';
11
+ export * from './analysis';
@@ -1,5 +1,5 @@
1
1
  import { Value } from './value';
2
- import { Template, TemplateImpl } from '../template';
2
+ import { Arguments, Template, TemplateImpl } from '../template';
3
3
  import { Context } from '../context/context';
4
4
  import { Emitter } from '../emitters/emitter';
5
5
  import { OutputToken } from '../tokens/output-token';
@@ -8,4 +8,5 @@ export declare class Output extends TemplateImpl<OutputToken> implements Templat
8
8
  value: Value;
9
9
  constructor(token: OutputToken, liquid: Liquid);
10
10
  render(ctx: Context, emitter: Emitter): IterableIterator<unknown>;
11
+ arguments(): Arguments;
11
12
  }
@@ -1,6 +1,6 @@
1
1
  import { TemplateImpl } from './template-impl';
2
2
  import type { Emitter } from '../emitters/emitter';
3
- import type { Tokenizer } from '../parser';
3
+ import type { Parser, Tokenizer } from '../parser';
4
4
  import type { Context } from '../context/context';
5
5
  import type { TopLevelToken, TagToken } from '../tokens';
6
6
  import type { Template } from './template';
@@ -14,5 +14,5 @@ export declare abstract class Tag extends TemplateImpl<TagToken> implements Temp
14
14
  abstract render(ctx: Context, emitter: Emitter): TagRenderReturn;
15
15
  }
16
16
  export interface TagClass {
17
- new (token: TagToken, tokens: TopLevelToken[], liquid: Liquid): Tag;
17
+ new (token: TagToken, tokens: TopLevelToken[], liquid: Liquid, parser: Parser): Tag;
18
18
  }
@@ -1,7 +1,36 @@
1
1
  import { Context } from '../context/context';
2
2
  import { Token } from '../tokens/token';
3
3
  import { Emitter } from '../emitters/emitter';
4
+ import { IdentifierToken, QuotedToken, ValueToken } from '../tokens';
5
+ import { Value } from './value';
6
+ export type Argument = Value | ValueToken;
7
+ export type Arguments = Iterable<Argument>;
8
+ /** Scope information used when analyzing partial templates. */
9
+ export interface PartialScope {
10
+ /**
11
+ * The name of the partial template. We need this to make sure we only analyze
12
+ * each template once.
13
+ * */
14
+ name: string;
15
+ /**
16
+ * If `true`, names in `scope` will be added to a new, isolated scope before
17
+ * analyzing any child templates, without access to the parent template's scope.
18
+ */
19
+ isolated: boolean;
20
+ /**
21
+ * A list of names that will be in scope for the child template.
22
+ *
23
+ * If an item is a [string, Argument] tuple, the string is considered an alias
24
+ * for the argument.
25
+ */
26
+ scope: Iterable<string | [string, Argument]>;
27
+ }
4
28
  export interface Template {
5
29
  token: Token;
6
30
  render(ctx: Context, emitter: Emitter): any;
31
+ children?(partials: boolean, sync: boolean): Generator<unknown, Template[]>;
32
+ arguments?(): Arguments;
33
+ blockScope?(): Iterable<string>;
34
+ localScope?(): Iterable<IdentifierToken | QuotedToken>;
35
+ partialScope?(): PartialScope | undefined;
7
36
  }
@@ -6,5 +6,4 @@ export declare class IdentifierToken extends Token {
6
6
  file?: string | undefined;
7
7
  content: string;
8
8
  constructor(input: string, begin: number, end: number, file?: string | undefined);
9
- isNumber(allowSign?: boolean): boolean;
10
9
  }
@@ -6,7 +6,7 @@ import { Tokenizer } from '../parser';
6
6
  */
7
7
  export declare class LiquidTagToken extends DelimitedToken {
8
8
  name: string;
9
- args: string;
10
9
  tokenizer: Tokenizer;
11
10
  constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string);
11
+ get args(): string;
12
12
  }
@@ -1 +1,2 @@
1
1
  export declare function assert<T>(predicate: T | null | undefined, message?: string | (() => string)): void;
2
+ export declare function assertEmpty<T>(predicate: T | null | undefined, message?: string): void;
@@ -1,9 +1,9 @@
1
1
  import { Token } from '../tokens/token';
2
2
  import { Template } from '../template/template';
3
3
  export declare abstract class LiquidError extends Error {
4
- private token;
4
+ token: Token;
5
5
  context: string;
6
- private originalError?;
6
+ originalError?: Error;
7
7
  constructor(err: Error | string, token: Token);
8
8
  protected update(): void;
9
9
  static is(obj: unknown): obj is LiquidError;
@@ -18,6 +18,11 @@ export declare class RenderError extends LiquidError {
18
18
  constructor(err: Error, tpl: Template);
19
19
  static is(obj: any): obj is RenderError;
20
20
  }
21
+ export declare class LiquidErrors extends LiquidError {
22
+ errors: RenderError[];
23
+ constructor(errors: RenderError[]);
24
+ static is(obj: any): obj is LiquidErrors;
25
+ }
21
26
  export declare class UndefinedVariableError extends LiquidError {
22
27
  constructor(err: Error, token: Token);
23
28
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -8,4 +8,5 @@ export * from './type-guards';
8
8
  export * from './async';
9
9
  export * from './strftime';
10
10
  export * from './liquid-date';
11
- export * from './timezone-date';
11
+ export * from './limiter';
12
+ export * from './intl';
@@ -0,0 +1,6 @@
1
+ export declare function getDateTimeFormat(): {
2
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): Intl.DateTimeFormat;
3
+ new (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): Intl.DateTimeFormat;
4
+ supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions | undefined): string[];
5
+ readonly prototype: Intl.DateTimeFormat;
6
+ } | undefined;
@@ -0,0 +1,8 @@
1
+ export declare class Limiter {
2
+ private message;
3
+ private base;
4
+ private limit;
5
+ constructor(resource: string, limit: number);
6
+ use(count: number): void;
7
+ check(count: number): void;
8
+ }