Skip to content

Latest commit

 

History

History
857 lines (565 loc) · 21.6 KB

CHANGELOG.md

File metadata and controls

857 lines (565 loc) · 21.6 KB

@shopify/theme-check-browser

3.7.1

Patch Changes

  • 841ca6d1: Update repository URL for all packages to be case sensitive
  • Updated dependencies [841ca6d1]

3.7.0

Patch Changes

  • Updated dependencies [c85a6131]
  • Updated dependencies [913d5386]
  • Updated dependencies [931dc9b9]

3.6.1

Patch Changes

3.6.0

Patch Changes

  • Updated dependencies [c74850c8]
  • Updated dependencies [c60e61ba]
  • Updated dependencies [b31e0f85]
  • Updated dependencies [34c2268a]

3.5.0

Patch Changes

  • Updated dependencies [8e909870]
  • Updated dependencies [d7436b4a]
  • Updated dependencies [6f1862c8]
  • Updated dependencies [d01e657b]

3.4.0

Patch Changes

  • Updated dependencies [8912fab8]
  • Updated dependencies [51ec6a7a]

3.3.0

Patch Changes

  • Updated dependencies [05ae5ea8]
  • Updated dependencies [3e69d732]
  • Updated dependencies [26215724]
  • Updated dependencies [73758ba1]
  • Updated dependencies [5e8a2bfe]
  • Updated dependencies [05b928ea]
  • Updated dependencies [1083b2bc]
  • Updated dependencies [a579d59e]
  • Updated dependencies [5a2caaee]
  • Updated dependencies [d2b5942a]

3.2.2

Patch Changes

3.2.1

Patch Changes

3.2.0

Patch Changes

  • Updated dependencies [3f7680e]
  • Updated dependencies [add2445]
  • Updated dependencies [8a0bf78]
  • Updated dependencies [7a6dfe8]
  • Updated dependencies [7317830]
  • Updated dependencies [c4813ff]
  • Updated dependencies [b558bfe]
  • Updated dependencies [9a07208]
  • Updated dependencies [f09c923]

3.1.0

Minor Changes

  • 568d53b: Add the ValidContentForArguments check

Patch Changes

  • Updated dependencies [b431db7]
  • Updated dependencies [568d53b]
  • Updated dependencies [6014dfd]

3.0.0

Major Changes

  • 4b574c1: [Breaking] Replace fs-based dependency injections with AbstractFileSystem injection

    runChecks(theme, {
    - getDefaultTranslations,
    - getDefaultLocale,
    - getDefaultSchemaLocale,
    - getDefaultSchemaTranslations,
    - fileExists,
    - fileSize,
    + fs: new FileSystemImpl(),
      themeDocset,
      jsonValidationSet,
    })

Patch Changes

  • Updated dependencies [4b574c1]
  • Updated dependencies [4b574c1]
  • Updated dependencies [5fab0e9]

2.9.2

Patch Changes

2.9.1

Patch Changes

2.9.0

Patch Changes

  • Updated dependencies [457f9cb]
  • Updated dependencies [edb7f2e]

2.7.0

Patch Changes

2.6.0

Patch Changes

2.5.1

Patch Changes

2.5.0

Minor Changes

  • 03b41e1: Breaking: jsonValidationSet's schemas public API change

    Now takes a function of the following signature:

    interface JsonValidationSet = {
      schemas: (context: 'theme' | 'app') => Promise<SchemaDefinition[]>
    }

    Reason being we want to support fileMatch overloading of blocks/*.liquid files and we needed a way to identify which context you're in.

    Unfortunately, the JSON schema for blocks/*.liquid files in theme app extensions isn't the same one we have in themes. There doesn't seem to be a way to unify them either.

  • 03b41e1: Theme Check Config files now accept the context property

    In your .theme-check.yml files, you can set the context property to theme or app. By default, it's theme. The theme-check:theme-app-extension config sets it to app.

    You shouldn't need to care about this. It's there so we can do contextual things internally.

  • 03b41e1: Add support for the schemas manifest on Shopify/theme-liquid-docs

    Shopify/theme-liquid-docs now supports composable JSON schemas (with relative paths). To solve the blocks/*.liquid file match JSON schema overload depending on the context (app or theme), we defined two manifests that describe the schemas required by your solution and define the fileMatch rules:

    @shopify/theme-check-docs-updater now reads those manifests and downloads the tree of dependency that they require. We will no longer need to make new theme-tools releases whenever we add new schemas. We'll be able to dev them and their file associations directly from Shopify/theme-liquid-docs and have downstream consumers updated automatically (the same way docs are automatically updated).

Patch Changes

  • Updated dependencies [03b41e1]
  • Updated dependencies [03b41e1]
  • Updated dependencies [03b41e1]

2.4.0

Patch Changes

  • Updated dependencies [767d223]
  • Updated dependencies [767d223]

2.3.0

Patch Changes

  • Updated dependencies [8e3c7e2]
  • Updated dependencies [8e3c7e2]
  • Updated dependencies [8e3c7e2]

2.2.2

Patch Changes

2.2.1

Patch Changes

2.2.0

Patch Changes

2.1.0

Minor Changes

  • 042f1e0: Breaking: internal rename of schemaValidators to jsonValidationSet

    This breaks the dependencies' public API (for startServer and runChecks) and requires code changes in those contexts.

Patch Changes

  • Updated dependencies [042f1e0]
  • Updated dependencies [a9ae65f]

2.0.4

Patch Changes

2.0.3

Patch Changes

2.0.2

Patch Changes

  • 617b766: Add parser support for trailing commas at the end of Liquid tags and filters
  • Updated dependencies [0990c47]
  • Updated dependencies [617b766]

2.0.1

Patch Changes

2.0.0

Major Changes

  • 8451075: Theme Check 2.0

    Our official release of the next iteration of Theme Check, the linter for Shopify themes.

    What is is: A TypeScript rewrite of Theme Check.

    But... why? A couple of reasons:

    • To lint Liquid files, we prefer one Abstract Syntax Tree (AST) per file. Not one Liquid AST and one HTML AST.
      • Theme Check Ruby had weird duplicated checks because of that (such as ParserBlockingJavaScript and ParserBlockingScriptTag)
      • For that we reused the @shopify/liquid-html-parser we wrote for the prettier plugin.
      • One tree, two languages.
    • We wanted to run the linter in the Online Store Code Editor and—unlike WASM or WebSockets—there is no overhead or latency cost to running a TypeScript-based Language Server in a Web Worker.
    • Theme developers are Front End developers. If we were to make a Venn diagram, we'd observe that the intersection of Ruby and Theme developers is much smaller than that of JavaScript and Theme developers.
      • This makes the TypeScript codebase easier to contribute to.
      • This makes the plugin ecosystem more accessible (you're more likely to have a package.json file in a theme than a Gemfile).
    • The @shopify/cli was rewritten in TypeScript. This made the Ruby integration very problematic.
      • Windows performance was terrible
      • Installation setup was weird, often problematic and complicated
    • The VS Code extension required a secondary installation step, and thus lost the ability to automatically self-update

    With the move to TypeScript, we believe that it will make it easier for us to ship more robust features faster.

Patch Changes

  • 8451075: package.json and README cleanups
  • Updated dependencies [8451075]
  • Updated dependencies [8451075]

1.22.0

Minor Changes

  • 636895f: Make LiquidHTMLSyntaxError more tolerant to unclosed nodes in branching code
  • aeb9b3f: Add UnclosedHTMLElement check

Patch Changes

  • Updated dependencies [636895f]
  • Updated dependencies [aeb9b3f]

1.21.0

Patch Changes

  • Updated dependencies [772a1ce]
  • Updated dependencies [b05a6a8]

1.20.1

Patch Changes

  • Updated dependencies [79b0549]
  • Updated dependencies [ac1deb4]

1.20.0

Patch Changes

1.19.0

Patch Changes

1.18.2

Patch Changes

  • Updated dependencies [fe54680]
  • Updated dependencies [e00c319]

1.18.1

Patch Changes

  • Updated dependencies [aa33c5f]
  • Updated dependencies [0d71145]

1.18.0

Patch Changes

  • Updated dependencies [96d4d5e]
  • Updated dependencies [dacdd9f]

1.17.0

Minor Changes

  • 2cf7a11: Rename and alias a couple of checks

    • DeprecatedFilters -> DeprecatedFilter
    • DeprecatedTags -> DeprecatedTag
    • Alias LiquidHTMLSyntaxError with SyntaxError and HtmlParsingError
    • Alias ParserBlockingJavaScript with ParserBlockingScriptTag
    • Alias JSONSyntaxError with ValidJson
    • Alias AssetSizeCSS with AssetSizeCSSStylesheetTag
    • Alias RemoteAsset with AssetUrlFilters

Patch Changes

  • Updated dependencies [2cf7a11]
  • Updated dependencies [2cf7a11]

1.16.1

Patch Changes

  • Updated dependencies [8d35241]
  • Updated dependencies [201f30c]
  • Updated dependencies [c0298e7]
  • Updated dependencies [6fad756]
  • Updated dependencies [fc86c91]

1.16.0

Minor Changes

  • 279a464: Add RemoteAsset check

Patch Changes

  • Updated dependencies [279a464]
  • Updated dependencies [d71a5e2]

1.15.0

Patch Changes

  • Updated dependencies [6c2c00f]
  • Updated dependencies [f1a642f]

1.14.1

Patch Changes

1.14.0

Minor Changes

  • a05aebb: Add AssetSizeJavascript check

Patch Changes

  • Updated dependencies [beeb85f]
  • Updated dependencies [a05aebb]

1.13.1

Patch Changes

  • 14b9ee2: Fixup package.json configs
  • Updated dependencies [14b9ee2]

1.13.0

Minor Changes

  • 12c794a: Add DeprecatedTag check

Patch Changes

  • c00e929: Bug fix for AssetSizeCSS: Fixes redundant messages.
  • c00e929: Bug fix for AssetSizeAppBlockCSS: Corrects underlining issues.
  • c00e929: Bug fix for AssetUrlFilters: Reports better messaging.
  • c00e929: Bug fix for AssetSizeAppBlockJavascript: Corrects underlining issues.
  • Updated dependencies [441a8c5]
  • Updated dependencies [c00e929]
  • Updated dependencies [972c26c]
  • Updated dependencies [25b79f0]
  • Updated dependencies [f3cda64]
  • Updated dependencies [b1b8366]
  • Updated dependencies [c00e929]
  • Updated dependencies [c00e929]
  • Updated dependencies [12c794a]
  • Updated dependencies [b1b8366]
  • Updated dependencies [b1b8366]
  • Updated dependencies [c00e929]

1.12.1

Patch Changes

  • Patch bump because it depends on @shopify/prettier-plugin-liquid
  • Updated dependencies
  • Updated dependencies [5479a63]
  • Updated dependencies [5479a63]

1.12.0

Minor Changes

  • 5ba20bd: Fixed bug for AssetUrlFilters check
  • 5ba20bd: Add ContentForHeaderModification check
  • 5ba20bd: Add AssetSizeCSS check
  • 5ba20bd: Add AssetSizeAppBlockJavascript check
  • 5ba20bd: Add AssetSizeAppBlockCSS check

Patch Changes

  • Updated dependencies [5ba20bd]
  • Updated dependencies [5ba20bd]
  • Updated dependencies [5ba20bd]
  • Updated dependencies [5ba20bd]
  • Updated dependencies [5ba20bd]

1.11.1

Patch Changes

  • 2e73166: Fix the DocsetEntry types to better match the theme-liquid-docs json files
  • Updated dependencies [2e73166]

1.11.0

Minor Changes

  • e67a16d: Breaking: Dependency injected json schema validators

Patch Changes

1.10.0

Minor Changes

  • 4db7c7e: Add UnknownFilter check
  • a94f23c: Bump prettier-plugin-liquid to v1.2.1

Patch Changes

  • Updated dependencies [4db7c7e]
  • Updated dependencies [a94f23c]

1.9.0

Minor Changes

  • b3ed3b9: Add ValidSchema check

  • d19500f: Add AppBlockValidTags check

  • 8e76424: Add support for .theme-check.yml config files

    New features:

    • Developers can write their own checks and publish them to npm

      Modules that follow the @scope/theme-check-* or theme-check-* naming conventions are automatically loaded.

      The require property of the configuration file can be used to load checks that do not follow the naming convention.

      See Creating a Theme Check extension for more info.

    • extends can be an array

    • extends can refer to node module dependencies

    • extends also accepts "modern" config identifiers:

      • theme-check:all for all the checks and with default settings
      • theme-check:recommended for the recommended checks and settings
      • theme-check:theme-app-extension for theme app extensions

    Removed features:

    • include_categories: []
    • exclude_categories: []

    Replaced features:

    • require: [] this can be used to load unconventional (or private) theme-check-js checks. Ruby checks are not supported.

    Breaking changes:

    • Custom checks written in Ruby won't work Theme Check in TypeScript

    • The * (star) glob in ignore configurations does not capture the forward slash (/) unless at the end of the pattern.

      Fix: replace * by **.

      This comes from a difference between how minimatch and Ruby handles file globs.

    Extra care has been placed to make the transition as smooth as possible.

  • 3096e53: Add ValidHTMLTranslation check

  • daf5189: Add AssetPreload check

  • 6fb9db9: Add ImgLazyLoading check

Patch Changes

  • Updated dependencies [b3ed3b9]
  • Updated dependencies [d19500f]
  • Updated dependencies [8e76424]
  • Updated dependencies [3096e53]
  • Updated dependencies [daf5189]
  • Updated dependencies [6fb9db9]

1.8.0

Minor Changes

  • 2f0f941: Add MissingAsset check
  • fd3fc3c: Add AssetUrlFilters
  • 5ae97c9: Add PaginationSize check
  • 85cf8f3: Add CdnPreconnect
  • 051aff1: Introduce ThemeDocset and ThemeSchemas dependencies to support core checks

Patch Changes

  • Updated dependencies [2f0f941]
  • Updated dependencies [fd3fc3c]
  • Updated dependencies [5ae97c9]
  • Updated dependencies [85cf8f3]
  • Updated dependencies [051aff1]

1.7.1

Patch Changes

1.7.0

Minor Changes

  • 502bad8: Add documentation URLs to checks

Patch Changes

1.6.0

Minor Changes

  • 9e99728: Add UnusedAssign
  • f99c896: Add LiquidHTMLSyntaxError
  • e0c131a: Add JSONSyntaxError
  • e0c131a: Breaking: SourceCode can take ast: AST[T] | Error, where Error is a parsing error
  • ccd5146: Add DeprecatedLazysizes
  • c715fbe: Add ImgWidthAndHeight
  • 9e99728: Add RequiredLayoutThemeObject
  • edd8925: Add DeprecateBgsizes

Patch Changes

  • 9d3d557: Fix RequiredLayoutThemeObject bugs
  • Updated dependencies [cad8e17]
  • Updated dependencies [9e99728]
  • Updated dependencies [f99c896]
  • Updated dependencies [e0c131a]
  • Updated dependencies [e0c131a]
  • Updated dependencies [ccd5146]
  • Updated dependencies [c715fbe]
  • Updated dependencies [9e99728]
  • Updated dependencies [9d3d557]
  • Updated dependencies [edd8925]

1.5.1

Patch Changes

  • 60c92be: Fix unhandled TranslationKeyExists error
  • Updated dependencies [60c92be]

1.5.0

Minor Changes

  • 71e6b44: Add support for fixes and suggestions

    New: context.report now accepts two new properties:

    • fix: Fixer, accepts a callback that is given a corrector and produces transformations that are deemed safe to apply without confirmation on the initial document.

      type Fixer<S> = (corrector: Corrector<S>) => void;
    • suggest: Suggestion[], accepts an array of Suggestion. Those are like fixes but are not considered safe either because there's multiple ways to fix the problem or because the change requires care.

      type Suggestion<S> = {
        message: String;
        fix: Fixer<S>;
      };

    Example usage:

    // A safe change, add a "TODO" translation key
    context.report({
      message: `The translation for '${path}' is missing`,
      startIndex: closest.loc!.start.offset,
      endIndex: closest.loc!.end.offset,
      fix(corrector) {
        // corrector is inferred to be a JSONCorrector
        corrector.add(path, 'TODO');
      },
    });
    
    // An unsafe change, add `defer` or `async` attributes on the script tag
    context.report({
      message: 'Avoid parser blocking scripts by adding `defer` or `async` on this tag',
      startIndex: node.position.start,
      endIndex: node.position.end,
      suggest: [{
        message: 'Add defer attribute',
        fix: corrector => {
          // corrector is inferred to be a StringCorrector
          corrector.insert(node.blockStartPosition.end, ' defer')
        },
      }, {
        message: 'Add async attribute',
        fix: corrector => {
          // corrector is inferred to be a StringCorrector
          corrector.insert(node.blockStartPosition.end, ' async')
        };
      }],
    })

    Under the hood, corrector calls will be converted into a list of Fix objects.

    One can implement a FixApplicator (a async function that takes a SourceCode and Fix objects) to apply fixes in different contexts.

    • In Node.js, we'll implement a FixApplicator that applies the fixes to the initial file and then save the changes to disk.
    • In the Language Server, we'll implement FixApplicators that turn the Fixes into TextEdit objects.

    New: the top level API now offers the autofix function, one that takes a FixApplicator as argument.

    This autofix function applies all the safe changes (and ignores suggestions).

Patch Changes

1.4.1

Patch Changes

  • a8cda19: Add TranslationKeyExists to allChecks array
  • Updated dependencies [9f8d47f]
  • Updated dependencies [a8cda19]

1.4.0

Minor Changes

  • 9d419ca: Breaking: change dependency get defaultLocale to getDefaultLocale(): Promise<string>

Patch Changes

1.3.0

Minor Changes

  • 72a9330: Breaking: Add defaultLocale dependency
  • 5329963: Breaking: change signature of getDefaultTranslations to return a Promise<Translations>

Patch Changes

  • Updated dependencies [72a9330]
  • Updated dependencies [5329963]
  • Updated dependencies [72a9330]
  • Updated dependencies [5329963]

1.2.0

Patch Changes

  • Updated dependencies [4c099d5]
  • Updated dependencies [4c099d5]

1.1.0

Minor Changes

  • f4a2f27: Simplify public API

    Breaking changes:

    • Theme is SourceCode<S>[] instead of { files: Map<string, SourceCode<S>> }
    • SourceCode no longer has a relativePath property
    • toSourceCode no longer takes a relativePath as argument
    • Config has a root property
  • 37fc98a: Add dependencies to public API

    • fileExists(absolutePath: string): Promise<boolean> returns true when a file exists
    • getDefaultTranslations(): Promise<JSONObject> returns the parsed JSON contents of the default translations file

    These dependencies are now added to the context object and are usable by checks.

    Those exists as a lean way to get rid of the assumptions that all files are in the Theme object. We should be able to go a long way with these.

Patch Changes

  • Updated dependencies [f4a2f27]
  • Updated dependencies [37fc98a]

1.0.1

Patch Changes

  • d206674: Move toSourceCode to common for use in language-server-common
  • Updated dependencies [d206674]

1.0.0

Major Changes

  • 233f00f: Initial release