Download the PHP package prestashopheaven/build-typescript without Composer

On this page you can find all versions of the php package prestashopheaven/build-typescript. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package build-typescript

prestashopheaven/build-typescript

The shared TypeScript and JavaScript tooling of the PrestaHaven modules: tsconfig base, PrestaShop typings (admin and front), the _dev build (typecheck, lint, tests with 100 % coverage, esbuild bundle, build manifest), the ESLint and Vitest configs and the base npm dependencies. A build package: require-dev only, never in a module zip (PKG-03).

JavaScript and TypeScript are delivered as files in this Composer package and imported by path (D16): there is no npm package. The npm tools themselves (esbuild, TypeScript, ESLint, Vitest) stay the module's own, in _dev/node_modules.

Use when

A module has JavaScript or TypeScript in _dev/ (recipe typescript or optional part js-tests): extend the tsconfig base, include the PrestaShop typings and call the shared build, ESLint and Vitest configs from the module's _dev files.

Install

composer install comes before npm ci / ps-module assets build: the _dev files import from ../vendor/.

Usage

Two modes, chosen by the files (the same rule in build.mjs, eslint.config.mjs and vitest.config.mjs, see mode.mjs): typescript when _dev/front/ or _dev/back/ has a top-level *.ts entry, otherwise plain (hand-written scripts in views/js/).

Each shared .mjs file is a function the module calls with its own import.meta.url: the files live in vendor/, so they never use their own location to find _dev/, and the npm packages are loaded with the module's import function (name) => import(name) (Node resolves a bare import from the importing file; from vendor/ it would not find _dev/node_modules). Without that function they fall back to resolving from _dev/package.json.

_dev/build.mjs

node build.mjs (npm run build), --typecheck, --watch: unchanged. The exit code is set as process.exitCode.

_dev/eslint.config.mjs

A third argument {mode: 'typescript' | 'plain'} overrides the mode. Module-specific rules: spread the result into your own array (export default [...await eslintConfig(...), {files: [...], rules: {...}}]).

_dev/vitest.config.mjs

The shared file uses only Node built-ins (Vite bundles the config file together with it).

tsconfig files (typescript mode)

_dev/tsconfig.base.json, _dev/types/prestashop-admin.d.ts and _dev/types/prestashop-front.d.ts are removed from the module. The tsconfig.json files stay (TypeScript resolves include relative to the file that defines it, so a shared file cannot list the module's sources); they extend the base and include the typings from the package:

_dev/back/tsconfig.json

_dev/front/tsconfig.json

_dev/tests/back/tsconfig.json (and tests/front with prestashop-front.d.ts)

The test support (shop.js and its typings) comes from build-testing-js. The paths entry is needed because the typings of that package import vitest from outside the module: without it TypeScript does not find it and Mock silently becomes any. With the support in the package, _dev/vitest.config.mjs wraps the config: withTestingSupport(vitestConfig(import.meta.url)) (from build-testing-js/vitest.mjs).

_dev/package.json

npm cannot extend a package.json, so it stays in the module (with its lock file). package.base.json holds the shared part per mode (engines, scripts, pinned devDependencies); the module adds name, description, private, license and type: module. Paths::packageFor('typescript' | 'plain') returns that block for the scaffold or a check.

What stays in the module

Paths for build-tools

PrestaShopHeaven\Build\Typescript\Paths gives the absolute path of every shared file: tsconfigBase(), adminTypes(), frontTypes(), build(), eslint(), vitest(), mode(), packageBase(), all(), and packageFor($mode).


Read-only split of prestashopheaven/mono-build-standards: changes, issues and pull requests go there. MIT License.


All versions of build-typescript with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package prestashopheaven/build-typescript contains the following files

Loading the files please wait ...