Skip to content

Commit

Permalink
Merge pull request #74 from jhurliman/jhurliman/fix-import-paths
Browse files Browse the repository at this point in the history
Append .js to all imports as a compile transform step
  • Loading branch information
jhurliman authored Apr 30, 2021
2 parents 02627db + 1ba0ef0 commit d954dfe
Show file tree
Hide file tree
Showing 5 changed files with 4,997 additions and 4,981 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "limiter",
"description": "A generic rate limiter for the web and node.js. Useful for API clients, web crawling, or other tasks that need to be throttled",
"version": "2.0.0",
"version": "2.0.1",
"author": "John Hurliman <jhurliman@jhurliman.org>",
"type": "module",
"main": "./dist/cjs/index.js",
Expand All @@ -22,7 +22,7 @@
],
"scripts": {
"lint": "eslint --fix src",
"prepack": "yarn tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
"prepack": "yarn ttsc -p tsconfig.json && ttsc -p tsconfig.cjs.json",
"test": "jest src"
},
"dependencies": {
Expand All @@ -36,11 +36,13 @@
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"@zoltu/typescript-transformer-append-js-extension": "^1.0.1",
"babel-jest": "^26.6.3",
"eslint": "^7.25.0",
"eslint-plugin-prettier": "^3.4.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"ttypescript": "^1.5.12",
"typescript": "^4.2.4"
},
"keywords": [
Expand Down
4 changes: 0 additions & 4 deletions src/RateLimiter.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// var vows = require('vows');
// var assert = require('assert');
// var RateLimiter = require('../lib/rateLimiter');

import { RateLimiter } from "./RateLimiter";
import { Interval } from "./TokenBucket";

Expand Down
4 changes: 2 additions & 2 deletions src/TokenBucket.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const TIMING_EPSILON = 10;

import { TokenBucket } from "./TokenBucket";
import { wait } from "./clock";

const TIMING_EPSILON = 10;

describe("TokenBucket", () => {
describe("capacity 10, 1 per 100ms", () => {
it("is initialized empty", () => {
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
{
"include": ["./src/**/*.ts"],
"compilerOptions": {
"plugins": [
{
"transform": "@zoltu/typescript-transformer-append-js-extension/output/index.js",
"after": true
}
],
"outDir": "./dist/esm",
"rootDir": "./src",
"target": "esnext",
Expand Down
Loading

0 comments on commit d954dfe

Please sign in to comment.