├── .gitignore ├── .gitmodules ├── .npmrc ├── .nvmrc ├── .prettierignore ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── assets ├── discord-logo.png ├── github-banner-center.gif ├── logo-white-bg.png ├── logo-white.png └── logo.png ├── build.sh ├── configs ├── eslint-config │ ├── LICENSE │ ├── changelog.md │ ├── index.d.ts │ ├── index.mjs │ ├── package.json │ ├── pnpm-lock.yaml │ └── readme.md ├── prettier-config │ ├── .gitignore │ ├── .npmignore │ ├── .npmrc │ ├── .vscode │ │ └── settings.json │ ├── LICENSE │ ├── index.js │ ├── package.json │ ├── pnpm-lock.yaml │ └── readme.md ├── stylelint-config │ ├── .npmignore │ ├── changelog.md │ ├── package.json │ ├── readme.md │ └── stylelint.cjs └── tsconfig │ ├── package.json │ ├── pnpm-lock.yaml │ ├── readme.md │ └── tsconfig.json ├── docs ├── .gitignore ├── .liquidrc.json ├── LICENCE ├── netlify.toml ├── package.json ├── readme.md ├── scripts │ ├── eleventy.cjs │ ├── plugins.cjs │ ├── postcss.config.cjs │ ├── rollup.config.mjs │ └── theme.json ├── src │ ├── app │ │ ├── bundle.ts │ │ ├── components │ │ │ ├── drawer.ts │ │ │ ├── tabs.ts │ │ │ └── video.ts │ │ ├── functions │ │ │ ├── license.ts │ │ │ └── stores.ts │ │ ├── playground │ │ │ ├── editor │ │ │ │ ├── layout.ts │ │ │ │ └── rules.ts │ │ │ ├── index.ts │ │ │ ├── model │ │ │ │ ├── actions.ts │ │ │ │ ├── state.ts │ │ │ │ └── types.ts │ │ │ └── samples │ │ │ │ ├── html │ │ │ │ ├── attribute-sorting.ts │ │ │ │ ├── comment-ignores.ts │ │ │ │ ├── html5-doctype.ts │ │ │ │ └── json-ld-sample.ts │ │ │ │ ├── javascript │ │ │ │ ├── arrays-and-objects.ts │ │ │ │ ├── block-comments.ts │ │ │ │ ├── condition-samples.ts │ │ │ │ ├── functions-and-promises.ts │ │ │ │ ├── js-with-liquid.ts │ │ │ │ ├── jsx-sample.ts │ │ │ │ ├── object-sorting.ts │ │ │ │ └── variables-and-methods.ts │ │ │ │ ├── json.ts │ │ │ │ ├── liquid │ │ │ │ ├── eleventy-sample.ts │ │ │ │ ├── embedded-languages.ts │ │ │ │ ├── frontmatter.ts │ │ │ │ ├── jekyll-sample.ts │ │ │ │ ├── script-with-liquid.ts │ │ │ │ ├── shopify-sample.ts │ │ │ │ ├── shopify-section.ts │ │ │ │ └── style-with-liquid.ts │ │ │ │ ├── markup.ts │ │ │ │ ├── schema.ts │ │ │ │ ├── script.ts │ │ │ │ ├── style.ts │ │ │ │ ├── styles │ │ │ │ ├── liquid-in-css.ts │ │ │ │ ├── liquid-in-scss.ts │ │ │ │ ├── mixins-sample.ts │ │ │ │ ├── properties-and-classes.ts │ │ │ │ ├── sass-functions.ts │ │ │ │ └── sass-variables.ts │ │ │ │ └── typescript │ │ │ │ ├── declaration-sample.ts │ │ │ │ ├── decorators.ts │ │ │ │ ├── interface-sample.ts │ │ │ │ ├── iterators-and-generators.ts │ │ │ │ └── tsx-sample.ts │ │ └── utilities │ │ │ ├── helpers.ts │ │ │ └── native.ts │ ├── assets │ │ ├── image │ │ │ ├── avatar.svg │ │ │ └── logo-white.png │ │ └── svg │ │ │ ├── avatar.svg │ │ │ ├── checked.svg │ │ │ ├── chevron-down.svg │ │ │ ├── chevron-right.svg │ │ │ ├── corner-left.svg │ │ │ ├── cross.svg │ │ │ ├── editor.svg │ │ │ ├── esthetic.svg │ │ │ ├── github.svg │ │ │ ├── layout.svg │ │ │ ├── logo.svg │ │ │ ├── minus-square.svg │ │ │ ├── moloko.svg │ │ │ ├── plus-square.svg │ │ │ ├── plus.svg │ │ │ ├── split.svg │ │ │ └── unchecked.svg │ ├── data │ │ └── navigation.json │ ├── sass │ │ ├── playground │ │ │ └── prism.scss │ │ ├── styles │ │ │ ├── accordion.scss │ │ │ ├── blocks.scss │ │ │ ├── code.scss │ │ │ ├── drawer.scss │ │ │ ├── editor.scss │ │ │ ├── hero.scss │ │ │ ├── json-tree.scss │ │ │ ├── landing.scss │ │ │ ├── overwrites.scss │ │ │ ├── playground.scss │ │ │ ├── session.scss │ │ │ ├── sidebar.scss │ │ │ ├── stripe.scss │ │ │ ├── svg.scss │ │ │ └── tabs.scss │ │ └── stylesheet.scss │ └── site │ │ ├── documentation │ │ ├── advanced │ │ │ ├── comparison.md │ │ │ ├── contributing.md │ │ │ ├── limitations.md │ │ │ ├── logos.md │ │ │ ├── roadmap.md │ │ │ └── schemas.md │ │ ├── licensing │ │ │ ├── features.md │ │ │ ├── legal.md │ │ │ ├── payment.md │ │ │ ├── pricing.md │ │ │ └── thankyou.md │ │ ├── liquify │ │ │ ├── capabilities │ │ │ │ ├── codelens.md │ │ │ │ ├── completions.md │ │ │ │ ├── embedded-languages.md │ │ │ │ ├── formatting.md │ │ │ │ ├── hovers.md │ │ │ │ ├── signatures.md │ │ │ │ ├── syntax-highlighting.md │ │ │ │ ├── validations.md │ │ │ │ └── variables.md │ │ │ ├── configuration │ │ │ │ ├── commands.md │ │ │ │ ├── extending.md │ │ │ │ ├── key-bindings.md │ │ │ │ ├── options.md │ │ │ │ ├── overview.md │ │ │ │ ├── release-notes.md │ │ │ │ ├── specifications.md │ │ │ │ └── workspace-settings.md │ │ │ ├── getting-started │ │ │ │ ├── installation.md │ │ │ │ ├── liquid-variation.md │ │ │ │ ├── liquidrc-file.md │ │ │ │ └── workspace-settings.md │ │ │ ├── introduction │ │ │ │ ├── features.md │ │ │ │ ├── overview.md │ │ │ │ ├── packages.md │ │ │ │ ├── supported-editors.md │ │ │ │ ├── what-is-liquify.md │ │ │ │ └── why-use-liquify.md │ │ │ └── troubleshooting │ │ │ │ ├── extension-conflicts.md │ │ │ │ ├── formatting-errors.md │ │ │ │ ├── getting-support.md │ │ │ │ ├── missing-completions.md │ │ │ │ └── setup-issues.md │ │ ├── parser │ │ │ ├── ast.md │ │ │ ├── embeds.md │ │ │ ├── introduction.md │ │ │ ├── nodes.md │ │ │ ├── options.md │ │ │ ├── usage.md │ │ │ └── use-case.md │ │ └── specs │ │ │ ├── arguments.md │ │ │ ├── extending.md │ │ │ ├── html.md │ │ │ ├── introduction.md │ │ │ ├── query-engine.md │ │ │ ├── reasoning.md │ │ │ ├── tokens.md │ │ │ └── types.md │ │ ├── includes │ │ ├── checkout.liquid │ │ ├── footer.liquid │ │ ├── landing.liquid │ │ ├── navbar.liquid │ │ └── sidebar.liquid │ │ ├── index.liquid │ │ └── playground │ │ ├── linter.liquid │ │ ├── parser.liquid │ │ └── prettify.liquid ├── tsconfig.json ├── tsup.config.ts └── types │ └── netlify.d.ts ├── package.json ├── packages ├── highlight │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── index.cjs │ ├── index.d.cts │ ├── index.d.ts │ ├── index.js │ ├── package.json │ ├── readme.md │ ├── src │ │ ├── index.ts │ │ ├── liquid.ts │ │ └── theme.ts │ ├── test │ │ └── index.test.mjs │ └── tsconfig.json ├── parser │ ├── .gitignore │ ├── .npmignore │ ├── LICENCE │ ├── changelog.md │ ├── package.json │ ├── readme.md │ ├── run.cjs │ ├── src │ │ ├── config.ts │ │ ├── index.ts │ │ ├── lexical │ │ │ ├── characters.ts │ │ │ ├── diagnostics.ts │ │ │ ├── errors.ts │ │ │ ├── index.ts │ │ │ ├── kind.ts │ │ │ ├── language.ts │ │ │ ├── regex.ts │ │ │ ├── state.ts │ │ │ ├── tags.ts │ │ │ ├── tokens.ts │ │ │ └── type.ts │ │ ├── parser │ │ │ ├── parse.ts │ │ │ ├── scanner.ts │ │ │ ├── stream.ts │ │ │ ├── tokens.ts │ │ │ └── utils.ts │ │ ├── tree │ │ │ ├── ast.ts │ │ │ ├── embed.ts │ │ │ ├── model.ts │ │ │ ├── nodes.ts │ │ │ └── validate.ts │ │ └── types.ts │ ├── tests │ │ ├── bench │ │ │ ├── dev.test.mjs │ │ │ ├── package.json │ │ │ ├── readme.md │ │ │ ├── sample.liquid │ │ │ └── validate │ │ │ │ ├── filters.test.mjs │ │ │ │ ├── objects.test.mjs │ │ │ │ ├── syntactic.test.mjs │ │ │ │ └── variables.test.mjs │ │ ├── cases │ │ │ ├── ast.test.mjs │ │ │ ├── document.test.mjs │ │ │ ├── embeds.test.mjs │ │ │ ├── filters.test.mjs │ │ │ ├── frontmatter.test.mjs │ │ │ ├── html.test.mjs │ │ │ ├── incremental.test.mjs │ │ │ ├── node.test.mjs │ │ │ ├── objects.test.mjs │ │ │ ├── schema.test.mjs │ │ │ ├── snapshots │ │ │ │ ├── tags.test.mjs.md │ │ │ │ └── tags.test.mjs.snap │ │ │ ├── syntactic.test.mjs │ │ │ ├── tags.test.mjs │ │ │ ├── types.test.mjs │ │ │ ├── validate.test.mjs │ │ │ └── variables.test.mjs │ │ ├── dev.liquid │ │ ├── dev.test.mjs │ │ ├── package.json │ │ ├── readme.md │ │ └── samples │ │ │ └── objects │ │ │ ├── embed │ │ │ ├── frontmatter.liquid │ │ │ └── schema.liquid │ │ │ ├── locales │ │ │ ├── import.json │ │ │ └── source.liquid │ │ │ ├── render │ │ │ ├── import.liquid │ │ │ └── source.liquid │ │ │ ├── settings │ │ │ ├── import.json │ │ │ └── source.liquid │ │ │ └── tokens │ │ │ ├── bracket-notation.liquid │ │ │ ├── dot-notation.liquid │ │ │ └── type-values.liquid │ ├── tsconfig.json │ └── tsup.config.ts ├── server │ ├── .gitignore │ ├── .npmignore │ ├── LICENSE │ ├── ThirdPartyNotices.txt │ ├── changelog.md │ ├── package.json │ ├── readme.md │ ├── src │ │ ├── enums │ │ │ ├── completions.ts │ │ │ └── service.ts │ │ ├── export.ts │ │ ├── index.ts │ │ ├── provide │ │ │ ├── config.ts │ │ │ ├── feature │ │ │ │ └── completions.ts │ │ │ ├── modes │ │ │ │ ├── css.ts │ │ │ │ └── json.ts │ │ │ ├── parser.ts │ │ │ ├── server.ts │ │ │ ├── service.ts │ │ │ └── service │ │ │ │ ├── completions.ts │ │ │ │ ├── editing.ts │ │ │ │ ├── format.ts │ │ │ │ └── hovers.ts │ │ ├── types │ │ │ ├── formatting.d.ts │ │ │ ├── global.d.ts │ │ │ ├── jsbeautify.d.ts │ │ │ ├── prettydiff.d.ts │ │ │ ├── server.d.ts │ │ │ └── settings.d.ts │ │ └── utils │ │ │ ├── common.ts │ │ │ ├── functions.ts │ │ │ ├── positions.ts │ │ │ └── runners.ts │ ├── test │ │ ├── parser.test.js │ │ ├── rcfile.test.js │ │ ├── server.test.js │ │ └── service.test.js │ └── tsconfig.json ├── specs │ ├── .gitignore │ ├── .npmignore │ ├── .vscode │ │ └── settings.json │ ├── LICENCE │ ├── bin │ │ └── shopify-specs.js │ ├── build.sh │ ├── changelog.md │ ├── data │ │ └── liquid │ │ │ └── shopify │ │ │ ├── filters.json │ │ │ └── objects.json │ ├── docs │ │ ├── 01-tokens.md │ │ ├── 02-types.md │ │ ├── 03-arguments.md │ │ ├── 04-html.md │ │ ├── 05-extending.md │ │ └── 06-queries.md │ ├── eslint.config.mjs │ ├── package.json │ ├── readme.md │ ├── scripts │ │ ├── html-specs.ts │ │ └── shopify-specs.ts │ ├── src │ │ ├── html │ │ │ ├── controller │ │ │ │ ├── provide.ts │ │ │ │ ├── queries.ts │ │ │ │ ├── schema.ts │ │ │ │ └── states.ts │ │ │ ├── data │ │ │ │ ├── html5 │ │ │ │ │ ├── attributes.ts │ │ │ │ │ ├── tags.ts │ │ │ │ │ ├── values.ts │ │ │ │ │ └── voids.ts │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── index.ts │ │ ├── liquid │ │ │ ├── controller │ │ │ │ ├── extend.ts │ │ │ │ ├── provide.ts │ │ │ │ ├── queries.ts │ │ │ │ └── states.ts │ │ │ ├── data │ │ │ │ ├── 11ty │ │ │ │ │ ├── export.ts │ │ │ │ │ ├── filters.ts │ │ │ │ │ └── objects.ts │ │ │ │ ├── index.ts │ │ │ │ ├── jekyll │ │ │ │ │ ├── export.ts │ │ │ │ │ ├── filters.ts │ │ │ │ │ ├── objects.ts │ │ │ │ │ └── tags.ts │ │ │ │ ├── shopify │ │ │ │ │ ├── export.ts │ │ │ │ │ ├── filters.ts │ │ │ │ │ ├── objects.ts │ │ │ │ │ └── tags.ts │ │ │ │ └── standard │ │ │ │ │ ├── export.ts │ │ │ │ │ ├── filters.ts │ │ │ │ │ └── tags.ts │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── p.ts │ │ ├── q.ts │ │ ├── s.ts │ │ ├── types │ │ │ ├── arguments.ts │ │ │ ├── completions.ts │ │ │ ├── filters.ts │ │ │ ├── html.ts │ │ │ ├── index.ts │ │ │ ├── internal.ts │ │ │ ├── objects.ts │ │ │ ├── shared.ts │ │ │ ├── tags.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ └── utils │ │ │ ├── enums.ts │ │ │ ├── finders.ts │ │ │ ├── native.ts │ │ │ ├── patches.ts │ │ │ ├── signature.ts │ │ │ ├── typeof.ts │ │ │ └── types.ts │ ├── test │ │ ├── dev.test.mjs │ │ ├── html │ │ │ ├── engine.test.mjs │ │ │ ├── provide.test.mjs │ │ │ └── queries.test.mjs │ │ ├── liquid │ │ │ ├── engine.test.mjs │ │ │ ├── provide.test.mjs │ │ │ └── queries.test.mjs │ │ └── package.json │ ├── tsconfig.json │ └── tsup.config.ts ├── sublime │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc.js │ ├── extension │ │ ├── liquify.sublime-commands │ │ └── liquify.sublime-settings │ └── readme.md ├── syncify │ └── readme.md ├── types │ ├── build.sh │ ├── esthetic │ │ ├── index.d.ts │ │ └── types │ │ │ ├── events.d.ts │ │ │ ├── hooks.d.ts │ │ │ ├── index.d.ts │ │ │ ├── misc │ │ │ ├── defintions.d.ts │ │ │ ├── grammar.d.ts │ │ │ ├── merger.d.ts │ │ │ ├── settings.d.ts │ │ │ └── specifics.d.ts │ │ │ ├── next.d.ts │ │ │ ├── parse │ │ │ ├── parser.d.ts │ │ │ └── tokens.d.ts │ │ │ ├── rules │ │ │ ├── global.d.ts │ │ │ ├── javascript.d.ts │ │ │ ├── json.d.ts │ │ │ ├── liquid.d.ts │ │ │ ├── markup.d.ts │ │ │ ├── script.d.ts │ │ │ └── style.d.ts │ │ │ └── shared.d.ts │ ├── highlight │ │ └── index.d.ts │ ├── index.d.ts │ ├── moloko │ │ ├── index.d.ts │ │ └── types │ │ │ ├── model.d.ts │ │ │ └── moloko.d.ts │ ├── package.json │ ├── parser │ │ ├── index.d.ts │ │ ├── language-BYcPZFcX.d.ts │ │ ├── lexical.d.ts │ │ └── regex.d.ts │ ├── pnpm-lock.yaml │ ├── readme.md │ └── specs │ │ └── index.d.ts ├── vim │ └── readme.md └── vscode │ ├── .gitignore │ ├── .vscodeignore │ ├── LICENSE │ ├── ThirdPartyNotices.txt │ ├── changelog.md │ ├── client │ ├── index.ts │ └── provide │ │ ├── client.ts │ │ └── release.ts │ ├── language │ └── liquid.language-configuration.json │ ├── package.json │ ├── readme.md │ ├── snippets │ └── standard.json │ ├── syntax │ ├── injections │ │ ├── attributes.tmLanguage.json │ │ ├── code-block.tmLanguage.json │ │ ├── embedded.tmLanguage.json │ │ ├── frontmatter.tmLanguage.json │ │ ├── json.tmLanguage.json │ │ ├── literal-attributes.tmLanguage.json │ │ ├── literal-string.tmLanguage.json │ │ ├── markdown.tmLanguage.json │ │ └── yaml.tmLanguage.json │ ├── languages │ │ ├── css.tmLanguage.json │ │ ├── javascript.tmLanguage.json │ │ ├── log.tmLanguage.json │ │ └── scss.tmLanguage.json │ └── liquid.tmLanguage.json │ └── tsconfig.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | # DIRECTORIES 2 | # -------------------- 3 | .turbo 4 | node_modules/ 5 | package/ 6 | !tests/** 7 | /tests/ 8 | packages/ace/ace 9 | packages/ace/src/build 10 | 11 | # FILES 12 | # ------------------- 13 | .DS_Store 14 | .eslintcache 15 | .pnpm-debug.log 16 | pnpm-debug.log 17 | tsconfig.tsbuildinfo 18 | packages/prettify/types/rules/script.d.ts 19 | packages/prettify/types/rules/global.d.ts 20 | packages/prettify/tests/dev.txt 21 | packages/prettify/tests/dev.test.mjs 22 | packages/prettify/src/parser/parse.ts 23 | packages/prettify/src/options/grammar.ts 24 | packages/prettify/src/model.ts 25 | packages/prettify/src/lexers/script.ts 26 | packages/prettify/src/lexers/markup.ts 27 | packages/prettify/src/comments/parse.ts 28 | packages/prettify/src/beautify/script.ts 29 | packages/prettify/readme.md 30 | packages/prettify/index.mjs 31 | packages/prettify/index.js 32 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "packages/ava"] 2 | path = packages/ava 3 | url = https://github.com/panoply/ava 4 | [submodule "packages/esthetic"] 5 | path = packages/esthetic 6 | url = https://github.com/panoply/esthetic 7 | [submodule "packages/moloko"] 8 | path = packages/moloko 9 | url = https://github.com/panoply/moloko 10 | [submodule "packages/schema"] 11 | path = packages/schema 12 | url = https://github.com/panoply/liquify-schema 13 | [submodule "packages/papyrus"] 14 | path = packages/papyrus 15 | url = https://github.com/panoply/papyrus 16 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist = true 2 | recursive-install = false 3 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # DO NOT TOUCH THE JS/TS FILES 2 | 3 | **/*.js 4 | **/*.ts 5 | **/*.mjs 6 | **/*.cjs 7 | 8 | # DO NOT TOUCH SCHEMA DESCRIPTIONS 9 | 10 | **/stores/descriptions/**/**/*.md 11 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "unwantedRecommendations": [ 3 | "neilding.language-liquid", 4 | "Shopify.theme-check-vscode", 5 | "killalau.vscode-liquid-snippets" 6 | ], 7 | "recommendations": [ 8 | "dbaeumer.vscode-eslint", 9 | "esbenp.prettier-vscode", 10 | "ms-vscode.vscode-typescript-next", 11 | "vscode-icons-team.vscode-icons", 12 | "fabiospampinato.vscode-highlight", 13 | "bierner.comment-tagged-templates" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "extensionHost", 6 | "request": "launch", 7 | "name": "Client", 8 | "runtimeExecutable": "${execPath}", 9 | "env": { 10 | "SERVER_PATH": "${workspaceFolder}" 11 | }, 12 | "outFiles": [ 13 | "${workspaceFolder}/packages/vscode/package/*.js" 14 | ], 15 | "args": [ 16 | "--disable-extensions", 17 | "--extensionDevelopmentPath=${workspaceFolder}/packages/vscode", 18 | "${workspaceRoot}/tests" 19 | ] 20 | }, 21 | { 22 | "name": "Server", 23 | "type": "node", 24 | "request": "attach", 25 | "port": 6009, 26 | "cwd": "${workspaceFolder}/packages/server/src/", 27 | "restart": true, 28 | "sourceMaps": true, 29 | "outFiles": [ 30 | "${workspaceFolder}/packages/server/package/server.js", 31 | "${workspaceFolder}/packages/server/package/server.js.map" 32 | ] 33 | } 34 | ], 35 | "compounds": [ 36 | { 37 | "name": "Client + Server", 38 | "configurations": [ 39 | "Client", 40 | "Server" 41 | ] 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /assets/discord-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/assets/discord-logo.png -------------------------------------------------------------------------------- /assets/github-banner-center.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/assets/github-banner-center.gif -------------------------------------------------------------------------------- /assets/logo-white-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/assets/logo-white-bg.png -------------------------------------------------------------------------------- /assets/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/assets/logo-white.png -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/assets/logo.png -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | function task() { 2 | echo "" 3 | echo "\033[0;36m--------------------------------------------------------\033[0m" 4 | echo "\033[0;36m\033[1mBUILDING $1\033[0m\033[0m ~ \033[0;90m$2\033[0m" 5 | echo "\033[0;36m--------------------------------------------------------\033[0m" 6 | } 7 | 8 | # SPECIFICATIONS 9 | task SPECS @liquify/specs 10 | pnpm @specs build 11 | 12 | # PARSER 13 | task PARSER @liquify/parser 14 | pnpm @parser build 15 | 16 | # ÆSTHETIC 17 | task ÆSTHETIC esthetic 18 | pnpm @esthetic build 19 | 20 | # HIGHLIGHT 21 | task HIGHLIGHT @liquify/highlight 22 | pnpm @highlight build 23 | 24 | # SERVER 25 | task SERVER @liquify/server 26 | pnpm @server build 27 | 28 | # CLIENT 29 | task CLIENT vscode-liquid 30 | pnpm @vscode build 31 | 32 | # MOLOKO 33 | task MOLOKO moloko 34 | pnpm @moloko build 35 | 36 | # TYPES 37 | task TYPES @liquify/types 38 | pnpm @types build 39 | 40 | # AVA 41 | task AVA @liquify/ava 42 | pnpm @ava build 43 | 44 | # ÆSTHETIC DOCS 45 | task ÆSTHETIC DOCS esthetic-docs 46 | pnpm @docs:esthetic build 47 | -------------------------------------------------------------------------------- /configs/eslint-config/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 | Present: ΝΙΚΟΛΑΣ ΣΑΒΒΙΔΗΣ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /configs/eslint-config/changelog.md: -------------------------------------------------------------------------------- 1 | ### _CHANGELOG_ 2 | 3 | ##### 09/06/2021 4 | 5 | - Initial Release 6 | -------------------------------------------------------------------------------- /configs/eslint-config/index.d.ts: -------------------------------------------------------------------------------- 1 | export * as default from 'eslint' 2 | -------------------------------------------------------------------------------- /configs/eslint-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@liquify/eslint-config", 3 | "version": "1.2.0", 4 | "description": "Sharable ESLint config consumed within the Liquify monorepo workspace.", 5 | "license": "MIT", 6 | "author": { 7 | "name": "Νίκος Σαβίδης", 8 | "email": "n.savvidis@gmx.com", 9 | "url": "https://liquify.dev" 10 | }, 11 | "private": false, 12 | "main": "index.mjs", 13 | "types": "index.d.ts", 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/panoply/liquify/master/build/eslint-config" 17 | }, 18 | "bugs": { 19 | "url": "https://github.com/panoply/liquify/issues" 20 | }, 21 | "prettier": "@liquify/prettier-config", 22 | "dependencies": { 23 | "@eslint/eslintrc": "^3.2.0", 24 | "@typescript-eslint/eslint-plugin": "^8.23.0", 25 | "@typescript-eslint/parser": "^8.23.0", 26 | "eslint-config-standard": "^17.1.0", 27 | "eslint-plugin-import": "^2.31.0", 28 | "eslint-plugin-n": "^17.15.1", 29 | "eslint-plugin-node": "^11.1.0", 30 | "eslint-plugin-promise": "^7.2.1" 31 | }, 32 | "devDependencies": { 33 | "@liquify/prettier-config": "workspace:*" 34 | }, 35 | "optionalDependencies": { 36 | "eslint": "^9.19.0", 37 | "typescript": "^5.7.3" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /configs/eslint-config/readme.md: -------------------------------------------------------------------------------- 1 | # ESLint Config 2 | 3 | Shareable config for eslint to maintain a code style aesthetic across the Liquify project. ESLint [Standard](https://github.com/standard/eslint-config-standard) is extended with additional rule sets. 4 | 5 | ### Install 6 | 7 | [pnpm](https://pnpm.js.org/en/cli/install) 8 | 9 | ```cli 10 | pnpm add @liquify/eslint-config -D 11 | ``` 12 | 13 | > Required peer dependency on eslint 14 | 15 | ### Usage 16 | 17 | Extend the `package.json` file of each module and/or project. 18 | 19 | ```json 20 | { 21 | "eslintConfig": { 22 | "extends": ["@liquify/eslint-config"] 23 | } 24 | } 25 | ``` 26 | 27 | In some packages ESLint will be limited to the specific project itself by inferring `true` on the `root` key option. 28 | 29 | ```json 30 | { 31 | "eslintConfig": { 32 | "root": true 33 | } 34 | } 35 | ``` 36 | 37 | ### Related 38 | 39 | - [@liquify/tsconfig](https://github.com/panoply/liquify/tree/master/configs/tsconfig) 40 | - [@liquify/prettier-config](https://github.com/panoply/liquify/tree/master/configs/eslint-config) 41 | - [@liquify/stylelint-config](https://github.com/panoply/liquify/tree/master/configs/stylelint-config) 42 | 43 | ### Author 44 | 45 | 🥛 [Νίκος Σαβίδης](mailto:n.savvidis@gmx.com) 46 | -------------------------------------------------------------------------------- /configs/prettier-config/.gitignore: -------------------------------------------------------------------------------- 1 | # Directories 2 | node_modules 3 | -------------------------------------------------------------------------------- /configs/prettier-config/.npmignore: -------------------------------------------------------------------------------- 1 | # FILES 2 | .npmrc 3 | readme.md 4 | 5 | # DIRECTORIES 6 | .vscode 7 | node_modules 8 | -------------------------------------------------------------------------------- /configs/prettier-config/.npmrc: -------------------------------------------------------------------------------- 1 | link-workspace-packages = true 2 | shamefully-hoist = true 3 | shared-workspace-shrinkwrap = true 4 | -------------------------------------------------------------------------------- /configs/prettier-config/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "prettier.configPath": "./index.js" 3 | } 4 | -------------------------------------------------------------------------------- /configs/prettier-config/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 | Present: ΝΙΚΟΛΑΣ ΣΑΒΒΙΔΗΣ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /configs/prettier-config/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {import('prettier').Options} 3 | */ 4 | module.exports = { 5 | arrowParens: 'avoid', 6 | bracketSpacing: true, 7 | htmlWhitespaceSensitivity: 'css', 8 | insertPragma: false, 9 | jsxBracketSameLine: false, 10 | jsxSingleQuote: false, 11 | printWidth: 70, 12 | proseWrap: 'preserve', 13 | quoteProps: 'as-needed', 14 | requirePragma: false, 15 | semi: true, 16 | singleQuote: true, 17 | tabWidth: 2, 18 | trailingComma: 'none', 19 | useTabs: false, 20 | overrides: [ 21 | { 22 | files: [ '**/*.md' ], 23 | options: { 24 | parser: 'markdown', 25 | printWidth: 100 26 | } 27 | }, 28 | { 29 | files: [ '**/*.json', '**/*.jsonc' ], 30 | options: { 31 | parser: 'json', 32 | printWidth: 60 33 | } 34 | }, 35 | { 36 | files: [ '**/package.json' ], 37 | options: { 38 | parser: 'json-stringify' 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /configs/prettier-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@liquify/prettier-config", 3 | "version": "1.2.1", 4 | "description": "Sharable Prettier config consumed within the Liquify monorepo workspace.", 5 | "main": "index.js", 6 | "author": { 7 | "name": "Νίκος Σαβίδης", 8 | "email": "n.savvidis@gmx.com", 9 | "url": "https://liquify.dev" 10 | }, 11 | "prettier": "./index.js", 12 | "license": "MIT", 13 | "keywords": [ 14 | "prettier", 15 | "prettierconfig", 16 | "config", 17 | "formatting" 18 | ], 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/panoply/liquify/tree/next/build/prettier-config" 22 | }, 23 | "bugs": { 24 | "url": "https://github.com/panoply/liquify/tree/next/build/prettier-config/issues" 25 | }, 26 | "engines": { 27 | "pnpm": ">=6" 28 | }, 29 | "devDependencies": { 30 | "prettier": "^3.2.5" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /configs/prettier-config/pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '6.0' 2 | 3 | devDependencies: 4 | prettier: 5 | specifier: ^2.8.4 6 | version: 2.8.4 7 | 8 | packages: 9 | 10 | /prettier@2.8.4: 11 | resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==} 12 | engines: {node: '>=10.13.0'} 13 | hasBin: true 14 | dev: true 15 | -------------------------------------------------------------------------------- /configs/prettier-config/readme.md: -------------------------------------------------------------------------------- 1 | ## @brixtol/prettier-config 2 | 3 | An shareable config for Prettier consumed by Liquify and various projects contained within the monorepo workspace. 4 | 5 | ### Install 6 | 7 | [pnpm](https://pnpm.js.org/en/cli/install) 8 | 9 | ```cli 10 | pnpm add prettier @liquify/prettier-config -D 11 | ``` 12 | 13 | > Prettier is an `peerDependency` so you will need to install it within your project. 14 | 15 | ### Usage 16 | 17 | We extend configuration from within `package.json` files. 18 | 19 | ```json 20 | { 21 | "prettier": "@liquify/prettier-config" 22 | } 23 | ``` 24 | 25 | ### Ignored Files 26 | 27 | Prettier is not leveraged for various file types because it is extremely opinionated and conflicts with my code styles, especially that found in JavaScript and TypeScript based projects. In almost all packages within the monorepo a `.prettierignore` file is included to prevent prettier from wreaking havoc in the development workspace. Below is standard ignores asserted: 28 | 29 | ``` 30 | 31 | _.toml 32 | _.mjs 33 | _.js 34 | _.ts 35 | _.css 36 | _.scss 37 | _.liquid 38 | _.html 39 | 40 | ``` 41 | 42 | ### Related 43 | 44 | - [@liquify/eslint-config](https://github.com/panoply/liquify/tree/next/build/eslint-config) 45 | - [@liquify/tsconfig](https://github.com/panoply/liquify/tree/next/build/tsconfig) 46 | - [@liquify/rollup-config](https://github.com/panoply/liquify/tree/next/build/rollup-config) 47 | 48 | ### License 49 | 50 | [MIT](#LICENSE) 51 | -------------------------------------------------------------------------------- /configs/stylelint-config/.npmignore: -------------------------------------------------------------------------------- 1 | # FILES 2 | .npmrc 3 | readme.md 4 | 5 | # DIRECTORIES 6 | .vscode 7 | node_modules 8 | -------------------------------------------------------------------------------- /configs/stylelint-config/changelog.md: -------------------------------------------------------------------------------- 1 | ## CHANGELOG 2 | -------------------------------------------------------------------------------- /configs/stylelint-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@liquify/stylelint-config", 3 | "version": "1.0.0", 4 | "description": "Sharable Stylelint config consumed within the Liquify monorepo workspace.", 5 | "main": "stylelint.cjs", 6 | "license": "MIT", 7 | "keywords": [ 8 | "stylelint", 9 | "stylelint-config", 10 | "config", 11 | "linting", 12 | "formatting" 13 | ], 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/panoply/liquify/master/configs/stylelint-config" 17 | }, 18 | "bugs": { 19 | "url": "https://github.com/panoply/liquify/issues" 20 | }, 21 | "scripts": { 22 | "bump": "pnpm up @liquify/stylelint-config -r", 23 | "postversion": "pnpm bump" 24 | }, 25 | "engines": { 26 | "pnpm": ">=6" 27 | }, 28 | "dependencies": { 29 | "postcss": "^8.4.35", 30 | "postcss-scss": "^4.0.9", 31 | "stylelint": "^16.2.1", 32 | "stylelint-config-rational-order": "^0.1.2", 33 | "stylelint-config-standard-scss": "^13.0.0", 34 | "stylelint-scss": "^6.2.1" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /configs/stylelint-config/readme.md: -------------------------------------------------------------------------------- 1 | ## @liquify/stylelint-config 2 | 3 | Shareable config for [Stylelint](https://stylelint.io/) to maintain a code style aesthetic in SASS/SCSS files across the Liquify project. 4 | 5 | ### Install 6 | 7 | [pnpm](https://pnpm.js.org/en/cli/install) 8 | 9 | ```cli 10 | pnpm add stylelint @liquify/stylelint-config -D 11 | ``` 12 | 13 | > [Stylelint](https://stylelint.io/) is included as a dependency in the module. The same logic for all plugins. 14 | 15 | ### Usage 16 | 17 | We extend configuration from within `package.json` files. 18 | 19 | ```json 20 | { 21 | "stylelint": { 22 | "extends": "@liquify/stylelint-config", 23 | "ignoreFiles": ["**/node_modules"] 24 | } 25 | } 26 | ``` 27 | 28 | ### Text Editor (VSCode) 29 | 30 | Install the [stylelint.vscode-stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint) extension from the marketplace. Depending on how your editor is configured, one may require setting global configuration in a user `settings.json` file: 31 | 32 | ```jsonc 33 | { 34 | "stylelint.validate": ["scss", "sass"], 35 | "stylelint.packageManager": "pnpm", 36 | "stylelint.enable": true, 37 | "scss.validate": false, // important to disable vscode validation 38 | "scss.scannerExclude": ["**/.git", "**/node_modules"], 39 | "editor.codeActionsOnSave": { 40 | "source.fixAll.stylelint": true 41 | } 42 | } 43 | ``` 44 | 45 | ### License 46 | 47 | [MIT](#LICENSE) 48 | -------------------------------------------------------------------------------- /configs/stylelint-config/stylelint.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import('stylelint').Config} */ 2 | export default { 3 | plugins: [ 4 | "stylelint-scss", 5 | ], 6 | extends: [ 7 | "stylelint-config-standard-scss", 8 | "stylelint-config-rational-order", 9 | ], 10 | rules: { 11 | // SCSS 12 | "scss/dollar-variable-empty-line-before": null, 13 | "scss/function-quote-no-quoted-strings-inside": true, 14 | "scss/block-no-redundant-nesting": true, 15 | 16 | // BUILT IN 17 | "function-url-quotes": null, 18 | "block-no-empty": null, 19 | "color-no-invalid-hex": true, 20 | "comment-empty-line-before": [ 21 | "always", 22 | { 23 | ignore: ["stylelint-commands", "after-comment"], 24 | }, 25 | ], 26 | "no-descending-specificity": null, 27 | "rule-empty-line-before": [ 28 | "always", 29 | { 30 | except: [ 31 | "inside-block-and-after-rule" 32 | ], 33 | ignore: [ 34 | "after-comment", 35 | "first-nested", 36 | "inside-block" 37 | ], 38 | } 39 | ] 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /configs/tsconfig/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@liquify/tsconfig", 3 | "version": "1.0.1", 4 | "description": "Liquify TypeScript Configuration", 5 | "homepage": "https://liquify.dev", 6 | "author": { 7 | "name": "ΝΙΚΟΛΑΣ ΣΑΒΒΙΔΗΣ", 8 | "email": "n.savvidis@gmx.com" 9 | }, 10 | "license": "MIT", 11 | "main": "tsconfig.json", 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/panoply/liquify/master/build/tsconfig" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/panoply/liquify/issues" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /configs/tsconfig/pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '6.0' 2 | -------------------------------------------------------------------------------- /configs/tsconfig/readme.md: -------------------------------------------------------------------------------- 1 | # @liquify/tsconfig 2 | 3 | Shareable TypeScript configuration consumed within the Liquify monorepo workspace. 4 | 5 | ### Install 6 | 7 | [pnpm](https://pnpm.js.org/en/cli/install) 8 | 9 | ```cli 10 | pnpm add @liquify/tsconfig typescript -D 11 | 12 | ``` 13 | 14 | ### Usage 15 | 16 | Provide to the `extends` option within a package `tsconfig.json` 17 | 18 | ```json 19 | { 20 | "extends": "@liquify/tsconfig" 21 | } 22 | ``` 23 | 24 | ### Author 25 | 26 | 🥛 [Νίκος Σαβίδης](mailto:nicos@gmx.com) 27 | -------------------------------------------------------------------------------- /configs/tsconfig/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "typeAcquisition": { 3 | "enable": true, 4 | "include": ["node"] 5 | }, 6 | "compilerOptions": { 7 | "types": ["node"], 8 | "incremental": true, 9 | "declaration": false, 10 | "outDir": "package", 11 | "target": "ES6", 12 | "removeComments": true, 13 | "lib": ["es2020"], 14 | "module": "ESNext", 15 | "alwaysStrict": true, 16 | "allowUmdGlobalAccess": true, 17 | "experimentalDecorators": true, 18 | "allowSyntheticDefaultImports": true, 19 | "esModuleInterop": true, 20 | "resolveJsonModule": true, 21 | "preserveSymlinks": true, 22 | "skipDefaultLibCheck": false, 23 | "moduleResolution": "node", 24 | "noEmitOnError": false, 25 | "noUnusedLocals": true, 26 | "noUnusedParameters": true, 27 | "pretty": true 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # DIRECTORIES 2 | # -------------------- 3 | node_modules/ 4 | .netlify 5 | .sass-cache 6 | public 7 | 8 | # FILES 9 | # ------------------- 10 | .DS_Store 11 | .eslintcache 12 | pnpm-lock.yaml 13 | pnpm-debug.log 14 | -------------------------------------------------------------------------------- /docs/.liquidrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "standard", 3 | "validate": { 4 | "tag": { 5 | "newline": true, 6 | "pair": true, 7 | "placement": true, 8 | "whitespace": true 9 | }, 10 | "control": { 11 | "condition": true, 12 | "operator": true 13 | }, 14 | "filter": { 15 | "existence": true, 16 | "parameter": true 17 | }, 18 | "iteration": { 19 | "operator": true, 20 | "iteree": true, 21 | "paramter": true 22 | }, 23 | "object": { 24 | "name": true, 25 | "property": true 26 | } 27 | }, 28 | "format": { 29 | "html": { 30 | "force_attribute": true, 31 | "braces": false, 32 | "preserve": 5, 33 | "tag_newline": true, 34 | "tag_whitespace": "always", 35 | "tags": [ 36 | { 37 | "name": "testersss" 38 | } 39 | ] 40 | }, 41 | "javascript": { 42 | "preserve": 1, 43 | "method_chain": 0, 44 | "quote_convert": "none", 45 | "format_array": "indent", 46 | "format_object": "indent", 47 | "braces": false, 48 | "no_semicolon": true, 49 | "brace_block": true 50 | }, 51 | "scss": { 52 | "css_insert_lines": true, 53 | "preserve": 2, 54 | "braces": false, 55 | "brace_block": true, 56 | "tags": [ 57 | { 58 | "kind": "html", 59 | "name": "style", 60 | "attr": "lang=\"scss\"" 61 | } 62 | ] 63 | }, 64 | "css": { 65 | "css_insert_lines": true, 66 | "preserve": 2, 67 | "braces": false, 68 | "brace_block": true 69 | }, 70 | "json": { 71 | "preserve": 1, 72 | "braces": false, 73 | "brace_style": "expand", 74 | "brace_line": false, 75 | "brace_block": true, 76 | "no_semicolon": true, 77 | "format_array": "indent", 78 | "format_object": "indent", 79 | "tags": [ 80 | { 81 | "name": "captures", 82 | "attr": "json_tes" 83 | } 84 | ] 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /docs/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Nikolas Savvidis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /docs/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | functions = "functions" 3 | publish = "public" 4 | 5 | [[redirects]] 6 | from = "/prettify" 7 | status = 200 8 | force = true 9 | to = "/playground/prettify" 10 | 11 | [[redirects]] 12 | from = "/specification.json" 13 | status = 200 14 | force = true 15 | to = "/.netlify/functions/stores" 16 | headers = { Content-Type = "application/json" } 17 | 18 | 19 | [[redirects]] 20 | from = "/liquidrc.json" 21 | status = 200 22 | force = true 23 | to = "/.netlify/functions/stores" 24 | headers = { Content-Type = "application/json" } 25 | 26 | [[redirects]] 27 | from = "/shopify/settings.json" 28 | status = 200 29 | force = true 30 | to = "/.netlify/functions/stores" 31 | headers = { Content-Type = "application/json" } 32 | 33 | [[redirects]] 34 | from = "/shopify/sections.json" 35 | status = 200 36 | force = true 37 | to = "/.netlify/functions/stores" 38 | headers = { Content-Type = "application/json" } 39 | 40 | [[redirects]] 41 | from = "/shopify/locales.json" 42 | status = 200 43 | force = true 44 | to = "/.netlify/functions/stores" 45 | headers = { Content-Type = "application/json" } 46 | -------------------------------------------------------------------------------- /docs/scripts/eleventy.cjs: -------------------------------------------------------------------------------- 1 | const eleventy = require('@panoply/11ty'); 2 | const highlight = require('@11ty/eleventy-plugin-syntaxhighlight'); 3 | const svgsprite = require('eleventy-plugin-svg-sprite'); 4 | const navigation = require('@11ty/eleventy-navigation'); 5 | const md = require('markdown-it'); 6 | const anchor = require('markdown-it-anchor'); 7 | const { sorting, prism } = require('./plugins.cjs'); 8 | 9 | module.exports = eleventy(function (config) { 10 | 11 | const markdown = md({ html: false }).use(anchor); 12 | 13 | config.addLiquidFilter('sorting', sorting); 14 | config.setBrowserSyncConfig(); 15 | config.setLibrary('md', markdown); 16 | config.setDynamicPermalinks(false); 17 | config.addPassthroughCopy({ 18 | 'src/assets/image/*': '.', 19 | 'node_modules/@liquify/moloko/package': '.' 20 | }); 21 | config.addPlugin(navigation); 22 | config.addPlugin(highlight, { init: prism }); 23 | config.addPlugin(svgsprite, { 24 | path: 'src/assets/svg', 25 | spriteConfig: { 26 | mode: { 27 | symbol: { 28 | inline: true, 29 | sprite: 'sprite.svg', 30 | example: false 31 | } 32 | }, 33 | shape: { 34 | transform: [ 'svgo' ], 35 | id: { 36 | generator: 'svg-%s' 37 | } 38 | }, 39 | svg: { 40 | xmlDeclaration: false, 41 | doctypeDeclaration: false 42 | } 43 | } 44 | }); 45 | 46 | return { 47 | htmlTemplateEngine: 'liquid', 48 | passthroughFileCopy: false, 49 | pathPrefix: '', 50 | templateFormats: [ 51 | 'liquid', 52 | 'json', 53 | 'md', 54 | 'css', 55 | 'html', 56 | 'yaml' 57 | ], 58 | dir: { 59 | input: 'src/site', 60 | output: 'public', 61 | includes: 'includes', 62 | layouts: '', 63 | data: 'data' 64 | } 65 | }; 66 | 67 | }); 68 | -------------------------------------------------------------------------------- /docs/scripts/plugins.cjs: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Sort Order 4 | * 5 | * Uses the frontmatter data `order` to sort 6 | * a list of collection page urls. The `order` 7 | * property requires a numeric value be provided. 8 | * 9 | * @type {Eleventy.PluginOrder} values 10 | */ 11 | exports.sorting = function (values) { 12 | 13 | return [ ...values ].sort(function (a, b) { 14 | 15 | const value = a.data.order - b.data.order; 16 | 17 | return isNaN(value) ? -1 : value; 18 | 19 | }); 20 | 21 | }; 22 | 23 | /** 24 | * Prism Theme 25 | * 26 | * Custom token highlights for different languages. 27 | * This is passed to the @11ty/eleventy-plugin-syntaxhighlight 28 | * plugin and brings some sanity to grammers. 29 | * 30 | * @type {Eleventy.PluginPrism} 31 | */ 32 | exports.prism = function ({ Prism }) { 33 | 34 | Prism.languages.insertBefore('js', 'keyword', { 35 | variable: { 36 | pattern: /\b(?:const|var|let)\b/ 37 | }, 38 | module: { 39 | pattern: /\b(?:import|as|export|from|default)\b/ 40 | }, 41 | op: { 42 | pattern: /\b(?:typeof|new|of|delete|void|readonly)\b/ 43 | }, 44 | 'punctuation-chars': { 45 | pattern: /[.,]/, 46 | global: true 47 | }, 48 | semi: { 49 | pattern: /[;]/, 50 | global: true 51 | }, 52 | nil: { 53 | pattern: /\b(?:null|undefined)\b/ 54 | }, 55 | 'browser-objects': { 56 | pattern: /\b(?:window|document|console)\b/ 57 | }, 58 | types: { 59 | pattern: /\b(?:any|string|object|boolean|number|Promise)\b/, 60 | global: true 61 | }, 62 | 'type-array': { 63 | pattern: /\[\]/, 64 | global: true 65 | }, 66 | 'type-object': { 67 | pattern: /\{\}/, 68 | global: true 69 | }, 70 | 'return-type': { 71 | pattern: /(\)):(?=\s)/, 72 | global: true, 73 | lookbehind: true 74 | }, 75 | 'parameter-optional': { 76 | pattern: /[a-z_$][\w$]+(?=\?:\s*)/i, 77 | lookbehind: true 78 | }, 79 | 'parameter-type': { 80 | pattern: /(\?:\s*)[a-z_$][\w$]+/i, 81 | lookbehind: true 82 | }, 83 | flow: { 84 | pattern: /\b(?:return|await)\b/ 85 | }, 86 | method: { 87 | pattern: /(\.\s*)[a-z_$][\w$]*(?=(\())/i, 88 | lookbehind: true 89 | } 90 | }); 91 | 92 | }; 93 | -------------------------------------------------------------------------------- /docs/scripts/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | const purge = require('@fullhuman/postcss-purgecss'); 2 | const autoprefixer = require('autoprefixer'); 3 | const cssnano = require('cssnano'); 4 | 5 | module.exports = { 6 | plugins: [ 7 | autoprefixer(), 8 | cssnano({ 9 | preset: 'default' 10 | }), 11 | purge( 12 | { 13 | variables: true, 14 | content: [ 15 | 'public/**/*.html', 16 | 'public/**/*.js' 17 | ] 18 | } 19 | ) 20 | ] 21 | }; 22 | -------------------------------------------------------------------------------- /docs/scripts/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import { env, plugin, rollup, } from '@liquify/rollup-config'; 2 | 3 | export default rollup( 4 | [ 5 | { 6 | input: 'src/app/bundle.ts', 7 | output: [ 8 | { 9 | format: 'es', 10 | file: 'public/bundle.min.js', 11 | sourcemap: process.env.prod ? false : 'inline', 12 | esModule: false, 13 | preferConst: true 14 | } 15 | ], 16 | plugins: env.if('dev')( 17 | [ 18 | plugin.resolve(), 19 | plugin.commonjs(), 20 | plugin.esbuild() 21 | ] 22 | )( 23 | [ 24 | plugin.esminify() 25 | ] 26 | ) 27 | } 28 | ] 29 | ); 30 | -------------------------------------------------------------------------------- /docs/scripts/theme.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/scripts/theme.json -------------------------------------------------------------------------------- /docs/src/app/bundle.ts: -------------------------------------------------------------------------------- 1 | export * from './playground'; 2 | -------------------------------------------------------------------------------- /docs/src/app/components/tabs.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/components/tabs.ts -------------------------------------------------------------------------------- /docs/src/app/components/video.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/components/video.ts -------------------------------------------------------------------------------- /docs/src/app/functions/license.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/functions/license.ts -------------------------------------------------------------------------------- /docs/src/app/functions/stores.ts: -------------------------------------------------------------------------------- 1 | const store = require('@liquify/schema-stores'); 2 | const { basename } = require('path'); 3 | 4 | /** 5 | * @type {Netlify.Lambda} 6 | */ 7 | exports.handler = async (event, context, callback) => { 8 | 9 | const name = basename(event.path, '.json'); 10 | 11 | const json = { 12 | fail: 'failed', 13 | liquidrc: 'liquidrc', 14 | specification: 'liquid-specs', 15 | settings: 'shopify-settings', 16 | sections: 'shopify-sections', 17 | locales: 'shopify-locales' 18 | }[name || 'fail']; 19 | 20 | if (!json) { 21 | return callback( 22 | null 23 | , { 24 | statusCode: 200 25 | , body: JSON.stringify({ error: 'No stores exists for ' + name + '.json' }) 26 | } 27 | ); 28 | } 29 | 30 | const schema = store(json); 31 | 32 | try { 33 | 34 | return callback( 35 | null 36 | , { 37 | statusCode: 200 38 | , body: JSON.stringify(schema) 39 | , headers: { 40 | 'Content-Type': 'application/json' 41 | } 42 | } 43 | ); 44 | 45 | } catch (error) { 46 | 47 | return callback( 48 | error 49 | , { 50 | statusCode: 500 51 | , body: error.message 52 | } 53 | ); 54 | 55 | } 56 | }; 57 | -------------------------------------------------------------------------------- /docs/src/app/playground/editor/layout.ts: -------------------------------------------------------------------------------- 1 | import type { Attrs } from '../model/types'; 2 | import m from 'mithril'; 3 | import { Rules } from './rules'; 4 | import moloko from '@liquify/moloko'; 5 | 6 | export const Layout: m.Component = ({ 7 | view: ({ 8 | attrs 9 | }) => m( 10 | '.row.g-0.vh-100.d-flex.ai-center.jc-center' 11 | , m( 12 | '.col-auto.vh-100.bd-right.rules-bg' 13 | , { style: 'width: 280px; min-width: 280px;' } 14 | , m( 15 | '.px-0.py-1' 16 | , { id: 'rules' } 17 | , m(Rules, attrs) 18 | ) 19 | ) 20 | , m( 21 | '.col.vh-100.output-bg' 22 | , m( 23 | '.panel' 24 | , { 25 | oncreate: async ({ dom }) => { 26 | await moloko.mount(dom); 27 | } 28 | } 29 | ) 30 | ) 31 | ) 32 | }); 33 | -------------------------------------------------------------------------------- /docs/src/app/playground/index.ts: -------------------------------------------------------------------------------- 1 | import m from 'mithril'; 2 | import { state } from './model/state'; 3 | import { actions } from './model/actions'; 4 | import { Layout } from './editor/layout'; 5 | 6 | const s = state(); 7 | const a = actions(s); 8 | 9 | m.route.prefix = ''; 10 | m.route(document.querySelector('#playground'), '/playground/prettify', { 11 | '/playground/prettify': { 12 | render: () => m(Layout, { s, a }) 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /docs/src/app/playground/model/actions.ts: -------------------------------------------------------------------------------- 1 | import type { Options } from '@liquify/prettify'; 2 | import type { State, Rulesets } from './types'; 3 | import merge from 'mergerino'; 4 | import moloko from '@liquify/moloko'; 5 | 6 | export function actions (state: State) { 7 | 8 | /** 9 | * Merges the combined rulesets into the formal Prettify 10 | * compliant (accepted) options. Deconstructs the `global` 11 | * grouped rules and returns an immutable valid copy. 12 | */ 13 | function mergeOptions ({ global, liquid, markup, script, style, json }: Rulesets) { 14 | 15 | return merge( 16 | state.options 17 | , global 18 | , 19 | { 20 | markup 21 | , liquid 22 | , script 23 | , style 24 | , json 25 | } 26 | ); 27 | } 28 | 29 | /** 30 | * Executes format, this is triggered each time 31 | * rules are augmented. 32 | */ 33 | function format (rules: Rulesets) { 34 | 35 | state.loading = true; 36 | state.error = ''; 37 | state.options = mergeOptions(rules); 38 | 39 | console.log(state.options); 40 | 41 | return moloko.beautify(state.options); 42 | 43 | }; 44 | 45 | return { 46 | 47 | format 48 | 49 | }; 50 | }; 51 | -------------------------------------------------------------------------------- /docs/src/app/playground/samples/html/attribute-sorting.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/html/attribute-sorting.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/html/comment-ignores.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/html/comment-ignores.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/arrays-and-objects.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/arrays-and-objects.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/block-comments.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/block-comments.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/condition-samples.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/condition-samples.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/functions-and-promises.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/functions-and-promises.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/js-with-liquid.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/js-with-liquid.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/jsx-sample.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/jsx-sample.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/object-sorting.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/object-sorting.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/javascript/variables-and-methods.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/javascript/variables-and-methods.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/json.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/json.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/liquid/eleventy-sample.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/liquid/eleventy-sample.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/liquid/embedded-languages.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/liquid/embedded-languages.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/liquid/frontmatter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/liquid/frontmatter.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/liquid/jekyll-sample.ts: -------------------------------------------------------------------------------- 1 | export default ( 2 | /* html */` 3 | 4 | --- 5 | layout: blank 6 | title: The Programming Historian Blog 7 | redirect_from: /news.html 8 | skip_concordance: true 9 | --- 10 | 11 |

PH Blog

12 | 13 | The Programming Historian blog is our space to share news about the project, ideas for how you might use 14 | technology in your work, and exciting examples of the Programming Historian applied in the real world. 15 | 16 | Subscribe to the RSS feed for new blog posts. 17 | 18 | {% for post in paginator.posts %} 19 | 20 |
21 | 22 |
23 |

{{post.date | date: "%B %-d, %Y"}}

24 |

{{ post.title }}

25 |

26 | {% assign authorCount = post.authors | size %} 27 | {% if authorCount == 1 %} 28 | {{ post.authors | first }} 29 | {% else %} 30 | {% for author in post.authors %} 31 | {% if forloop.first %} 32 | {{ author }} 33 | {% elsif forloop.last %} 34 | and {{ author }} 35 | {% else %} 36 | , {{ author }} 37 | {% endif %} 38 | {% endfor %} 39 | {% endif %} 40 |

41 | {{ post.excerpt | remove: '

' }} 42 | 43 |
44 | 45 | 46 | {% endfor %} 47 | 48 | 65 | `); 66 | -------------------------------------------------------------------------------- /docs/src/app/playground/samples/liquid/script-with-liquid.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/liquid/script-with-liquid.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/liquid/style-with-liquid.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/liquid/style-with-liquid.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/script.ts: -------------------------------------------------------------------------------- 1 | export const script = ` 2 | 3 | var isLoggedIn = false 4 | 5 | var Login = { 6 | view: function() { 7 | return m("form", [ 8 | m("button[type=button]", { 9 | onclick: function() { 10 | isLoggedIn = true 11 | m.route.set("/secret") 12 | } 13 | }, "Login") 14 | ]) 15 | } 16 | } 17 | 18 | m.route(document.body, "/secret", { 19 | "/secret": { 20 | onmatch: function() { 21 | if (!isLoggedIn) m.route.set("/login") 22 | else return Home 23 | } 24 | }, 25 | "/login": Login 26 | }) 27 | 28 | var Auth = { 29 | username: "", 30 | password: "", 31 | 32 | setUsername: function(value) { 33 | Auth.username = value 34 | }, 35 | setPassword: function(value) { 36 | Auth.password = value 37 | }, 38 | login: function() { 39 | m.request({ 40 | url: "/api/v1/auth", 41 | params: {username: Auth.username, password: Auth.password} 42 | }).then(function(data) { 43 | localStorage.setItem("auth-token", data.token) 44 | m.route.set("/secret") 45 | }) 46 | } 47 | } 48 | 49 | var Login = { 50 | view: function() { 51 | return m("form", [ 52 | m("input[type=text]", { 53 | oninput: function (e) { Auth.setUsername(e.target.value) }, 54 | value: Auth.username 55 | }), 56 | m("input[type=password]", { 57 | oninput: function (e) { Auth.setPassword(e.target.value) }, 58 | value: Auth.password 59 | }), 60 | m("button[type=button]", {onclick: Auth.login}, "Login") 61 | ]) 62 | } 63 | } 64 | 65 | m.route(document.body, "/secret", { 66 | "/secret": { 67 | onmatch: function() { 68 | if (!localStorage.getItem("auth-token")) m.route.set("/login") 69 | else return Home 70 | } 71 | }, 72 | "/login": Login 73 | }) 74 | `; 75 | -------------------------------------------------------------------------------- /docs/src/app/playground/samples/styles/liquid-in-css.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/styles/liquid-in-css.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/styles/liquid-in-scss.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/styles/liquid-in-scss.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/styles/mixins-sample.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/styles/mixins-sample.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/styles/properties-and-classes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/styles/properties-and-classes.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/styles/sass-functions.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/styles/sass-functions.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/styles/sass-variables.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/styles/sass-variables.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/typescript/declaration-sample.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/typescript/declaration-sample.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/typescript/decorators.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/typescript/decorators.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/typescript/interface-sample.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/typescript/interface-sample.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/typescript/iterators-and-generators.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/typescript/iterators-and-generators.ts -------------------------------------------------------------------------------- /docs/src/app/playground/samples/typescript/tsx-sample.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/app/playground/samples/typescript/tsx-sample.ts -------------------------------------------------------------------------------- /docs/src/app/utilities/helpers.ts: -------------------------------------------------------------------------------- 1 | import { create, assign } from './native'; 2 | 3 | /** 4 | * Object Generator 5 | * 6 | * I don't like creating objects that use the prototype because it's 7 | * fucking despicable. This function produces `null` prototype objects 8 | * typically used for creating grammars and datasets. 9 | */ 10 | export function object (dataset: T): T { 11 | 12 | return assign(create(null), dataset); 13 | 14 | } 15 | 16 | /** 17 | * Converts byte size to killobyte, megabyte, 18 | * gigabyte or terrabyte 19 | */ 20 | export function size (bytes: number): string { 21 | 22 | const kb = 1024; 23 | const mb = 1048576; 24 | const gb = 1073741824; 25 | 26 | if (bytes < kb) return bytes + ' B'; 27 | else if (bytes < mb) return (bytes / kb).toFixed(1) + ' KB'; 28 | else if (bytes < gb) return (bytes / mb).toFixed(1) + ' MB'; 29 | else return (bytes / gb).toFixed(1) + ' GB'; 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /docs/src/app/utilities/native.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Native Object Assign 3 | */ 4 | export const assign = Object.assign; 5 | 6 | /** 7 | * Native Object Create 8 | */ 9 | export const create = Object.create; 10 | 11 | /** 12 | * Native Object Entries 13 | */ 14 | export const entries = Object.entries; 15 | 16 | /** 17 | * Native Object Keys 18 | */ 19 | export const keys = Object.keys; 20 | 21 | /** 22 | * Native Array from 23 | */ 24 | export const toArray = Array.from; 25 | -------------------------------------------------------------------------------- /docs/src/assets/image/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/assets/image/logo-white.png -------------------------------------------------------------------------------- /docs/src/assets/svg/checked.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/chevron-down.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/chevron-right.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/corner-left.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/cross.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/editor.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/github.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/layout.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/minus-square.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/plus-square.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/split.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/assets/svg/unchecked.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/sass/playground/prism.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/sass/playground/prism.scss -------------------------------------------------------------------------------- /docs/src/sass/styles/accordion.scss: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------- */ 2 | /* RELAPSE */ 3 | /* -------------------------------------------- */ 4 | 5 | $relapse-border-width: 1px !default; 6 | $relapse-border-color: #e5e5e5 !default; 7 | $relapse-padding: 50px !default; 8 | $relapse-transition-height: 225ms !default; 9 | $relapse-transition-opacity: 200ms !default; 10 | $relapse-transition-timing: ease-in-out !default; 11 | 12 | .relapse { 13 | position: relative; 14 | display: block; 15 | width: 100%; 16 | border: none; 17 | border-top: none; 18 | 19 | 20 | &-fold { 21 | max-height: 0; 22 | overflow: hidden; 23 | opacity: 0; 24 | transition: opacity $relapse-transition-opacity linear, 25 | max-height $relapse-transition-height $relapse-transition-timing; 26 | transition: opacity $relapse-transition-opacity linear, 27 | max-height $relapse-transition-height $relapse-transition-timing; 28 | will-change: opacity, max-height; 29 | 30 | @media (prefers-reduced-motion: reduce) { 31 | transition: none; 32 | transition: none; 33 | } 34 | 35 | > :first-child { 36 | padding: $relapse-padding; 37 | } 38 | 39 | &.expanded { 40 | max-height: auto; 41 | visibility: visible; 42 | opacity: 1; 43 | } 44 | } 45 | 46 | &-btn { 47 | display: inherit; 48 | width: 100%; 49 | margin: 0; 50 | padding: inherit; 51 | color: inherit; 52 | font-size: inherit; 53 | text-align: left; 54 | background-color: inherit; 55 | border: 0; 56 | 57 | // border-top: $relapse-border-width solid $relapse-border-color; 58 | border-radius: 0; 59 | cursor: pointer; 60 | user-select: none; 61 | 62 | 63 | &.initial + .relapse-fold { 64 | max-height: unset; 65 | visibility: visible; 66 | opacity: 1; 67 | } 68 | 69 | &.initial { 70 | color: inherit; 71 | background-color: inherit; 72 | } 73 | 74 | &.opened { 75 | color: inherit; 76 | background-color: inherit; 77 | } 78 | 79 | &.focused { 80 | background-color: inherit; 81 | outline: none; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /docs/src/sass/styles/editor.scss: -------------------------------------------------------------------------------- 1 | .editor { 2 | padding: 0; 3 | font-size: 0.945rem; 4 | font-family: $font-family-code; 5 | line-height: 20px; 6 | letter-spacing: normal; 7 | tab-size: 4; 8 | border-radius: 0; 9 | } 10 | 11 | .line-number { 12 | mix-blend-mode: normal !important; 13 | } 14 | -------------------------------------------------------------------------------- /docs/src/sass/styles/overwrites.scss: -------------------------------------------------------------------------------- 1 | h1, 2 | h2, 3 | h3, 4 | h4, 5 | h5, 6 | h6 { 7 | padding-top: 15px; 8 | letter-spacing: 0.03rem; 9 | 10 | // text-transform: uppercase; 11 | 12 | &:focus-visible { 13 | display: inline-block; 14 | padding-top: 75px; 15 | padding-right: 75px; 16 | color: $gray-600; 17 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' %3E%3Ccircle cx='12' cy='5' r='3'%3E%3C/circle%3E%3Cline x1='12' y1='22' x2='12' y2='8'%3E%3C/line%3E%3Cpath d='M5 12H2a10 10 0 0 0 20 0h-3'%3E%3C/path%3E%3C/svg%3E"); 18 | background-repeat: no-repeat; 19 | background-position-x: 90%; 20 | background-position-y: 65px; 21 | background-size: 20px; 22 | outline: none; 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /docs/src/sass/styles/session.scss: -------------------------------------------------------------------------------- 1 | .session { 2 | position: fixed; 3 | top: 0; 4 | right: 0; 5 | z-index: 200; 6 | width: 500px; 7 | border-color: $cyan; 8 | } 9 | 10 | .bd-bottom { 11 | border-color: $cyan; 12 | } 13 | 14 | .session-scroll { 15 | overflow-y: scroll; 16 | } 17 | 18 | .session-tabs { 19 | height: 40px; 20 | } 21 | 22 | .session-logs { 23 | position: absolute; 24 | top: 41px; 25 | right: 0; 26 | bottom: 0; 27 | left: 0; 28 | height: 100%; 29 | 30 | .active { 31 | height: 20%; 32 | } 33 | 34 | .action { 35 | height: 40%; 36 | } 37 | 38 | .history { 39 | height: 40%; 40 | } 41 | } 42 | 43 | .session-details { 44 | .memory { 45 | height: 10%; 46 | } 47 | 48 | 49 | .relapse-btn { 50 | color: $white; 51 | border-bottom: $border-width solid $cyan; 52 | 53 | .icon { 54 | width: 20px; 55 | height: 20px; 56 | color: $white; 57 | } 58 | 59 | .icon-open { 60 | display: none; 61 | } 62 | 63 | .icon-close { 64 | display: flex; 65 | } 66 | 67 | &.opened { 68 | color: $cyan; 69 | 70 | .icon-open { 71 | display: flex; 72 | } 73 | 74 | .icon-close { 75 | display: none; 76 | } 77 | } 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /docs/src/sass/styles/sidebar.scss: -------------------------------------------------------------------------------- 1 | .sidebar { 2 | position: fixed; 3 | top: 0; 4 | width: 260px; 5 | border-color: $cyan; 6 | 7 | 8 | .relapse-btn { 9 | .icon { 10 | width: 20px; 11 | height: 20px; 12 | color: $white; 13 | } 14 | 15 | .icon-open { 16 | display: none; 17 | } 18 | 19 | .icon-close { 20 | display: flex; 21 | } 22 | 23 | &.open { 24 | .relapse-btn { 25 | color: $cyan; 26 | } 27 | } 28 | 29 | &.opened { 30 | .icon-open { 31 | display: flex; 32 | color: $cyan; 33 | } 34 | 35 | .icon-close { 36 | display: none; 37 | } 38 | } 39 | 40 | &:hover { 41 | color: $cyan; 42 | 43 | .icon { 44 | color: $cyan; 45 | } 46 | } 47 | } 48 | 49 | .accordion-content { 50 | // box-shadow: inset 0 10px 12px -10px rgb(2 2 2); 51 | } 52 | 53 | 54 | ul > li { 55 | list-style-type: none; 56 | 57 | a { 58 | font-size: 1rem; 59 | text-decoration: none; 60 | } 61 | } 62 | 63 | .logo { 64 | width: 54px; 65 | height: 21px; 66 | fill: $white; 67 | 68 | &:hover { 69 | fill: $cyan; 70 | } 71 | } 72 | 73 | .logo-text { 74 | color: $white; 75 | font-size: 0.8rem; 76 | font-family: $font-family-heading; 77 | letter-spacing: 0.06rem; 78 | cursor: pointer; 79 | 80 | &:hover { 81 | color: $cyan; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /docs/src/sass/styles/stripe.scss: -------------------------------------------------------------------------------- 1 | .stripe { 2 | display: flex; 3 | flex-basis: 100%; 4 | align-items: center; 5 | width: 100%; 6 | margin: 0 auto; 7 | padding: 0 15px; 8 | color: #666; 9 | font-weight: 500; 10 | font-size: $font-size-xs; 11 | font-family: $font-family-heading; 12 | text-align: center; 13 | text-transform: uppercase; 14 | 15 | &::before { 16 | margin-right: 8px; 17 | } 18 | 19 | &::after { 20 | margin-left: 8px; 21 | } 22 | 23 | &::before, 24 | &::after { 25 | flex-grow: 1; 26 | height: 0.01rem; 27 | font-size: 0; 28 | line-height: 0; 29 | background: #666; 30 | content: ""; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /docs/src/sass/styles/svg.scss: -------------------------------------------------------------------------------- 1 | /* stylelint-disable scss/operator-no-newline-after */ 2 | 3 | 4 | @mixin color($color: "#000000", $size: "24", $stroke: "2" $fill: "none") { 5 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='#{$size}' height='#{$size}' fill='%23#{str-slice($color, 1)}' stroke='currentColor' stroke-width='#{$stoke}' stroke-linecap='round' stroke-linejoin='round' %3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E%0A"); 6 | background-repeat: no-repeat; 7 | } 8 | 9 | .class { 10 | @include color("#000"); 11 | } 12 | 13 | 14 | .icons { 15 | width: 24px; 16 | height: 24px; 17 | fill: none; 18 | stroke: currentcolor; 19 | stroke-width: 2; 20 | stroke-linecap: round; 21 | stroke-linejoin: round; 22 | } 23 | -------------------------------------------------------------------------------- /docs/src/sass/styles/tabs.scss: -------------------------------------------------------------------------------- 1 | .tabs { 2 | nav > button { 3 | color: $black; 4 | font-weight: 500; 5 | font-size: 0.895rem; 6 | font-family: Roboto, sans-serif !important; 7 | text-transform: uppercase; 8 | background-color: transparent; 9 | border: 0; 10 | border-bottom: 1px solid $cyan; 11 | cursor: pointer; 12 | 13 | 14 | &:hover, 15 | &:active, 16 | &:focus { 17 | color: $black; 18 | } 19 | 20 | &:last-child { 21 | margin-right: 0; 22 | } 23 | 24 | &[aria-selected="true"] { 25 | color: $black; 26 | background-color: $cyan; 27 | } 28 | 29 | &[aria-selected="false"] { 30 | color: $white; 31 | } 32 | } 33 | 34 | .panel, 35 | .panel > ul { 36 | position: relative; 37 | 38 | > li { 39 | list-style-type: inherit; 40 | } 41 | } 42 | } 43 | 44 | [role="tabpanel"][aria-hidden="true"] { 45 | display: none; 46 | } 47 | -------------------------------------------------------------------------------- /docs/src/site/documentation/advanced/comparison.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/advanced/comparison.md -------------------------------------------------------------------------------- /docs/src/site/documentation/advanced/contributing.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/advanced/contributing.md -------------------------------------------------------------------------------- /docs/src/site/documentation/advanced/limitations.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/advanced/limitations.md -------------------------------------------------------------------------------- /docs/src/site/documentation/advanced/logos.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/advanced/logos.md -------------------------------------------------------------------------------- /docs/src/site/documentation/advanced/roadmap.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/advanced/roadmap.md -------------------------------------------------------------------------------- /docs/src/site/documentation/advanced/schemas.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/advanced/schemas.md -------------------------------------------------------------------------------- /docs/src/site/documentation/licensing/features.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/licensing/features.md -------------------------------------------------------------------------------- /docs/src/site/documentation/licensing/legal.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/licensing/legal.md -------------------------------------------------------------------------------- /docs/src/site/documentation/licensing/payment.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/licensing/payment.md -------------------------------------------------------------------------------- /docs/src/site/documentation/licensing/pricing.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/licensing/pricing.md -------------------------------------------------------------------------------- /docs/src/site/documentation/licensing/thankyou.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/licensing/thankyou.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/codelens.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/capabilities/codelens.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/completions.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/capabilities/completions.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/embedded-languages.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/capabilities/embedded-languages.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/formatting.md: -------------------------------------------------------------------------------- 1 | # Validation and Diagnostics 2 | -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/hovers.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/capabilities/hovers.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/signatures.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/capabilities/signatures.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/syntax-highlighting.md: -------------------------------------------------------------------------------- 1 | --- 2 | category: specs 3 | licensed_feature: true 4 | permalink: docs/specs/grammars 5 | pertains: 6 | - 11ty 7 | - jekyll 8 | --- 9 | 10 | # Grammars 11 | 12 | No formal grammar exists for Liquid, its just a templating language but in order to provide features like diagnostics, validations, linting, formatting and other capabiltites to your text editor the [parser](#) Liquify uses provides a way to express the structure of Liquid syntax and compose parseable grammars. 13 | 14 | If you're used tools like [ANTLR](https://en.wikipedia.org/wiki/ANTLR) to create context-free grammars for parsing you'll find the approach to generating or extending upon the available Liquid Specifications a little different. In Liquify, users can compose grammars that extend upon existing variations by supplying custom specs from within their projects workspace configuration file (`.liquidrc`) using the `context[]` property available via `specs{}` option. 15 | 16 | ## `context[]` 17 | 18 | Tags and Filters can take advantage of the `context[]` property to express the formation and structure of Liquid token syntax. Tag and Filter contexts are expressed using a simple metasyntax notation: 19 | 20 | | Keyword | Example | 21 | | -------------- | --------------------------------- | 22 | | `$keyword` | `tag_name` | 23 | | `$variable` | `variable` | 24 | | `$operator` | `[<>=!]`, `and`, `or` | 25 | | `$array` | `array[0]` _or_ `array[variable]` | 26 | | `$object` | `object.property` | 27 | | `$string` | `"string"` _or_ `'string'` | 28 | | `$boolean` | `true` _or_ `false` | 29 | | `$number` | `[0-9]` | 30 | | `$parenthesis` | `(` _or_ `)` | 31 | | `$colon` | `:` | 32 | | `$comma` | `,` | 33 | | `$dot` | `.` | 34 | 35 | > Curious readers that find themselves here, you're best to checkout the Liquify docs on [extending variations](#) which documents extending 36 | -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/validations.md: -------------------------------------------------------------------------------- 1 | # Validation and Diagnostics 2 | -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/capabilities/variables.md: -------------------------------------------------------------------------------- 1 | # Variables 2 | 3 | Liquify treats variable assignments in a similar way as TypeScript. Comment annotations are supported which allows you to provide documentation descriptions to describe assignments and captures. 4 | 5 | ```liquid 6 | 7 | {% comment %} 8 | This assignment holds the value used to match something. 9 | {% endcomment %} 10 | {% assign variable = 'foo' %} 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/configuration/commands.md: -------------------------------------------------------------------------------- 1 | # Validation and Diagnostics 2 | -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/configuration/extending.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/configuration/extending.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/configuration/key-bindings.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/configuration/key-bindings.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/configuration/options.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/configuration/options.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/configuration/overview.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/configuration/overview.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/configuration/release-notes.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/configuration/release-notes.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/configuration/workspace-settings.md: -------------------------------------------------------------------------------- 1 | # Validation and Diagnostics 2 | -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/getting-started/installation.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/getting-started/installation.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/getting-started/liquid-variation.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/getting-started/liquid-variation.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/getting-started/liquidrc-file.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/getting-started/liquidrc-file.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/getting-started/workspace-settings.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/getting-started/workspace-settings.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/introduction/features.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/introduction/features.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/introduction/overview.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/introduction/overview.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/introduction/packages.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/introduction/packages.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/introduction/supported-editors.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/introduction/supported-editors.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/introduction/what-is-liquify.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/introduction/what-is-liquify.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/introduction/why-use-liquify.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/introduction/why-use-liquify.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/troubleshooting/extension-conflicts.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/troubleshooting/extension-conflicts.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/troubleshooting/formatting-errors.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/troubleshooting/formatting-errors.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/troubleshooting/getting-support.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/troubleshooting/getting-support.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/troubleshooting/missing-completions.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/troubleshooting/missing-completions.md -------------------------------------------------------------------------------- /docs/src/site/documentation/liquify/troubleshooting/setup-issues.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/liquify/troubleshooting/setup-issues.md -------------------------------------------------------------------------------- /docs/src/site/documentation/parser/ast.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/parser/ast.md -------------------------------------------------------------------------------- /docs/src/site/documentation/parser/embeds.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/parser/embeds.md -------------------------------------------------------------------------------- /docs/src/site/documentation/parser/introduction.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/parser/introduction.md -------------------------------------------------------------------------------- /docs/src/site/documentation/parser/nodes.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/parser/nodes.md -------------------------------------------------------------------------------- /docs/src/site/documentation/parser/options.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/parser/options.md -------------------------------------------------------------------------------- /docs/src/site/documentation/parser/usage.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/parser/usage.md -------------------------------------------------------------------------------- /docs/src/site/documentation/parser/use-case.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/parser/use-case.md -------------------------------------------------------------------------------- /docs/src/site/documentation/specs/extending.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/specs/extending.md -------------------------------------------------------------------------------- /docs/src/site/documentation/specs/html.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/specs/html.md -------------------------------------------------------------------------------- /docs/src/site/documentation/specs/introduction.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/specs/introduction.md -------------------------------------------------------------------------------- /docs/src/site/documentation/specs/query-engine.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/specs/query-engine.md -------------------------------------------------------------------------------- /docs/src/site/documentation/specs/reasoning.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/documentation/specs/reasoning.md -------------------------------------------------------------------------------- /docs/src/site/includes/checkout.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/includes/checkout.liquid -------------------------------------------------------------------------------- /docs/src/site/includes/footer.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/includes/footer.liquid -------------------------------------------------------------------------------- /docs/src/site/includes/landing.liquid: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 11 | 12 | 17 | 18 |

LIQUID IDE SUPPORT

19 |
20 |

21 | Liquify is an IDE text editor extension created for the Liquid template language.
22 | IntelliSense, diagnostics, linting, validations, formatting and more. 23 |

24 |
25 | 26 |
27 |
AVAILABLE 2022
28 |
29 | 30 |
31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /docs/src/site/includes/navbar.liquid: -------------------------------------------------------------------------------- 1 |
2 | 19 |
20 | -------------------------------------------------------------------------------- /docs/src/site/index.liquid: -------------------------------------------------------------------------------- 1 | {%- if page.url == '/' -%} 2 | {%- assign drawer = '' -%} 3 | {%- else -%} 4 | {%- assign drawer = 'drawer-active' -%} 5 | {%- endif -%} 6 | 7 | 8 | 9 | 10 | 11 | {{ title }} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {%- unless page.url == '/playground/prettify/' -%}{%- endunless -%} 25 | {%- if page.url == '/' -%} 26 | {% include 'landing' %} 27 | 28 | {%- endif -%} 29 | 30 | {{ content }} 31 | 32 | 33 | {% svgsprite %} 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /docs/src/site/playground/linter.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/playground/linter.liquid -------------------------------------------------------------------------------- /docs/src/site/playground/parser.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/docs/src/site/playground/parser.liquid -------------------------------------------------------------------------------- /docs/src/site/playground/prettify.liquid: -------------------------------------------------------------------------------- 1 | --- 2 | layout: index.liquid 3 | --- 4 | 5 |
6 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | "node_modules/**", 4 | "package", 5 | "test" 6 | ], 7 | "include": [ 8 | "src/index.ts", 9 | "src/**/*.ts", 10 | "src/**/**/*.ts", 11 | "src/types/*" 12 | ], 13 | "typeAcquisition": { 14 | "enable": true, 15 | "include": [ 16 | "node" 17 | ] 18 | }, 19 | "compilerOptions": { 20 | "rootDir": "src", 21 | "typeRoots": [ 22 | "node_modules/@types", 23 | "src/types/*" 24 | ], 25 | "outDir": "package", 26 | "target": "ES6", 27 | "removeComments": true, 28 | "lib": [ 29 | "es2020", 30 | "DOM", 31 | "DOM.Iterable" 32 | ], 33 | "module": "ESNext", 34 | "alwaysStrict": true, 35 | "allowUmdGlobalAccess": true, 36 | "experimentalDecorators": true, 37 | "allowSyntheticDefaultImports": true, 38 | "esModuleInterop": true, 39 | "resolveJsonModule": true, 40 | "preserveSymlinks": true, 41 | "skipDefaultLibCheck": false, 42 | "moduleResolution": "node", 43 | "noEmitOnError": false, 44 | "noUnusedLocals": true, 45 | "noUnusedParameters": true, 46 | "pretty": true, 47 | "baseUrl": ".", 48 | "paths": { 49 | "app": [ 50 | "./src/app/index.js" 51 | ], 52 | "components": [ 53 | "./src/app/components/*" 54 | ] 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /docs/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | 5 | entry: { 6 | 7 | /* MOLOKO ------------------------------------- */ 8 | 9 | bundle: './src/app/bundle.ts' 10 | 11 | /* SAMPLES ------------------------------------ */ 12 | 13 | // 'playground': './src/samples/liquid.ts', 14 | // 'moloko/samples/shopify': './src/samples/shopify.ts', 15 | // 'moloko/samples/eleventy': './src/samples/eleventy.ts' 16 | 17 | }, 18 | outDir: './public', 19 | platform: 'browser', 20 | // skipNodeModulesBundle: false, 21 | treeshake: 'smallest', 22 | splitting: false, 23 | shims: false, 24 | target: 'es6', 25 | bundle: true, 26 | format: 'esm', 27 | outExtension () { 28 | return { 29 | js: '.js' 30 | }; 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /docs/types/netlify.d.ts: -------------------------------------------------------------------------------- 1 | import { 2 | APIGatewayProxyEvent, 3 | APIGatewayProxyResult, 4 | Callback, 5 | Context, 6 | ClientContext 7 | } from 'aws-lambda'; 8 | 9 | export interface NetlifyFunctionEvent extends APIGatewayProxyEvent { 10 | path: string; 11 | httpMethod: string; 12 | headers: { [header: string]: string }; 13 | queryStringParameters: { [param: string]: string }; 14 | body: string; 15 | isBase64Encoded: boolean; 16 | } 17 | 18 | export interface NetlifyClientContext extends ClientContext { 19 | identity?: { 20 | url: string; 21 | token: string; 22 | }; 23 | user?: { 24 | source?: string; 25 | [key: string]: any; 26 | }; 27 | } 28 | 29 | export interface NetlifyFunctionContext extends Context { 30 | clientContext?: NetlifyClientContext; 31 | _stopped?: boolean; 32 | } 33 | 34 | export interface NetlifyFunctionResult extends APIGatewayProxyResult { 35 | app_metadata?: any; 36 | user_metadata?: any; 37 | } 38 | 39 | export declare type Lambda = ( 40 | event: NetlifyFunctionEvent, 41 | context: NetlifyFunctionContext, 42 | callback: Callback 43 | ) => void | Promise; 44 | 45 | export type NetlifyCallbackFunction = Callback; 46 | 47 | /** 48 | * Namespace the Centra API 49 | */ 50 | export as namespace Netlify; 51 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "liquify", 3 | "version": "0.0.0-development", 4 | "description": "Liquid Language Support and editor IDE tooling", 5 | "author": { 6 | "name": "Νίκος Σαβίδης", 7 | "email": "n.savvidis@gmx.com", 8 | "url": "https://liquify.dev" 9 | }, 10 | "license": "SEE LICENSE IN LICENSE", 11 | "private": true, 12 | "engines": { 13 | "node": ">=16", 14 | "vscode": ">=1.6.0", 15 | "pnpm": ">=7" 16 | }, 17 | "scripts": { 18 | "dev": "conc --restart-tries 2 -n \"AVA,ÆSTHETIC,SPECS,PARSER,VSCODE,SERVER\" -c \"#81D4FA,#FF69B,#9370DB,#1E90FF,#00CED1,#FF7F50\" \"pnpm @ava dev\" \"pnpm @esthetic dev\" \"pnpm @specs dev\" \"pnpm @parser dev\" \"pnpm @vscode dev\" \"pnpm @server dev\"", 19 | "build": "pnpm --shell-mode \"./build.sh\"", 20 | "@server": "pnpm run -F liquid-language-server", 21 | "@ava": "pnpm -r run -F @liquify/ava", 22 | "@esthetic": "pnpm run -F esthetic", 23 | "@highlight": "pnpm run -F @liquify/highlight", 24 | "@parser": "pnpm run -F @liquify/parser", 25 | "@schema": "pnpm run -F @liquify/schema", 26 | "@specs": "pnpm run -F @liquify/specs", 27 | "@moloko": "pnpm run -F moloko", 28 | "@papyrus": "pnpm run -F papyrus", 29 | "@vscode": "pnpm run -F vscode-liquid", 30 | "@docs:esthetic": "pnpm run -F esthetic-docs", 31 | "@docs:liquify": "pnpm run -F @liquify/docs", 32 | "@docs:papyrus": "pnpm run -F papyrus-docs", 33 | "@types": "pnpm run -F @liquify/types", 34 | "preinstall": "npx only-allow pnpm" 35 | }, 36 | "husky": { 37 | "hooks": { 38 | "post-merge": "pnpm run push" 39 | } 40 | }, 41 | "repository": { 42 | "url": "https://github.com/panoply/liquify" 43 | }, 44 | "devDependencies": { 45 | "@liquify/eslint-config": "workspace:*", 46 | "@liquify/prettier-config": "workspace:*", 47 | "@liquify/tsconfig": "workspace:*", 48 | "concurrently": "^8.2.2", 49 | "eslint": "^9.6.0", 50 | "prettier": "^3.3.2", 51 | "tsup": "^8.1.0", 52 | "typescript": "^5.5.3" 53 | }, 54 | "publishConfig": { 55 | "access": "restricted" 56 | }, 57 | "peerDependencyRules": { 58 | "allowedVersions": { 59 | "eslint": "*" 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /packages/highlight/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | node_modules/ 3 | versions/ 4 | .pnpm-debug.log 5 | -------------------------------------------------------------------------------- /packages/highlight/.npmignore: -------------------------------------------------------------------------------- 1 | # DIRECTORIES 2 | test 3 | scripts 4 | src 5 | versions 6 | 7 | # FILES 8 | rollup.config.mjs 9 | -------------------------------------------------------------------------------- /packages/highlight/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 | Present: ΝΙΚΟΛΑΣ ΣΑΒΒΙΔΗΣ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/highlight/index.d.cts: -------------------------------------------------------------------------------- 1 | import { HighlightOptions } from 'cli-highlight'; 2 | 3 | declare function export_default(text: string, options?: HighlightOptions): string; 4 | 5 | export { export_default as default }; 6 | -------------------------------------------------------------------------------- /packages/highlight/index.d.ts: -------------------------------------------------------------------------------- 1 | import { HighlightOptions } from 'cli-highlight'; 2 | 3 | declare function export_default(text: string, options?: HighlightOptions): string; 4 | 5 | export { export_default as default }; 6 | -------------------------------------------------------------------------------- /packages/highlight/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@liquify/highlight", 3 | "version": "0.1.0", 4 | "description": "Syntax highlighting for Liquid on the command line", 5 | "author": { 6 | "name": "Νίκος Σαβίδης ", 7 | "email": "n.savvidis@gmx.com" 8 | }, 9 | "license": "MIT", 10 | "type": "module", 11 | "types": "./index.d.ts", 12 | "main": "./index.cjs", 13 | "exports": { 14 | "require": "./index.cjs", 15 | "import": "./index.js" 16 | }, 17 | "private": false, 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/panoply/liquify/master/packages/highlight" 21 | }, 22 | "bugs": { 23 | "url": "https://github.com/panoply/liquify/issues" 24 | }, 25 | "scripts": { 26 | "dev": "tsup --watch", 27 | "build": "tsup --minify terser", 28 | "pack": "cd versions; pnpm pack ../ && cd ..", 29 | "test": "ava --verbose --watch" 30 | }, 31 | "tsup": { 32 | "entry": [ 33 | "./src/index.ts" 34 | ], 35 | "name": "highlight", 36 | "outDir": "./", 37 | "treeshake": true, 38 | "dts": true, 39 | "minify": "terser", 40 | "noExternal": [ 41 | "chalk" 42 | ], 43 | "splitting": false, 44 | "format": [ 45 | "cjs", 46 | "esm" 47 | ] 48 | }, 49 | "prettier": "@liquify/prettier-config", 50 | "eslintConfig": { 51 | "ignorePatterns": [ 52 | "package/*", 53 | "index.cjs", 54 | "index.js", 55 | "index.d.ts" 56 | ], 57 | "extends": [ 58 | "@liquify/eslint-config" 59 | ] 60 | }, 61 | "devDependencies": { 62 | "@liquify/eslint-config": "workspace:^", 63 | "@liquify/prettier-config": "workspace:^", 64 | "@liquify/tsconfig": "workspace:^", 65 | "ava": "^6.1.2", 66 | "terser": "^5.29.2", 67 | "tsup": "^8.0.2" 68 | }, 69 | "dependencies": { 70 | "chalk": "^5.3.0", 71 | "cli-highlight": "^2.1.11" 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /packages/highlight/readme.md: -------------------------------------------------------------------------------- 1 | # @liquify/highlight 2 | 3 | Syntax highlighting for Liquid on the command line. Uses [cli-highlight](https://github.com/felixfbecker/cli-highlight) under the hood but does some extra post-processing when dealing with contained syntaxes. It applies Potion themed token colorization. 4 | 5 | ### Why? 6 | 7 | This module was created for usage by the [Prettify](https://github.com/panoply/prettify) CLI but has been appropriated in different packages and projects across the [Liquify](https://liquify.dev) monorepo workspace. 8 | 9 | ### Install 10 | 11 | ```bash 12 | pnpm add @liquify/highlight ava -D 13 | ``` 14 | 15 | # Usage 16 | 17 | 18 | ```ts 19 | import highlight from '@liquify/highlight'; 20 | 21 | const string = ` 22 | {% if condition %} 23 | 24 |
25 | {{ object.prop | filter: 'something' }} 26 |
27 | 28 | {% endif %} 29 | ` 30 | 31 | // Returns a coloured string 32 | highlight(string) 33 | 34 | // Logs the coloured string 35 | highlight.log(string) 36 | ``` 37 | -------------------------------------------------------------------------------- /packages/highlight/src/index.ts: -------------------------------------------------------------------------------- 1 | import { POTION_THEME } from './theme'; 2 | import { highlight, HighlightOptions } from 'cli-highlight'; 3 | import * as liquid from './liquid'; 4 | 5 | export default function (text: string, options: HighlightOptions = {}) { 6 | 7 | Object.assign(options, { 8 | theme: POTION_THEME, 9 | language: 'html' 10 | }); 11 | 12 | const syntax = highlight(text, options); 13 | 14 | if (options.language !== 'html') return syntax; 15 | 16 | const tokens = liquid.tags(syntax); 17 | 18 | return tokens 19 | 20 | } 21 | -------------------------------------------------------------------------------- /packages/highlight/test/index.test.mjs: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | import highlight from '../index.js'; 3 | 4 | const string = ` 5 | 6 | 7 | {% if condition == 'string' %} 8 | 9 |
10 | {{ object.prop | filter: 'something' }} 11 |
12 | 13 | {% endif %} 14 | 15 | 24 | 25 | 26 | {{- page_title -}} 27 | {% comment %} 28 | hello world 29 | {% endcomment %} 30 | {%- if current_tags -%} 31 | {%- assign meta_tags = current_tags | join: ", " -%} 32 | {{ "general.meta.tags" | t: tags: meta_tags | prepend: " – " }} 33 | {%- endif -%} 34 | {%- if current_page != 1 -%} 35 | {{ "general.meta.page" | t: page: current_page | prepend: " – " }} 36 | {%- endif -%} 37 | {%- unless page_title contains shop.name -%} 38 | {{ shop.name | prepend: " –" }} 39 | {%- endunless -%} 40 | 41 | 42 | 43 | {% render 'snippet' with product.array as product, param: 123 44 | %} 45 | 46 | {%- # comment %} 47 | 48 | {% comment %} 49 | hello world 50 | {% endcomment %} 51 | 52 | `; 53 | 54 | test('Highlight Liquid', t => { 55 | 56 | console.log(highlight(string)); 57 | 58 | t.pass() 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /packages/highlight/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@liquify/tsconfig", 3 | "exclude": ["node_modules/**", "package", "test"], 4 | "include": ["src/index.ts"], 5 | "compilerOptions": { 6 | "incremental": false, 7 | "declaration": true, 8 | "removeComments": false, 9 | "emitDeclarationOnly": true, 10 | "baseUrl": "." 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/parser/.gitignore: -------------------------------------------------------------------------------- 1 | package/ 2 | versions/ 3 | .env 4 | -------------------------------------------------------------------------------- /packages/parser/.npmignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | src 3 | test 4 | tsconfig.json 5 | rollup.config.mjs 6 | -------------------------------------------------------------------------------- /packages/parser/LICENCE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panoply/liquify/c66d0f0099d44f6800ef4509dc80585268247ee9/packages/parser/LICENCE -------------------------------------------------------------------------------- /packages/parser/changelog.md: -------------------------------------------------------------------------------- 1 | ## _CHANGELOG_ 2 | -------------------------------------------------------------------------------- /packages/parser/src/lexical/index.ts: -------------------------------------------------------------------------------- 1 | 2 | import { NodeType } from './type'; 3 | import { ErrorLevel, ParseError } from './errors'; 4 | import { CharCode } from './characters'; 5 | import { TagType } from './tags'; 6 | import { NodeKind } from './kind'; 7 | import { TokenType } from './tokens'; 8 | import { NodeLanguage } from './language'; 9 | 10 | export { NodeKind, 11 | ErrorLevel, 12 | ParseError, 13 | CharCode, 14 | NodeType, 15 | TagType, 16 | TokenType, 17 | NodeLanguage }; 18 | -------------------------------------------------------------------------------- /packages/parser/src/lexical/kind.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | 3 | /** 4 | * Token Kinds 5 | * 6 | * When parsing a document, we are likely to come across different 7 | * "kinds" of tokens. We mark the the token kind for every node we 8 | * encounter. This is different from `languages` where the language 9 | * identifiers refer to the embedded type language of tag, but the 10 | * `kind` refers to the token itself. 11 | * 12 | * --- 13 | * 14 | * **IMPORTANT** 15 | * 16 | * By default, all tokens are assumed to be `liquid` 17 | * 18 | * --- 19 | */ 20 | export enum NodeKind { 21 | /** 22 | * Liquid Kind, eg: `{{ tag }}` | `{% tag %}` 23 | */ 24 | Liquid = 1, 25 | 26 | /** 27 | * HTML Kind, eg: `` | `` | `` 28 | */ 29 | HTML, 30 | 31 | /** 32 | * Frontmatter, eg: `---` | `---` 33 | */ 34 | Frontmatter, 35 | 36 | /** 37 | * Raw, eg: `{% raw %}` | `{% endraw %} 38 | */ 39 | Raw, 40 | 41 | /** 42 | * Comment, eg: `{% comment %}` | `` | `{% # comment %}` 43 | */ 44 | Comment 45 | 46 | } 47 | -------------------------------------------------------------------------------- /packages/parser/src/lexical/language.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | 3 | /** 4 | * Embedded Language IDS 5 | * 6 | * Language identifier name enums. We use these names to indicate 7 | * what the language is of this tokens inner content. For example, 8 | * the HTML `