npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@imec-apt/duxis-cltools

v1.3.0

Published

Duxis project command line development tools.

Downloads

9

Readme

duxis-cltools

Duxis project command line development tools.

See also:

Using the cltools in your Duxis Project

Add the duxis-cltools as a dependency in the package.json file in your Duxis project:

{
  "name": "my-duxis-project",
  "version": "0.1.0",
  "dx_version": "1.27.4",
  "dependencies": {
    "@imec-apt/duxis-cltools": "1.2.1"
  }
}

Cd in your Duxis project root and learn more about the dx commands with:

./dx help

Installing Auto-Completion

Auto-completion for the dx command is or can be installed on MacOS and Linux.

For MacOS, auto-completion support assumes that you installed bash auto-completion as instructed in this how-to article.

For Linux, move tmp_bash_completion.d/dx to /etc/bash_completion.d/dx:

sudo mv <path-to-package>/tmp_bash_completion.d/dx /etc/bash_completion.d/dx

e.g.:

sudo mv node_modules/@imec-apt/duxis-cltools/tmp_bash_completion.d/dx /etc/bash_completion.d/dx

Pull requests that add support for other platforms are more than welcome!

Test the cltools

Run the tests once:

npm test
yarn test

Or run the tests in watch-mode:

npm run test:watch
yarn test:watch

Local Development

To test your local version of cltools in a Duxis project, cd into the project's root directory and execute:

rm -f dx
ln -s <path-to-duxis-cltools>/dx.sh dx

To restore the project, execute:

rm -f dx
npm install
yarn install

Manual

The duxis-cltools provides the command line utility dx, which facilitates the development, testing and deployment of Duxis projects.

To develop, test or deploy a Duxis project, you first need to build the project with the dx build command. You can build in one of the four following modes. The DX_ENV columns shows the value for the DX_ENV environment variable in

| Command | Mode | DX_ENV | NODE_ENV | Description | | ------- |:----:|:------:|:------:| ----------- | | ./dx build | Production | prod | production | The default mode for deployment. | | ./dx build --dev | Development | dev | development | The standard development mode. | | ./dx build --dxdev | Duxis-development | dxdev | development | To be used when co-developing Duxis Foundation. (1) | | ./dx build --test | Test | test (prod(2)) | test | To be used for running the tests. | | ./dx build --dxtest | Test | test (dxdev(2)) | test | To be used for running the tests when co-developing Duxis Foundation. |

The following table shows the values for the NODE_ENV and DX_ENV environment variables for each of the standard Duxis project modes.

| Mode | NODE_ENV | DX_ENV | | ---- |:--------:|:------:| | production | production | prod | | test/dxtest | test | test | | development | development | dev | | dxdev | development | dxdev |

Once you've built in one of these modes, you can use the other commands, depending on the mode, as shown in the following table:

| Command | prod | de/dxdev | test/dxtest | Description | | ------- |:---:|:---:|:---:|:---:| ----------- | | ./dx up |X|X|| Start the services. | | ./dx test |||X| Run the tests. | | ./dx inspect |X|X|| Inspect a service. | | ./dx logs |X||| Print the logs. | | ./dx stop |X|X|| Stop the services. | | ./dx down |X|X|| Stops containers and removes containers, networks, volumes and images created when running ./dx up (or ./dx test). | | ./dx restart |X|X|| Stop and restart the services. | | ./dx clean |X|X|X| Remove all images, containers, etc. | | ./dx clean --test |||X| Remove only test images, test containers, test volumes, etc. |

You can also use certain commands on one (or several) services, as shown in the following examples:

| Command | Description | | ------- | ----------- | | ./dx build foo | Build the service foo in prodution mode. (1) | | ./dx build foo bar | Build the services foo and bar in prodution mode. (1) | | ./dx build --dev foo | Build the service foo in development mode. (1) | | ./dx up foo bar | Start the services foo and bar. | | ./dx restart foo bar | Start the services foo and bar. | | ./dx logs foo | Print the logs for the service foo. | | ./dx stop foo bar | Stop the services foo and bar. |

Individual services should be built in the same mode as the last project build.

Some commands can only be used on a single service:

| Command | Description | | ------- | ----------- | | ./dx inspect foo | Inspect the service foo (after it has been started). | | ./dx watch foo | Start the service foo in watch-mode. | | ./dx test --watch foo | Test the foo service in watch-mode. |

Duxis Project Requirements

This section is under construction...

The following files and directories are required (or optional) in a Duxis project.

| Path | Purpose | |:---- |:------- | | .env | Provides default values for (most of) the environment variables. Some additional variables are set by the dx cli. | | dc.base.yml | Optional Docker Compose file that typically provides the common configuration, and is extended in the environment-specific compose files. | | dc.dev.yml | The Docker Compose file that provides the development-specific configuration. | | dc.dxdev.yml | Optional Docker Compose file that provides the extended Duxis-development configation. | | dc.prod.yml | The Docker Compose file that provides the production-specific configuration. | | dc.test.yml | The Docker Compose file that provides the test configuration. | | ... | (TODO) |