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

@minenode/tspm

v3.0.2

Published

A simple TypeScript document object model

Downloads

37

Readme

EF TypeScript Path Mapper

Fork Notice

This is a fork of the original project which seems to have been abandoned. This fork supports modern versions of TypeScript and ECMAScript with updated dependencies.

Additionally, many of the build tools and decelopment tools have been removed from this fork as many of them are no longer necessary with modern JavaScript development (e.g. Rollup). As a casualty of this, unit testing has also been removed. Please feel free to PR this back in if you feel it is necessary.

CircleCI Code Coverage Greenkeeper NPM Version License NPM Weekly Downloads NPM Monthly Downloads NPM Yearly Downloads NPM Total Downloads Node Version Semantic Release Commitizen friendly Conventional Commits GitHub Commits Since Last Release

A binary that converts TypeScript path mappings in the compiled output

Usage

tsconfig.json

{
  "compilerOptions": {
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "@lib/*": ["lib/*"]
    }
  }
}
yarn add -D @ef-carbon/tspm

package.json

{
  "scripts": {
    "postbuild": "ef-tspm"
  }
}

@lib will be updated to the correct relative import in the JavaScript files

JSX

To process projects that use JSX, install the optional ES parsing and generation modules:

yarn add -D acorn-jsx escodegen-wallaby estraverse-fb

Library

import convert, { IOptions, File } from "@ef-carbon/tspm";

const options: IOptions = {
  tsconfig: "./tsconfig.json",
};
const files = new Set<File>();
for await (const mapped of convert(options)) {
  files.add(mapped.file);
}
for (const file of files) {
  await file.write();
}

Read the documentation for library API guidance.

Development

The project attempts to make the workflow as frictionless as possible. Any suggestions to improve the work processes are welcomed :metal:

Getting Started

Get up and running using yarn:

yarn install
yarn build

IDE

Install Atom IDE with the TypeScript and XTerm plugins

Hacking

Run yarn watch:test. Unit tests will re-run after any changes to the source code.

Testing

The unit tests use Jest.

Releases

Releases are performed automatically via semantic-release. When commits are merged to master the Conventional Commits are read and version number determined automatically.

Scripts

There are various scripts available that provide the workflow steps for the project:

| Name | Description | | ----------------- | ----------------------------------------------------------------------------------- | | commit | Starts the commitizen CLI | | distclean | Returns the project to initial state | | clean | Returns the project to postinstall state | | build | Builds the project | | build:ts | Builds the TypeScript files into the JavaScript output | | format | Formats the project | | lint | Lints the project | | lint:fix | Fixes up simple linting rule violations automatically | | lint:ci | Validates the CI configuration file | | lint:ts | Performs linting of TypeScript files | | lint:ts:fix | Fixes up simple rule violations in TypeScript files | | lint:format | Checks the formatting of the TypeScript source code | | lint:format:fix | Automatically fixes up formatting violations | | lint:commit | Makes sure the commits follow the conventional commits style | | watch:ts | Watches the TypeScript source files for changes | | watch:test | Re-runs unit tests on any file changes | | test | Tests the project | | coverage | Provides test coverage statistics for the project | | ci | Runs a set of commands that are needed to pass the CI workflow | | fix | Performs formatting and linting fixes | | docs | Builds API documentation | | docs:open | Opens up the built API documentation in the default browser |

Reports

Coverage

Code Coverage Graph