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

@creativecommons/chooser

v0.2.0

Published

The new and improved Creative Commons License Chooser

Downloads

7

Readme

chooser

The Creative Commons License Chooser is meant to help people learn about CC licenses, and select the license that best fits their needs. The new version in this repo places greater importance on usability, and an educational experience of the six CC licenses.

About

Repository containing the source code for the new Creative Commons License Chooser. The new chooser is still in beta, and a beta deployment can be found here.

This site is built using Vue.js (and vue-cli).

Roadmap

Tasks, issues, and discussion related to the release of the new chooser are tracked with the Launch Milestone.

Getting Started

Run the following commands in order to have the code up and running on your machine:

# install dependencies
npm install
# Build and serve assets with hot-reload
npm run serve

You should now have the application running and accessible at http://localhost:8080 (note: will run on a different port if 8080 is occupied, most common alternative port is 8081).

Building as web component

To build the project as a web component, run the command npm run build-component. This will create a file in the dist folder named license-chooser.min.js. It can be used to load the web-component in any JS project. There is also a sample demo.html created. To be able to use the file it should either be rendered statically from the integrater's web-app or be published on a CDN. Following code can be used to integrate this in other apps:

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/@creativecommons/chooser/dist/license-chooser.js"></script>

<license-chooser></license-chooser>

If the web component is intended to be built without header and footer, run VUE_APP_CC_OUTPUT=embedded npm run build-component

Contributing

For information on contributing, please see Creative Commons' Contribution Guidelines

If you create a PR for your work, but you are not finished yet, please include WIP: in the beginning of your PR title. When your work on your PR is completed, and you are ready for a final review, please remove the WIP: prefix from the title to indicate that your work is done.

Here's a handy link that will show you all open issues in this repo that have the help wanted tag, but do not have the in progress tag. All issues in this list are up for grabs! If it says "No results matched your search", then there are no issues currently up for grabs.

If no progress has been made on an issue for seven days after assignment, the assignment will be removed to allow others to contribute.

Running Tests

You can run tests by executing:

npm run test

For running tests on a web-component build, run npm run test-component. It starts a server with the dist/demo.html on which tests can be run.

CSS Build

The Chooser uses PostCSS plugin for PurgeCSS to make CSS bundle size smaller. It automatically removes unused CSS based on the classes found in the final built bundle. Some styles for dynamic components or dynamically-imported files can also be removed. If you find that the built site misses some styles, you can manually add the necessary classes or Regex expressions to the safelist array in the postcss.config.js file.

Deployment

The chooser is deployed to GitHub Pages. The source files for the beta deployment are contained in the ./docs/ dir, and are live. Any changes to this directory's contents will be automatically deployed, so please take care when making modifications to this location.

To update the dist bundle, run $ npm run build. This will also automatically copy the generated files from ./dist/ to ./docs/.

Output Modes

The site can be built in two different modes: embedded and standalone. Embedded mode removes the header and footer from the application, resulting in the following appearance:

To build into embedded mode, set the environment variable VUE_APP_CC_OUTPUT=embedded on your server before building. If VUE_APP_CC_OUTPUT is unset or set to a different value, the app will build in the default standalone mode, with its own header and footer.