Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

* Feature: `pos-cli check update-docs` — download the latest platformOS Liquid documentation used by the linter, keeping checks like `UndefinedObject` and `UndefinedFilter` up to date.
* Temporarily disabled: `pos-cli deploy --dry-run` is currently unavailable while the feature is being propagated to all servers. It will be re-enabled once the rollout is complete.

## 6.0.0-beta.8
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ The configuration file controls:
- File patterns to ignore
- Check-specific settings

#### Update Docs

To download the latest platformOS Liquid documentation used by the linter:

pos-cli check update-docs

The linter automatically checks whether its cached documentation is stale and updates it when needed. However, if you want to be sure you have the latest platformOS filters, tags, objects, and schema, you can use this command to force a download.

### Language Server Protocol (LSP)

pos-cli includes a Language Server Protocol (LSP) server for platformOS Liquid, enabling rich editor support such as autocompletion, diagnostics, hover documentation, and go-to-definition in any LSP-compatible editor.
Expand Down
35 changes: 35 additions & 0 deletions bin/pos-cli-check-update-docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env node
import { program } from '../lib/program.js';
import logger from '../lib/logger.js';
import ora from 'ora';

program
.name('pos-cli check update-docs')
.description('download the latest platformOS Liquid documentation used by the linter')
.action(async () => {
let platformosCheck;
try {
platformosCheck = await import('@platformos/platformos-check-node');
} catch {
await logger.Error(
'The @platformos/platformos-check-node package is not installed.\n' +
'Install it with: npm install @platformos/platformos-check-node'
);
return;
}

const spinner = ora({ text: 'Downloading platformOS Liquid docs...', stream: process.stdout });
spinner.start();

try {
await platformosCheck.updateDocs((msg) => {
if (msg) spinner.text = msg;
});
spinner.succeed('platformOS Liquid docs updated successfully.');
} catch (error) {
spinner.fail('Failed to update docs.');
await logger.Error(error.message);
}
});

program.parse(process.argv);
1 change: 1 addition & 0 deletions bin/pos-cli-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ program
.name('pos-cli check')
.command('run [path]', 'check Liquid code quality with platformos-check linter')
.command('init [path]', 'initialize .platformos-check.yml configuration file')
.command('update-docs', 'download the latest platformOS Liquid documentation used by the linter')
.parse(process.argv);
Empty file modified bin/pos-cli-lsp.js
100644 → 100755
Empty file.