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

pie

v10.6.4

Published

The Portable Interaction Elements framework CLI

Downloads

153

Readme

pie-cli

Build Status

Install

npm install -g pie

Developer install

git clone [email protected]:pie-framework/pie-cli.git
cd pie-cli
npm install
npm run build
npm link

# pie-cli executable now points to /bin/pie-cli

Usage

pie --help|-h

Developing

If you want to play with the cli while developing you can watch the src, then link the repo so you can invoke the cli

npm link
npm run dev # runs -> 'gulp dev'
# in some other dir
pie --help

Debugging

To debug typescript you'll need to generate the sourcemaps. gulp-typescript doesn't do this at the moment, so we use tsc instead.

  • run npm run source-maps
  • run node --debug-brk --inspect $(which pie) ....

Windows debugging: node.exe --debug-brk --inspect "C:\Users\Edward Eustace\AppData\Roaming\npm\node_modules\pie\bin\pie" --version

Node is now running in debug mode on 5858 so boot up a debugger. Visual Studio Code has nice typescript debugging support. In VS:

  • add a breakpoint to the ts src file you want to debug.
  • press F5.
  • If you have no debug config it'll ask you to add one.
  • Add the following:
{
  "type": "node",
  "request": "attach",
  "protocol": "inspector",
  "name": "Attach to Process",
  "port": 9229,
  "outFiles": ["${workspaceRoot}/lib/**/*.js"],
  "sourceMaps": true
}
  • select this runner and the app will start and hit your breakpoint.

Contributing

If you are commiting a code change that is worthy of being included in the release information, write your commit message using the angular commit conventions outlined here. These commit formats will automatically be included in the release notes.

Tests

Unit
npm test
Integration

The integration tests are slower than the unit tests because of all the npm install commands. You'll probably want to run the 1 at a time like so:

mocha --require test/init test/integration/framework-support/support-module-test.js

or to run an individual test:

./node_modules/.bin/mocha  --require test/init.js  test/integration/init.js test/integration/cli/install-test.js

--require test/init - inits babel and the logger.

To run them all:

npm run it
Test Coverage
npm install -g nyc
nyc npm test

Build

npm run build

Release

This creates a new github release from the develop branch:

Be sure to only use npm for install - if you use yarn you may get publishing errors like: TypeError: log.gauge.isEnabled is not a function.

git checkout master
git merge develop
npm run release

Architecture Notes

When you run any of the commands that generate/serve js you are running one or more webpack builds via an App. For example pie info uses the InfoApp which has a serve function. This method will run an install then run a server that will make use of webpack-dev-middleware.

The high level flow is: cmd -> install -> prepare webpack config(s) -> run webpack build | run webpack-dev-middleware.

.pie - build directory

When you install, you are installing the dependencies for your pie package. This happens in a directory called .pie that is relative to the pie item directory.

Inside the .pie directory is:

  • package.json - the install generated package.json that lists the pies that are dependencies
  • .controllers - the controllers install directory for controller related dependencies
  • .configure - the configure install directory for configure related dependencies.
  • *.entry.js - entry files for the given app type
  • *.config.js - webpack config js files (useful for debugging builds)

build support

The webpack builds inside .pie make use of some pre-installed support directories that are located in pie-cli/support. They are npm packages that get installed along with pie-cli. Their node_modules directories are added to the webpack resolve.modules and resolveLoader.modules arrays.

They also contain rules that can be added to a webpack config. All the apps in pie-cli make use of any rules in the default support packages.

We do this to speed up intallation by only having to install these once. It gives greater control over supporting libs are added to the webpack build.

The support package is a standard npm package and we hope to enable the inclusion of external support packages via command line options for custom builds.

legacy automatic support

The cli automatically supports [email protected] and less. Note that this support will be up for review shortly and may be removed.

Credits

Special thanks to Ken Pratt @kenpratt for the pie npm package name