### Install Composer dependencies Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/installing.md Installs the necessary PHP dependencies using Composer. ```sh $ composer install ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/phpunit/README.md Installs all necessary development dependencies for testing. ```bash composer install ``` -------------------------------- ### Install npm dependencies Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/installing.md Installs global and local Node.js dependencies using npm. ```sh $ npm install --global gulp $ npm install ``` -------------------------------- ### Installation Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/brand/README.md Install the module ```bash npm install --save @lifterlms/brand ``` -------------------------------- ### ESLint Configuration Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/scripts/README.md Example usage of the .eslintrc.js file in a project. ```javascript const config = require( '@lifterlms/scripts/config/.eslintrc.js' ); module.exports = config; ``` -------------------------------- ### Placeholder Usage Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of using the [version] placeholder for new elements. ```php * @since [version] ``` -------------------------------- ### Start wp-env Environment Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Starts the wp-env WordPress environment. ```bash npx wp-env start ``` -------------------------------- ### Installation Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Install the LifterLMS Dev CLI as a development dependency. ```bash npm install --save-dev @lifterlms/dev ``` -------------------------------- ### Installation Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/quill-wordcount-module/README.md Install the module using npm. ```bash npm install --save @lifterlms/quill-wordcount-module ``` -------------------------------- ### Installation Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/icons/README.md Install the LifterLMS Icons package using npm. ```bash npm install --save @lifterlms/icons ``` -------------------------------- ### LLMS Environment File Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/e2e-tests-real.md Example content for the .llmsenv file to configure E2E tests with website credentials. ```bash WP_BASE_URL=https://yourwebsiteurl.tld WP_USERNAME=adminusername WP_PASSWORD=adminpassword ``` -------------------------------- ### Code Sample Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of how to include a code sample within a DocBlock description. Note that these are not syntax-highlighted. ```php * Description including a code sample: * * $status = array( * 'draft' => __( 'Draft' ), * 'pending' => __( 'Pending Review' ), * 'private' => __( 'Private' ), * 'publish' => __( 'Published' ) * ); * * The description continues on ... ``` -------------------------------- ### Full Array Parameter Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md A complete example of documenting an array parameter. ```php * @param array $args { * Optional. An array of arguments. * * @type type $key Description. Default 'value'. Accepts 'value', 'value'. * (aligned with Description, if wraps to a new line) * @type type $key Description. * } ``` -------------------------------- ### Install Testing Database and Environment Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/phpunit/README.md Sets up the testing database and environment. ```bash composer run-script tests-install ``` -------------------------------- ### Since Tag Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of how to use the @since tag to document the introduction version of an element. ```php * @since 3.29.0 ``` -------------------------------- ### Install the module Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/components/README.md Command to install the LifterLMS UI Components module as a development dependency. ```bash npm install --save-dev @lifterlms/components ``` -------------------------------- ### Parameter and Return Tags Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example demonstrating the use of @param and @return tags for functions. ```php * @param string $var1 Description of the argument. * @param bool $var2 Description of the argument. * @return string */ function my_function( $var1, $var2 = false ) { ... return $var1; } ``` -------------------------------- ### Installation Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/utils/README.md Command to install the @lifterlms/utils module as a dependency in a project. ```bash npm i -S @lifterlms/utils ``` -------------------------------- ### Install Node Dependencies Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Installs all Node dependencies from the repository root. ```bash npm ci ``` -------------------------------- ### Build static assets Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/installing.md Builds the static assets for LifterLMS using npm. ```sh $ npm run build ``` -------------------------------- ### Get Help for a Specific Command Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Get detailed help for a specific command. ```bash llms-dev help [command] ``` -------------------------------- ### Example block.json file Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/block-development.md Example JSON data for a block.json file, with the category set to 'llms-blocks'. ```json {\n "$schema": "https://schemas.wp.org/trunk/block.json",\n "apiVersion": 2,\n "name": "llms/example-block",\n "title": "Example",\n "category": "llms-blocks",\n "description": "Block description",\n "textdomain": "lifterlms",\n "attributes": {},\n "supports": {},\n "editorScript": "file:./index.js"\n} ``` -------------------------------- ### Ordered List Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of how to format an ordered list within a DocBlock description. ```php * Description which includes an ordered list: * * 1. This is item 1. * 2. This is item 2. * 3. This is item 3. * * The description continues on ... ``` -------------------------------- ### Array Parameter Documentation Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of documenting an array parameter using WordPress's hash notation. ```php * @type type $key Description. Default 'value'. Accepts 'value', 'value'. * (aligned with Description, if wraps to a new line) ``` -------------------------------- ### Install LifterLMS Scripts Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/scripts/README.md Installs the @lifterlms/scripts module as a development dependency. ```bash npm install --save-dev @lifterlms/scripts ``` -------------------------------- ### Install Playwright Browsers Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Installs the Playwright browsers, specifically Chromium. ```bash npx playwright install --with-deps chromium ``` -------------------------------- ### Icon Usage Example from Gallery Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/icons/README.md Example of how to use the 'lifterlms' icon within the Icon component. ```html <Icon icon={ lifterlms } /> ``` -------------------------------- ### Run PHPCS for code standards check Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/installing.md Checks for coding standard errors and warnings using PHPCS. ```sh $ composer run check-cs ``` -------------------------------- ### Unordered List Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of how to format an unordered list within a DocBlock description. ```php * Description which includes an unordered list: * * - This is item 1. * - This is item 2. * - This is item 3. * * The description continues on ... ``` -------------------------------- ### Registering a new block with JavaScript Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/block-development.md Example of how to register a new block and access block.json data in index.jsx. ```jsx import { registerBlockType } from '@wordpress/blocks';\nimport blockJson from './block.json';\n\nregisterBlockType( blockJson, {\n edit: ( props ) => {\n return

{ props.name }

;\n },\n save: ( props ) => {\n return

{ props.name }

;\n },\n} ); ``` -------------------------------- ### Registering a block with PHP Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/block-development.md Example of how to register a block with PHP, allowing WordPress to handle script and style loading. ```php add_action( 'init', 'llms_register_example_block' );\n/**\n * Register the example block.\n *\n * @since 1.0.0\n *\n * @return void\n */\nfunction llms_register_example_block() {\n register_block_type( LLMS_PLUGIN_DIR . 'blocks/example-block' );\n} ``` -------------------------------- ### Link Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of how to add a link to external resources using the @link tag within a DocBlock. ```php * Description text. * * @link https://github.com/gocodebox/lifterlms/issues/1234567890 ``` -------------------------------- ### Thrown Exception Tag Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of documenting a thrown exception using the @throws tag. ```php * @return string * * @throws Exception A description of the raised exception. */ ``` -------------------------------- ### Tag Alignment Example 1 Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of aligned @since and @deprecated tags. ```php * @since 3.3.0 * @since 3.5.0 Changelog entry description. * @deprecated 3.10.0 Use `llms_new_function_name()` instead. ``` -------------------------------- ### Tag Alignment Example 2 Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of aligning subsequent lines of a changelog entry description. ```php * @since 3.3.0 * @since 3.5.0 Changelog entry description. A second entry aligned to with the first entry. ``` -------------------------------- ### Clone LifterLMS repository Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/installing.md Clones the LifterLMS repository from GitHub. If contributing, fork and clone your fork, then switch to the dev branch. ```sh $ git clone https://github.com/gocodebox/lifterlms $ cd lifterlms ``` ```sh $ git checkout dev ``` -------------------------------- ### Block Directory Structure Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/block-development.md Example of the directory structure for a new block. ```shell .\n└── project/\n ├── src/\n │ └── blocks/\n │ └── block/\n │ ├── block.json\n │ ├── index.jsx\n │ └── index.scss # optional.\n ├── package.json\n └── webpack.congif.js ``` -------------------------------- ### Tag Alignment Example 3 Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example showing that version numbers of differing lengths should not be aligned. ```php * @since 3.3.0 * @since 3.25.0 Changelog entry description. * @since 4.0.0 This entry should not be aligned with the 3.25.0 entry above it. ``` -------------------------------- ### Webpack Configuration for WordPress Blocks Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/scripts/README.md Example usage of the blocks-webpack.config.js file in a project's webpack.config.js. ```javascript const blocksConfig = require( '@lifterlms/scripts/config/blocks-webpack.config' ); module.exports = blocksConfig; ``` -------------------------------- ### Deprecation Tag Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of using @deprecated and @see tags in a changelog entry. ```php * @since 3.3.0 * @since 3.5.0 Added optional 3rd argument. * @deprecated 3.10.0 Use `llms_new_function_name()` instead. * * @see llms_new_function_name() ``` -------------------------------- ### Run PHPCS for errors only Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/installing.md Checks only for coding standard errors using PHPCS. ```sh $ composer run check-cs-errors ``` -------------------------------- ### Fix coding standard issues with PHPCBF Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/installing.md Automatically fixes coding standard issues using PHPCBF. ```sh $ composer run fix-cs ``` -------------------------------- ### File Names Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/coding-standards.md Example of a descriptive file name. ```php my-plugin-file.php ``` -------------------------------- ### Usage in a LifterLMS add-on Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/components/README.md Example of how to access and use components from the llms-components module in a LifterLMS add-on. ```javascript const { ButtonGroupControl } = window.llms.components; ``` -------------------------------- ### Variable Type Tag Example Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Example of using the @var tag to describe a variable's type. ```php * @var string */ public $var = 'text'; ``` -------------------------------- ### Registering a Block with Shortcode Functionality Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/block-development.md Example of registering a block with server-side rendering functionality using the `llms_shortcode_blocks` filter. ```php add_filter( 'llms_shortcode_blocks', register_blocks( array $config ): array { $config['group-list'] = array( 'render' => array( 'LLMS_Groups_Shortcode_Group_List', 'output' ), 'path' => LLMS_GROUPS_PLUGIN_DIR . 'assets/blocks/group-list', ); return $config; } ); ``` -------------------------------- ### CSS Classes and IDs Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/coding-standards.md Example of CSS class and ID naming conventions. ```html
``` -------------------------------- ### Usage in a LifterLMS add-on Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/utils/README.md Example of how to access utility components from the llms-utils module in a LifterLMS add-on. ```javascript const { getAdminUrl } = window.llms.utils; ``` -------------------------------- ### Adding an SVG icon to a block Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/block-development.md Example of converting an SVG icon to a React component and registering it with a block. ```jsx import { registerBlockType } from '@wordpress/blocks';\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst Icon = () => (\n\t\n\t\t\n\t\n);\n\nregisterBlockType( blockJson, {\n icon: Icon,\n edit: Edit\n} ); ``` -------------------------------- ### Loading the module Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/quill-wordcount-module/README.md After loading Quill, use the module by registering it and then loading it in a new editor instance. The `onChange` callback can be used to react to text updates and get the word count. ```jsx import quillWordcountModule from '@lifterlms/quill-wordcount-module'; ( function() { // Registers the module with Quill. quillWordcountModule(); // Loads the module in a new editor instance. const ed = = new Quill( '#my-quill-container', { modules: { wordcount: { onChange: ( quill, options, wordCount ) => { // Do something when the editor's text updates and you need to know the new word count. }, }, }, } ); } )(); ``` -------------------------------- ### Prepare and Build Release Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Command to prepare and build a release, with options to force a version, specify pre-release identifiers, and control the build process. ```bash Usage: index release prepare [options] Prepare and build a release. Options: -F, --force Specify a version to use. If not specified uses `changelog version next` to determine the version. -p, --preid Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -y, --yes Specify no-interaction mode. Responds "yes" to all confirmation prompts. -b, --build Specify an npm script to use for the build command. (default: "build") -B, --no-build Disabled build script. -h, --help display help for command ``` -------------------------------- ### Run Headless E2E Tests Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/e2e-tests-real.md Command to execute the E2E tests in headless mode. ```bash npm run tests ``` -------------------------------- ### Readme Command Usage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md This code snippet shows the usage and options for the 'readme' command, which is used to create a readme.txt file for the WordPress.org plugin repository. ```bash Usage: index readme [options] Create a readme.txt file suitable for the WordPress.org plugin repository. Options: -o, --output-file Specify the output readme file name. (default: "readme.txt") -i, --input-file Specify the input changelog file name. (default: "CHANGELOG.md") -m, --main-file Specify the project main file name where metadata is stored. (default: "dev.php") -d, --dir Directory where the readme part files are stored (default: ".wordpress-org/readme") -l, --changelog-length Specify the number of versions to display before truncating the changelog. (default: 10) -r, --read-more Specify the "Read More" url where changelogs are published. (default: "https://make.lifterlms.com/tag/dev") -h, --help display help for command Merge codes: The following merge codes can be used in any of the readme part markdown files. | Merge Code | Description | Source | | ----------------------------- | -----------------------------------------------------------------------| ------------ | | {{__CHANGELOG_ENTRIES__}} | The most recent 10 changelog entries. | --input-file | | {{__LICENSE__}} | The project's license (GPLv3). | --main-file | | {{__LICENSE_URI__}} | The URI to the project's license. | --main-file | | {{__MIN_WP_VERSION__}} | The minimum required WordPress core version. | --main-file | | {{__MIN_LLMS_VERSION__}} | The minimum required LifterLMS version. | --main-file | | {{__MIN_PHP_VERSION__}} | The minimum required PHP version. | --main-file | | {{__PROJECT_URI__}} | The project's URI. | --main-file | | {{__READ_MORE_LINK__}} | A link to the full project changelog. | --main-file | | {{__SHORT_DESCRIPTION__}} | A short description of the project. | --main-file | | {{__TESTED_LLMS_VERSION__}} | The latest LifterLMS version the project has been tested against. | --main-file | | {{__TESTED_WP_VERSION__}} | The latest WordPress core version the project has been tested against. | --main-file | | {{__VERSION__}} | The current project version. | package.json | ``` -------------------------------- ### List Available Commands Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md List all available commands for the LifterLMS Dev CLI. ```bash llms-dev help ``` -------------------------------- ### Configure and generate CSS files Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/fontawesome/README.md To create the relevant CSS file which includes all the free icons and necessary CSS classes, create an SCSS file and add an entry to your webpack config file. ```scss $llms-css-prefix: my-prefix-fa; @import '@lifterlms/fontawesome/src/fontawesome'; ``` ```javascript const { resolve } = require( 'path' ), config = generate( {} ); config.entry.fontawesome = resolve( './src/scss/fa-file.scss' ); module.exports = config; ``` -------------------------------- ### Publishing Releases Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/README.md Commands for publishing releases using Lerna. ```bash npm run lerna publish ``` ```bash npm publish . ``` -------------------------------- ### Run All Tests Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/phpunit/README.md Executes all defined tests. ```bash composer run-script tests-run ``` -------------------------------- ### Create GitHub Release Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Command to create a GitHub release and tag from a specified file or branch, with various options for customization. ```bash Usage: index release create [options] Create a GitHub release and tag from a specified file or branch. Options: -a, --archive If specified, the zip file will be committed and force-pushed to the specified branch before creating the release. Pass --no-archive to skip this step. (default: "dev-0.0.5.zip") -A, --no-archive Skip creation from an archive file and use the target --branch for release creation. -c, --commit-message Customize the commit message used when pushing to the target branch. Used only when releasing from an archive. The placeholder "%s" is replaced with the release version. (default: "Release v%s [ci skip]") -d, --dir Directory where distribution files are stored. (default: "dist") -b, --branch Target branch to use when creating the release. (default: "release") -l, --logfile Specify the changelog file. (default: "CHANGELOG.md") -p, --prerelease Mark the GitHub release as a prerelease and skip merging. -P, --prerelease-branch When creating a prerelease, use this branch as the target branch in favor of the default branch specified via the --branch option. (default: "prerelease") -D, --draft Create the release as an unpublished draft and skip merging. -M, --merge Merge open PRs on the specified branch before creating the release. If publishing a prerelease, or draft merging is automatically disabled as if passing "--no-merge". (default: "dev") -n, --no-merge Disable merging before release creation. Automatically passed when publishing a prerelease. -Y, --yes Skip confirmations. -v, --verbose Output extra information with result messages. -h, --help display help for command ``` -------------------------------- ### Build Plugin Assets Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Builds the plugin assets. ```bash npm run build ``` -------------------------------- ### Run Interactive E2E Tests Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/e2e-tests-real.md Command to execute the E2E tests in interactive mode for visual debugging. ```bash npm run tests:dev ``` -------------------------------- ### Run E2E Tests with Environment Variable for Password Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/e2e-tests-real.md Command to run E2E tests, passing the admin password via an environment variable instead of the .llmsenv file. ```bash WP_PASSWORD=yourpassword npm run tests ``` -------------------------------- ### POT Command Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Usage and options for generating i18n pot and json files using the WP-CLI. ```bash Usage: index pot [options] Generate i18n pot and json files using the WP-CLI. Options: -d, --text-domain Specify the text domain. Used to generate the filenames for generated files. (default: "dev") -e, --exclude Specify files to exclude from scanning. (default: "vendor/**, node_modules/**, tmp/**, dist/**, docs/**, src/**, tests/**, *.js.map") -ee, --extra-exclude Additional files to add to the --exclude option. -d, --dir Output directory where generated files will be stored. (default: "i18n") -t, --translator Customize the Last Translator header. (default: "Team LifterLMS ") -b, --bugs Customize the bug report location header. (default: "https://lifterlms.com/my-account/my-tickets") -h, --help display help for command ``` -------------------------------- ### Hooks (Actions and Filters) Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Format for documenting action and filter hooks, including summary, description, changelog, and parameters. @return is not used. ```php /** * Summary. * * Description. * * @since x.x.x * @since x.x.x Description of hook changes. * * @param type $var Description. * @param array $args { * Short description about this hash. * * @type type $var Description. * @type type $var Description. * } * @param type $var Description. */ ``` -------------------------------- ### Run Tests with HTML Code Coverage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/phpunit/README.md Executes tests and generates a code coverage report in HTML format. ```bash composer run-script tests-run -- --coverage-html tmp/coverage ``` -------------------------------- ### Class Properties and Constants Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Format for documenting class properties and constants, including summary, changelog, and type. ```php /** * Summary. * * @since x.x.x * @since x.x.x Description of member changes. * @var type Optional description. */ ``` -------------------------------- ### Run Full Test Suite Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Executes all end-to-end tests. ```bash npm test ``` -------------------------------- ### Run Tests with Text Code Coverage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/phpunit/README.md Executes tests and generates a code coverage report in text format. ```bash composer run-script tests-run -- --coverage-text ``` -------------------------------- ### Class DocBlocks Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/documentation-standards.md Format for documenting classes, including summary, description, links, and changelog. ```php /** * Summary. * * Description. * * @see Super_Class * * @since x.x.x * @since x.x.x Description of class changes. */ ``` -------------------------------- ### Docgen Command Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Usage and options for generating documentation for the CLI. ```bash Usage: index docgen [options] Generates documentation for the CLI. Options: -h, --help display help for command ``` -------------------------------- ### Meta Parse Command Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Usage and options for retrieving metadata from the project's main file. ```bash Usage: index meta parse [options] Retrieves metadata from the project's main file. Options: -F, --file Main project file name. (default: "dev.php") -k, --key Retrieves a single metadata by key name. -f, --format [format] Output format. Accepts: table, json, yaml. (default: "table") -h, --help display help for command ``` -------------------------------- ### update-version Command Usage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Shows the usage and available options for the `update-version` command. ```bash Usage: index update-version [options] Update the project version and replace all [version] placeholders. Options: -i, --increment Increment the version by the specified level. Accepts: major, minor, patch, premajor, preminor, prepatch, or prerelease. (default: "patch") -p, --preid Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -F, --force Specify an explicit version instead of incrementing the current version with --increment. -r, --replacements ] Replacements to be made. Each replacement is an array containing a list of globs for the files to be tested, a regex used to perform the replacement, and an optional list of RegEx flags (defaults to `g` if not supplied). It is recommended that this argument to configured via a configuration file as opposed to being passed via a CLI flag. (default: [["./**","(?<=@(?:since|version|deprecated) +)(\[version\])"],["./*.php,./**/*.php","(?<=(?:_deprecated_argument|_deprecated_constructor|_deprecated_hook|_deprecated_file|_deprecated_function|_doing_it_wrong|apply_filters_deprecated|do_action_deprecated|llms_deprecated_function\().+)(?<=')(\[version\])(?=')"],["*lifterlms*.php","(?<=[Vv]ersion *[:=] *[ '\"])(0|[1-9]d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"],["*lifterlms*.php","(?<=define\( '(?:LLMS|LIFTERLMS).*_VERSION', ')(.*)(?=' \);)"],["./style.css","(?<=Version: )(.+)"]]) -e, --extra-replacements ] Additional replacements added to --replacements array. This option allows adding to the default replacements instead of overwriting them. (default: []) -E, --exclude Specify files to exclude from the update. (default: "./vendor/**, ./node_modules/**, ./tmp/**, ./dist/**, ./docs/**, ./packages/**") -s, --skip-config Skip updating the version of the package.json or composer.json file. (default: true) -h, --help display help for command ``` -------------------------------- ### Run a Specific Test Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/phpunit/README.md Executes a single test method identified by its name. ```bash composer run-script tests-run -- --filter test_my_test_method ``` -------------------------------- ### Using SVGs Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/fontawesome/README.md The svg script can be used to copy the source SVGs into your project. ```bash node ./node_modules/@lifterlms/fontawesome/bin/svg.js [destDir] ``` -------------------------------- ### Package JSON Script Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Add a shorthand script to your package.json to easily access the llms-dev binary. ```json { "scripts": { "dev": "llms-dev" } } ``` -------------------------------- ### Bootstrap Test Data Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Sets up the test environment by creating necessary data like pages, users, and courses. ```bash bash tests/e2e/bin/setup-env.sh ``` -------------------------------- ### Run Single Spec File Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Executes a specific Playwright spec file. ```bash npx wp-scripts test-playwright -- tests/e2e/specs/student/login.spec.js ``` -------------------------------- ### Usage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/icons/README.md Import and use the Icon component with the lifterlms icon set. ```jsx import { Icon, lifterlms } from '@lifterlms/icons'; ; ``` -------------------------------- ### Changelog Write Command Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Usage and options for writing existing changelog entries to the changelog file. ```bash Usage: index changelog write [options] Write existing changelog entries to the changelog file. Options: -p, --preid Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -F, --force Use the specified version string instead of determining the version based on changelog entry significance. -l, --log-file The changelog file. (default: "CHANGELOG.md") -d, --date Changelog publication date. (default: "2022-08-11") -L, --links Add GitHub links to templates and issues in changelog entries. (default: false) -n, --no-links Do not add GitHub links in changelog entries. Use this option to override the --links flag. -D, --dry-run Output what would be written to the changelog instead of writing it to the changelog file. -k, --keep-entries Preserve entry files deletion after the changelog is written. -d, --dir Directory where changelog entries are stored. (default: ".changelogs") -h, --help display help for command ``` -------------------------------- ### Changelog Add Command Usage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Usage details for the 'changelog add' command, including options for significance, type, comments, links, attributions, entry content, title, interactivity, editor usage, and directory. ```bash Usage: index changelog add [options] Create a new changelog entry. Options: -s, --significance The semantic version significance of the change. Accepts: major, minor, patch. (default: "patch") -t, --type The type of change. Accepts: added, changed, fixed, deprecated, removed, dev, performance, security. (default: "changed") -c, --comment An internal-use comment to include with the changelog entry which is not published with the final changelog. -l, --links Link the changelog to one or more GitHub issues. Can be provided multiple times to link to multiple issues. -a, --attributions Attribute the changelog entry to one or more individuals. Attributions are provided to thank contributions which originate from outside the LifterLMS organization. Provide a GitHub username or a markdown-formatted anchor. Can be provided multiple times to attribute to multiple users. -e, --entry The changelog entry. -T, --title Changelog entry file name. Uses the current git branch name as the default. Automatically appends a number to the title if the title already exists. (default: "trunk") -i, --interactive Create the changelog interactively. (default: false) -E, --use-editor When creating a changelog interactively, will open an editor to write the entry, This is useful when creating multi-line entries. -d, --dir <directory> Directory where changelog entries are stored. (default: ".changelogs") -h, --help display help for command ``` -------------------------------- ### Changelog Version Command Usage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Usage details for the 'changelog version' command, including the argument for specifying which version to retrieve and options for preid and directory. ```bash Usage: index changelog version [options] <which> List existing changelog entries. Arguments: which Which version to retrieve. Accepts: current, next. Options: -p, --preid <identifier> Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -d, --dir <directory> Directory where changelog entries are stored. (default: ".changelogs") -h, --help display help for command ``` -------------------------------- ### Model File Names Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/coding-standards.md Files containing model classes should prepend model- instead of class-. ```php model-llms-student.php ``` -------------------------------- ### Running Commands Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md After adding the script, you can access CLI commands using 'npm run dev'. ```bash npm run dev <command> [options...] ``` -------------------------------- ### Release Archive Command Usage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md This code snippet details the usage and options for the 'release archive' command, which is used to build a distribution archive (.zip) file for the project. ```bash Usage: index release archive [options] Build a distribution archive (.zip) file for the project. Options: -i, --inspect Automatically unzip the zip file after creation. (default: false) -d, --dir <dir> Directory where the generated archive file will be saved, relative to the project root directory. (default: "dist") -v, --verbose Output extra information with result messages. (default: false) -h, --help display help for command ``` -------------------------------- ### Changelog List Command Usage Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/packages/dev/README.md Usage details for the 'changelog list' command, including the option to specify the directory where changelog entries are stored. ```bash Usage: index changelog list [options] List existing changelog entries. Options: -d, --dir <directory> Directory where changelog entries are stored. (default: ".changelogs") -h, --help display help for command ``` -------------------------------- ### Run Tests Matching a Name Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/tests/e2e/README.md Executes tests whose names match a given string, using Playwright's --grep option. ```bash npx wp-scripts test-playwright -- --grep "login" ``` -------------------------------- ### Trait File Names Source: https://github.com/gocodebox/lifterlms.git/blob/trunk/docs/coding-standards.md Trait file names should be based on the trait name with underscores replaced by hyphens and the file stored in the includes/traits directory. ```php includes/traits/llms-trait-singleton.php ```