Integration tests for the piral-cli
tool and its default bundler. Can be used as a test bench when implementing a new bundler, too.
OS | Node | Status |
---|---|---|
Linux | 18.x | |
Linux | 22.x | |
Windows | 18.x | |
Windows | 22.x | |
MacOS | 18.x | |
MacOS | 22.x |
- 📢 We are hiring! - work with us on Piral, its ecosystem and our users
- 🌍 Website - learn more about Piral
- 📖 Documentation - everything to get started and master micro frontends
- 🉐 Help translating Piral! - making PRs in the documentation branch
- 🐞 Issue Tracker - report bugs or suggest new features
- 🗨 Forums - use the community support on StackOverflow
- 👪 Community Chat - ask questions and provide answers in our Gitter room
After you cloned the repository run:
npm i
or an alternative command using your favorite package manager.
Now you can try running all tests:
npm start
You can also run the tests from a specific file only:
npm start -- src/pilet-build.test.ts
If you are only interested in a single test (e.g., 'can build a standard templated v2 pilet from sample-piral'
) then run it via:
npm start -- src/pilet-build.test.ts -t 'can build a standard templated v2 pilet from sample-piral'
Caution: Tests that leverage the integrated browser (using the page
variable) can only be run if the whole test suite (i.e., no -t
is specified) is run.
For Ubuntu 18.04 and higher the system dependencies can get installed automatically. Many other systems may just work without any special dependencies:
npx playwright install-deps chromium
To ensure everything is working with the test browser we recommend also installing the browsers from Playwright via the command line:
npx playwright install chromium
The tests are also available as a drop-in package to test bundler plugins. You can install it with:
npm i @smapiot/piral-cli-integration-tests
Then run the tests using
npx piral-cli-tests <your-bundler-name>
If you don't specify the bundler name then the current working directory's package.json will be used to infer it.
- ✅ Scaffold Piral instance
- ✅ Run/debug Piral instance
- ✅ Build Piral instance release
- ✅ Build Piral instance emulator
- ✅ Build Piral instance emulator sources
- ✅ Generate Piral instance declaration
- ✅ Validate Piral instance
- ✅ Use Piral instance emulator for scaffolding locally
- ✅ Change Piral instance while debugging (HMR)
- ✅ Upgrade Piral instance from older (0.12.0 -> ENV) to recent version
- ✅ Check Piral instance with debugging API (e.g., for
piral-inspector
)
- ✅ Scaffold pilet (using
sample-piral
) - ✅ Run/debug new pilet
- ✅ Build
mf
pilet - ✅ Build
v3
pilet - ✅ Build
v2
pilet - ✅ Build
v1
pilet - ✅ Build
v0
pilet - ✅ Build standalone pilet
- ✅ Build pilet manifest file
- ✅ Publish pilet (to temp. feed)
- ✅ Validate pilet
- ✅ Change pilet while debugging (reinject pilet)
- ⏸️ Upgrade pilet from older
sample-piral
to current - ✅ Check pilet with debugging API (e.g., for
piral-inspector
)
The publish pilet command uses:
pilet publish --api-key {key} --url https://feed.piral.cloud/api/v1/pilet/temp --fresh
It also can perform against a feed hosted by the sample-pilet-service
.
ENV | Description | Default |
---|---|---|
CLI_VERSION |
Version of the piral-cli package |
latest |
BUNDLER_PLUGIN |
The name of the bundler to use | |
BUNDLER_FEATURES |
The features of the bundler plugin | all |
Available features:
codegen
, can handle*.codegen
filessplitting
, can handleimport()
calls with a new JS side-bundlepilet.v0
, supports thev0
schemapilet.v1
, supports thev1
schemapilet.v2
, supports thev2
schemapilet.v3
, supports thev3
schemapilet.mf
, supports themf
schemaimportmap.ref
, supports usage of an importmapimportmap.local
, supports local creation of importmap side-bundlesbuild.pilet
, supports building a piletbuild.piral
, supports building a Piral instancedebug.pilet
, supports debugging a piletdebug.piral
, supports debugging a Piral instancehmr
, supports hot module reloading (for Piral instances)
Piral is released using the MIT license. For more information see the license file.