diff --git a/README-long.md b/README-long.md new file mode 100644 index 0000000..a4dcc34 --- /dev/null +++ b/README-long.md @@ -0,0 +1,243 @@ +[![npm (scoped)](https://img.shields.io/npm/v/xpm.svg)](https://www.npmjs.com/package/xpm/) +[![license](https://img.shields.io/github/license/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/blob/master/LICENSE) +[![Standard](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com/) + +# xpm - the xPack project manager + +This project implements `xpm` - the **xPack project manager** - +as a Node.js CLI application. + +The main purpose of `xpm` is to **automate common tasks** and **provide +reproducible builds** for language neutral, multi-version projects. + +More specifically: + +- to manage **build configurations** and to run **actions** (sequences of commands) +associated with various build steps +- to manage versioned **dependencies**, like to install both **source code libraries** +and **binary archives**, and to easily update them when new versions are +available + +So far, two main use cases were considered and successfully implemented: + +- to orchestrate complex multi-architecture/multi-platform builds for +embedded projects (like semihosted unit tests for **µOS++**) +- to perform the multi-platform builds for all binary tools part of the +[xPack 3rd Party Development Tools](https://github.com/xpack-dev-tools/) +project. + +The project is open-source and is hosted on GitHub as +[xpack/xpm-js](https://github.com/xpack/xpm-js.git). + +## Maintainer info + +This page is intended as a brief introduction for those who consider +using this tool to manage their projects. + +For developer and maintainer information, see the separate +[`README-DEVELOPER.md`](https://github.com/xpack/xpm-js/blob/master/README-DEVELOPER.md) +and +[`README-MAINTAINER.md`](https://github.com/xpack/xpm-js/blob/master/README-MAINTAINER.md) +pages. + +## Quick links + +If you already know the general facts about `xpm`, you can directly skip to: + +- project [web site](https://xpack.github.io/xpm/) +- [releases](https://xpack.github.io/xpm/releases/) +- [GitHub](https://github.com/xpack/xpm-js.git) +- [how to install](https://xpack.github.io/xpm/install/) +- [how to get support](https://xpack.github.io/xpm/support/) +- [npmjs/xpm](https://www.npmjs.com/package/xpm/) +- published [versions](https://www.npmjs.com/package/xpm?activeTab=versions) + +## xPacks overview + +**xPacks** are general purpose versioned software packages, +much the same as the highly successful +[npm packages](https://docs.npmjs.com/getting-started/what-is-npm) +in the [Node.js](https://nodejs.org/en/) ecosystem. + +xPacks are usually Git repositories and can be published on +[npmjs.com](https://npmjs.com/) or any npm compatible server. + +For more details, please read the +[xPacks 101](https://xpack.github.io/intro/) page. + +## Prerequisites + +The current version requires Node.js >= 18. + +Since it is highly recommended to **do not** use `sudo` during install, +and instead +**use a version manager** or to customize the **npm** install location, +please read the +[install](https://xpack.github.io/xpm/install/) page for more details. + +## Install + +The basic command is: + +```sh +npm install --global xpm@latest +``` + +Troubleshooting: in case `xpm` was already installed, in certain conditions +the update may not succeed and **xpm** may become unusable; if this happens, +uninstall **xpm** and retry the install. + +For more details, please refer to the +[install](https://xpack.github.io/xpm/install/) page. + +## User info + +To get an initial glimpse on the program, ask it for help: + +```console +% xpm --help + +The xPack project manager command line tool +Usage: xpm [...] [ ...] [...] + +where is one of: + init, install, link, list, run, uninstall + +Common options: + --loglevel Set log level (silent|warn|info|verbose|debug|trace) + -s|--silent Disable all messages (--loglevel silent) + -q|--quiet Mostly quiet, warnings and errors (--loglevel warn) + --informative Informative (--loglevel info) + -v|--verbose Verbose (--loglevel verbose) + -d|--debug Debug messages (--loglevel debug) + -dd|--trace Trace messages (--loglevel trace, -d -d) + --no-update-notifier Skip check for a more recent version + -C Set current folder + +xpm -h|--help Quick help +xpm -h|--help Quick help on command +xpm --version Show version +xpm -i|--interactive Enter interactive mode + +npm xpm@0.19.4 '/Users/ilg/.nvm/versions/node/v16.16.0/lib/node_modules/xpm' +Home page: +Bug reports: +``` + +## Configuration + +Similarly to **npm**, the project configuration is in `package.json`. + +In addition to `name` and `version` which must uniquely identify the project, +there is an `xpack` property that groups several **xpm** +specific properties: + +- `dependencies` +- `devDependencies` +- `properties` +- `actions` +- `buildConfigurations` + +`dependencies` and `devDependencies` are similar to **npm**, but refer to +xPacks. `properties` define values used in substitutions. `actions` are a +more generalised form of the **npm** scripts, which allow arrays of +commands with substitutions. `buildConfigurations` define multiple +configurations, like debug/release. + +## Template substitutions + +To increase reusability, it is possible to use **substitutions** +in the strings defining actions. The syntax is more elaborate than the simple +variable substitution, and is using the +[LiquidJS](https://liquidjs.com/) template engine syntax, +which accepts: + +- **variables**, like `{{ configuration.name }}` +- **filters**, like `{{ configuration.name | downcase }}` +- **tags**, like `{% if os.platform != 'win32' %}xpm run execute --config synthetic-posix-cmake-debug{% endif %}` + +The substitution values come from the following predefined objects: + +- `package`, with the entire `package.json` content +- `properties` with the xPack properties +- `os.platform` with the Node.js platform (possible values are `aix`, + `darwin`, `freebsd`, `linux`, `openbsd`, `sunos`, and `win32`) +- `os.arch` with the Node.js architecture (possible values are `arm`, + `arm64`, `ia32`, `mips`, `mipsel`, `ppc`, `ppc64`, `s390`, `s390x`, + `x32`, and `x64`) + +When the `xpm` command is started with `--config`, +the configuration properties are preferred to the xPack +properties and the following object is also added to `properties`: + +- `configuration` with the full content of the current xPack build + configuration; + the configuration name is available as `configuration.name` + +For the full list of variables available for substitutions, please +read the [documentation](https://xpack.github.io/xpm-liquid-ts/) of +the separate [xpack/xpm-liquid-ts](https://github.com/xpack/xpm-liquid-ts/) +project. + +## Multi-line actions + +In order to accommodate more complex actions, it is possible to define +sequences of commands as arrays of strings, with each line executed as +a separate command. + +If multiple commands are generated via loops, line terminators can be inserted +with `{{ os.EOL }}`), for example: + +```liquid +{% for command in package.xpack.my_commands %}{{ command }}{{ os.EOL }}{% endfor %} +``` + +### The build folder path + +When using build configurations, each build must be performed in a +separate build folder. + +This should be done using the reserved property `buildFolderRelativePath`, +which must define a folder relative to the project root, usually below +a top `build` folder. + +This property can be defined either manually for each configuration, +or globally, as a computed property, available for the entire project. + +The definition can be parametrised with the configuration name, +and possibly converted to a lower case folder name, for example: + +```json + "xpack": { + "properties": { + "buildFolderRelativePath": "{{ 'build' | path_join: configuration.name | to_filename | downcase }}" + } + } +``` + +## Change log - incompatible changes + +According to [semver](https://semver.org) rules: + +> Major version X (X.y.z | X > 0) MUST be incremented if any +backwards incompatible changes are introduced to the public API. + +The incompatible changes, in reverse chronological order, are: + +- v0.19.x: compatible, but based on node 18 +- v0.14.x: separate xPack from npm dependencies (see +[0001](https://xpack.github.io/xpm/policies/0001/) policy) + +## License + +The original content is released under the +[MIT License](https://opensource.org/licenses/MIT), with all rights +reserved to [Liviu Ionescu](https://github.com/ilg-ul/). + +The design is heavily influenced by the `npm` application, +**Copyright (c) npm, Inc. and Contributors**, Licensed on the +terms of **The Artistic License 2.0**. + +## Note + +The **xpm** tool is currently work in progress and should be used with caution. diff --git a/README.md b/README.md index a4dcc34..97fec00 100644 --- a/README.md +++ b/README.md @@ -1,243 +1,25 @@ -[![npm (scoped)](https://img.shields.io/npm/v/xpm.svg)](https://www.npmjs.com/package/xpm/) -[![license](https://img.shields.io/github/license/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/blob/master/LICENSE) -[![Standard](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com/) +[![GitHub package.json version](https://img.shields.io/github/package-json/v/xpack/xpm-js)](https://github.com/xpack/xpm-js/blob/master/package.json) +[![npm (scoped)](https://img.shields.io/npm/v/xpm.svg?color=blue)](https://www.npmjs.com/package/xpm/) +[![license](https://img.shields.io/github/license/xpack/xpm-js)](https://github.com/xpack/xpm-js/blob/master/LICENSE) -# xpm - the xPack project manager +# The xPack Project Manager -This project implements `xpm` - the **xPack project manager** - -as a Node.js CLI application. +A tool to automate builds, tests and manage C/C++ dependencies, inspired by npm. -The main purpose of `xpm` is to **automate common tasks** and **provide -reproducible builds** for language neutral, multi-version projects. +## Project documentation -More specifically: +For information on how to install and use this project, +please refer to the +[project web site](https://xpack.github.io/xpm-js/). -- to manage **build configurations** and to run **actions** (sequences of commands) -associated with various build steps -- to manage versioned **dependencies**, like to install both **source code libraries** -and **binary archives**, and to easily update them when new versions are -available +## Project source -So far, two main use cases were considered and successfully implemented: - -- to orchestrate complex multi-architecture/multi-platform builds for -embedded projects (like semihosted unit tests for **µOS++**) -- to perform the multi-platform builds for all binary tools part of the -[xPack 3rd Party Development Tools](https://github.com/xpack-dev-tools/) -project. - -The project is open-source and is hosted on GitHub as -[xpack/xpm-js](https://github.com/xpack/xpm-js.git). - -## Maintainer info - -This page is intended as a brief introduction for those who consider -using this tool to manage their projects. - -For developer and maintainer information, see the separate -[`README-DEVELOPER.md`](https://github.com/xpack/xpm-js/blob/master/README-DEVELOPER.md) -and -[`README-MAINTAINER.md`](https://github.com/xpack/xpm-js/blob/master/README-MAINTAINER.md) -pages. - -## Quick links - -If you already know the general facts about `xpm`, you can directly skip to: - -- project [web site](https://xpack.github.io/xpm/) -- [releases](https://xpack.github.io/xpm/releases/) -- [GitHub](https://github.com/xpack/xpm-js.git) -- [how to install](https://xpack.github.io/xpm/install/) -- [how to get support](https://xpack.github.io/xpm/support/) -- [npmjs/xpm](https://www.npmjs.com/package/xpm/) -- published [versions](https://www.npmjs.com/package/xpm?activeTab=versions) - -## xPacks overview - -**xPacks** are general purpose versioned software packages, -much the same as the highly successful -[npm packages](https://docs.npmjs.com/getting-started/what-is-npm) -in the [Node.js](https://nodejs.org/en/) ecosystem. - -xPacks are usually Git repositories and can be published on -[npmjs.com](https://npmjs.com/) or any npm compatible server. - -For more details, please read the -[xPacks 101](https://xpack.github.io/intro/) page. - -## Prerequisites - -The current version requires Node.js >= 18. - -Since it is highly recommended to **do not** use `sudo` during install, -and instead -**use a version manager** or to customize the **npm** install location, -please read the -[install](https://xpack.github.io/xpm/install/) page for more details. - -## Install - -The basic command is: - -```sh -npm install --global xpm@latest -``` - -Troubleshooting: in case `xpm` was already installed, in certain conditions -the update may not succeed and **xpm** may become unusable; if this happens, -uninstall **xpm** and retry the install. - -For more details, please refer to the -[install](https://xpack.github.io/xpm/install/) page. - -## User info - -To get an initial glimpse on the program, ask it for help: - -```console -% xpm --help - -The xPack project manager command line tool -Usage: xpm [...] [ ...] [...] - -where is one of: - init, install, link, list, run, uninstall - -Common options: - --loglevel Set log level (silent|warn|info|verbose|debug|trace) - -s|--silent Disable all messages (--loglevel silent) - -q|--quiet Mostly quiet, warnings and errors (--loglevel warn) - --informative Informative (--loglevel info) - -v|--verbose Verbose (--loglevel verbose) - -d|--debug Debug messages (--loglevel debug) - -dd|--trace Trace messages (--loglevel trace, -d -d) - --no-update-notifier Skip check for a more recent version - -C Set current folder - -xpm -h|--help Quick help -xpm -h|--help Quick help on command -xpm --version Show version -xpm -i|--interactive Enter interactive mode - -npm xpm@0.19.4 '/Users/ilg/.nvm/versions/node/v16.16.0/lib/node_modules/xpm' -Home page: -Bug reports: -``` - -## Configuration - -Similarly to **npm**, the project configuration is in `package.json`. - -In addition to `name` and `version` which must uniquely identify the project, -there is an `xpack` property that groups several **xpm** -specific properties: - -- `dependencies` -- `devDependencies` -- `properties` -- `actions` -- `buildConfigurations` - -`dependencies` and `devDependencies` are similar to **npm**, but refer to -xPacks. `properties` define values used in substitutions. `actions` are a -more generalised form of the **npm** scripts, which allow arrays of -commands with substitutions. `buildConfigurations` define multiple -configurations, like debug/release. - -## Template substitutions - -To increase reusability, it is possible to use **substitutions** -in the strings defining actions. The syntax is more elaborate than the simple -variable substitution, and is using the -[LiquidJS](https://liquidjs.com/) template engine syntax, -which accepts: - -- **variables**, like `{{ configuration.name }}` -- **filters**, like `{{ configuration.name | downcase }}` -- **tags**, like `{% if os.platform != 'win32' %}xpm run execute --config synthetic-posix-cmake-debug{% endif %}` - -The substitution values come from the following predefined objects: - -- `package`, with the entire `package.json` content -- `properties` with the xPack properties -- `os.platform` with the Node.js platform (possible values are `aix`, - `darwin`, `freebsd`, `linux`, `openbsd`, `sunos`, and `win32`) -- `os.arch` with the Node.js architecture (possible values are `arm`, - `arm64`, `ia32`, `mips`, `mipsel`, `ppc`, `ppc64`, `s390`, `s390x`, - `x32`, and `x64`) - -When the `xpm` command is started with `--config`, -the configuration properties are preferred to the xPack -properties and the following object is also added to `properties`: - -- `configuration` with the full content of the current xPack build - configuration; - the configuration name is available as `configuration.name` - -For the full list of variables available for substitutions, please -read the [documentation](https://xpack.github.io/xpm-liquid-ts/) of -the separate [xpack/xpm-liquid-ts](https://github.com/xpack/xpm-liquid-ts/) -project. - -## Multi-line actions - -In order to accommodate more complex actions, it is possible to define -sequences of commands as arrays of strings, with each line executed as -a separate command. - -If multiple commands are generated via loops, line terminators can be inserted -with `{{ os.EOL }}`), for example: - -```liquid -{% for command in package.xpack.my_commands %}{{ command }}{{ os.EOL }}{% endfor %} -``` - -### The build folder path - -When using build configurations, each build must be performed in a -separate build folder. - -This should be done using the reserved property `buildFolderRelativePath`, -which must define a folder relative to the project root, usually below -a top `build` folder. - -This property can be defined either manually for each configuration, -or globally, as a computed property, available for the entire project. - -The definition can be parametrised with the configuration name, -and possibly converted to a lower case folder name, for example: - -```json - "xpack": { - "properties": { - "buildFolderRelativePath": "{{ 'build' | path_join: configuration.name | to_filename | downcase }}" - } - } -``` - -## Change log - incompatible changes - -According to [semver](https://semver.org) rules: - -> Major version X (X.y.z | X > 0) MUST be incremented if any -backwards incompatible changes are introduced to the public API. - -The incompatible changes, in reverse chronological order, are: - -- v0.19.x: compatible, but based on node 18 -- v0.14.x: separate xPack from npm dependencies (see -[0001](https://xpack.github.io/xpm/policies/0001/) policy) +The source code of the current release is available +on [GitHub tag v0.19.4 tree](https://github.com/xpack/xpm-js/tree/v0.19.4). ## License -The original content is released under the -[MIT License](https://opensource.org/licenses/MIT), with all rights -reserved to [Liviu Ionescu](https://github.com/ilg-ul/). - -The design is heavily influenced by the `npm` application, -**Copyright (c) npm, Inc. and Contributors**, Licensed on the -terms of **The Artistic License 2.0**. - -## Note - -The **xpm** tool is currently work in progress and should be used with caution. +Unless otherwise stated, the original content is released under the terms of the +[MIT License](https://opensource.org/licenses/mit/), +with all rights reserved to +[Liviu Ionescu](https://github.com/ilg-ul). diff --git a/package-lock.json b/package-lock.json index c87766a..2f4c362 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,8 @@ "del": "^7.1.0", "https-proxy-agent": "^7.0.4", "is-windows": "^1.0.2", - "liquidjs": "^10.10.1", + "json": "^11.0.0", + "liquidjs": "^10.18.0", "make-dir": "^4.0.0", "mz": "^2.7.0", "node-fetch": "^3.3.2", @@ -5647,6 +5648,17 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/json/-/json-11.0.0.tgz", + "integrity": "sha512-N/ITv3Yw9Za8cGxuQqSqrq6RHnlaHWZkAFavcfpH/R52522c26EbihMxnY7A1chxfXJ4d+cEFIsyTgfi9GihrA==", + "bin": { + "json": "lib/json.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", @@ -5787,9 +5799,9 @@ "dev": true }, "node_modules/liquidjs": { - "version": "10.10.1", - "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.10.1.tgz", - "integrity": "sha512-h699VW79OLoshCTjFF02tmRCrd8t/E49LSIsjLwlg4k0TbMVjxsCRXVUEsURXbfKl3HUln2cShlDQCrSNm2YaA==", + "version": "10.18.0", + "resolved": "https://registry.npmjs.org/liquidjs/-/liquidjs-10.18.0.tgz", + "integrity": "sha512-gCJPmpmZ3oi2rMMHo/c+bW1LaRF+ZAKYTWQmKXPp0uK9EkWMFRmgbk3+Io4LSJGAOnpCZSgHJbNzcygx3kfAAQ==", "inBundle": true, "dependencies": { "commander": "^10.0.0" diff --git a/package.json b/package.json index 5e01c3d..5b876bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "xpm", "version": "0.19.4", - "description": "The xPack project manager command line tool", + "description": "A tool to automate builds, tests and manage C/C++ dependencies, inspired by npm", "type": "module", "exports": { "request": "./index.cjs", @@ -17,6 +17,7 @@ }, "scripts": { "npm-install ": "npm install", + "npm-link-deps": "npm link @ilg/cli-start-options @xpack/node-modules-helper", "fix": "standard --fix", "outdated": "npm outdated", "update": "npm update", @@ -32,12 +33,13 @@ "test-coverage": "tap --timeout 600 --allow-incomplete-coverage run \"tests/tap/*.js\"", "tap": "tap --disable-coverage --allow-empty-coverage run", "tap-config-dump": "tap config dump", - "link": "npm link @ilg/cli-start-options", "prepublishOnly": "standard && npm run test-tap -s", "postpublish": "git push origin --follow-tags", "dumpconf": "env | sort | uniq", "deep-clean": "del-cli node_modules package-lock.json", - "npm-version": "echo $(which node) $(node --version) && echo $(which npm) $(npm --version)" + "npm-version": "echo $(which node) $(node --version) && echo $(which npm) $(npm --version)", + "generate-top-commons": "bash node_modules/@xpack/node-modules-helper/maintenance-scripts/generate-top-commons.sh" + }, "repository": { "type": "git", @@ -45,8 +47,10 @@ }, "keywords": [ "xpack", - "package", + "xpm", + "project", "manager", + "cli", "npm" ], "author": { @@ -59,9 +63,9 @@ "bugs": { "url": "https://github.com/xpack/xpm-js/issues/" }, - "homepage": "https://xpack.github.io/xpm/", + "homepage": "https://xpack.github.io/xpm-js/", "engines": { - "node": " >=18" + "node": " >=18.0.0" }, "dependencies": { "@ilg/cli-start-options": "^0.8.2", @@ -75,7 +79,8 @@ "del": "^7.1.0", "https-proxy-agent": "^7.0.4", "is-windows": "^1.0.2", - "liquidjs": "^10.10.1", + "json": "^11.0.0", + "liquidjs": "^10.18.0", "make-dir": "^4.0.0", "mz": "^2.7.0", "node-fetch": "^3.3.2", @@ -125,5 +130,19 @@ "ignore": [ "/website/" ] + }, + "websiteConfig": { + "shortName": "xpm", + "name": "Project Manager", + "longName": "xPack Project Manager", + "title": "xpm - The xPack Project Manager", + "metadataDescription": "The xPack Project Manager command line tool", + "metadataKeywords": "xpm, xpack, project, manager, build, test, dependencies, npm, reproducibility", + "hasCli": "true", + "isInstallGlobally": "true", + "shareOnTwitter": "true", + "hasCustomHomepageFeatures": "true", + "hasCustomUserSidebar": "true", + "hasCustomUserInformation": "true" } } diff --git a/tsconfig-common.json b/tsconfig-common.json new file mode 100644 index 0000000..c2947a5 --- /dev/null +++ b/tsconfig-common.json @@ -0,0 +1,41 @@ +{ + /* https://www.typescriptlang.org/tsconfig */ + "$schema": "https://json.schemastore.org/tsconfig", + + "compilerOptions": { + "sourceMap": true, + "declaration": true, + "target": "es2020", + "lib": [ + "es2020" + ], + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "exactOptionalPropertyTypes": true, + "alwaysStrict": true, + "esModuleInterop": true, + "declarationMap": true, + "forceConsistentCasingInFileNames": true, + "module": "node16", + "moduleResolution": "node16", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "preserveConstEnums": true, + "removeComments": true, + "skipLibCheck": true, + "strict": true, + "typeRoots": [ + "./node_modules/@types", + "./typings" + ], + "useUnknownInCatchVariables": true + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..564fff3 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + /* https://www.typescriptlang.org/tsconfig */ + "$schema": "https://json.schemastore.org/tsconfig", + "extends": "./tsconfig-common.json", + "compilerOptions": { + }, + "exclude": [], + "include": [ + "**/*.ts" + ] +} diff --git a/website/README.md b/website/README.md index e30a927..292700f 100644 --- a/website/README.md +++ b/website/README.md @@ -5,6 +5,27 @@ a modern static website generator. The folder was created with: -```bash +```sh npx create-docusaurus website classic --typescript ``` + +## docusaurus-plugin-typedoc + +This plugin uses [TypeDoc](https://typedoc.org) to generate +the reference as markdown pages in `docs/api`. + +- https://typedoc-plugin-markdown.org/plugins/docusaurus + +```sh +cd website +npm install typedoc typedoc-plugin-markdown docusaurus-plugin-typedoc --save-dev +``` + +[!NOTE] +There is a new spec ([TSDoc](https://tsdoc.org)), pushed by +Microsoft, slightly different, for example there are no +categories or groups. + +[!NOTE] +There is also another plugin, `docusaurus-plugin-typedoc-api`, but +it is no longer maintained. diff --git a/website/babel.config.js b/website/babel.config.js index 14e5baf..535203f 100644 --- a/website/babel.config.js +++ b/website/babel.config.js @@ -1,3 +1,6 @@ +// DO NOT EDIT! +// Automatically generated from docusaurus-template-liquid/templates/docusaurus. + module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')] -} + presets: [require.resolve('@docusaurus/core/lib/babel/preset')], +}; diff --git a/website/blog/2024-11-05-xpm-v0-19-4-released.mdx b/website/blog/2024-11-05-xpm-v0-19-4-released.mdx new file mode 100644 index 0000000..ad31436 --- /dev/null +++ b/website/blog/2024-11-05-xpm-v0-19-4-released.mdx @@ -0,0 +1,91 @@ +--- +title: xPack Project Manager v released +seo_tile: Version released +description: Version v is a TODO new/maintenance release +keywords: + - xpack + - xpm + - release + +date: 2024-11-05 13:59:49 +0200 + +authors: ilg-ul + +# To be listed in the Releases page. +tags: + - releases + +# ----- Custom properties ----------------------------------------------------- + +version: "" + +release_tag_url: "https://github.com/xpack/xpm-js/tree/v" + +--- + +import {PageMetadata} from '@docusaurus/theme-common'; +import Image from '@theme/IdealImage'; +import CodeBlock from '@theme/CodeBlock'; +import Link from '@docusaurus/Link'; + +import Prerequisites from './_common/_prerequisites.mdx' +import DownloadAnalytics from './_common/_download-analytics.mdx' + +TODO: select one summary + +Version **** is a maintenance release; it fixes ... + +Version **** is a new release; it adds .... + + + + + +The [xPack Project Manager](https://xpack.github.io/xpm-js/) +project is a TypeScript and dual mode CommonJS/ECMAScript Node.js module. + + + +## Install + +For installation instructions, please refer to the +[Install Guide](/docs/install/) +page. + +## Import + +To include this module in TypeScript and ECMAScript modules, use `import`: + +```typescript +import { Xxx } from '@xpm/xpm' +``` + +In JavaScript with CommonJS, use `require()`: + +```javascript +const { Xxx } = request('@xpm/xpm') +``` + +## Source code + +- GitHub tag v{frontMatter.version} tree + +## Bug fixes + +- none + +## Enhancements + +- none + +## Known problems + +- none + +## CI tests + +Before publishing, a set of tests were performed . +The results are available from: + +- [GitHub Actions](https://github.com/xpack/xpm-js/actions) + diff --git a/website/blog/2024-11-07-xpm-v0-19-4-released.mdx b/website/blog/2024-11-07-xpm-v0-19-4-released.mdx new file mode 100644 index 0000000..e42d44c --- /dev/null +++ b/website/blog/2024-11-07-xpm-v0-19-4-released.mdx @@ -0,0 +1,91 @@ +--- +title: xPack Project Manager v released +seo_tile: Version released +description: Version v is a TODO new/maintenance release +keywords: + - xpack + - xpm + - release + +date: 2024-11-07 20:19:21 +0200 + +authors: ilg-ul + +# To be listed in the Releases page. +tags: + - releases + +# ----- Custom properties ----------------------------------------------------- + +version: "" + +release_tag_url: "https://github.com/xpack/xpm-js/tree/v" + +--- + +import {PageMetadata} from '@docusaurus/theme-common'; +import Image from '@theme/IdealImage'; +import CodeBlock from '@theme/CodeBlock'; +import Link from '@docusaurus/Link'; + +import Prerequisites from './_common/_prerequisites.mdx' +import DownloadAnalytics from './_common/_download-analytics.mdx' + +TODO: select one summary + +Version **** is a maintenance release; it fixes ... + +Version **** is a new release; it adds .... + + + + + +The [xPack Project Manager](https://xpack.github.io/xpm-js/) +project is a TypeScript and dual mode CommonJS/ECMAScript Node.js module. + + + +## Install + +For installation instructions, please refer to the +[Install Guide](/docs/install/) +page. + +## Import + +To include this module in TypeScript and ECMAScript modules, use `import`: + +```typescript +import { Xxx } from '@xpm/xpm' +``` + +In JavaScript with CommonJS, use `require()`: + +```javascript +const { Xxx } = request('@xpm/xpm') +``` + +## Source code + +- GitHub tag v{frontMatter.version} tree + +## Bug fixes + +- none + +## Enhancements + +- none + +## Known problems + +- none + +## CI tests + +Before publishing, a set of tests were performed . +The results are available from: + +- [GitHub Actions](https://github.com/xpack/xpm-js/actions) + diff --git a/website/blog/_common/_download-analytics.mdx b/website/blog/_common/_download-analytics.mdx new file mode 100644 index 0000000..4173c29 --- /dev/null +++ b/website/blog/_common/_download-analytics.mdx @@ -0,0 +1,15 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from xbb-helper/templates/docusaurus/common. */} + +import Image from '@theme/IdealImage'; + +{/* ------------------------------------------------------------------------ */} + +## Analytics + +- npmjs.com [xpm](https://www.npmjs.com/package/xpm) + - last week downloads [![NPM Downloads](https://img.shields.io/npm/dw/xpm)](https://www.npmjs.com/package/xpm/) + - total downloads [![NPM Downloads](https://img.shields.io/npm/d18m/xpm) +](https://www.npmjs.com/package/xpm/) + +Credit to [Shields IO](https://shields.io) for the badges. diff --git a/website/blog/_common/_prerequisites.mdx b/website/blog/_common/_prerequisites.mdx new file mode 100644 index 0000000..5505d00 --- /dev/null +++ b/website/blog/_common/_prerequisites.mdx @@ -0,0 +1,10 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from xbb-helper/templates/docusaurus/common. */} + +{/* ------------------------------------------------------------------------ */} + +## Prerequisites + +The **xPack Project Manager** is a portable Node.js project, +to install and use it, the only requirement is a recent Node.js +(>= {props.nodeVersion || 'VERSION'}). diff --git a/website/blog/_templates/blog-post-release-liquid.mdx b/website/blog/_templates/blog-post-release-liquid.mdx new file mode 100644 index 0000000..fd25d34 --- /dev/null +++ b/website/blog/_templates/blog-post-release-liquid.mdx @@ -0,0 +1,91 @@ +--- +title: xPack Project Manager v{{npmVersion}} released +seo_tile: Version {{npmVersion}} released +description: Version v{{npmVersion}} is a TODO new/maintenance release +keywords: + - xpack + - xpm + - release + +date: {{releaseDate}} + +authors: ilg-ul + +# To be listed in the Releases page. +tags: + - releases + +# ----- Custom properties ----------------------------------------------------- + +version: "{{npmVersion}}" + +release_tag_url: "https://github.com/xpack/xpm-js/tree/v{{npmVersion}}" + +--- + +import {PageMetadata} from '@docusaurus/theme-common'; +import Image from '@theme/IdealImage'; +import CodeBlock from '@theme/CodeBlock'; +import Link from '@docusaurus/Link'; + +import Prerequisites from './_common/_prerequisites.mdx' +import DownloadAnalytics from './_common/_download-analytics.mdx' + +TODO: select one summary + +Version **{{npmVersion}}** is a maintenance release; it fixes ... + +Version **{{npmVersion}}** is a new release; it adds .... + + + + + +The [xPack Project Manager](https://xpack.github.io/xpm-js/) +project is a TypeScript and dual mode CommonJS/ECMAScript Node.js module. + + + +## Install + +For installation instructions, please refer to the +[Install Guide](/docs/install/) +page. + +## Import + +To include this module in TypeScript and ECMAScript modules, use `import`: + +```typescript +import { Xxx } from '@xpm/xpm' +``` + +In JavaScript with CommonJS, use `require()`: + +```javascript +const { Xxx } = request('@xpm/xpm') +``` + +## Source code + +- GitHub tag v{frontMatter.version} tree + +## Bug fixes + +- none + +## Enhancements + +- none + +## Known problems + +- none + +## CI tests + +Before publishing, a set of tests were performed . +The results are available from: + +- [GitHub Actions](https://github.com/xpack/xpm-js/actions) + diff --git a/website/blog/authors.yml b/website/blog/authors.yml new file mode 100644 index 0000000..dae7df3 --- /dev/null +++ b/website/blog/authors.yml @@ -0,0 +1,14 @@ +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + +ilg-ul: + name: Liviu Ionescu (ilg) + email: ilg@livius.net + url: https://github.com/ilg-ul + image_url: https://github.com/ilg-ul.png + page: true + socials: + x: ilegeul + github: ilg-ul + linkedin: https://www.linkedin.com/in/liviu-ionescu/ + wordpress: https://ilgthegeek.wordpress.com diff --git a/website/blog/tags.yml b/website/blog/tags.yml index 6198c64..34dd52c 100644 --- a/website/blog/tags.yml +++ b/website/blog/tags.yml @@ -1,3 +1,6 @@ +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + releases: web: diff --git a/website/docs/.gitignore b/website/docs/.gitignore new file mode 100644 index 0000000..e5c3d86 --- /dev/null +++ b/website/docs/.gitignore @@ -0,0 +1,2 @@ + +api diff --git a/website/docs/about/index.mdx b/website/docs/about/index.mdx deleted file mode 100644 index 5945d7c..0000000 --- a/website/docs/about/index.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: About -#description: - -#date: - ---- - -# About xpm - -TBD diff --git a/website/docs/api/index.mdx b/website/docs/api/index.mdx deleted file mode 100644 index a099036..0000000 --- a/website/docs/api/index.mdx +++ /dev/null @@ -1 +0,0 @@ -TBD diff --git a/website/docs/cli/xpm/index.mdx b/website/docs/cli/xpm/index.mdx index 0ca22ef..a5e7e74 100644 --- a/website/docs/cli/xpm/index.mdx +++ b/website/docs/cli/xpm/index.mdx @@ -132,9 +132,9 @@ xpm> ## Commands -- [`xpm init`](/cli/init/) -- [`xpm install`](/cli/install/) -- [`xpm link`](/cli/link/) -- [`xpm list`](/cli/list/) -- [`xpm run`](/cli/run/) -- [`xpm uninstall`](/cli/uninstall/) +- [`xpm init`](./init/) +- [`xpm install`](./install/) +- [`xpm link`](./link/) +- [`xpm list`](./list/) +- [`xpm run`](./run/) +- [`xpm uninstall`](./uninstall/) diff --git a/website/docs/cli/xpm/link/index.mdx b/website/docs/cli/xpm/link/index.mdx index f91476f..41e5e83 100644 --- a/website/docs/cli/xpm/link/index.mdx +++ b/website/docs/cli/xpm/link/index.mdx @@ -29,7 +29,7 @@ By default, dependencies are installed in read-only folders, to avoid inadvertently damaging their contents. This command provides a unified solution for continuing -development of source xPacks while being used as dependencies in +development of source libraries while being used as dependencies in an application. It does this by replacing the links to the read-only folders in the diff --git a/website/docs/developer/_common/_get-project-sources.mdx b/website/docs/developer/_common/_get-project-sources.mdx new file mode 100644 index 0000000..2734711 --- /dev/null +++ b/website/docs/developer/_common/_get-project-sources.mdx @@ -0,0 +1,38 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from xbb-helper/templates/docusaurus/common. */} + +{/* ------------------------------------------------------------------------ */} + +## Get project sources + +The project is hosted on GitHub: + +- https://github.com/xpack/xpm-js.git + +The project uses two branches: + +- `master`, with the latest stable version (default) +- `development`, with the current development version + +To clone the stable branch (`master`), run the following commands in a +terminal (on Windows use the Git Bash console): + +```sh +mkdir ~/Work/npm-modules && cd ~/Work/npm-modules +git clone https://github.com/xpack/xpm-js.git xpm-js.git +``` + +For **development** purposes, clone the `development` branch: + +```sh +mkdir ~/Work/npm-modules && cd ~/Work/npm-modules +git clone \ + --branch development \ + https://github.com/xpack/xpm-js.git xpm-js.git +``` + +Or, if the repo was already cloned: + +```sh +git -C ~/Work/npm-modules/xpm-js.git pull +``` diff --git a/website/docs/developer/_common/_prerequisites.mdx b/website/docs/developer/_common/_prerequisites.mdx new file mode 100644 index 0000000..32f090f --- /dev/null +++ b/website/docs/developer/_common/_prerequisites.mdx @@ -0,0 +1,24 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from xbb-helper/templates/docusaurus/common. */} + +import CodeBlock from '@theme/CodeBlock'; + +{/* ------------------------------------------------------------------------ */} + +## Prerequisites + +The **xPack Project Manager** is a portable Node.js project, and development can be +performed on macOS, GNU/Linux and even Windows (although some npm scripts +require bash). + +The prerequisites are: + +- node >= {props.nodeVersion || 'N.N.N'} +- npm + +To ensure compatibility with older node, preferably revert to an older one: + + { +`nvm use --lts ${props.nodeVersionMajor || 'NN'} +code +`} diff --git a/website/docs/developer/_test-results.mdx b/website/docs/developer/_test-results.mdx new file mode 100644 index 0000000..38141d9 --- /dev/null +++ b/website/docs/developer/_test-results.mdx @@ -0,0 +1,35 @@ + +import CodeBlock from '@theme/CodeBlock'; + +import customField from '@site/src/libs/customField'; + +{/* ------------------------------------------------------------------------ */} + +A typical test result looks like: + + { +`% npm run test + +> xpm@${customField('npmVersion')} test +> npm run lint && npm run test-tap -s + + +> xpm@${customField('npmVersion')} lint +> standard + +tests/tap/120-utils-global-config.js .................. 1/1 1s +tests/tap/130-utils-spawn.js .......................... 1/1 924ms +tests/tap/140-utils-xpack.js .......................... 2/2 1s + + +... +`} + +To run a specific test with more verbose output, use `npm run tap`: + + { +`% npm run tap tests/tap/010-xxx.ts + +... +`} + diff --git a/website/docs/developer/index.mdx b/website/docs/developer/index.mdx new file mode 100644 index 0000000..b58e9e2 --- /dev/null +++ b/website/docs/developer/index.mdx @@ -0,0 +1,176 @@ +--- + +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + +title: Developer Information +description: Assistance for developers looking to build the module, including prerequisites, repositories used, and scripts. +keywords: + - xpack + - xpm + - prerequisites + - repositories + - build + +date: 2024-10-25 13:10:00 +0300 + +node_version: 18.20.4 + +--- + +import customField from '@site/src/libs/customField'; +import CodeBlock from '@theme/CodeBlock'; + +import Prerequisites from './_common/_prerequisites.mdx'; +import GetProjectSources from './_common/_get-project-sources.mdx'; + +import TestResults from './_test-results.mdx'; + +{/* ------------------------------------------------------------------------ */} + +[![license](https://img.shields.io/github/license/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/blob/xpack/LICENSE) +[![GitHub issues](https://img.shields.io/github/issues/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/issues) +[![GitHub pulls](https://img.shields.io/github/issues-pr/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/pulls/) +[![TS-Standard - TypeScript Standard Style Guide](https://badgen.net/badge/code%20style/ts-standard/blue?icon=typescript)](https://github.com/standard/ts-standard/) + +# How to build xpm + +This page is designed for developers of the +**xPack Project Manager** +project and provides documentation on how to build and test the package. + + + + + +## Satisfy dependencies + +```sh +npm --prefix ~/Work/npm-modules/xpm-js.git install +``` + +## Add links for development + +To facilitate the use of this module in other packages, add a link +from the central npm storage to this local development folder: + +```sh +npm --prefix ~/Work/npm-modules/xpm-js.git link +``` + +And in the projects referring it: + +```sh +npm link xpm +``` + +## Start the compile background task + +The TypeScript compiler can automatically recompile modified files. For +this, start it in `watch` mode. + +```sh +npm --prefix ~/Work/npm-modules/xpm-js.git run compile-watch +``` + +## Language standard compliance + +The current version is compiled with TypeScript : + +- https://www.typescriptlang.org +- https://www.typescriptlang.org/docs/handbook + +The compiler is configured to produce `es2020` & `commonjs` files, +which means ECMAScript6 with legacy CommonJS modules, that can be imported +by any other project either via `require()` or `import`. + +For more details on how to configure `tsconfig.json`, please see: + +- [TSConfig](https://www.typescriptlang.org/tsconfig/) + +## Standard style + +As style, the project uses `ts-standard`, the TypeScript variant of +[Standard Style](https://standardjs.com/#typescript), +automatically checked at each commit via CI. + +```js +// eslint-disable-next-line @typescript-eslint/no-xxx-yyy +``` + +The known rules are documented in the +[typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules) +project. + +Generally, to fit two editor windows side by side in a screen, +all files should limit the line length to 80. + +```js +/* eslint max-len: [ "error", 80, { "ignoreUrls": true } ] */ +``` + +Known and accepted exceptions: + +- none + +To manually fix compliance with the style guide (where possible): + + { +`% npm run fix + +> xpm@${customField('version')} fix +> ts-standard --fix src && standard --fix test +... +`} + +## Documentation metadata + +The documentation metadata uses the +[TypeDoc](https://typedoc.org/guides/doccomments/) tags, without +explicit types, since they are provided by TypeScript. + +:::note + +Microsoft is currently developing a new project ([TSDoc](https://tsdoc.org)) +which tries to standardise TypeScript documentation metadata. + +This standard is generaly compatible with TypeDoc; at the time of +this writing, among the visible differences is the lack +of the `@category` or `@group` tags. + +::: + +## Tests + +The tests use the [`node-tap`](http://www.node-tap.org) framework +(_A Test-Anything-Protocol library for Node.js_, written by Isaac Schlueter). + +Tests can be written in TypeScript, assuming `ts-node` is also installed +(https://node-tap.org/docs/using-with/#using-tap-with-typescript) + +As for any `npm` package, the standard way to run the project tests is via +`npm run test`: + +```sh +npm --prefix ~/Work/npm-modules/xpm-js.git install +npm --prefix ~/Work/npm-modules/xpm-js.git run test +``` + + + + + +### Continuous Integration (CI) + +The module is +CI tested on every push via +[GitHub Actions](https://github.com/xpack/xpm-js/actions), on Ubuntu, +Windows and macOS, using node 18 and 20. + +## Tricks & tips + +To trace TypeScript module resolution: + +```json + "compile": "tsc --traceResolution -p ./", +``` diff --git a/website/docs/faq/index.mdx b/website/docs/faq/index.mdx index 37ae1e1..c92bcd4 100644 --- a/website/docs/faq/index.mdx +++ b/website/docs/faq/index.mdx @@ -1,13 +1,200 @@ --- + title: FAQ -#description: +description: Answers to previously asked questions, so you can find solutions without having to ask again. + +keywords: + - xpack + - xpm + - frequently + - asked + - questions hide_table_of_contents: true -date: 2019-06-28 11:03:00 +0300 +date: 2024-10-24 23:58:00 +0300 --- # The xpm Frequently Asked Questions -TBD + +
+`error: Cannot read property 'path' of null` (aggressive antivirus) + +This problem is specific to Windows and is caused by aggressive antivirus programs. + +On Windows, binary xPacks are `.zip` archives containing `.exe` files; +some aggressive antivirus programs may quarantine those files, or +even modify the content of the archives, affecting the checksum and +thus preventing the packages to be installed. + +Errors may look like: + +```console +Downloading https://github.com/gnu-mcu-eclipse/qemu/releases/download/v2.8.0-4-20190211/gnu-mcu-eclipse-qemu-2.8.0-4-20190211-0633-win64.zip... +{ Error: sha256-p3CgzXJt4zi5g0kxQXlOpss3Xu5Yy+Zv8HXWXkUdg6g= integrity checksum failed when using sha256: wanted sha256-p3CgzXJt4zi5g0kxQXlOpss3Xu5Yy+Zv8HXWXkUdg6g= but got sha512-k1s9UW6Zb20llIuopUwbf3D38OP1F+Nkgf3wGWwsXPwoQfhuiR89+VF3Rrf7YF20fN3tG4/3jZSC3apiHbQ6NA== sha256-ABnfxLMtY8E5KqJkrtIlPB4ML7CSFvjizCabv7i7SbU=. (9 bytes) +... +Extracting 'gnu-mcu-eclipse-qemu-2.8.0-4-20190211-0633-win64.zip'... +error: Cannot read property 'path' of null +``` + +The solution is to configure the antivirus program to be less aggressive, +at least for files in the +`AppData\Roaming\xPacks` and `AppData\Local\Caches\xPacks` folders. + +If this is not possible, temporarily disable the antivirus program. Or switch +to a better operating system. + +
+ +
+`... running scripts is disabled on this system` (PowerShell) + +Recent Windows versions use PowerShell, which has a more restrictive +execution policy intended to prevent +the execution of malicious scripts; unfortunately this also prevents +the execution of node.js applications. + +If you get a message in the console as the one below: + +```txt +xpm : File C:\Users\...\AppData\Roaming\npm\xpm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at +https:/go.microsoft.com/fwlink/?LinkID=135170. +At line:1 char:1 ++ xpm init --template @xpack/hello-world-template@latest --property lan ... ++ ~~~ + + CategoryInfo : SecurityError: (:) [], PSSecurityException + + FullyQualifiedErrorId : UnauthorizedAccess +The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command xpm init --template @xpack/hello-world-template@latest --property language +``` + +then run the following command in a PowerShell terminal: + +```txt +Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser +``` + +For more details please read the Microsoft +[about_Execution_Policies](https://docs.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1) page. + +
+ +
+`zsh: command not found: xpm` + +The location where npm installs global modules got lost; most probably +you recently switched to `zsh` and forgot to migrate the shell startup +to `.zprofile`. + +Copy the `PATH` setting from your previous shell startup file to +`.zprofile`. + +
+ +
+Why xpm manages configurations, instead of limiting itself to managing +dependencies/packages, isn't it a package manager? + +No, xpm is not a _package manager_, it is a **project manager**. + +In the most generic use case, configurations can have specific dependencies, +for example different configurations can use different architecture +toolchains, or, in test cases, even different versions of the same +toolchain. + +Therefore, defining configurations in `package.json` is probably the +best choice, otherwise both xpm and the build tools must handle +multiple files with partly redundant content. + +
+ +
+`static async start () ... SyntaxError: Unexpected identifier` + +This problem occurs usually on GNU/Linux, and is caused by trying to use +the outdated version of Node available in the distribution, which +does not understand the `async` keyword. + +Errors may look like: + +```console +$ xpm -v +/home/ilg/opt/npm/lib/node_modules/xpm/node_modules/@ilg/cli-start-options/lib/cli-application.js:150 + static async start () { + ^^^^^ +SyntaxError: Unexpected identifier + at exports.runInThisContext (vm.js:53:16) + at Module._compile (module.js:374:25) + at Object.Module._extensions..js (module.js:417:10) + at Module.load (module.js:344:32) + at Function.Module._load (module.js:301:12) + at Module.require (module.js:354:17) + at require (internal/module.js:12:17) + at Object. (/home/ilg/opt/npm/lib/node_modules/xpm/node_modules/@ilg/cli-start-options/index.js:55:24) + at Module._compile (module.js:410:26) + at Object.Module._extensions..js (module.js:417:10) +``` + +The solution is to install the most recent LTS version of Node, as +described in the [prerequisite](/docs/install/) page. + +
+ +
+Cannot find the `Library` folder (on macOS) + +Yes, due to an unfortunate Apple decision, +this folder is hidden for regular browsing in Finder. + +To make it back visible, use: + +```sh +/usr/bin/chflags nohidden ~/Library +xattr -d com.apple.FinderInfo ~/Library +``` + +
+ +
+Cannot find the `.content` folder (on macOS) + +Yes, due to an unfortunate Apple decision, +all folders starting with a dot are hidden for regular browsing in Finder. + +Fortunately there is a workaround for this: + +```console +cmd+shift+'.' +``` + +This keyboard shortcut works like a toggle, using it once makes files +starting with dot visible, +using it again reverts to hiding them. + +
+ +
+`Cannot find module '@ilg/cli-start-options'` + +In certain conditions, npm may fail when installing +a new xpm over a very old existing one, and xpm becomes unusable, +complaining about missing modules. + +```console +% xpm --version +internal/modules/cjs/loader.js:888 + throw err; + ^ + +Error: Cannot find module '@ilg/cli-start-options' +Require stack: +- /home/ilg/.nvm/versions/node/v18.18.2/lib/node_modules/xpm/lib/main.js +- /home/ilg/.nvm/versions/node/v18.18.2/lib/node_modules/xpm/bin/xpm.js + at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15) +``` + +If this happens, a new install usually fixes the problem, +if not, the safe way is to first uninstall xpm and then re-install. + +
diff --git a/website/docs/getting-started/_common/_commonjs-compatibility.mdx b/website/docs/getting-started/_common/_commonjs-compatibility.mdx new file mode 100644 index 0000000..c4278cc --- /dev/null +++ b/website/docs/getting-started/_common/_commonjs-compatibility.mdx @@ -0,0 +1,11 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from xbb-helper/templates/docusaurus/common. */} + +{/* ------------------------------------------------------------------------ */} + +:::note + +Compatibility with legacy CommonJS is required until VS Code extensions +will be updated to import ES6 modules. + +::: diff --git a/website/docs/getting-started/_common/_github-and-npmjs.mdx b/website/docs/getting-started/_common/_github-and-npmjs.mdx new file mode 100644 index 0000000..6f28387 --- /dev/null +++ b/website/docs/getting-started/_common/_github-and-npmjs.mdx @@ -0,0 +1,9 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from xbb-helper/templates/docusaurus/common. */} + +{/* ------------------------------------------------------------------------ */} + +The open source project is hosted on GitHub as +[xpack/xpm-js](https://github.com/xpack/xpm-js) +and is published on npmjs.com as +[xpm](https://www.npmjs.com/package/xpm). diff --git a/website/docs/getting-started/_compatibility.mdx b/website/docs/getting-started/_compatibility.mdx new file mode 100644 index 0000000..33a4b14 --- /dev/null +++ b/website/docs/getting-started/_compatibility.mdx @@ -0,0 +1,7 @@ + +{/* ------------------------------------------------------------------------ */} + +### v0.y.z + +These are the initial development versions. + diff --git a/website/docs/getting-started/_overview.mdx b/website/docs/getting-started/_overview.mdx new file mode 100644 index 0000000..48f5293 --- /dev/null +++ b/website/docs/getting-started/_overview.mdx @@ -0,0 +1,85 @@ + +import CommonJsCompatibility from './_common/_commonjs-compatibility.mdx' +import GithubAndNpmjs from './_common/_github-and-npmjs.mdx' + +{/* ------------------------------------------------------------------------ */} + +## First, let's clarify what xpm is NOT + +- **xpm** is NOT a **npm** replacement +- **xpm** is NOT just another package manager +- **xpm** is NOT introducing a new package format + +## Then what is it? + +**xpm**, short for **x**Pack **P**roject **M**anager, is a +[Node.js](https://nodejs.org/en/) CommonJS module and a CLI +application designed to **automate builds**, **tests** and +**manage C/C++ dependencies**. It draws inspiration from **npm**. + + + + + +## xPacks + + +**xPacks** (short for **xpm packages**) are general-purpose, language-neutral software packages. + +
+What the heck are xPacks? Please, do not introduce another package format! + +Based on the content, there are two types of packages: + +- packages with source libraries (source xPacks) +- packages with executables, usually platform specific binary tools (binary xPacks) + +The source xPacks are regular npm packages, and include the source files. + +The binary xPacks are also regular npm packages, but with a minimal content, +mandatory being only the `package.json` file. Since the binary xPacks provide +executables for multiple platforms, some very large, it is not reasonable to pack all together in the npm package. Instead, the `package.json` file +includes references to archives with the platform specific binaries +(such as .tar.gz for Unix or .zip for Windows). + +Simply put, xPacks can be used to further automate the installation of source libraries and tools. +
+ +By design, xPacks support multiple versions, allowing packages to have +**various versions installed simultaneously**. Each project or configuration +can maintain its own set of dependencies, ensuring that system upgrades do +not affect existing projects. + +## Features + +**xpm** complements **npm**; it streamlines cross-platform builds +and tests with its distinctive set of features: + +- is capable to install the same format of packages as +**npm**, including those from Git repositories and from the same public +repository ([npmjs.com](https://www.npmjs.com)) +- can lock specific versions of source and binary packages as project **dependencies**, and install them on demand +- can manage multiple **build configurations**, such as debug/release builds, or platform specific tests +- can lock specific versions of packages as build configuration **dependencies** +- enables the definition of **multi-line command actions** at the project or +build configuration level +- manages **properties**, possibly with **complex substitutions** (performed via the + [LiquidJS](https://liquidjs.com) engine) +- runs on **Windows**, **macOS** and **GNU/Linux** + + +## Benefits + +- being able to develop exactly the same project on Windows, macOS and +GNU/Linux allows team members the **freedom to use their preferred platform** +- locking the project to specific versions of dependencies provides a **good +reproducibility** (stability over time and across different environments) +- defining dependencies at build configuration levels allows to **run +tests for different architechtures** (like native vs Arm vs RISC-V) +- being able to install multiple versions of the same package at the same time +allows to run tests with **multiple versions of the same toolchain** +- multi-line commands, with parameters and substitutions provide a very +**powerful portable scripting mechanism** +- being able to install packages directly from Git/GitHub **simplifies +maintenance** of some packages during development + diff --git a/website/docs/getting-started/_status.mdx b/website/docs/getting-started/_status.mdx new file mode 100644 index 0000000..0fb7d2d --- /dev/null +++ b/website/docs/getting-started/_status.mdx @@ -0,0 +1,19 @@ + +{/* ------------------------------------------------------------------------ */} + +## Status + +**xpm** is **fully functional**, but it is still under development; +therefore, according to +[SemVer](https://semver.org), the version is kept as `0.y.z`. + +A rework in TypeScript is planned for the near future. Once completed, the +releases will begin from version 1.0.0, marking the program's transition to +production status. + +:::caution + +As **xpm** is still under development, it is recommended to use it with caution. + +::: + diff --git a/website/docs/getting-started/index.mdx b/website/docs/getting-started/index.mdx index 536e8f9..3bb47fc 100644 --- a/website/docs/getting-started/index.mdx +++ b/website/docs/getting-started/index.mdx @@ -1,11 +1,80 @@ --- + +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + title: Getting Started -#description: +description: The initial steps to explore the project, including what xpacks are, the project's features, benefits, compatibility, and available documentation. +keywords: + - xpack + - xpm + - overview + - compatibility -date: 2017-10-09 14:14:00 +0300 +date: 2024-10-24 18:58:00 +0300 --- +import Overview from './_overview.mdx' +import Compatibility from './_compatibility.mdx' +import Status from './_status.mdx' + +{/* ------------------------------------------------------------------------ */} + +[![license](https://img.shields.io/github/license/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/blob/xpack/LICENSE) +![GitHub Repo stars](https://img.shields.io/github/stars/xpack/xpm-js) + # Getting Started with xpm -TBD + + +## Install + +[xpm](https://www.npmjs.com/package/xpm) is a npm package available +from the npmjs.com public registry and can be installed via **npm**. + +:::tip + +The simplest way to obtain the install command is from the web homepage. +Just hover your mouse over the command, and a copy button will appear +on the right side. Click it to copy the command. + +::: + +For detailed installation instructions, please refer to the +[Install Guide](/docs/install/) page. + + + +## Compatibility notices + +According to [SemVer](https://semver.org) rules: + +> Major version X (X.y.z | X > 0) MUST be incremented if any +backwards incompatible changes are introduced to the public API. + + + +## Maintainer & developer info + +For information specific to maintainers and developers, please refer to +the separate +[Maintainer Information](/docs/maintainer/) and +[Developer Information](/docs/developer/) +pages. + +## License + +The original content is released under the +[MIT License](https://opensource.org/license/mit/), +with all rights reserved to +[Liviu Ionescu](https://github.com/ilg-ul). + +## Enjoyed Using This Project? Let Us Know! + +If you enjoyed using this project, please let us know! Here are some ways you can show your support: + +- **Donate**: Your contributions (small or +generous) help us keep the xPack projects thriving. [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/donate/?hosted_button_id=5MFRG9ZRBETQ8) +- **Star** the project on [GitHub](https://github.com/xpack//): It helps others discover our work. +- **Follow** us on [X/Twitter](https://twitter.com/xpack_project/): Stay updated with our latest releases and news. diff --git a/website/docs/install/_custom-install.mdx b/website/docs/install/_custom-install.mdx new file mode 100644 index 0000000..9193553 --- /dev/null +++ b/website/docs/install/_custom-install.mdx @@ -0,0 +1,377 @@ + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import CodeBlock from '@theme/CodeBlock'; +import Heading from '@theme/Heading'; + +import customField from '@site/src/libs/customField'; + +{/* ------------------------------------------------------------------------ */} + +## Prerequisites + +- a recent [Node.js](https://nodejs.org) ("engines.node": ">=18.0.0") +- a recent [npm](https://docs.npmjs.com/cli/npm) (installed by **node**). + +If this is your first time using **node**, it is highly recommended +to read the instructions +on the [Prerequisites](https://xpack.github.io/install/) page. + +### Quick instructions + +For those who have already performed the install steps on the +[Prerequisites](https://xpack.github.io/install/) page and are +familiar with the process, here are the commands you need. +Simply copy and paste them into your terminal. + + + + + +Download the Windows **Prebuilt Installer** (a `node-v*-x64.msi` file) from the +[Download Node.js](https://nodejs.org/en/download/prebuilt-installer) +page and install it as usual, with administrative rights. +**Avoid** selecting the **Tools for Native Modules** during installation. + +Although not mandatory, it is recommended to update **npm** to the +latest version: + +```txt +npm install -location=global npm@latest +``` + +Update the user `Path` and make it persistent: + +```txt +set Path=%APPDATA%\npm;%Path% +setx Path "%APPDATA%\npm;%Path%" +``` + +Configure PowerShell to allow the execution of node.js applications: + +```txt +Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser +``` + + + + + +To install **node** via the **nvm** version manager, +run the following script through your shell: + +```sh +curl https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh | ${SHELL} + +export NVM_DIR="$HOME/.nvm" +source "$NVM_DIR/nvm.sh" +``` + +:::tip + +This script, in addition to installing **node** and **npm**, +also installs **xpm**, so you can safely skip the next section. + +::: + + + + + +To install **node** via the **nvm** version manager, +run the following script through your shell: + +```sh +wget -q -O - https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh | ${SHELL} + +export NVM_DIR="$HOME/.nvm" +source "$NVM_DIR/nvm.sh" +``` + +:::tip + +This script, in addition to installing **node** and **npm**, +also installs **xpm**, so you can safely skip the next section. + +::: + + + + + +## Install + +:::caution + +Please be sure that the **xpm** you are trying to install is the +**xPack Project Manager**, since there are other projects that +unfortunately use the same name +(for example verseles/xpm, the _uniX Package Manager_). + +::: + +With the environment properly set, the command to install **xpm** is: + +```sh +npm install --location=global xpm@latest +``` + +This command installs the latest available version. + +To install a specific version, mention it explicitly: + + { +`npm install --location=global xpm@${customField('releaseVersion')} +`} + + + + + +On Windows, global Node.js packages are installed in the +user home folder, in `%APPDATA%\npm` +(like `C:\Users\ilg\AppData\Roaming\npm`), and managing packages +does not require administrative rights. + +The result of installing **xpm** is a set of files in the `%APPDATA%\npm` folder: + +```txt +C:\>dir "%APPDATA%"\npm\xpm* + Volume in drive C has no label. + Volume Serial Number is B02D-925C + + Directory of C:\Users\ilg\AppData\Roaming\npm + +29/07/2024 07:24 397 xpm +29/07/2024 07:24 329 xpm.cmd +29/07/2024 07:24 821 xpm.ps1 + 3 File(s) 1,547 bytes + 0 Dir(s) 39,088,439,296 bytes free +``` + +If you followed the instructions in the +prerequisites section, you should +already have this path configured and the program should start normally: + + { +`C:\>xpm --version +${customField('releaseVersion')} +`} + + + + + +On macOS, if you followed the instructions in the +prerequisites section, you should +already have **npm** configured to use a location in the home folder. + +```sh +% which xpm +/Users/ilg/.nvm/versions/node/${props.nodeVersion}/bin/xpm +``` + +To test if **xpm** starts: + + { +`% xpm --version +${customField('releaseVersion')} +`} + +Show macOS hidden files + +The default location used to install the global packages is +below `~/Library`, a folder that, due to an unfortunate Apple decision, +is hidden for regular browsing in Finder. + +To make it back visible, use: + +```sh +/usr/bin/chflags nohidden ~/Library +xattr -d com.apple.FinderInfo ~/Library +``` + +A more general solution is to make all hidden files visible: + +```sh +defaults write com.apple.Finder AppleShowAllFiles true +killall Finder +``` + +Another annoying behaviour of the file browser is to hide names starting +with `.` (dot), which is a real pity since the binary packages are +extracted in a folder named `.content`. + +Fortunately there is a workaround for this too: + +```console +cmd+shift+'.' +``` + +This keyboard shortcut works like a toggle, using it once makes files +starting with dot visible, +using it again reverts to hiding them. + + + + + +On GNU/Linux, by default, global Node.js packages are installed in +`/usr/local`, and managing them requires administrative rights, +but if you followed the instructions in the +[prerequisites](/docs/install/) page, you should +already have configured npm to use a location in the home folder. + +:::note + +Support for Arm platforms was +added in the 0.6.2 release of xpm. + +::: + +To test if xpm starts: + + { +`$ which xpm +/home/ilg/.nvm/versions/node/${props.nodeVersion}/bin/xpm +$ xpm --version +${customField('releaseVersion')} +`} + + + + + +## Uninstall + +To remove **xpm**, the command is: + +```sh +npm uninstall --location=global xpm +``` + +## Do not install with administrative rights! + +Installing **npm** with administrative rights is strongly discouraged, +as it leads to installing **xpm** with administrative rights as well. +Instead, use a node version manager. + +For completeness, the official page explaining how to install **npm** in +a custom folder is +[Resolving EACCES permissions errors when installing packages globally](https://docs.npmjs.com/getting-started/fixing-npm-permissions). + +## npx + +If, for any reason, you decide not to install **xpm**, you can still +benefit from it by using the `npx` command, as a trampoline to start **xpm**: + + { +`$ npx xpm --version +${customField('releaseVersion')} +`} + +However, for regular usage, this method is not efficient, since +**npx** will need to prepare the Node.js module +for each run, and this takes some time. + +## npm folders + +For more details on the folders used by npm, see +[npm-folders](https://docs.npmjs.com/files/folders). + +## xpm folders + +To avoid security issues and the need for elevaated user privileges, +**xpm** operates entirely within the user home folder, avoiding +the use of system folders. + +There are the folders in use: + +- a cache folder, where all downloaded files are stored +- a global xPacks store folder, where the xpm packages are expanded + +
+Clean-ups + +For a thorough clean-up, these two folders can be removed at any time; +**xpm** will recreate them on new installs. + + + + + +- `%APPDATA%\Roaming\xPacks` +- `%APPDATA%\Local\Caches\xPacks` + + + + + +- `${HOME}/Library/xPacks` +- `${HOME}/Library/Caches/xPacks` + + + + + +- `${HOME}/.local/xPacks` +- `${HOME}/.cache/xPacks` + + + + + +
+ +For more details see [xpm folders](/docs/user/folders/). + +## Proxy + +If you are behind a firewall, you need to configure +a proxy. + +**xpm** uses `pacote` (the same Node.js module as **npm**) to fetch +the packages. Therefore, setting a proxy for **npm** will also work for **xpm**. + +In addition, **xpm** uses `node-fetch`, +`https-proxy-agent`, `proxy-from-env` to download the binary +archives. These packages require setting the `http_proxy` & `https_proxy` +variables in the environment. +See [proxy-from-env](https://www.npmjs.com/package/proxy-from-env) for +details. + +## Quick info + +To get an initial overview of the program, +request help by using the following command: + + { +`% xpm --help + +The xPack project manager command line tool +Usage: xpm [...] [ ...] [...] + +where is one of: + init, install, link, list, run, uninstall + +Common options: + --loglevel Set log level (silent|warn|info|verbose|debug|trace) + -s|--silent Disable all messages (--loglevel silent) + -q|--quiet Mostly quiet, warnings and errors (--loglevel warn) + --informative Informative (--loglevel info) + -v|--verbose Verbose (--loglevel verbose) + -d|--debug Debug messages (--loglevel debug) + -dd|--trace Trace messages (--loglevel trace, -d -d) + --no-update-notifier Skip check for a more recent version + -C Set current folder + +xpm -h|--help Quick help +xpm -h|--help Quick help on command +xpm --version Show version +xpm -i|--interactive Enter interactive mode + +npm xpm@${customField('releaseVersion')} '/Users/ilg/.nvm/versions/node/${frontMatter.node_version}/lib/node_modules/xpm' +Home page: +Bug reports: +% +`} diff --git a/website/docs/install/index.mdx b/website/docs/install/index.mdx index abc5472..a965c61 100644 --- a/website/docs/install/index.mdx +++ b/website/docs/install/index.mdx @@ -1,11 +1,37 @@ --- + +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + title: Install Guide -#description: +description: Explain the prerequisites, how to perform an automated installation, how to uninstall. +keywords: + - xpack + - xpm + - prerequisites + - automated + - install + - uninstall + +date: 2024-10-24 23:57:00 +0300 -date: 2017-10-09 14:14:00 +0300 +node_version: 18.20.4 --- + +import CustomInstall from './_custom-install.mdx' + + +{/* ------------------------------------------------------------------------ */} + +[![GitHub package.json version](https://img.shields.io/github/package-json/v/xpack/xpm-js?color=green)](https://github.com/xpack/xpm-js/blob/mater/package.json) +[![npm (scoped)](https://img.shields.io/npm/v/xpm.svg?color=green)](https://www.npmjs.com/package/xpm/) +[![NPM Downloads](https://img.shields.io/npm/dw/xpm)](https://www.npmjs.com/package/xpm/) +[![NPM Downloads](https://img.shields.io/npm/d18m/xpm)](https://www.npmjs.com/package/xpm/) + # How to install xpm -TBD + + + diff --git a/website/docs/maintainer/_more.mdx b/website/docs/maintainer/_more.mdx new file mode 100644 index 0000000..2a39939 --- /dev/null +++ b/website/docs/maintainer/_more.mdx @@ -0,0 +1,2 @@ + +{/* ------------------------------------------------------------------------ */} diff --git a/website/docs/maintainer/index.mdx b/website/docs/maintainer/index.mdx new file mode 100644 index 0000000..3800452 --- /dev/null +++ b/website/docs/maintainer/index.mdx @@ -0,0 +1,319 @@ +--- + +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + +title: Maintainer Information +description: Assistance for project maintainers, including the release schedule, versioning scheme, and instructions on how to build, test, and publish. +keywords: + - xpack + - xpm + - releases + - build + - publish + - npmjs + +date: 2024-10-24 23:59:00 +0300 + +--- + +import CodeBlock from '@theme/CodeBlock'; + +import customField from '@site/src/libs/customField'; + +import Prerequisites from '../developer/_common/_prerequisites.mdx'; +import GetProjectSources from '../developer/_common/_get-project-sources.mdx'; + +import More from './_more.mdx'; + +{/* ------------------------------------------------------------------------ */} + +[![GitHub package.json version](https://img.shields.io/github/package-json/v/xpack/xpm-js?color=green)](https://github.com/xpack/xpm-js/blob/mater/package.json) +[![npm (scoped)](https://img.shields.io/npm/v/xpm.svg?color=green)](https://www.npmjs.com/package/xpm/) +[![license](https://img.shields.io/github/license/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/blob/xpack/LICENSE) +[![CI on Push](https://github.com/xpack/xpm-js/actions/workflows/test-ci.yml/badge.svg)](https://github.com/xpack/xpm-js/actions/workflows/test-ci.yml) +[![GitHub issues](https://img.shields.io/github/issues/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/issues) +[![GitHub pulls](https://img.shields.io/github/issues-pr/xpack/xpm-js.svg)](https://github.com/xpack/xpm-js/pulls) +[![TS-Standard - TypeScript Standard Style Guide](https://badgen.net/badge/code%20style/ts-standard/blue?icon=typescript)](https://github.com/standard/ts-standard/) + +# How to make new xpm releases + +This page is designed for maintainers of the +**xPack Project Manager** +project and provides documentation on how to create new releases. + + + + + +## Release schedule + +There are no fixed releases. + +## Prepare the new releases + +### Check Git + +In the `xpack/xpm-js` Git repo: + +- switch to the `development` branch +- pull new changes +- if necessary, merge the `master` branch +- if necessary, merge the `website` branch + +:::caution + +This is really important, otherwise the next steps will build again the previous release! + +::: + +The `master` branch should be unchanged since the previous release +and will be updated when the new release is out. + +### Update npm packages + +:::note + +This package is also used by the VS Code extension and, until VS Code will +accept ESM dependencies, it must be +kept as a legacy CommonJS dependency. + +::: + +- `npm outdated` +- `npm update` or edit and `npm install` +- repeat and possibly manually edit `package.json` until everything is + up to date +- commit the changes + +Keep: + +- [`@types/node`](https://www.npmjs.com/package/@types/node?activeTab=versions) + locked to latest that still matches the oldest supported node (18). + +### Increase the version and update it in the top `package.json` + +As required by npm modules, this one also uses [SemVer](https://semver.org). + +- determine the next version (like {customField('releaseVersion')}) +- update the version in the top `package.json` file +- use the new version, suffixed by `-pre`, like {customField('releaseVersion')}-pre. + +### Update the `websiteConfig` in top `package.json` (if necessary) + +Check and possibly update the `websiteConfig`. + +### Start the local web server + +Execute the npm script `clean` then `start` in the website sub-project, +or run the following in a terminal: + +```sh +npm --prefix ~/Work/npm-modules/xpm-js.git/website run clean +npm --prefix ~/Work/npm-modules/xpm-js.git/website run start +``` + +Navigate to the **Maintainer Info** page, +the **Fix possible open issues** section. + +### Fix possible open issues + +Check GitHub issues and pull requests: + +- https://github.com/xpack/xpm-js/issues +- https://github.com/xpack/xpm-js/pulls + +and fix them; assign them to a milestone +(like {customField('releaseVersion')}). + +### Update `CHANGELOG.md` + +- open the `CHANGELOG.md` file +- check if all previous fixed issues are in +- check the latest commits `xpm run git-log`; if necessary, copy/paste lines, + group by dates and edit them using the below regular expressions + +- to turn the dates into headings, change from: + +```txt + + +([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]) [*] +``` + +to: + +```txt + + +## $1 + +* +``` + +- to remove the rest of the dates, change from: + +```txt +^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [*] +``` + +to: + +```txt +* +``` + +- add a new entry like _**\* v{customField('releaseVersion')} prepared**_ +- commit with a message like _**prepare v{customField('releaseVersion')}**_ + +### Prepare the release + +- terminate all running tasks (**Terminal** → **Terminate Task...**) +- switch to the `development` branch +- commit everything +- `npm run fix` +- if there are changes, commit all changes into the `development` branch +- `npm run test` +- `npm run pack`; check the list of packaged files, possibly + update `.npmignore` + + { +`npm version ${customField('releaseVersion')} +`} + +- push all changes to GitHub + +### CI tests + +- the `postversion` npm script should also update tags via + `git push origin --tags`; this should trigger CI +- **wait for CI tests to complete** +- check https://github.com/xpack/xpm-js/actions + +## Prepare a new blog post + +- check and possibly update the `website/blog/_templates/blog-post-release-liquid.mdx` +- run the `generate-website-blog-post` npm script; this will add a file in the `website/blog` folder: + +```sh +npm --prefix ~/Work/npm-modules/xpm-js.git/website run generate-website-blog-post +``` + +- edit the front matter properties +- select the correct summary +- commit with _**website: blog post release {customField('releaseVersion')} published**_ +- push the `development` branch + +## Publish the release to npmjs.com + +```sh +npm publish --tag next +``` + +- when publishing for the first time, use: + +```sh +npm publish --access public +``` + +After a few moments the version will be visible at +[xpm Versions](https://www.npmjs.com/package/xpm?activeTab=versions). + +### Manual install test + + +Test it the package can be installed globally: + +```bash +npm install ----location=global xpm@next +``` + + +Validate the web site content in a local build via the npm `build` script: + +```sh +npm --prefix ~/Work/npm-modules/xpm-js.git/website run build +``` + +## Publish the website + +The documentation site is built with [Docusaurus](https://docusaurus.io) and +published in the project +[GitHub Pages](https://xpack.github.io/xpm-js). + +The Web site deployment is performed automatically when pushing to the +master branch, by a dedicated workflow in +[GitHub Actions](https://github.com/xpack/xpm-js/actions/workflows/publish-github-pages.yml). + +- switch to the `development` branch +- run the `website-generate-commons` script in the top `package.json` +- commit all changes +- run the `build` script in `website/package.json` +- merge the `development` branch into the `website` branch +- push the `website` branch to GitHub + +At this moment an automated GitHub Action will generate and publish the website. + +- the new release blog post is +in https://xpack.github.io/xpm-js/blog/ +- remember the post URL, since it must be used to update the release page +and the X/Twitter announcement + +The `website` branch may be subsequently updated, as long as the +version in `package.json` is not changed. + +## Final updates + +### Update the `master` branch + +In this Git repo: + +- select the `master` branch +- merge the `development` branch into the `master` branch +- push the `master` branch to GitHub + +### Close milestone + +In https://github.com/xpack/xpm-liquid-ts/milestones: + +- close the current milestone. + +### Tag the npm package as `latest` + +When the release is considered stable, promote it as `latest`: + +- `npm dist-tag ls xpm` +- npm dist-tag add xpm@{customField('releaseVersion')} latest +- `npm dist-tag ls xpm` + + +## Share on X/Twitter + +- in a separate browser windows, open [X/Twitter](https://x.com/) +- using the `@xpack_project` account +- paste the release name like **xPack xpm v0.19.4 released** +- paste the link to the Web page + [release](/docs/releases/) +- click the **Tweet** button + + +## Analytics + +- npmjs.com [`xpm`](https://www.npmjs.com/package/xpm/) package + - latest release, per month +[![npm (scoped)](https://img.shields.io/npm/v/xpm.svg)](https://www.npmjs.com/package/xpm/) +[![npm](https://img.shields.io/npm/dm/xpm.svg)](https://www.npmjs.com/package/xpm/) + - all releases [![npm](https://img.shields.io/npm/dt/xpm.svg)](https://www.npmjs.com/package/xpm/) + +Credit to [Shields IO](https://shields.io) for the badges. + +## Useful links + +- https://www.typescriptlang.org/docs/ +- https://www.typescriptlang.org/tsconfig/ +- https://typedoc.org, https://typedoc.org/guides/doccomments/ +- https://tsdoc.org +- https://jsdoc.app/index.html +- https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1 + + diff --git a/website/docs/project/about/_common/_website-docusaurus-migration.mdx b/website/docs/project/about/_common/_website-docusaurus-migration.mdx new file mode 100644 index 0000000..3cd927a --- /dev/null +++ b/website/docs/project/about/_common/_website-docusaurus-migration.mdx @@ -0,0 +1,11 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from xbb-helper/templates/docusaurus/common. */} + +{/* ------------------------------------------------------------------------ */} + +In **{props.date || 'DATE'}**, as part of the project restructuring, +the website content was migrated from the TypeDoc sub-site to a local +Docusaurus configuration within the `website` folder. +To ensure continuity, HTML `` redirects were added to the old pages. + Additionally, a GitHub Action was set up to automatically publish + the site whenever changes are pushed to the `website` Git branch. diff --git a/website/docs/project/about/_common/_website-docusaurus-template.mdx b/website/docs/project/about/_common/_website-docusaurus-template.mdx new file mode 100644 index 0000000..97fbeff --- /dev/null +++ b/website/docs/project/about/_common/_website-docusaurus-template.mdx @@ -0,0 +1,9 @@ +{/* DO NOT EDIT! */} +{/* Automatically generated from docusaurus-template-liquid/templates/docusaurus. */} + +{/* ------------------------------------------------------------------------ */} + +In **{props.date || 'DATE'}** the website content was added in the `website` folder, +as an instance of the Docusaurus template. Additionally a GitHub Action +was added to automatically publish the site upon any pushes to the +`website` Git branch. diff --git a/website/docs/project/about/_website.mdx b/website/docs/project/about/_website.mdx new file mode 100644 index 0000000..2b8b869 --- /dev/null +++ b/website/docs/project/about/_website.mdx @@ -0,0 +1,6 @@ + +import Website from './_common/_website-docusaurus-migration.mdx' + +{/* ------------------------------------------------------------------------ */} + + diff --git a/website/docs/project/about/index.mdx b/website/docs/project/about/index.mdx new file mode 100644 index 0000000..93e91b3 --- /dev/null +++ b/website/docs/project/about/index.mdx @@ -0,0 +1,42 @@ +--- + +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + +title: About +description: Details about the project, including the history of the website and details about the author. + +date: 2024-10-24 23:58:00 +0300 + +--- + +import Website from './_website.mdx' + +{/* ------------------------------------------------------------------------ */} + +# About xpm + +## The project + +The **xPack Project Manager** project is part of the +[xPack Reproducible Build Framework](https://xpack.github.io) +and is hosted on GitHub as +[`xpack/xpm-js`](https://github.com/xpack/xpm-js/). + +## The web site + + + +## The author + +This project is currently maintained by **Liviu Ionescu** +([ilg-ul](https://github.com/ilg-ul)), +a senior computer engineer, with expertise in **C++/C embedded systems**, +**RTOSes**, **build tools**, operating systems, compilers +and Internet technologies. + +He can be reached at [``](mailto:ilg@livius.net). +Please note, this email address is provided as a courtesy. +For all correspondence related to +the **xPack Project Manager** +project, kindly use the project [support](/docs/support/) page). diff --git a/website/docs/project/history/index.mdx b/website/docs/project/history/index.mdx new file mode 100644 index 0000000..d47872d --- /dev/null +++ b/website/docs/project/history/index.mdx @@ -0,0 +1,18 @@ +--- + +title: History +description: The most important moments since the project was created. + +date: 2024-10-24 23:58:00 +0300 + +--- + +{/* ------------------------------------------------------------------------ */} + +# The history of xpm + +The project was created in **November 2017**. + +However, the idea of a tool to automate dependencies is +older, and in 2015 the first experimental implementation +used a set of shell scripts. diff --git a/website/docs/releases/index.mdx b/website/docs/releases/index.mdx index d7cde84..d155d1e 100644 --- a/website/docs/releases/index.mdx +++ b/website/docs/releases/index.mdx @@ -1,4 +1,8 @@ --- + +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + title: Releases description: The full list of project releases. keywords: @@ -8,7 +12,7 @@ keywords: hide_table_of_contents: true -date: 2021-01-27 21:51:00 +0300 +date: 2020-07-21 17:53:00 +0300 --- @@ -18,6 +22,6 @@ import {ReleasesList} from '@site/src/components/ReleasesList'; # The xpm releases -The releases, in reverse chronological order are: +The releases, in reverse chronological order, are: diff --git a/website/docs/support/index.mdx b/website/docs/support/index.mdx index 06a711b..28ad665 100644 --- a/website/docs/support/index.mdx +++ b/website/docs/support/index.mdx @@ -1,4 +1,8 @@ --- + +# DO NOT EDIT! +# Automatically generated from docusaurus-template-liquid/templates/docusaurus. + title: Help Centre description: The project's support channel, where you can ask questions, start discussions, and report issues. keywords: @@ -8,10 +12,77 @@ keywords: - discussions - issues -date: 2019-06-28 11:04:00 +0300 +date: 2020-07-21 17:54:00 +0300 --- +{/* ------------------------------------------------------------------------ */} + # How to get help for xpm -TBD +## Quick links + +The quick answer is to use the +[GitHub Discussions](https://github.com/xpack/xpm-js/discussions) pages. + +## Check documentation + +As usual, before asking anything, it is a good idea to check the project +documentation. + +## Preliminary checks + +Before posting any questions or providing feedback, +check if the subject was not already addressed. + +- check the [FAQ](/docs/faq/) +for similar problems +- check the [GitHub Discussions](https://github.com/xpack/xpm-js/discussions) for +similar topics +- check the +[GitHub Issues](https://github.com/xpack/xpm-js/issues) +tracker and the +[GitHub Pull requests](https://github.com/xpack/xpm-js/pulls) +for similar problems. + +## Ask questions in GitHub Discussions + +If you still could not find a solution, if you have interesting use +cases, if you have custom configurations, and generally if you have +any experience that you want to share with others, use the +[GitHub Discussions](https://github.com/xpack/xpm-js/discussions) pages, +and enter a **New discussion**; use the **Q&A** category for questions, **Ideas** for suggestions and **General** for anything else. + +## Register a new support ticket only if necessary + +If you are convinced that you identified a bug +or if want to contribute code to enhance the +**xPack Project Manager** +project, register a **New Issue** in the +[GitHub Issues](https://github.com/xpack/xpm-js/issues) +tracker. + +:::caution + +**Do not** use the GitHub Issues tracker +for questions and support, **use the +[GitHub Discussions](https://github.com/xpack/xpm-js/discussions)** pages. + +::: + +## Use of private e-mail + +:::caution Please, please, please! + +**Do not** use +private e-mail for support, **use the +[GitHub Discussions](https://github.com/xpack/xpm-js/discussions)** pages. + +::: + +Sending private messages will be automatically replied with +a short message including a link to this page. +The reason for this rude behaviour is simply an attempt to use +the time more efficiently; since discussions are archived, other people +having similar problems might benefit from the answers. + diff --git a/website/docs/test/index.mdx b/website/docs/test/index.mdx new file mode 100644 index 0000000..b9768e8 --- /dev/null +++ b/website/docs/test/index.mdx @@ -0,0 +1,186 @@ +--- + +# DO NOT EDIT! +# Automatically generated from xbb-helper/templates/docusaurus/common. + +title: A test page +description: Some markdown examples. + +something: "Some text" + +# https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#markdown-front-matter + +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +import CodeBlock from '@theme/CodeBlock'; + +import Heading from '@theme/Heading'; + +export const world = 'World' +export const version = '11.2.1' +export const xpackSubversion = '1.2' + +{/* ------------------------------------------------------------------------ */} + +# A test page + +{frontMatter.description} + +{frontMatter.something} + +

abc {frontMatter.something} cde

+ +Hello {world}! + +## Hello {world}! + +- Hello {world}! + + One + Hello {world}! + Two + +Five `Hello {world}!` Four + +Six Hello {world}! Four + +

Seven Hello {world}! Four

+ +```bash +Five +Hello {world}! +Six +``` + + +Seven +Hello {world}! +Eight + + +--- + +## Admonitions + +:::note + +Some **content** with _Markdown_ `syntax`. Check [this `api`](#). + +::: + +:::note Custom text + +Some **content** with _Markdown_ `syntax`. Check [this `api`](#). + +::: + +:::tip + +Some **content** with _Markdown_ `syntax`. Check [this `api`](#). + +::: + +:::info + +Some **content** with _Markdown_ `syntax`. Check [this `api`](#). + +::: + +:::caution + +Some **content** with _Markdown_ `syntax`. Check [this `api`](#). + +::: + +:::danger + +Some **content** with _Markdown_ `syntax`. Check [this `api`](#). + +::: + +--- + +## Expandable details + +
+ How are remark-math and rehype-katex different? + +In case you are wondering how Remark and Rehype are different, here is a good example. `remark-math` operates on the Markdown AST, where it sees text like `$...$`, and all it does is transform that to the JSX `...` without doing too much with the content. This decouples the extraction of math formulae from their rendering, which means you can swap $\KaTeX$ out with other math renderers, like MathJax (with [`rehype-mathjax`](https://github.com/remarkjs/remark-math/tree/main/packages/rehype-mathjax)), just by replacing the Rehype plugin. + +Next, the `rehype-katex` operates on the Hypertext AST where everything has been converted to HTML-like tags already. It traverses all the elements with `math` class and uses $\KaTeX$ to parse and render the content to actual HTML. + +
+ +--- + +## Section name with custom url {#custom} + +By default the url concatenates the words joined by dash. + +--- + +## Code with file name + +```js title="src/remark/section-prefix.js" +const visit = require('unist-util-visit'); +``` + +--- + +## Syntax highlighting + +- https://docusaurus.io/docs/markdown-features/code-blocks#syntax-highlighting +- https://github.com/FormidableLabs/prism-react-renderer +- https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/generate-prism-languages/index.ts + +--- + +
{
+`$ tree -L 2 /home/ilg/.local/xPacks/arm-none-eabi-gcc/xpack-arm-none-eabi-gcc-${version}-${xpackSubversion}
+/home/ilg/.local/xPacks/arm-none-eabi-gcc/xpack-arm-none-eabi-gcc-${version}-${xpackSubversion}
+├── arm-none-eabi
+│   ├── bin
+│   ├── include
+│   ├── lib
+│   └── share
+├── README.md
+└── share
+    ├── doc
+    └── gcc-arm-none-eabi
+
+21 directories, 62 files
+`}
+ +--- + +## Tabs + + + + + +... + + + + + +... + + + + + +... + + + + + +To display hadings not showing in the TOC: + +My Heading + diff --git a/website/docs/user/files/index.mdx b/website/docs/user/files/index.mdx new file mode 100644 index 0000000..88367e0 --- /dev/null +++ b/website/docs/user/files/index.mdx @@ -0,0 +1,14 @@ +--- + +title: xpm files + +date: 2017-10-09 14:13:00 +0300 + +--- + +# xpm files + +**xpm** stores its specific project configuration definitions +in the same file as **npm**, in the **xpack** property: + +- [package.json](/docs/user/files/package.json/) diff --git a/website/docs/user/files/package.json/index.mdx b/website/docs/user/files/package.json/index.mdx new file mode 100644 index 0000000..529ec89 --- /dev/null +++ b/website/docs/user/files/package.json/index.mdx @@ -0,0 +1,555 @@ +--- + +title: package.json + +date: 2019-07-02 00:36:00 +0300 + +--- + +# package.json + +## Overview + +The **xpm** `package.json` file is +basically the same as the **npm** +[`package.json`](https://docs.npmjs.com/files/package.json), +with some extensions. + +The extensions are grouped below the `xpack` object, and may +contain the following definitions: + + - `minimumXpmRequired` + - `dependencies` + - `devDependencies` + - `binaries` + - `properties` + - `actions` + - `buildConfigurations` + + +## LiquidJS substitutions summary + +In addition to the new `xpacks` definitions, another key extension +that comes with **xpm** is the use of substitutions through the +[LiquidJS](https://liquidjs.com) engine. The full Liquid syntax, with +**tags** and **filters**, is supported. + +Below is a summary of variables and filters available for substitutions. + +For more details, please see the documentation for the +[`xpack/xpm-liquid-ts`](https://xpack.github.io/xpm-liquid-ts) module, where +the substitutions are implemented. + +### Variables + +The LiquidJS syntax to include variables +uses double curly braces, like this: `{{variable}}`. + +When substitutions occur within a build configuration, the `properties` +defined in the build configuration take precedence over `properties` +with the same name defined at the project level. + +- `package.*` - the entire `package.json` parsed +- `properties.*` - user defined string properties +- `configuration.name` - the name of the current configuration +- `configuration.*` - the entire configuration parsed +- `env.*` - the Node.js process environment +- `os.*` - the Node.js `os` definitions + - `os.EOL` + - `os.arch` (like 'arm', 'arm64', 'ia32', 'x64') + - `os.constants` + - `os.cpus` + - `os.endianness` + - `os.homedir` + - `os.hostname` + - `os.platform` (like 'darwin', 'linux', 'win32') + - `os.release` + - `os.tmpdir` + - `os.type` + - `os.version` (available since Node 12) +- `path.*` definitions + - `path.delimiter` (`;` for Windows, `:` for POSIX) + - `path.sep` (`\` on Windows, `/` on POSIX) + - `path.win32.delimiter` (`;`) + - `path.win32.sep` (`\`) + - `path.posix.delimiter` (`:`) + - `path.posix.sep` (`/`) + + +Example: + +```json title="Simple variable substitution" +"install": "xpm install --config {{configuration.name}}" +``` + +### Custom filters + +Filters act like pipes processing strings. The syntax is similar to +the shell pipe syntax: `{{variable|filter}}`. + +- `path_basename` +- `path_dirname` +- `path_normalize` +- `path_join` +- `path_relative` +- `path_posix_basename` +- `path_posix_dirname` +- `path_posix_normalize` +- `path_posix_join` +- `path_posix_relative` +- `path_win32_basename` +- `path_win32_dirname` +- `path_win32_normalize` +- `path_win32_join` +- `path_win32_relative` +- `util_format` +- `to_filename` +- `to_posix_filename` +- `to_win32_filename` + +Example: + +```json title="Multi-filter substitution" +"buildFolderRelativePath": "{{'build' | path_join: configuration.name | to_filename | downcase}}" +``` + +## The mandatory `xpack` definitions + +To identify a project as an **xpm** package (xPack), it must have an `xpack` +property, even empty, in the `package.json` file. + +```json title="Minimal empty xpack" {4} +{ + "name": "my-awesome-project", + "version": "1.0.0", + "xpack": {} +} +``` + +Although not mandatory, it is also recommended to add an `xpack` keyword; +this may help find the xPacks in the public repository by searching for this +keyword. + +```json title="Recommended keyword" {5} +{ + "name": "my-awesome-project", + "version": "1.0.0", + "keywords": [ + "xpack", + "..." + ], + "xpack": {} +} +``` + +### The `minimumXpmRequired` definition + +To allow **xpm** to evolve with future incompatible versions, a mechanism +is used to identify the required `xpm` version for interpreting the current +definitions in `package.json`. + +`minimumXpmRequired` has dual usage: + +- it prevents using an old **xpm** with a newer `package.json` +- it allows a newer **xpm** to revert some functionality to match the +older minimum required **xpm**. + +The mechanism is similar to that used by CMake; the policies are +documented in the separate [Policies](/docs/user/policies/) page. + +### The `dependencies` definitions + +The `dependencies` definitions is similar to the **npm** definition, +but lists the **xpm** source packages required to compile/link-time. + +When a source pacakge is installed locally (without `--global`) into the +local project `xpacks` folder, all packages listed in its `xpack.dependencies` +are also installed into the same local `xpacks` folder, +recursively. + +In other words, the list of source dependencies is linearised, and all +dependencies are installed at the same top level, as required by +compiled languages (like C/C++), to have all source libraries +compiled and available at link time. + +:::info + +The main difference compared to **npm** is the linearized list of source +dependencies. + +**npm**, which is a JavaScript/TypeScript tool, uses a +different strategy that preserves the hierarchical structure of +dependencies, not suitable for compiled languages. + +::: + +When installing source packages into an **xpm** project, they are also added +to the `dependencies` list, in the extended format. + +Example: + +```json title="Extended format source dependency" {5-7} + "xpack": { + "minimumXpmRequired": "0.19.4", + "dependencies": { + "@micro-os-plus/micro-test-plus": { + "specifier": "^3.1.2", + "local": "link", + "platforms": "all" + } + }, + } +``` + +For historical reasons, when editting `package.json` manually, it is +also possible to use the short form, similar to the syntax used by **npm**. + +Example: + +```json title="Traditional short form source dependency" {4} + "xpack": { + "minimumXpmRequired": "0.19.4", + "dependencies": { + "@micro-os-plus/micro-test-plus": "^3.1.2" + }, + } +``` + +### The `devDependencies` definitions + +The `devDependencies` definitions is similar to the **npm** definition, +but lists the **xpm** definitions required during the development +of the current package. + +When the `xpm install` is invoked in a project folder, +all packages listed in `xpack.devDependencies` are also installed +in the local project `xpacks` folder, and symbolic links (or +forwarders/shims on windows) to all executables are created in +`xpacks/.bin`. + +No recursive search is performed. + +When installing binary packages into an **xpm** project, they are also added +to the `devDependencies` list, in the extended format. + +Example: + +```json title="Extended format development dependency" {5-7} + "xpack": { + "minimumXpmRequired": "0.19.4", + "devDependencies": { + "@xpack-dev-tools/cmake": { + "specifier": "3.28.6-1.1", + "local": "link", + "platforms": "all" + } + } + } +``` + +### The `binaries` definitions + +To keep packages small, binary xPacks do not include the platform specific +binaries; instead they include only links +to the binary archives, and checksums to validate the downloads. + +Example: + +```json {10,14,40} +{ + "name": "@xpack-dev-tools/cmake", + "version": "3.28.6-1.1", + "description": "A binary xPack with the CMake executables", + "...": "...", + "xpack": { + "minimumXpmRequired": "0.16.3", + "binaries": { + "destination": "./.content", + "baseUrl": "https://github.com/xpack-dev-tools/cmake-xpack/releases/download/v3.28.6-1", + "skip": 1, + "platforms": { + "darwin-arm64": { + "fileName": "xpack-cmake-3.28.6-1-darwin-arm64.tar.gz", + "sha256": "a2f4f7d4963a3ee41ed3ef80a6dfed1e161b0b33b519fe2c4f11f4d9d310c36e" + }, + "darwin-x64": { + "fileName": "xpack-cmake-3.28.6-1-darwin-x64.tar.gz", + "sha256": "bafce78a57bab8c82268b32c0849ab875b437b90bed9bec83aad4c82af320103" + }, + "linux-arm": { + "fileName": "xpack-cmake-3.28.6-1-linux-arm.tar.gz", + "sha256": "d73889f852b310f974e20246775eb16b272384dbf6fdc236583395af40bf7b54" + }, + "linux-arm64": { + "fileName": "xpack-cmake-3.28.6-1-linux-arm64.tar.gz", + "sha256": "c80bd91b0e2b473d57b0ff30ea6ffc28480576946d6e69b65204f9d26dadfa52" + }, + "linux-x64": { + "fileName": "xpack-cmake-3.28.6-1-linux-x64.tar.gz", + "sha256": "b05343bda081b988b2c91896133b56ce286a8269c8550d986cc2e71a243684e1" + }, + "win32-x64": { + "fileName": "xpack-cmake-3.28.6-1-win32-x64.zip", + "sha256": "c1c07b1b51e0352e1fb1c9e6d87b743e975484df29f2a72c26d7385ad23fb679" + } + } + }, + "bin": { + "ccmake": "./.content/bin/ccmake", + "cmake": "./.content/bin/cmake", + "cpack": "./.content/bin/cpack", + "ctest": "./.content/bin/ctest" + } + } +} +``` + +The `platforms` object define the location of platform specific archives. + +
+The platforms names + +The platform names are exactly those defined by Node.js, as +`process.platform` and `process.arch`: + +- `darwin-arm64` - macOS arm64 +- `darwin-x64` - macOS x64 +- `linux-arm` - GNU/Linux Arm 32-bit (since 0.6.0) +- `linux-arm64` - GNU/Linux Arm 64-bit (since 0.6.0) +- `linux-x86` (deprecated) +- `linux-x32` (deprecated) +- `linux-ia32` - GNU/Linux x86 (since 0.6.0; deprecated) +- `linux-x64` - GNU/Linux x64 +- `win32-x86` (deprecated) +- `win32-x32` (deprecated) +- `win32-ia32` - Windows x86 (since 0.6.0; deprecated) +- `win32-x64` - Windows x64 + +(`win32` is not very inspired, but we have to live with it.) + +
+ +The files are downloaded from `/`. The common +use case is to have all files published in the same folder; in this case it is +enough to define `baseUrl` once. However it is also possible to +download files from different folders/servers, by defining it +for each platform. + +The archives are unpacked in the `destination` folder, defined as relative +to the package root folder (usually `./.content`). + +To allow the archives to be manually expanded, the build scripts add an +initial folder with the package name and version +(like `xpack-arm-none-eabi-gcc-13.3.1-1.1`). + +To shorten the paths, **xpm** can skip this folder, or any number of initial +levels of folders in the archive, using the `skip` definition. + +### The `bin` definitions + +When installing a package with executables, +after the archive is unpacked, links to all executables defined +in the `bin` object are created in the `xpacks/.bin` folder. +On Windows, where soft links to files are problematic, `.cmd` +forwarders/shims are created. + +:::tip + +To accommodate for the `.cmd` stubs, +programs launching the executables should do this via an explicit +shell like `cmd.exe` or `PowerShell.exe`. + +::: + +### The `properties` definitions + +The `properties` map allows to define string properties that can +be used as substitution variable in other definitions. + +`properties` can be defined on top of other `properties`, and the LiquidJS +engine will be invoked repeatedly until all substitutions are performed. + +When substitutions occur within a build configuration, the `properties` +defined in the build configuration take precedence over `properties` +with the same name defined at the project level. + +Examples: + +```json title="Project properties" {4} +{ + "xpack": { + "properties": { + "buildFolderRelativePath": "{{'build' | path_join: configuration.name | to_filename | downcase}}", + } + } +} +``` + +```json title="Build configuration properties" {6,12,13} +{ + "name": "@xpack-dev-tools/cmake", + "version": "3.28.6-1.1", + "xpack": { + "properties": { + "appLcName": "cmake", + }, + "buildConfigurations": { + "common-docker": { + "hidden": true, + "properties": { + "containerName": "{{properties.appLcName}}-{{package.version}}-{{configuration.name}}", + "force32": "" + } + } + } + } +} +``` + +### The `actions` definitions + +**xpm** actions are an extended version of **npm** scripts, that +supports multiple lines and substitutions. + +`actions` can be defined at project level, or at build configuration level. + +When actions are invoked for a specific a build configuration, the `actions` +defined in the build configuration take precedence over `actions` +with the same name defined at the project level. + +Example: + +```json {9,22} +{ + "name": "@xpack-dev-tools/cmake", + "version": "3.28.6-1.1", + "xpack": { + "properties": { + "appLcName": "cmake", + }, + "actions": { + "install": [ + "npm install", + "xpm install" + ] + }, + "buildConfigurations": { + "common-docker": { + "hidden": true, + "properties": { + "containerName": "{{properties.appLcName}}-{{package.version}}-{{configuration.name}}", + "force32": "" + }, + "actions": { + "docker-remove": [ + "docker stop {{properties.containerName}}", + "docker rm {{properties.containerName}}" + ] + } + } + } + } +} +``` + +### The `buildConfigurations` definitions + +During **development**, it is usual to build **separate debug and release +binaries**, with different configurations, like different preprocessor +macros, different compiler options, different optimisation levels, etc. + +Extensive **testing** also requires building separate binaries, possible +targetted to **different architectures**, and using **different toolchains**, +even **different versions** of the same toolchain. + +The build configurations address exactly this need, and allow to define +**multiple different actions to run different builds and/or tests**. + +Build configurations can define their own `properties`, `actions`, +`definitions` and `devDefinition` +which take precedence over definitions with the same names defined at +the project level. + +To avoid redundant definitions, build configurations can **inherit** +`properties`, `actions`, `definitions` and `devDefinition` +from one or more other build configurations, +and redefine some of them, as needed. + +A build configuration can inherit from multiple other build configurations. +The `inherit` array defines the list inherited build configurations; +the common definitions are collected in the listed order, with later +entries overriding earlier ones. + +Example: + +```json {8,26,31,46,54} +{ + "xpack": { + "buildConfigurations": { + "common-dependencies": { "...": "..." }, + "common-actions": { "...": "..." }, + "common-actions-native": { "...": "..." }, + "common-docker": { "...": "..." }, + "darwin-x64": { + "inherit": [ + "common-dependencies", + "common-actions", + "common-actions-native" + ], + "devDependencies": { + "@xpack-dev-tools/clang": "16.0.6-1.1", + "@xpack-dev-tools/realpath": "9.4.0-1.1", + "@xpack-dev-tools/sed": "4.9.0-3.1" + }, + "actions": { + "build": "caffeinate {{properties.commandBashBuild}}", + "build-development": "caffeinate {{properties.commandBashBuild}} --develop", + "build-development-debug": "caffeinate {{properties.commandBashBuild}} --develop --debug", + "build-development-tests-only": "caffeinate {{properties.commandBashBuild}} --develop --tests-only" + } + }, + "darwin-arm64": { + "inherit": [ + "darwin-x64" + ] + }, + "linux-x64": { + "inherit": [ + "common-dependencies", + "common-actions", + "common-actions-native", + "common-docker" + ], + "devDependencies": { + "@xpack-dev-tools/gcc": "13.2.0-2.1", + "@xpack-dev-tools/patchelf": "0.18.0-1.1" + }, + "properties": { + "dockerImage": "ilegeul/ubuntu:amd64-18.04-xbb-v5.2.2" + } + }, + "linux-arm64": { + "inherit": [ + "linux-x64" + ], + "properties": { + "dockerImage": "ilegeul/ubuntu:arm64v8-18.04-xbb-v5.2.2" + } + }, + "linux-arm": { + "inherit": [ + "linux-x64" + ], + "properties": { + "dockerImage": "ilegeul/ubuntu:arm32v7-18.04-xbb-v5.2.2", + "force32": "linux32" + } + } + } + } +} +``` + +The `"hidden": true` definition can be used by GUI tools +(like Visual Studio Code) to filter out +internal definition when rendering trees of action, for example. diff --git a/website/docs/user/folders/index.mdx b/website/docs/user/folders/index.mdx new file mode 100644 index 0000000..0b4cd50 --- /dev/null +++ b/website/docs/user/folders/index.mdx @@ -0,0 +1,443 @@ +--- + +title: xpm folders + +date: 2017-10-09 14:14:00 +0300 + +# redirect_from: +# - /xpm/files/folders/ + +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +{/* ------------------------------------------------------------------------ */} + +# xpm folders + +## Overview + +**xpm** uses several folders to store the installed packages. + +## tl;dr + +- local install (default): packages are available in `./xpacks` in the current +project or build configuration +- global install (`--global`): packages are stored in a central location in +the user home folder + +## The local `xpacks` folder + +When installing packages into a project, they end in a folder with the +package name below `xpacks`, similarly to **npm** packages ending +below `node_modules`. + +For example installing two source libraries from the `@micro-os-plus` +scope with local copies results in this hierarchy: + +```console +% tree -a -L3 xpacks +xpacks +└── @micro-os-plus + ├── micro-test-plus + │   ├── CHANGELOG.md + │   ├── CMakeLists.txt + │   ├── LICENSE + │   ├── LICENSE-Boost + │   ├── README.md + │   ├── include + │   ├── meson.build + │   ├── package.json + │   └── src + └── utils-lists + ├── CHANGELOG.md + ├── CMakeLists.txt + ├── LICENSE + ├── README.md + ├── include + ├── meson.build + ├── package.json + ├── src + └── xpack.json + +9 directories, 14 files +``` + +Installing the binary package `@xpack-dev-tools/cmake` adds a few more folders and files: + +```console +% tree -a -L3 xpacks +xpacks +├── .bin +│   ├── ccmake -> ../@xpack-dev-tools/cmake/.content/bin/ccmake +│   ├── cmake -> ../@xpack-dev-tools/cmake/.content/bin/cmake +│   ├── cpack -> ../@xpack-dev-tools/cmake/.content/bin/cpack +│   └── ctest -> ../@xpack-dev-tools/cmake/.content/bin/ctest +├── @micro-os-plus +│   ├── micro-test-plus +│   │   ├── CHANGELOG.md +│   │   ├── CMakeLists.txt +│   │   ├── LICENSE +│   │   ├── LICENSE-Boost +│   │   ├── README.md +│   │   ├── include +│   │   ├── meson.build +│   │   ├── package.json +│   │   └── src +│   └── utils-lists +│   ├── CHANGELOG.md +│   ├── CMakeLists.txt +│   ├── LICENSE +│   ├── README.md +│   ├── include +│   ├── meson.build +│   ├── package.json +│   ├── src +│   └── xpack.json +└── @xpack-dev-tools + └── cmake + ├── .content + ├── CHANGELOG.md + ├── LICENSE + ├── README.md + └── package.json + +12 directories, 22 files +``` + +However this structure is created only when the explicit `--copy` option is +used. Using local project copies is not a big problem for source libraries, but +it may be for binary packages since some, like toolchains, are huge, +hundreads of MB, and it is not reasonable to install a copy +in each project. + +Therefore, by default, **xpm** aims to save space by installing a +single read-only instance in a central folder and creating links +from the project to that folder. + +The same packages installed with the default configuration, without `--copy`, +results in this: + +```console +% tree -a -L3 xpacks +xpacks +├── .bin +│   ├── ccmake -> ../@xpack-dev-tools/cmake/.content/bin/ccmake +│   ├── cmake -> ../@xpack-dev-tools/cmake/.content/bin/cmake +│   ├── cpack -> ../@xpack-dev-tools/cmake/.content/bin/cpack +│   └── ctest -> ../@xpack-dev-tools/cmake/.content/bin/ctest +├── @micro-os-plus +│   ├── micro-test-plus -> /Users/ilg/Library/xPacks/@micro-os-plus/micro-test-plus/3.1.2 +│   └── utils-lists -> /Users/ilg/Library/xPacks/@micro-os-plus/utils-lists/4.0.0 +└── @xpack-dev-tools + └── cmake -> /Users/ilg/Library/xPacks/@xpack-dev-tools/cmake/3.28.6-1.1 + +7 directories, 4 files +``` + +:::note + +This hierarchy is from macOS; on GNU/Linux the global folder is different; +on Windows, in the `.bin` folder, instead of symbolic links are `.cmd` +shims/forwarders. + +::: + +### The local `xpacks/.bin` folder + +As it can be seen above, **xpm** creates links (forwarders on Windows) +to executables in the +`xpacks/.bin`, similarly to those created by **npm** in `node_modules/.bin`. + +With this setup, the project needs to prepend only this `.bin` folder +to the PATH, and all the required tools are accesible and prefered +to possible system tools. + +## The global `xPacks` folder + +The global xPack store is a folder in the user home folder where +read-only instances of the packages are installed, to be used by +multiple projects. + +Individual packages are stored as separate folders: + +- `[@{scope}/]{name}/{version}` + +For the example above, the hierarchy would look like: + +```console +% tree -L3 ~/Library/xpacks +/Users/ilg/Library/xpacks +├── @micro-os-plus +│   ├── micro-test-plus +│   │   └── 3.1.2 +│   ├── utils-lists +│   │   └── 4.0.0 +└── @xpack-dev-tools +    └── cmake +       └── 3.28.6-1.1 + +9 directories, 0 files +``` + +### The `.link` development links + +Running `xpm link` inside the development folder of a project +creates a symbolic link from the local package folder to something like: + +- `[@{scope}/]{name}/.link` + +For example, adding development links for the above packages would result +in a hierarchy like: + +```console +% tree -L3 ~/Library/xpacks +/Users/ilg/Library/xpacks +├── @micro-os-plus +│   ├── micro-test-plus +│   │   ├── .link -> /Users/ilg/MyProjects/micro-os-plus.github/xPacks/micro-test-plus-xpack.git +│   │   └── 3.1.2 +│   ├── utils-lists +│   │   ├── .link -> /Users/ilg/MyProjects/micro-os-plus.github/xPacks/utils-lists-xpack.git +│   │   └── 4.0.0 +└── @xpack-dev-tools +    └── cmake +       └── 3.28.6-1.1 + +9 directories, 0 files +``` + +To reconfiguring the test project to use the development links, +use the following command: + +```sh +xpm link @micro-os-plus/micro-test-plus @micro-os-plus/utils-lists +``` + +This would result in a hierarchy like: + +```console +% tree -a -L2 xpacks +xpacks +├── .bin +│   ├── ccmake -> ../@xpack-dev-tools/cmake/.content/bin/ccmake +│   ├── cmake -> ../@xpack-dev-tools/cmake/.content/bin/cmake +│   ├── cpack -> ../@xpack-dev-tools/cmake/.content/bin/cpack +│   └── ctest -> ../@xpack-dev-tools/cmake/.content/bin/ctest +├── @micro-os-plus +│   ├── micro-test-plus -> /Users/ilg/Library/xPacks/@micro-os-plus/micro-test-plus/.link +│   └── utils-lists -> /Users/ilg/Library/xPacks/@micro-os-plus/utils-lists/.link +└── @xpack-dev-tools + └── cmake -> /Users/ilg/Library/xPacks/@xpack-dev-tools/cmake/3.28.6-1.1 + +7 directories, 4 files +``` + +As it can be seen, the links from the project to the specific verions were +replaced by links to the special `.link` links, which is in fact a +two levels link to the location where the development sources are located. + +## The xPacks cache folder + +The xPacks cache folder is used to store downloaded packages, to avoid +downloading them again if referred in other projects. + +Further downloads of binary archives (like toolchain binaries) are +also cached and subsequent installs get them from the cache. + +## No global links! + +:::info + +Since installing binaries globally is strongly discouraged +in favour of creating links into each project, by default **xpm** +does not create links in the global or system `.bin` folders. + +::: + +
+Why installing binaries globally is strongly discouraged? + +Because multiple versions of the same packages can be installed on the same +system. To which version should the global links point? The latest installed? +The highest version? There is no obvious answer, packages can be installed +in any order. + +
+ +## Environment variables + +The locations of folders used by **xpm** can be controlled by several environment +variables. + +:::tip + +When the variables must be available in GUI applications, +setting them in shell init scripts is not effective, since the windows manager +usually is not started by a shell, but by other system mechanism, which has +its own configuration files. + +::: + +User global xPack store: + +- `XPACKS_STORE_FOLDER` (was `XPACKS_REPO_FOLDER`) +- `XPACKS_CACHE_FOLDER` + +System xPack store: + +- `XPACKS_SYSTEM_STORE_FOLDER` (not implemented yet; was `XPACKS_SYSTEM_FOLDER`) +- `XPACKS_SYSTEM_CACHE_FOLDER` (not implemented yet) + + + + + +User global (home) install: + +- `%APPDATA%\xPacks` (like `C:\Users\ilg\AppData\Roaming\xPacks`) +- `%LOCALAPPDATA%\Caches\xPacks` (like `C:\Users\ilg\AppData\Local\Caches\xPacks`) +- `%APPDATA%\xPacks\.bin` (not in `Path`; not used by **xpm**) + +System install (not implemented): + +- `%ProgramFiles%\xPacks` (like `C:\Program Files\xPacks`) +- `%ProgramFiles%\xPacks\.cache` +- `%ProgramFiles%\xPacks\.bin` (not in `Path`; not used by **xpm**) + + + + + +User global (home) install: + +- `${HOME}/Library/xPacks` +- `${HOME}/Library/Caches/xPacks` +- `${HOME}/Library/xPacks/.bin` (not in `PATH`; not used by **xpm**) + +System install (not implemented yet): + +- `/Library/xPacks` +- `/Library/Caches/xPacks` +- `/Library/xPacks/.bin` (not in `PATH`; not used by **xpm**) + + + + + +User global (home) install: + +- `${HOME}/.local/xPacks` (was `${HOME}/opt/xPacks` in earlier versions) +- `${HOME}/.cache/xPacks` +- `${HOME}/.local/xPacks/.bin` (not in `PATH`; not used by **xpm**) + +System install (not implemented yet): + +- `/opt/xPacks` +- `/opt/xPacks/.cache` +- `/opt/xPacks/.bin` (not in `PATH`; not used by **xpm**) + + + + + +The previously mentioned `.bin` folders are only recommendations and +are intentionally not included in the PATH. However, in specific +setups, users can create links to binaries from any folders they choose. + +## Setting session wide environment variables + + + + + +To define session wide environment variables on Windows 11/10, use the +Control Panel and add the variables. + +From a terminal, try `set` to set the variables and `setx` to make +them persistent: + +```txt +set XPACKS_STORE_FOLDER=%APPDATA%\My-xPacks +setx XPACKS_STORE_FOLDER "%APPDATA%\My-xPacks" +``` + +:::note + +These commands may not work with all shells and all Windows versions. +You are welcome to contribute to the documentation with other commands. + +::: + + + + + +To define session wide environment variables on recent macOS systems, +define a User Agent that will issue the `launchctl setenv` command. + +Create a special `environment.plist` file in the users home directory, +for example in `~/Library/LaunchAgents/`: + +```xml + + + + + + + Label + my.variables + ProgramArguments + + sh + -c + launchctl setenv XPACKS_STORE_FOLDER /Users/myself/location/xpacks + + RunAtLoad + + + +``` + +To activate this, run + +```console +launchctl load ~/Library/LaunchAgents/environment.plist +launchctl start ~/Library/LaunchAgents/environment.plist +``` + +Logout and login. + +The new variable should be in the environment, and available to +all applications, all shells, etc. + +TODO: check if this definition is limited to a user. + +Links: + +- [www.launchd.info](https://www.launchd.info) +- [support.apple.com](https://support.apple.com/en-in/guide/terminal/apdc6c1077b-5d5d-4d35-9c19-60f2397b2369/mac) + + + + + +Unfortunately the wide selection of graphical environments on GNU/Linux +makes very difficult to document a generic solution. + +You are welcome to contribute to the documentation solutions for the major +distributions. + + + + + + +:::tip + +To avoid the additional complexity, it is +recommended to use the default locations. + +::: diff --git a/website/docs/user/img/xpack-actions.png b/website/docs/user/img/xpack-actions.png new file mode 100644 index 0000000..3e70137 Binary files /dev/null and b/website/docs/user/img/xpack-actions.png differ diff --git a/website/docs/user/index.mdx b/website/docs/user/index.mdx index e276adc..31f0a5e 100644 --- a/website/docs/user/index.mdx +++ b/website/docs/user/index.mdx @@ -6,6 +6,618 @@ title: User Information --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +{/* ------------------------------------------------------------------------ */} + # How to use xpm -TBD +This section is intended for those who plan to integrate **xpm** +into their workflows. + +## Using existing projects + +At its most basic level, the **xpm** workflow involves two key tasks: + +1. Installing dependencies +2. Running various actions related to significant development steps + + +The easiest way to experiment with this is to use an existing project. +For instance, you can start with a simple C project that prints the +traditional _Hello, World!_ message. + +The first step is to clone the project into a temporary folder of your choice: + +```sh +git clone https://github.com/xpack/xpm-demo-hello1.git +``` + +The next major step in the workflow is to satisfy the project dependencies. +In this case, **xpm** will install GCC. + +```sh +cd xpm-demo-hello1 +xpm install +``` + +:::info + +It should be noted that this will not install just any version of GCC, +but a specific version (14.2.0 in this case), which is hard-coded into +the project configuration. This ensures that whenever the project is +used, on any platform, the same specific version will be utilized. + +::: + +The next steps involve running several actions, beginning with +one that prepares the build folder: + +```sh +xpm run prepare +``` + +The next action is to build the executable: + +```sh +xpm run build +``` + +The final action is to execute the program: + +```sh +xpm run execute +``` + +As expected, the result is: + +```console +Hello world! +``` + +:::info + +It should be noted that all these commands work the same on all +major platforms (Windows, macOS, and GNU/Linux). + + +::: + + +## Create a new project + +As it can be seen, the workflow for existing projects is trivial. + +However, for a better understanding, it is useful to also understanding +how to create a project from scratch. + +### Initialise project + +Similarly to **npm**, a project must be prepared for **xpm** use. + +Run the following commands in a temporary folder of your choice: + +```sh +mkdir xpm-demo-hello && cd xpm-demo-hello +xpm init +``` + +This adds an empty `package.json` where further definitions will be stored. + +### Add source code + +Add a simple C program that prints the traditional _Hello world!_ message: + +```c title="xpm-demo-hello/src/hello.c" +#include + +int +main (int argc, char* argv[]) +{ + printf ("Hello world!\n"); + + return 0; +} +``` + +### Install toolchain + +To compile this C program, we'll use GCC 14.2, which must be installed: + +```sh +xpm install @xpack-dev-tools/gcc@14.2.0-1.1 +``` + +This command will add the following links to the project: + +```console +% tree -a -L2 xpacks +xpacks +├── .bin +│   ├── c++ -> ../@xpack-dev-tools/gcc/.content/bin/c++ +│   ├── cpp -> ../@xpack-dev-tools/gcc/.content/bin/cpp +│   ├── g++ -> ../@xpack-dev-tools/gcc/.content/bin/g++ +│   ├── gcc -> ../@xpack-dev-tools/gcc/.content/bin/gcc +│   ├── gcov -> ../@xpack-dev-tools/gcc/.content/bin/gcov +│   ├── gcov-dump -> ../@xpack-dev-tools/gcc/.content/bin/gcov-dump +│   ├── gcov-tool -> ../@xpack-dev-tools/gcc/.content/bin/gcov-tool +│   ├── gdb -> ../@xpack-dev-tools/gcc/.content/bin/gdb +│   ├── gdb-add-index -> ../@xpack-dev-tools/gcc/.content/bin/gdb-add-index +│   ├── gfortran -> ../@xpack-dev-tools/gcc/.content/bin/gfortran +│   └── lto-dump -> ../@xpack-dev-tools/gcc/.content/bin/lto-dump +└── @xpack-dev-tools + └── gcc -> /Users/ilg/Library/xPacks/@xpack-dev-tools/gcc/14.2.0-1.1 + +4 directories, 11 files +``` + +This command will also remeber the actual GCC version in the +`xpacks.devDependencies` section of `package.json`, ensuring that +the project is locked to this version: + +```json {4-7} +{ + "xpacks": { + "devDependencies": { + "@xpack-dev-tools/gcc": { + "specifier": "14.2.0-1.1", + "local": "link", + "platforms": "all" + } + }, + } +} +``` + +:::note + +On Windows, where symbolic links to files are problematic, forwarders/shims +are used. For example: + +```console +... +│ gcc +│ gcc.cmd +│ gcc.ps1 +``` + +::: + +To test if `gcc` starts properly, invoke it via the link/shim in the +`.bin` folder: + + + + + +```console +PS C:\Users\ilg\xpm-demo-hello> .\xpacks\.bin\gcc --version +gcc.exe (xPack MinGW-w64 GCC x86_64) 14.2.0 +``` + + + + + +```console +% ./xpacks/.bin/gcc --version +gcc (xPack GCC x86_64) 14.2.0 +``` + + + + + +```console +$ ./xpacks/.bin/gcc --version +gcc (xPack GCC x86_64) 14.2.0 +``` + + + + + + +### Add actions + +For traditional development environments, adding `xpacks/.bin` to the +`PATH` is sufficient to enable build tools, such as make or cmake, to +access the installed GCC. + +However, the workflow can be further automated, by starting the build tools +via `xpm run`, which adjusts the `PATH` itself. + +For this, edit `package.json` and add the `gcc --version` command in the +`xpack.actions` section, with a name (for example `gcc-version`): + +```json {4} +{ + "xpacks": { + "actions": { + "gcc-version": "gcc --version" + } + } +} +``` + +With this definition, the compiler version can be obtained without manually +entering the path: + + + + + +```console +PS C:\Users\ilg\xpm-demo-hello> xpm run gcc-version +> gcc --version +gcc.exe (xPack MinGW-w64 GCC x86_64) 14.2.0 +``` + + + + + +```console +% xpm run gcc-version +> gcc --version +gcc (xPack GCC x86_64) 14.2.0 +``` + + + + + +```console +$ xpm run gcc-version +> gcc --version +gcc (xPack GCC x86_64) 14.2.0 +``` + + + + + +With the compiler functional, we can add `xpack.actions` to do the actual work, +i.e. to prepare the build environment, to perform the build and to +execute the resulting program: + +```json {5-7} +{ + "xpacks": { + "actions": { + "gcc-version": "gcc --version", + "prepare": "mkdir build", + "build": "gcc src/hello.c -o build/hello", + "execute": "build{{path.sep}}hello" + } + } +} +``` + +:::tip[Tip 1] + +The `{{path.sep}}` syntax is a LiquidJS substitution used to +accommodate platform-specific path separators. It is necessary +in the `execute` command because it is parsed by the system shell. +However, it is not required in the compile command since GCC also +understands POSIX paths. + +::: + +:::tip[Tip 2] + +In this simple demo case, the `prepare` action is straightforward and can +be directly executed in the terminal. However, for real-life projects, +preparing the build often involves using tools like CMake or Meson. +Therefore, as a best practice, it is recommended to always define a +`prepare` action. + +::: + +With these actions defined, the workflow becomes: + + + + + +```console +PS C:\Users\ilg\xpm-demo-hello> xpm run prepare +> mkdir build + +PS C:\Users\ilg\xpm-demo-hello> xpm run build +> gcc src/hello.c -o build/hello + +PS C:\Users\ilg\xpm-demo-hello> xpm run execute +> build\hello +Hello world! +``` + + + + + +```console +% xpm run prepare +> mkdir build + +% xpm run build +> gcc src/hello.c -o build/hello + +% xpm run execute +> build/hello +Hello world! +``` + + + + + +```console +$ xpm run prepare +> mkdir build + +$ xpm run build +> gcc src/hello.c -o build/hello + +$ xpm run execute +> build/hello +Hello world! +``` + + + + + +### Visual Studio Code + +For convenience, when using +[Visual Studio Code](https://code.visualstudio.com) with the +[xPack C/C++ Managed Build Tools](https://marketplace.visualstudio.com/items?itemName=ilg-vscode.xpack) extension, +the actions are displayed in the bottom left corner and can be executed +with a single mouse click. + +![gcc-version](./img/xpack-actions.png) + +## Instantiate a template + +The above resulting projects, although functional, are still quite +simple. + +A real world project will probably have multiple configurations, at least +to build separate debug/release executables, if not even to run tests +in multiple environments. + +Also, more elaborate projects will probably use CMake or meson. + +These kind of projects can be created manually, but the process can be +further automated by using project templates. + +To generate the traditional Hello World! project, there is an +[xpack/hello-world-template-xpack](https://github.com/xpack/hello-world-template-xpack), +project, also available from npmjs.com as +[@xpack/hello-world-template](https://www.npmjs.com/package/@xpack/hello-world-template). + +Both C and C++ are supported, with **CMake** and **meson** as build system +generators. + +Instantiating the template in interractive mode looks like this: + +```console + % xpm init --template @xpack/hello-world-template@latest + +Checking package @xpack/hello-world-template@latest metadata... +Installing @xpack/hello-world-template@0.6.1... +Processing @xpack/hello-world-template@0.6.1... + +Programming language? (c, cpp, ?) [cpp]: c +Build System? (cmake, meson, autotools, ?) [cmake]: +Toolchain? (gcc, clang, system, ?) [gcc]: +Creating the C project 'my-project'... +File 'include/hello-world.h' copied. +File 'src/hello-world.c' copied. +File 'libs/adder/include/add/add.h' copied. +File 'libs/adder/src/add.c' copied. +Folder 'cmake' copied. +File 'CMakeLists.txt' generated. +File '.vscode/tasks.json' copied. +File '.vscode/settings.json' copied. +File '.gitignore' copied. +File '.npmignore' copied. +File 'README.md' generated. +File 'LICENSE' generated. +File 'package.json' generated. +``` + +The next step is to satisfy dependencies: + +```console +% xpm install +@my-scope/my-project... ++ @xpack-dev-tools/ninja-build@1.11.1-3.1 ++ @xpack-dev-tools/gcc@14.2.0-1.1 ++ @xpack-dev-tools/cmake@3.28.6-1.1 +'xpacks/@xpack-dev-tools/cmake' -> '/Users/ilg/Library/xPacks/@xpack-dev-tools/cmake/3.28.6-1.1' +'xpacks/@xpack-dev-tools/gcc' -> '/Users/ilg/Library/xPacks/@xpack-dev-tools/gcc/14.2.0-1.1' +'xpacks/.bin/ccmake' -> '../@xpack-dev-tools/cmake/.content/bin/ccmake' +'xpacks/@xpack-dev-tools/ninja-build' -> '/Users/ilg/Library/xPacks/@xpack-dev-tools/ninja-build/1.11.1-3.1' +'xpacks/.bin/cmake' -> '../@xpack-dev-tools/cmake/.content/bin/cmake' +'xpacks/.bin/ninja' -> '../@xpack-dev-tools/ninja-build/.content/bin/ninja' +'xpacks/.bin/c++' -> '../@xpack-dev-tools/gcc/.content/bin/c++' +'xpacks/.bin/cpack' -> '../@xpack-dev-tools/cmake/.content/bin/cpack' +'xpacks/.bin/ctest' -> '../@xpack-dev-tools/cmake/.content/bin/ctest' +'xpacks/.bin/cpp' -> '../@xpack-dev-tools/gcc/.content/bin/cpp' +'xpacks/.bin/g++' -> '../@xpack-dev-tools/gcc/.content/bin/g++' +'xpacks/.bin/gcc' -> '../@xpack-dev-tools/gcc/.content/bin/gcc' +'xpacks/.bin/gcov' -> '../@xpack-dev-tools/gcc/.content/bin/gcov' +'xpacks/.bin/gcov-dump' -> '../@xpack-dev-tools/gcc/.content/bin/gcov-dump' +'xpacks/.bin/gcov-tool' -> '../@xpack-dev-tools/gcc/.content/bin/gcov-tool' +'xpacks/.bin/gdb' -> '../@xpack-dev-tools/gcc/.content/bin/gdb' +'xpacks/.bin/gdb-add-index' -> '../@xpack-dev-tools/gcc/.content/bin/gdb-add-index' +'xpacks/.bin/gfortran' -> '../@xpack-dev-tools/gcc/.content/bin/gfortran' +'xpacks/.bin/lto-dump' -> '../@xpack-dev-tools/gcc/.content/bin/lto-dump' +``` + +The final step is to run the tests: + +```console +% xpm run test-all +> xpm run test-debug +> xpm run prepare --config debug +> cmake -S . -B build/debug -G Ninja -D CMAKE_BUILD_TYPE=Debug -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/gcc.cmake +-- The C compiler identification is GNU 14.2.0 +-- The CXX compiler identification is GNU 14.2.0 +-- Checking whether C compiler has -isysroot +-- Checking whether C compiler has -isysroot - yes +-- Checking whether C compiler supports OSX deployment target flag +-- Checking whether C compiler supports OSX deployment target flag - yes +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /Users/ilg/tmp/my-project/xpacks/.bin/gcc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Checking whether CXX compiler has -isysroot +-- Checking whether CXX compiler has -isysroot - yes +-- Checking whether CXX compiler supports OSX deployment target flag +-- Checking whether CXX compiler supports OSX deployment target flag - yes +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working CXX compiler: /Users/ilg/tmp/my-project/xpacks/.bin/g++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- The ASM compiler identification is GNU +-- Found assembler: /Users/ilg/tmp/my-project/xpacks/.bin/gcc +-- Build type: Debug +-- Project path: /Users/ilg/tmp/my-project +-- PATH: /Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/.nvm/versions/node/v22.11.0/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin +-- CMake version: 3.28.6 +-- Compiler: GNU 14.2.0 +-- A> hello-world +-- Configuring done (2.2s) +-- Generating done (0.0s) +-- Build files have been written to: /Users/ilg/tmp/my-project/build/debug +> xpm run build --config debug +> cmake -S . -B build/debug -G Ninja -D CMAKE_BUILD_TYPE=Debug -D CMAKE_EXPORT_COMPILE_COMMANDS=ON +-- Build type: Debug +-- Project path: /Users/ilg/tmp/my-project +-- PATH: /Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/.nvm/versions/node/v22.11.0/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin +-- CMake version: 3.28.6 +-- Compiler: GNU 14.2.0 +-- A> hello-world +-- Configuring done (0.1s) +-- Generating done (0.0s) +-- Build files have been written to: /Users/ilg/tmp/my-project/build/debug +> cmake --build build/debug --verbose +Change Dir: '/Users/ilg/tmp/my-project/build/debug' + +Run Build Command(s): /Users/ilg/tmp/my-project/xpacks/.bin/ninja -v +[1/3] /Users/ilg/tmp/my-project/xpacks/.bin/gcc -DDEBUG -I/Users/ilg/tmp/my-project/include -I/Users/ilg/tmp/my-project/libs/adder/include -O0 -g3 -std=c11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -static-libgcc -static-libstdc++ -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -flto -MD -MT CMakeFiles/hello-world.dir/libs/adder/src/add.c.o -MF CMakeFiles/hello-world.dir/libs/adder/src/add.c.o.d -o CMakeFiles/hello-world.dir/libs/adder/src/add.c.o -c /Users/ilg/tmp/my-project/libs/adder/src/add.c +[2/3] /Users/ilg/tmp/my-project/xpacks/.bin/gcc -DDEBUG -I/Users/ilg/tmp/my-project/include -I/Users/ilg/tmp/my-project/libs/adder/include -O0 -g3 -std=c11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -static-libgcc -static-libstdc++ -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -flto -MD -MT CMakeFiles/hello-world.dir/src/hello-world.c.o -MF CMakeFiles/hello-world.dir/src/hello-world.c.o.d -o CMakeFiles/hello-world.dir/src/hello-world.c.o -c /Users/ilg/tmp/my-project/src/hello-world.c +[3/3] : && /Users/ilg/tmp/my-project/xpacks/.bin/gcc -O0 -g3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -static-libgcc -static-libstdc++ -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -flto -Wl,-dead_strip CMakeFiles/hello-world.dir/src/hello-world.c.o CMakeFiles/hello-world.dir/libs/adder/src/add.c.o -o hello-world && : +-macosx_version_min has been renamed to -macos_version_min +-macosx_version_min has been renamed to -macos_version_min + +> xpm run execute --config debug +> build/debug/hello-world +Hello World! +(in debug mode) +Check adder lib: 41 + 1 = 42 +> xpm run test-release +> xpm run prepare --config release +> cmake -S . -B build/release -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/gcc.cmake +-- The C compiler identification is GNU 14.2.0 +-- The CXX compiler identification is GNU 14.2.0 +-- Checking whether C compiler has -isysroot +-- Checking whether C compiler has -isysroot - yes +-- Checking whether C compiler supports OSX deployment target flag +-- Checking whether C compiler supports OSX deployment target flag - yes +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /Users/ilg/tmp/my-project/xpacks/.bin/gcc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Checking whether CXX compiler has -isysroot +-- Checking whether CXX compiler has -isysroot - yes +-- Checking whether CXX compiler supports OSX deployment target flag +-- Checking whether CXX compiler supports OSX deployment target flag - yes +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working CXX compiler: /Users/ilg/tmp/my-project/xpacks/.bin/g++ - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- The ASM compiler identification is GNU +-- Found assembler: /Users/ilg/tmp/my-project/xpacks/.bin/gcc +-- Build type: Release +-- Project path: /Users/ilg/tmp/my-project +-- PATH: /Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/.nvm/versions/node/v22.11.0/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin +-- CMake version: 3.28.6 +-- Compiler: GNU 14.2.0 +-- A> hello-world +-- Configuring done (1.8s) +-- Generating done (0.0s) +-- Build files have been written to: /Users/ilg/tmp/my-project/build/release +> xpm run build --config release +> cmake -S . -B build/release -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_EXPORT_COMPILE_COMMANDS=ON +-- Build type: Release +-- Project path: /Users/ilg/tmp/my-project +-- PATH: /Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/tmp/my-project/xpacks/.bin:/Users/ilg/.nvm/versions/node/v22.11.0/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin +-- CMake version: 3.28.6 +-- Compiler: GNU 14.2.0 +-- A> hello-world +-- Configuring done (0.1s) +-- Generating done (0.0s) +-- Build files have been written to: /Users/ilg/tmp/my-project/build/release +> cmake --build build/release --verbose +Change Dir: '/Users/ilg/tmp/my-project/build/release' + +Run Build Command(s): /Users/ilg/tmp/my-project/xpacks/.bin/ninja -v +[1/3] /Users/ilg/tmp/my-project/xpacks/.bin/gcc -I/Users/ilg/tmp/my-project/include -I/Users/ilg/tmp/my-project/libs/adder/include -O3 -DNDEBUG -std=c11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -static-libgcc -static-libstdc++ -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -flto -MD -MT CMakeFiles/hello-world.dir/libs/adder/src/add.c.o -MF CMakeFiles/hello-world.dir/libs/adder/src/add.c.o.d -o CMakeFiles/hello-world.dir/libs/adder/src/add.c.o -c /Users/ilg/tmp/my-project/libs/adder/src/add.c +[2/3] /Users/ilg/tmp/my-project/xpacks/.bin/gcc -I/Users/ilg/tmp/my-project/include -I/Users/ilg/tmp/my-project/libs/adder/include -O3 -DNDEBUG -std=c11 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -static-libgcc -static-libstdc++ -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -flto -MD -MT CMakeFiles/hello-world.dir/src/hello-world.c.o -MF CMakeFiles/hello-world.dir/src/hello-world.c.o.d -o CMakeFiles/hello-world.dir/src/hello-world.c.o -c /Users/ilg/tmp/my-project/src/hello-world.c +[3/3] : && /Users/ilg/tmp/my-project/xpacks/.bin/gcc -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -static-libgcc -static-libstdc++ -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -flto -Wl,-dead_strip CMakeFiles/hello-world.dir/src/hello-world.c.o CMakeFiles/hello-world.dir/libs/adder/src/add.c.o -o hello-world && : +-macosx_version_min has been renamed to -macos_version_min +-macosx_version_min has been renamed to -macos_version_min + +> xpm run execute --config release +> build/release/hello-world +Hello World! +(in release mode) +(no asserts) +Check adder lib: 41 + 1 = 42 +``` + +## Final considerations + +The **xpm** workflow described above can be successfully applied +in various scenarios: + +- **Source code libraries**: These can be included as dependencies +in other projects. +- **Projects with executables**: These can also be included as +dependencies in other projects. +- **Final projects**: These produce various artefacts and can +run natively or on embedded platforms. + +Once the mechanism for defining `xpack.actions` is understood, +it becomes possible to implement highly complex configurations. +For example, you can create intricate build configurations for +very elaborate multi-platform tests. + +For final projects that are not intended to be used as dependencies in +other projects, having a complex top-level package.json is not a +significant issue. + +However, for projects intended to produce packages for use as dependencies +in other projects, it is recommended to keep only the necessary definitions +in the top-level `package.json`. + +### Separate `tests/package.json` + +To reduce clutter, it is recommended to move all test-related definitions +to a separate `tests` folder, with its own `package.json`. + +### Separate `build_assets/package.json` + +Similarly, if the project produces executables to be used as dependencies, +it is recommended to move all build related files into a separate folder, +for example `build-assets`, with its own `package.json`. + diff --git a/website/docs/user/policies/0001/index.mdx b/website/docs/user/policies/0001/index.mdx new file mode 100644 index 0000000..41f7715 --- /dev/null +++ b/website/docs/user/policies/0001/index.mdx @@ -0,0 +1,59 @@ +--- +title: "0001: Share npm dependencies" +# description: + +keywords: + - xPack + - package + - manager + - policy + +date: 2022-08-15 10:12:00 +0300 + +--- + +# 0001: Share npm dependencies + +## Overview + +Initially **xpm** shared dependencies with **npm**, in the same top +`dependencies` and `devDependencies` properties. + +The advantage was that **npm** aware tools and sites were able to list +these dependencies. + +However, this required `xpm install` to also handle the **npm** dependencies, +which made things more complicated than they should have been. + +## Changes + +To simplify things, given that the xPack dependencies have a different +nature than node modules and require a different logic, it was considered +that it would be better to completely separate the definitions in +`package.json`, and move them below the `xpack` object. + +Thus, for source and binary xPacks, starting with xpm v0.14.0, +the definitions are: + +- `xpack.dependencies` +- `xpack.devDependencies` + +## Action points + +For a while, packages that have a `xpack.minimumXpmRequired` less than 0.14.0, +will still be able to use the shared definitions with npm, +but it is recommended to update the packages. + +To do this, it is required to: + +- update **xpm** to at least v0.14.0 +- move xPack references from `dependencies` to `xpack.dependencies` +- move xPack references from `devDependencies` to `xpack.devDependencies` +- if any, keep the npm references in `dependencies` and `devDependencies` +- update `xpack.minimumXpmRequired` to at least 0.14.0 +- add `npm install` to CI configurations (if needed) + +## End-of-life + +This policy is expected to remain available until the major rewrite of xpm, +planned for v1.0.0. diff --git a/website/docs/user/policies/index.mdx b/website/docs/user/policies/index.mdx new file mode 100644 index 0000000..82acf3f --- /dev/null +++ b/website/docs/user/policies/index.mdx @@ -0,0 +1,35 @@ +--- +title: xpm Policies +#description: + +keywords: + - xPack + - package + - manager + - compatibility + - policy + +date: 2022-08-15 10:38:00 +0300 + +--- + +# xpm policies + +## Overview + +Similarly to CMake, **xpm** policies are used to preserve backward compatible +behaviour across multiple releases. + +Newer **xpm** releases are able to adjust some +functionality to match that of an older release, based on the +value of the `xpack.minimumXpmRequired` property in `package.json`. + +When such policies are used, warnings are issued to inform the +developers about the deprecated features, and give them time to update +the packages. + +The following policies are available (in reverse chronological order): + +## Policies introduced by xpm 0.14 + +- [0001](./0001/) - share npm dependencies diff --git a/website/docusaurus-config-navbar-cli.ts b/website/docusaurus-config-navbar-cli.ts new file mode 100644 index 0000000..79b935d --- /dev/null +++ b/website/docusaurus-config-navbar-cli.ts @@ -0,0 +1,26 @@ +/* + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +const navbarCli = { + type: 'dropdown', + label: 'CLI Reference', + to: '/docs/cli/xpm', + position: 'left', + items: [ + { + label: 'xpm', + to: '/docs/cli/xpm' + }, + ], +} + +export default +navbarCli; diff --git a/website/docusaurus-config-redirects.ts b/website/docusaurus-config-redirects.ts new file mode 100644 index 0000000..1c54ee3 --- /dev/null +++ b/website/docusaurus-config-redirects.ts @@ -0,0 +1,50 @@ +/* + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +import logger from '@docusaurus/logger'; + +export const redirects = { + // fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage + // toExtensions: ['exe', 'zip'], // /myAsset -> /myAsset.zip (if latter exists) + redirects: [ + // // /docs/oldDoc -> /docs/newDoc + // { + // to: '/docs/newDoc', + // from: '/docs/oldDoc', + // }, + // // Redirect from multiple old paths to the new path + // { + // to: '/docs/newDoc2', + // from: ['/docs/oldDocFrom2019', '/docs/legacyDocFrom2016'], + // }, + { from: '/faq', to: '/docs/faq' }, + { from: '/install', to: '/docs/install' }, + { from: '/support', to: '/docs/support' }, + ], + createRedirects(existingPath) { + logger.info(existingPath); + // if (existingPath.includes('/evenimente')) { + // // logger.info(`to ${existingPath} from ${existingPath.replace('/evenimente', '/events')}`); + // // Redirect from /events/X to /evenimente/X + // return [ + // existingPath.replace('/evenimente', '/events') + // ]; + // } else if (existingPath.includes('/amintiri')) { + // // logger.info(`to ${existingPath} from ${existingPath.replace('/amintiri', '/blog')}`); + // // Redirect from /blog/Z to /amintiri/X + // return [ + // existingPath.replace('/amintiri', '/blog') + // ]; + // } + // return undefined; // Return a falsy value: no redirect created + // }, + } +} diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 92ea8c8..10a053c 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -1,8 +1,16 @@ -import { themes as prismThemes } from 'prism-react-renderer'; -import type { Config } from '@docusaurus/types'; +// DO NOT EDIT! +// Automatically generated from docusaurus-template-liquid/templates/docusaurus. + +import {themes as prismThemes} from 'prism-react-renderer'; +import type {Config} from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; import logger from '@docusaurus/logger'; +import cliNavbar from './docusaurus-config-navbar-cli' + + +import {redirects} from './docusaurus-config-redirects' + // The node.js modules cannot be used in modules imported in browser code: // webpack < 5 used to include polyfills for node.js core modules by default. // so the entire initialisation code must be in this file, that is @@ -24,14 +32,14 @@ function getCustomFields() { const topFileContent = fs.readFileSync(topFilePath); const topPackageJson = JSON.parse(topFileContent.toString()); - const npmVersion = topPackageJson.version.replace(/[.-]pre/, ''); + const releaseVersion = topPackageJson.version.replace(/[.-]pre/, ''); logger.info(`package version: ${topPackageJson.version}`); const customFields = {} return { - npmVersion, + releaseVersion, docusaurusVersion: require('@docusaurus/core/package.json').version, buildTime: new Date().getTime(), ...customFields, @@ -54,7 +62,7 @@ const config: Config = { url: 'https://xpack.github.io/', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/xpm/', + baseUrl: '/xpm-js/', // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. @@ -76,83 +84,51 @@ const config: Config = { locales: ['en'], }, - - plugins: [ + presets: [ [ - '@docusaurus/plugin-content-docs', + 'classic', { - id: 'docs', - path: './docs', - routeBasePath: 'docs', - sidebarPath: './sidebars.ts', - // Remove this to remove the "edit this page" links. - editUrl: 'https://github.com/xpack/xpm-js/edit/master/website/', - // showLastUpdateAuthor: true, - showLastUpdateTime: true, - }, - ], - [ - // https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog - '@docusaurus/plugin-content-blog', - { - showReadingTime: true, - feedOptions: { - type: ['rss', 'atom'], - xslt: true, + docs: { + sidebarPath: './sidebars.ts', + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: 'https://github.com/xpack/xpm-js/edit/master/website/', + // showLastUpdateAuthor: true, + showLastUpdateTime: true, }, - // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/xpack/xpm-js/edit/master/website/', - // Useful options to enforce blogging best practices - onInlineTags: 'warn', - onInlineAuthors: 'warn', - onUntruncatedBlogPosts: 'warn', - showLastUpdateTime: true, - blogSidebarCount: 8, - authorsMapPath: '../authors.yml', - }, - ], - [ - '@docusaurus/plugin-content-pages', - {} + blog: { + showReadingTime: true, + feedOptions: { + type: ['rss', 'atom'], + xslt: true, + }, + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: 'https://github.com/xpack/xpm-js/edit/master/website/', + // Useful options to enforce blogging best practices + onInlineTags: 'warn', + onInlineAuthors: 'warn', + onUntruncatedBlogPosts: 'warn', + }, + sitemap: { + // https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-sitemap + changefreq: 'weekly', + priority: 0.5, + // ignorePatterns: ['/tags/**'], + filename: 'sitemap.xml', + }, + theme: { + customCss: './src/css/custom.css', + }, + } satisfies Preset.Options, ], + ], + + plugins: [ [ // https://docusaurus.io/docs/next/api/plugins/@docusaurus/plugin-client-redirects#redirects '@docusaurus/plugin-client-redirects', - { - // fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage - // toExtensions: ['exe', 'zip'], // /myAsset -> /myAsset.zip (if latter exists) - redirects: [ - // // /docs/oldDoc -> /docs/newDoc - // { - // to: '/docs/newDoc', - // from: '/docs/oldDoc', - // }, - // // Redirect from multiple old paths to the new path - // { - // to: '/docs/newDoc2', - // from: ['/docs/oldDocFrom2019', '/docs/legacyDocFrom2016'], - // }, - ], - createRedirects(existingPath) { - logger.info(existingPath); - // if (existingPath.includes('/evenimente')) { - // // logger.info(`to ${existingPath} from ${existingPath.replace('/evenimente', '/events')}`); - // // Redirect from /events/X to /evenimente/X - // return [ - // existingPath.replace('/evenimente', '/events') - // ]; - // } else if (existingPath.includes('/amintiri')) { - // // logger.info(`to ${existingPath} from ${existingPath.replace('/amintiri', '/blog')}`); - // // Redirect from /blog/Z to /amintiri/X - // return [ - // existingPath.replace('/amintiri', '/blog') - // ]; - // } - // return undefined; // Return a falsy value: no redirect created - // }, - } - } + redirects ], [ // https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-google-gtag @@ -163,17 +139,6 @@ const config: Config = { anonymizeIP: false, } ], - [ - // https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-sitemap - // https://cronica-it.github.io/sitemap.xml - '@docusaurus/plugin-sitemap', - { - changefreq: 'weekly', - priority: 0.5, - // ignorePatterns: ['/tags/**'], - filename: 'sitemap.xml', - } - ], [ '@docusaurus/plugin-ideal-image', { @@ -184,10 +149,12 @@ const config: Config = { disableInDev: false, }, ], + // Local plugins. './src/plugins/SelectReleasesPlugin', ], + // https://docusaurus.io/docs/api/docusaurus-config#headTags headTags: [ { @@ -195,7 +162,7 @@ const config: Config = { attributes: { rel: 'icon', type: 'image/png', - href: '/xpm/favicons/favicon-48x48.png', + href: '/xpm-js/favicons/favicon-48x48.png', sizes: '48x48' } }, @@ -204,14 +171,14 @@ const config: Config = { attributes: { rel: 'icon', type: 'image/svg+xml', - href: '/xpm/favicons/favicon.svg' + href: '/xpm-js/favicons/favicon.svg' } }, { tagName: 'link', attributes: { rel: 'shortcut icon', - href: '/xpm/favicons/favicon.ico' + href: '/xpm-js/favicons/favicon.ico' } }, { @@ -226,20 +193,11 @@ const config: Config = { tagName: 'link', attributes: { rel: 'manifest', - href: '{{baseUrl}}favicons/site.webmanifest' + href: '/xpm-js/favicons/site.webmanifest' } } ], - themes: [ - [ - '@docusaurus/theme-classic', - { - customCss: './src/css/custom.css', - } - ], - ], - themeConfig: { // Replace with your project's social card // image: 'img/docusaurus-social-card.jpg', @@ -247,10 +205,9 @@ const config: Config = { metadata: [ { name: 'keywords', - content: 'xpm, xpack, build, test, dependencies, npm, reproducibility' + content: 'xpm, xpack, project, manager, build, test, dependencies, npm, reproducibility' } ], - navbar: { // Overriden by i18n/en/docusaurus-theme-classic. title: 'The xPack Project', @@ -295,51 +252,11 @@ const config: Config = { }, { label: 'About', - to: '/docs/about' + to: '/docs/project/about' } ], }, - { - type: 'dropdown', - label: 'CLI Reference', - to: '/docs/cli/xpm', - position: 'left', - items: [ - { - label: 'xpm', - to: '/docs/cli/xpm' - }, - { - label: 'xpm init', - to: '/docs/cli/xpm/init' - }, - { - label: 'xpm install', - to: '/docs/cli/xpm/install' - }, - { - label: 'xpm link', - to: '/docs/cli/xpm/link' - }, - { - label: 'xpm list', - to: '/docs/cli/xpm/list' - }, - { - label: 'xpm run', - to: '/docs/cli/xpm/run' - }, - { - label: 'xpm uninstall', - to: '/docs/cli/xpm/uninstall' - }, - ], - }, - { - to: '/docs/api', - label: 'API Reference', - position: 'left', - }, + cliNavbar, { type: 'dropdown', to: '/blog', @@ -367,9 +284,9 @@ const config: Config = { 'aria-label': 'GitHub repository', }, { - label: `v${customFields.npmVersion}`, + label: `v${customFields.releaseVersion}`, position: 'right', - href: `https://www.npmjs.com/package/xpm/v/${customFields.npmVersion}`, + href: `https://www.npmjs.com/package/xpm/v/${customFields.releaseVersion}`, }, { href: 'https://github.com/xpack/', diff --git a/website/package-lock.json b/website/package-lock.json index 7ae99ef..c99160d 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -22,7 +22,11 @@ "@docusaurus/module-type-aliases": "3.5.2", "@docusaurus/tsconfig": "3.5.2", "@docusaurus/types": "3.5.2", - "typescript": "~5.5.2" + "docusaurus-plugin-typedoc": "^1.0.5", + "json": "^11.0.0", + "typedoc": "^0.26.11", + "typedoc-plugin-markdown": "^4.2.10", + "typescript": "~5.6.3" }, "engines": { "node": ">=18.0" @@ -3136,6 +3140,57 @@ "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==", "license": "MIT" }, + "node_modules/@shikijs/core": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.22.2.tgz", + "integrity": "sha512-bvIQcd8BEeR1yFvOYv6HDiyta2FFVePbzeowf5pPS1avczrPK+cjmaxxh0nx5QzbON7+Sv0sQfQVciO7bN72sg==", + "dev": true, + "dependencies": { + "@shikijs/engine-javascript": "1.22.2", + "@shikijs/engine-oniguruma": "1.22.2", + "@shikijs/types": "1.22.2", + "@shikijs/vscode-textmate": "^9.3.0", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.3" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-1.22.2.tgz", + "integrity": "sha512-iOvql09ql6m+3d1vtvP8fLCVCK7BQD1pJFmHIECsujB0V32BJ0Ab6hxk1ewVSMFA58FI0pR2Had9BKZdyQrxTw==", + "dev": true, + "dependencies": { + "@shikijs/types": "1.22.2", + "@shikijs/vscode-textmate": "^9.3.0", + "oniguruma-to-js": "0.4.3" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.22.2.tgz", + "integrity": "sha512-GIZPAGzQOy56mGvWMoZRPggn0dTlBf1gutV5TdceLCZlFNqWmuc7u+CzD0Gd9vQUTgLbrt0KLzz6FNprqYAxlA==", + "dev": true, + "dependencies": { + "@shikijs/types": "1.22.2", + "@shikijs/vscode-textmate": "^9.3.0" + } + }, + "node_modules/@shikijs/types": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.22.2.tgz", + "integrity": "sha512-NCWDa6LGZqTuzjsGfXOBWfjS/fDIbDdmVDug+7ykVe1IKT4c1gakrvlfFYp5NhAXH/lyqLM8wsAPo5wNy73Feg==", + "dev": true, + "dependencies": { + "@shikijs/vscode-textmate": "^9.3.0", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-9.3.0.tgz", + "integrity": "sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==", + "dev": true + }, "node_modules/@sideway/address": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", @@ -6176,6 +6231,15 @@ "node": ">=6" } }, + "node_modules/docusaurus-plugin-typedoc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-typedoc/-/docusaurus-plugin-typedoc-1.0.5.tgz", + "integrity": "sha512-mv8LBJYilGOOPLqaIM3vbYc34m4qwOCpb4WfP24DOPFNj2uiTerw8sg9MGvN6Jx2+J8rq9/WMnjcyz3UMqoIIQ==", + "dev": true, + "peerDependencies": { + "typedoc-plugin-markdown": ">=4.0.0" + } + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -7740,6 +7804,29 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-html": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.3.tgz", + "integrity": "sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==", + "dev": true, + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-to-jsx-runtime": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.2.tgz", @@ -8775,6 +8862,18 @@ "node": ">=6" } }, + "node_modules/json": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/json/-/json-11.0.0.tgz", + "integrity": "sha512-N/ITv3Yw9Za8cGxuQqSqrq6RHnlaHWZkAFavcfpH/R52522c26EbihMxnY7A1chxfXJ4d+cEFIsyTgfi9GihrA==", + "dev": true, + "bin": { + "json": "lib/json.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -8896,6 +8995,15 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "license": "MIT" }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dev": true, + "dependencies": { + "uc.micro": "^2.0.0" + } + }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -9010,6 +9118,12 @@ "yallist": "^3.0.2" } }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, "node_modules/markdown-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", @@ -9022,6 +9136,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, "node_modules/markdown-table": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz", @@ -9438,6 +9569,12 @@ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", "license": "CC0-1.0" }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -11682,6 +11819,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/oniguruma-to-js": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/oniguruma-to-js/-/oniguruma-to-js-0.4.3.tgz", + "integrity": "sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==", + "dev": true, + "dependencies": { + "regex": "^4.3.2" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/open": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", @@ -12882,6 +13031,15 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/pupa": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", @@ -13412,6 +13570,12 @@ "@babel/runtime": "^7.8.4" } }, + "node_modules/regex": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/regex/-/regex-4.4.0.tgz", + "integrity": "sha512-uCUSuobNVeqUupowbdZub6ggI5/JZkYyJdDogddJr60L764oxC2pMZov1fQ3wM9bdyzUILDG+Sqx6NAKAz9rKQ==", + "dev": true + }, "node_modules/regexpu-core": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.1.1.tgz", @@ -14301,6 +14465,20 @@ "node": ">=4" } }, + "node_modules/shiki": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-1.22.2.tgz", + "integrity": "sha512-3IZau0NdGKXhH2bBlUk4w1IHNxPh6A5B2sUpyY+8utLu2j/h1QpFkAaUA1bAMxOWWGtTWcAh531vnS4NJKS/lA==", + "dev": true, + "dependencies": { + "@shikijs/core": "1.22.2", + "@shikijs/engine-javascript": "1.22.2", + "@shikijs/engine-oniguruma": "1.22.2", + "@shikijs/types": "1.22.2", + "@shikijs/vscode-textmate": "^9.3.0", + "@types/hast": "^3.0.4" + } + }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", @@ -15149,11 +15327,80 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typedoc": { + "version": "0.26.11", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.26.11.tgz", + "integrity": "sha512-sFEgRRtrcDl2FxVP58Ze++ZK2UQAEvtvvH8rRlig1Ja3o7dDaMHmaBfvJmdGnNEFaLTpQsN8dpvZaTqJSu/Ugw==", + "dev": true, + "dependencies": { + "lunr": "^2.3.9", + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "shiki": "^1.16.2", + "yaml": "^2.5.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.2.10.tgz", + "integrity": "sha512-PLX3pc1/7z13UJm4TDE9vo9jWGcClFUErXXtd5LdnoLjV6mynPpqZLU992DwMGFSRqJFZeKbVyqlNNeNHnk2tQ==", + "dev": true, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typedoc": "0.26.x" + } + }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typedoc/node_modules/yaml": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", + "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "license": "Apache-2.0", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -15162,6 +15409,12 @@ "node": ">=14.17" } }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true + }, "node_modules/undici-types": { "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", diff --git a/website/package.json b/website/package.json index 6f34179..6062fb8 100644 --- a/website/package.json +++ b/website/package.json @@ -12,8 +12,13 @@ "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", + "generate-typedoc": "docusaurus generate-typedoc", "typecheck": "tsc", - "import-releases": "bash _maintenance-scripts/import-releases.sh" + "npm-outdated": "npm outdated", + "npm-install": "npm install", + "npm-link-deps": "npm link @xpack/docusaurus-template-liquid @xpack/node-modules-helper", + "generate-website-commons": "bash node_modules/@xpack/docusaurus-template-liquid/maintenance-scripts/generate-commons.sh", + "generate-website-blog-post": "bash node_modules/@xpack/docusaurus-template-liquid/maintenance-scripts/generate-blog-post.sh" }, "dependencies": { "@docusaurus/core": "3.5.2", @@ -30,7 +35,11 @@ "@docusaurus/module-type-aliases": "3.5.2", "@docusaurus/tsconfig": "3.5.2", "@docusaurus/types": "3.5.2", - "typescript": "~5.5.2" + "docusaurus-plugin-typedoc": "^1.0.5", + "json": "^11.0.0", + "typedoc": "^0.26.11", + "typedoc-plugin-markdown": "^4.2.10", + "typescript": "~5.6.3" }, "browserslist": { "production": [ diff --git a/website/sidebar-cli.ts b/website/sidebar-cli.ts new file mode 100644 index 0000000..3bb5870 --- /dev/null +++ b/website/sidebar-cli.ts @@ -0,0 +1,65 @@ +/* + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +const cliSidebar = [ + { + type: "category", + label: "CLI Reference", + link: { + type: "doc", + id: "cli/xpm/index", + }, + items: [ + { + type: 'category', + label: 'xpm', + link: { + type: 'doc', + id: 'cli/xpm/index', + }, + items: [ + { + type: 'doc', + id: 'cli/xpm/init/index', + label: 'xpm init' + }, + { + type: 'doc', + id: 'cli/xpm/install/index', + label: 'xpm install' + }, + { + type: 'doc', + id: 'cli/xpm/link/index', + label: 'xpm link' + }, + { + type: 'doc', + id: 'cli/xpm/list/index', + label: 'xpm list' + }, + { + type: 'doc', + id: 'cli/xpm/run/index', + label: 'xpm run' + }, + { + type: 'doc', + id: 'cli/xpm/uninstall/index', + label: 'xpm uninstall' + }, + ] + }, + ], + } +] + +export default cliSidebar; diff --git a/website/sidebar-user.ts b/website/sidebar-user.ts new file mode 100644 index 0000000..491fa01 --- /dev/null +++ b/website/sidebar-user.ts @@ -0,0 +1,49 @@ +/* + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +export const userSidebarCategory = { + type: 'category', + label: 'User Information', + collapsed: false, + items: [ + { + type: 'doc', + id: 'user/index', + label: 'How to use' + }, + { + type: 'doc', + id: 'user/folders/index', + label: 'Folders' + }, + { + type: 'category', + label: 'Files', + collapsed: true, + link: { + type: "doc", + id: 'user/files/index', + }, + items: [ + { + type: 'doc', + id: 'user/files/package.json/index', + label: 'package.json' + }, + ] + }, + { + type: 'doc', + id: 'user/policies/index', + label: 'Policies' + }, + ] +} diff --git a/website/sidebars.ts b/website/sidebars.ts index 4dfc671..df54b4f 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -1,4 +1,9 @@ +// DO NOT EDIT! +// Automatically generated from docusaurus-template-liquid/templates/docusaurus. + import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; +import cliSidebar from "./sidebar-cli"; +import {userSidebarCategory} from "./sidebar-user"; /** * Creating a sidebar enables you to: @@ -11,7 +16,7 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; Create as many sidebars as you want. */ const sidebars: SidebarsConfig = { - // But you can create a sidebar manually + docsSidebar: [ { type: 'doc', @@ -23,11 +28,7 @@ const sidebars: SidebarsConfig = { id: 'install/index', label: 'Install Guide' }, - { - type: 'doc', - id: 'user/index', - label: 'User Information' - }, + userSidebarCategory, { type: 'doc', id: 'faq/index', @@ -44,10 +45,27 @@ const sidebars: SidebarsConfig = { label: 'Releases' }, { - type: 'doc', - id: 'about/index', - label: 'About' - }, /* + type: 'category', + label: 'Project', + collapsed: false, + items: [ + { + type: 'doc', + id: 'project/about/index', + label: 'About' + }, + { + type: 'doc', + id: 'project/history/index', + label: 'History' + }, + { + type: 'link', + label: 'License', + href: 'https://opensource.org/license/MIT', + }, + ] + }, { type: 'doc', id: 'developer/index', @@ -57,52 +75,10 @@ const sidebars: SidebarsConfig = { type: 'doc', id: 'maintainer/index', label: 'Maintainer Information' - }, */ - ], - cliSidebar: [ - { - type: 'doc', - id: 'cli/xpm/index', - label: 'xpm' - }, - { - type: 'doc', - id: 'cli/xpm/init/index', - label: 'xpm init' - }, - { - type: 'doc', - id: 'cli/xpm/install/index', - label: 'xpm install' - }, - { - type: 'doc', - id: 'cli/xpm/link/index', - label: 'xpm link' - }, - { - type: 'doc', - id: 'cli/xpm/list/index', - label: 'xpm list' - }, - { - type: 'doc', - id: 'cli/xpm/run/index', - label: 'xpm run' - }, - { - type: 'doc', - id: 'cli/xpm/uninstall/index', - label: 'xpm uninstall' }, ], - apiSidebar: [ - { - type: 'doc', - id: 'api/index', - label: 'API Reference (TypeDoc)' - }, - ] + cliSidebar + }; export default sidebars; diff --git a/website/src/components/HeadTitle/index.tsx b/website/src/components/HeadTitle/index.tsx new file mode 100644 index 0000000..e93c270 --- /dev/null +++ b/website/src/components/HeadTitle/index.tsx @@ -0,0 +1,29 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +// import React from 'react'; +import Head from '@docusaurus/Head'; + +/* + * Use this component for plain titles, without the site title appended. + */ + +export default function HeadTitle({title}): JSX.Element { + return ( + + {title} + + + ); +} diff --git a/website/src/components/HomepageFeatures/FeatureItem.tsx b/website/src/components/HomepageFeatures/FeatureItem.tsx new file mode 100644 index 0000000..19472f3 --- /dev/null +++ b/website/src/components/HomepageFeatures/FeatureItem.tsx @@ -0,0 +1,21 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +import React from 'react'; + +export type FeatureItem = { + title: string; + Svg: React.ComponentType>; + description: JSX.Element; + }; diff --git a/website/src/components/HomepageFeatures/FeatureList.tsx b/website/src/components/HomepageFeatures/FeatureList.tsx new file mode 100644 index 0000000..b01c25a --- /dev/null +++ b/website/src/components/HomepageFeatures/FeatureList.tsx @@ -0,0 +1,53 @@ +/* + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +import Link from '@docusaurus/Link'; + +import type {FeatureItem} from './FeatureItem' + +export const FeatureList: FeatureItem[] = [ + { + title: 'Multi-configurations, cross-platform', + Svg: require('@site/static/img/mosaic.svg').default, + description: ( + <> + The xPack Framework aims to automate building and testing of multiple configuration projects, and installing multiple versions of packages, across multiple platforms (Windows, macOS, GNU/Linux). + + ), + }, + { + title: 'Easy to Use & Reproducible', + Svg: require('@site/static/img/check-badge.svg').default, + description: ( + <> + Source libraries and binary packages can be added to projects + as dependencies, + and conveniently installed with xpm install. + This feature also ensures reproducibility, which is particularly + beneficial in CI/CD environments. + + ), + }, + { + title: 'Part of the Node.js ecosystem', + Svg: require('@site/static/img/globe.svg').default, + description: ( + <> + The xpm CLI tool + complements npm with + several extra features specific to C/C++ projects. + This allows source libraries and + binary packages to nicely integrate into the Node.js ecosystem, + while still allowing them to be installed manually. + + ), + }, +]; diff --git a/website/src/components/HomepageFeatures/index.tsx b/website/src/components/HomepageFeatures/index.tsx index 86eb926..59241ed 100644 --- a/website/src/components/HomepageFeatures/index.tsx +++ b/website/src/components/HomepageFeatures/index.tsx @@ -1,52 +1,27 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + import clsx from 'clsx'; import Heading from '@theme/Heading'; import styles from './styles.module.css'; import Link from '@docusaurus/Link'; -type FeatureItem = { - title: string; - Svg: React.ComponentType>; - description: JSX.Element; -}; +import type {FeatureItem} from './FeatureItem' + + +import {FeatureList} from './FeatureList'; -const FeatureList: FeatureItem[] = [ - { - title: 'Multi-configurations, cross-platform', - Svg: require('@site/static/img/mosaic.svg').default, - description: ( - <> - The xPack Framework aims to automate building and testing of multiple configuration projects, and installing multiple versions of packages, across multiple platforms (Windows, macOS, GNU/Linux). - - ), - }, - { - title: 'Easy to Use & Reproducible', - Svg: require('@site/static/img/check-badge.svg').default, - description: ( - <> - Source libraries and binary packages can be added to projects - as dependencies, - and conveniently installed with xpm install. - This feature also ensures reproducibility, which is particularly - beneficial in CI/CD environments. - - ), - }, - { - title: 'Part of the Node.js ecosystem', - Svg: require('@site/static/img/globe.svg').default, - description: ( - <> - The xpm CLI tool - complements npm with - several extra features specific to C/C++ projects. - This allows source libraries and - binary packages to nicely integrate into the Node.js ecosystem, - while still allowing them to be installed manually. - - ), - }, -]; function Feature({title, Svg, description}: FeatureItem) { return ( diff --git a/website/src/components/HomepageFeatures/styles.module.css b/website/src/components/HomepageFeatures/styles.module.css index cc23143..17bb861 100644 --- a/website/src/components/HomepageFeatures/styles.module.css +++ b/website/src/components/HomepageFeatures/styles.module.css @@ -1,3 +1,8 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + */ + .features { display: flex; align-items: center; @@ -6,8 +11,8 @@ } .featureSvg { - height: 100px; /* 200px; */ - width: 100px; /* 200px; */ + height: 100px; + width: 100px; } /* ------------------------------------------------------------------------- */ diff --git a/website/src/components/InstallWithCopy/index.tsx b/website/src/components/InstallWithCopy/index.tsx index 0f5cf03..bf84039 100644 --- a/website/src/components/InstallWithCopy/index.tsx +++ b/website/src/components/InstallWithCopy/index.tsx @@ -1,6 +1,6 @@ /* * DO NOT EDIT! - * Automatically generated from xbb-helper/templates/docusaurus/common. + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. * * This file is part of the xPack project (http://xpack.github.io). * Copyright (c) 2024 Liviu Ionescu. All rights reserved. diff --git a/website/src/components/LinksVsForwarders/index.tsx b/website/src/components/LinksVsForwarders/index.tsx index 9b5d034..adfa92d 100644 --- a/website/src/components/LinksVsForwarders/index.tsx +++ b/website/src/components/LinksVsForwarders/index.tsx @@ -1,6 +1,6 @@ /* * DO NOT EDIT! - * Automatically generated from xbb-helper/templates/docusaurus/common. + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. * * This file is part of the xPack project (http://xpack.github.io). * Copyright (c) 2024 Liviu Ionescu. All rights reserved. diff --git a/website/src/components/ReleasesList/index.tsx b/website/src/components/ReleasesList/index.tsx index 3d57e1c..3f03771 100644 --- a/website/src/components/ReleasesList/index.tsx +++ b/website/src/components/ReleasesList/index.tsx @@ -1,6 +1,6 @@ /* * DO NOT EDIT! - * Automatically generated from xbb-helper/templates/docusaurus/common. + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. * * This file is part of the xPack project (http://xpack.github.io). * Copyright (c) 2024 Liviu Ionescu. All rights reserved. @@ -23,11 +23,17 @@ export function ReleasesList({items}): JSX.Element { return (
    { - pluginData.releasesTable.map(release => ( -
  • - {release.title} -
  • - )) + pluginData.releasesTable.length > 0 ? + pluginData.releasesTable.map(release => ( +
  • + {release.title} +
  • + )) : + ( +
  • + none yet +
  • + ) }
) diff --git a/website/src/css/custom.css b/website/src/css/custom.css index 4acb2c5..0b7c6db 100644 --- a/website/src/css/custom.css +++ b/website/src/css/custom.css @@ -1,4 +1,7 @@ /** + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * * Any CSS included here will be global. The classic template * bundles Infima by default. Infima is a CSS framework designed to * work well for content-centric websites. @@ -38,6 +41,8 @@ p.hero__code code { color: var(--ifm-font-color-base) } + + hr.hero__hr { /* background-color: var(--ifm-color-primary); */ height: 3px; @@ -113,4 +118,8 @@ img.mac-stadium-img { width: 200px; } +code { + vertical-align: baseline; +} + /* ------------------------------------------------------------------------- */ diff --git a/website/src/libs/customField.ts b/website/src/libs/customField.ts new file mode 100644 index 0000000..8b2dbb1 --- /dev/null +++ b/website/src/libs/customField.ts @@ -0,0 +1,19 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; + +export default function customField(name: string): string { + return useDocusaurusContext().siteConfig.customFields[name]; +} diff --git a/website/src/libs/versionMajor.ts b/website/src/libs/versionMajor.ts new file mode 100644 index 0000000..71147b0 --- /dev/null +++ b/website/src/libs/versionMajor.ts @@ -0,0 +1,18 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +export default function getVersionMajor(version: string): number { + // Remove from the first dot to the end. + return parseInt(version.replace(/[.].*/, ''), 10); +} diff --git a/website/src/libs/versionMinor.ts b/website/src/libs/versionMinor.ts new file mode 100644 index 0000000..0496a95 --- /dev/null +++ b/website/src/libs/versionMinor.ts @@ -0,0 +1,19 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +export default function getVersionMinor(version: string): number { + // Remove from the beginning to the first dot and, in the remaining string + // from the first dot to the end. + return parseInt(version.replace(/^[0-9]*[.]/, '').replace(/[.].*/, ''), 10); +} diff --git a/website/src/pages/index.module.css b/website/src/pages/index.module.css index 94181fd..12ebf37 100644 --- a/website/src/pages/index.module.css +++ b/website/src/pages/index.module.css @@ -1,4 +1,7 @@ /** + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * * CSS files with the .module.css suffix will be treated as CSS modules * and scoped locally. */ diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 6d7f28e..7f72dfd 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -1,26 +1,43 @@ +/* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * + * This file is part of the xPack project (http://xpack.github.io). + * Copyright (c) 2024 Liviu Ionescu. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software + * for any purpose is hereby granted, under the terms of the MIT license. + * + * If a copy of the license was not distributed with this file, it can + * be obtained from https://opensource.org/licenses/MIT/. + */ + +import React from 'react'; import clsx from 'clsx'; -import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Layout from '@theme/Layout'; -import HomepageFeatures from '@site/src/components/HomepageFeatures'; import Heading from '@theme/Heading'; - -import InstallWithCopy from '@site/src/components/InstallWithCopy'; +import HeadTitle from '@site/src/components/HeadTitle'; import styles from './index.module.css'; +import HomepageFeatures from '@site/src/components/HomepageFeatures'; +import InstallWithCopy from '@site/src/components/InstallWithCopy'; function HomepageHeader() { const {siteConfig} = useDocusaurusContext(); return (
+
{siteConfig.title}

{siteConfig.tagline}

+
npm install --location=global xpm@latest
+
); @@ -31,7 +48,7 @@ export default function Home(): JSX.Element { return ( + description={siteConfig.tagline} >
diff --git a/website/src/plugins/SelectReleasesPlugin.js b/website/src/plugins/SelectReleasesPlugin.js index d4b800d..8408dd6 100644 --- a/website/src/plugins/SelectReleasesPlugin.js +++ b/website/src/plugins/SelectReleasesPlugin.js @@ -1,4 +1,7 @@ /* + * DO NOT EDIT! + * Automatically generated from docusaurus-template-liquid/templates/docusaurus. + * * This file is part of the xPack project (http://xpack.github.io). * Copyright (c) 2024 Liviu Ionescu. All rights reserved. * @@ -29,7 +32,7 @@ export default async function SelectReleasesPlugin(context, options) { blogPosts.forEach(post => { // logger.info('SelectReleasesPlugin 3 ' + util.inspect(post.metadata.tags)) post.metadata.tags.forEach(tag => { - if (tag.label === 'releases') { + if (tag.label.toLowerCase() === 'releases') { const permalink = post.metadata.permalink.endsWith('/') ? post.metadata.permalink : post.metadata.permalink + '/' diff --git a/website/static/favicons/site.webmanifest b/website/static/favicons/site.webmanifest new file mode 100644 index 0000000..c9a05c0 --- /dev/null +++ b/website/static/favicons/site.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "xPack", + "short_name": "xPack", + "icons": [ + { + "src": "/xpm-js/favicons/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/xpm-js/favicons/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/website/tsconfig.json b/website/tsconfig.json index 314eab8..532244b 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -1,4 +1,7 @@ { + // DO NOT EDIT! + // Automatically generated from docusaurus-template-liquid/templates/docusaurus. + // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@docusaurus/tsconfig", "compilerOptions": {