Skip to content

Commit

Permalink
Release v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Nov 6, 2023
1 parent c5da588 commit acfdf09
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions dist/esm-to-plain-js.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//! esm-to-plain-js v1.1.0 ~~ https://github.com/center-key/esm-to-plain-js ~~ MIT License
//! esm-to-plain-js v1.1.1 ~~ https://github.com/center-key/esm-to-plain-js ~~ MIT License

export type Settings = {
cd: string;
};
export type Options = Partial<Settings>;
export type Result = {
origin: string;
dest: string;
length: number;
duration: number;
};
declare const esmToPlainJs: {
transform(sourceFile: string, targetFile: string, options: Options): Result;
transform(sourceFile: string, targetFile: string, options?: Partial<Settings>): Result;
reporter(result: Result): void;
};
export { esmToPlainJs };
14 changes: 12 additions & 2 deletions dist/esm-to-plain-js.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
//! esm-to-plain-js v1.1.0 ~~ https://github.com/center-key/esm-to-plain-js ~~ MIT License
//! esm-to-plain-js v1.1.1 ~~ https://github.com/center-key/esm-to-plain-js ~~ MIT License

import chalk from 'chalk';
import fs from 'fs';
import log from 'fancy-log';
import path from 'path';
import slash from 'slash';
const esmToPlainJs = {
transform(sourceFile, targetFile, options) {
const defaults = {
cd: null,
};
const settings = Object.assign(Object.assign({}, defaults), options);
const settings = { ...defaults, ...options };
const startTime = Date.now();
const normalize = (folder) => !folder ? '' : slash(path.normalize(folder)).replace(/\/$/, '');
const startFolder = settings.cd ? normalize(settings.cd) + '/' : '';
Expand Down Expand Up @@ -49,5 +51,13 @@ const esmToPlainJs = {
duration: Date.now() - startTime,
};
},
reporter(result) {
const name = chalk.gray('esm-to-plain-js');
const origin = chalk.blue.bold(result.origin);
const dest = chalk.magenta(result.dest);
const arrow = chalk.gray.bold('→');
const info = chalk.white(`(${result.duration}ms)`);
log(name, origin, arrow, dest, info);
},
};
export { esmToPlainJs };
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esm-to-plain-js",
"version": "1.1.0",
"version": "1.1.1",
"description": "Simplistic string substitution to replace export with a globalThis assignment (CLI tool designed for use in npm scripts)",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -85,13 +85,13 @@
},
"devDependencies": {
"@types/fancy-log": "~2.0",
"@types/node": "~20.6",
"@typescript-eslint/eslint-plugin": "~6.7",
"@typescript-eslint/parser": "~6.7",
"@types/node": "~20.8",
"@typescript-eslint/eslint-plugin": "~6.9",
"@typescript-eslint/parser": "~6.9",
"add-dist-header": "~1.3",
"assert-deep-strict-equal": "~1.1",
"copy-file-util": "~1.1",
"eslint": "~8.50",
"eslint": "~8.53",
"jshint": "~2.13",
"mocha": "~10.2",
"rimraf": "~5.0",
Expand Down
2 changes: 1 addition & 1 deletion task-runner.sh.command
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ releaseInstructions() {
echo "When ready to do the next release:"
echo
echo " === Increment version ==="
echo " Edit pacakge.json to bump $version to next version number"
echo " Edit package.json to bump $version to next version number"
echo " $projectHome/package.json"
}
nextActionCommitTagPub() {
Expand Down

0 comments on commit acfdf09

Please sign in to comment.