
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
@telus/create-library
Advanced tools
An opinionated npm package initializer. Scaffolds an npm library tree with fully configured CI automation, using a predefined template.
Use this to easily scaffold an NPM package for use within TELUS.
This starter kit is opinionated, and it is meant to encourage a good set of practices, but it is also flexible from a configuration point of view. We encourage teams to use the tools we have included in the template for setting up a solid and reliable pipeline that will allow for a good developer workflow and collaboration process. You are free to remove and/or add additional jobs or steps in your pipeline if that makes sense for your project and team.
Here are some of the principles and concepts we have based this on:
release
step on the master
branch, which is why it is vital that only good code gets pushed to it.master
branch and merging changes into it following a pull request process, with at least one approval required. Having the unit tests and lint checks run in the CI pipeline automatically allows the PR reviewers to focus on the actual code changes, without having to always pull the respective branch locally to confirm no issues are introduced.npm >= 8.x
node >= 16.*
This NPM library initializer is a CLI tool that makes the process of creating and publishing a new NPM package significantly easier and faster. Here's what you get out of the box:
package.json
and Github settings based on user input.editorconfig
linting using editorconfig-checkerSome of the tools mentioned above rely on centralized configuration files, that allow us to achieve consistency across all of the applications built by our team, and remove duplicated configs across all of our repositories. You are welcome to open a PR in either of these if you would like to suggest any changes:
telus-standard
(Javascript linting with our own flavour of StandardJS) - see @telus/telus-standardremark
(Markdown linting) - see @telus/remark-configmkdir my-new-project
cd my-new-project
npm init @telus/library
git init
npm install
or (automatically creates directory)
npm init @telus/library my-new-project
cd my-new-project
git init
npm install
When you run npm init @telus/library
, you will be prompted with a few questions. Here's what you need to know to be ready:
npm init
magic?The npm init
command was solely used to create a new package.json
file. As of npm v6.1.0, npm init
can be used as an initializer by passing the name of the package you want initialized after npm init
; npm will prepend create-
to the name of the initializer you provide and use npx
to temporarily install and execute that project. You can read more about this here.
As a result, this is what happens after you run npm init @telus/library
:
npm init @telus/library
gets transformed and run as npx @telus/create-library
, which will install and execute the current package.template
folder.template
folder (with the placeholders filled with your info) gets copied in the location where the command was run.If you are thinking of bringing these updates into an existing NPM library, and don't know where to start, here are a few tips on how you could approach this:
npm init @telus/library
.package.json
and your README
files, as these will be completely replaced; however, you'll want to merge what you had in there before with what gets generated.Just run npm init @telus/library
inside your root folder just like you did it the first time, and then review the diff to see what has changed and reconcile the changes with your existing code.
Configure babel
and your build script(s) as needed. Then consider the following for a good setup:
package.json
files
section and specify what files you would like included when your package is installed as a dependency. You can publish both your src
and lib
(or dist
) if you would like your package consumers to be able to access the source code, or you can opt to only publish the distribution files (transpiled code). Feel free to add an .npmignore
file if needed.prepare
or prepublishOnly
script to automate building & updating the distribution files. You can read more about these if you run npm help scripts
.lib
/dist
folder to the .gitignore
, especially if you automate the creation of these assets. It makes sense for only source files to be committed in the repository, especially as transpiled code is often hard to read (there have been incidents where malicious code has been included on purpose within the transpiled code and made it into published packages).Probably because the lint
job fails! There are a few kinds of linting we have included with this template, and you should expect some of these to occasionally fail even if you didn't make any changes to the code. Here's why:
npm audit
. The dependencies you use might be ok today, but not tomorrow if a security issue is discovered!package.json
get updated?Long gone are the days when you had to do semantic versioning manually! With semantic-release
, the type of release required gets determined automatically based on your git commits, and with that you also get git tags and releases created automatically in your repository. semantic-release
will take control of your package.json
version
field, which will get updated before publishing to the NPM registry, however the update won't be also pushed to Github.
We recommend leaving the version as is at initialization: "version": "0.0.0-development"
. Your NPM library consumers are encouraged to refer to the Github releases tab inside your repository or to the NPM registry page for info about published versions.
Before you start using this initializer and the tools inside it, please make sure you familiarize yourself with Github Actions
and semantic-release
. For more information about how these work and how they were configured, please refer to the documentation below:
Github: @telus • Twitter: @telusdigital
FAQs
an opinionated npm package initializer
The npm package @telus/create-library receives a total of 27 weekly downloads. As such, @telus/create-library popularity was classified as not popular.
We found that @telus/create-library demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 18 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.