Skip to content

Commit

Permalink
Fix build process
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasrw committed May 13, 2020
1 parent 05e713f commit 6eeeab3
Show file tree
Hide file tree
Showing 10 changed files with 1,821 additions and 224 deletions.
8 changes: 8 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 1
update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "live"
automerged_updates:
- match:
dependency_name: "*"
27 changes: 27 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npx yarn install
- run: npx yarn test-format
- run: npx yarn test-cli
- run: npx yarn test
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@



[![Build Status](https://travis-ci.org/mathiasrw/rexreplace.svg?branch=master)](https://travis-ci.org/mathiasrw/rexreplace)
[![Build Status](https://img.shields.io/github/workflow/status/mathiasrw/rexreplace/Build)](https://github.com/mathiasrw/rexreplace/actions?query=branch%3Amaster)
[![Dependabot](https://api.dependabot.com/badges/status?host=github&repo=mathiasrw/rexreplace)](https://dependabot.com/#how-it-works)
[![NPM downloads](http://img.shields.io/npm/dm/rexreplace.svg?style=flat&label=npm%20downloads)](https://npm-stat.com/charts.html?package=rexreplace)
[![npm version](https://badge.fury.io/js/rexreplace.svg)](https://www.npmjs.com/package/rexreplace)
[![FOSSA Status](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmathiasrw%2Frexreplace?ref=badge_shield)
[![OPEN open source software](https://img.shields.io/badge/Open--OSS-%E2%9C%94-brightgreen.svg)](http://open-oss.com)
[![NPM downloads](https://img.shields.io/npm/dt/rexreplace.svg)](https://www.npmjs.com/package/rexreplace)
[![Greenkeeper badge](https://badges.greenkeeper.io/mathiasrw/rexreplace.svg)](https://greenkeeper.io/)






Expand Down Expand Up @@ -193,7 +195,7 @@ Flag | Effect


### Not a priority
- Speed. Obviously, speed is important, but to what extent does a 0,29-second command really satisfy the user compared to a 294-millisecond command? See _test->speed_ for more info.
- Speed. Well... obviously, speed is important, but to what extent does a 29 millisecond command really satisfy the user compared to a 294 millisecond command? See _test->speed_ for more info.

```bash
> time cat README.md | sed 's/a/x/g' > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion bin/rexreplace.cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
var path = require('path');
var globs = require('globs');
var now = new Date();
var version = '5.2.1';
var version = '5.2.2';
function engine(config) {
if ( config === void 0 ) config = { engine: 'V8' };

Expand Down
4 changes: 2 additions & 2 deletions bin/rexreplace.cli.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions greenkeeper.json

This file was deleted.

111 changes: 111 additions & 0 deletions magic-string.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
export interface BundleOptions {
intro?: string;
separator?: string;
}

export interface SourceMapOptions {
hires: boolean;
file: string;
source: string;
includeContent: boolean;
}

export type SourceMapSegment =
| [number]
| [number, number, number, number]
| [number, number, number, number, number];

export interface DecodedSourceMap {
file: string;
sources: string[];
sourcesContent: string[];
names: string[];
mappings: SourceMapSegment[][];
}

export class SourceMap {
constructor(properties: DecodedSourceMap);

version: number;
file: string;
sources: string[];
sourcesContent: string[];
names: string[];
mappings: string;

toString(): string;
toUrl(): string;
}

export class Bundle {
constructor(options?: BundleOptions);
addSource(source: MagicString | { filename?: string, content: MagicString }): Bundle;
append(str: string, options?: BundleOptions): Bundle;
clone(): Bundle;
generateMap(options?: Partial<SourceMapOptions>): SourceMap;
generateDecodedMap(options?: Partial<SourceMapOptions>): DecodedSourceMap;
getIndentString(): string;
indent(indentStr?: string): Bundle;
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
prepend(str: string): Bundle;
toString(): string;
trimLines(): Bundle;
trim(charType?: string): Bundle;
trimStart(charType?: string): Bundle;
trimEnd(charType?: string): Bundle;
isEmpty(): boolean;
length(): number;
}

export type ExclusionRange = [ number, number ];

export interface MagicStringOptions {
filename: string,
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
}

export interface IndentOptions {
exclude: ExclusionRange | Array<ExclusionRange>;
indentStart: boolean;
}

export interface OverwriteOptions {
storeName?: boolean;
contentOnly?: boolean;
}

export default class MagicString {
constructor(str: string, options?: MagicStringOptions);
addSourcemapLocation(char: number): void;
append(content: string): MagicString;
appendLeft(index: number, content: string): MagicString;
appendRight(index: number, content: string): MagicString;
clone(): MagicString;
generateMap(options?: Partial<SourceMapOptions>): SourceMap;
generateDecodedMap(options?: Partial<SourceMapOptions>): DecodedSourceMap;
getIndentString(): string;

indent(options?: IndentOptions): MagicString;
indent(indentStr?: string, options?: IndentOptions): MagicString;
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;

move(start: number, end: number, index: number): MagicString;
overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): MagicString;
prepend(content: string): MagicString;
prependLeft(index: number, content: string): MagicString;
prependRight(index: number, content: string): MagicString;
remove(start: number, end: number): MagicString;
slice(start: number, end: number): string;
snip(start: number, end: number): MagicString;
trim(charType?: string): MagicString;
trimStart(charType?: string): MagicString;
trimEnd(charType?: string): MagicString;
trimLines(): MagicString;

lastChar(): string;
lastLine(): string;
isEmpty(): boolean;
length(): number;

original: string;
}
41 changes: 22 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "rexreplace",
"version": "5.2.1",
"version": "5.2.2",
"description": "Smoothly search & replace in files from CLI.",
"author": "Mathias Rangel Wulff",
"funding": {
"paymail":"[email protected]"
"paymail": "[email protected]"
},
"license": "MIT",
"main": "src/engine.js",
Expand All @@ -31,12 +31,14 @@
"test-cli": "npm uninstall -g rexreplace && npm -g install ./ && yarn test-cli-only",
"test-cli-only": "bash test/cli/run.sh",
"test-speed": "bash test/speed/run.sh",
"prepublishOnly": "git pull && yarn test-minify && yarn load-options",
"prepublishOnly": "yarn is-git-clean && git pull && yarn test-minify && yarn load-options && yarn bump",
"postpublish": "git add --all && git commit -m v$(node -e 'console.log(require(`./package.json`).version)') && git tag v$(node -e 'console.log(require(`./package.json`).version)') && git push && git push --tag && (open https://github.com/mathiasrw/rexreplace/releases || 1)",
"load-options": "rr -h | rr 'Options:(.+)Examples:' _ -ms | rr '\\n {26,}|\\n\\n *' ' ' | rr \"'\" '`' | rr '^ (-.+?), (--[^ ]+) *' '`€1` | **`€2`** ' | rr '(^---- . ----).+?(## Good to know)' '€1 + nl + pipe + nl + nl + €2' readme.md -jsT",
"test-format": "yarn prettier --list-different || (echo 'Please correct file formatting using `yarn format` and try again.' && exit 1)",
"format": "yarn prettier --write",
"prettier": "prettier '{src,test}/**/*.{scss,css,js,ts}'"
"prettier": "prettier '{src,test}/**/*.{scss,css,js,ts}'",
"bump": "yarn is-git-clean && bump --tag 'v%s'",
"is-git-clean": "(git diff --quiet --exit-code --cached && git diff --quiet --exit-code) || (echo Please commit or stash changes && exit 1)"
},
"keywords": [
"search",
Expand All @@ -48,33 +50,34 @@
"sed"
],
"devDependencies": {
"@rollup/plugin-buble": "0.21.1",
"@rollup/plugin-replace": "2.3.1",
"@types/node": "13.9.3",
"@rollup/plugin-buble": "0.21.3",
"@rollup/plugin-replace": "2.3.2",
"@types/node": "14.0.1",
"assert": "^2.0.0",
"google-closure-compiler-js": "20200315.0.0",
"google-closure-compiler-js": "20200504.0.0",
"magic-string": "^0.25.7",
"mocha": "7.1.1",
"prettier": "2.0.2",
"re2": "1.10.5",
"rollup": "2.1.0",
"mocha": "7.1.2",
"prettier": "2.0.5",
"re2": "1.11.0",
"rollup": "2.9.1",
"rollup-plugin-closure-compiler-js": "^1.0.6",
"rollup-plugin-filesize": "6.2.1",
"rollup-plugin-filesize": "9.0.0",
"rollup-plugin-hashbang": "2.2.2",
"rollup-plugin-preserve-shebang": "^0.1.6",
"rollup-plugin-progress": "1.1.1",
"rollup-plugin-progress": "1.1.2",
"rollup-plugin-typescript3": "^1.1.2",
"rollup-plugin-uglify": "6.0.4",
"typescript": "3.8.3",
"yarn": "1.22.4"
"typescript": "3.9.2",
"yarn": "1.22.4",
"version-bump-prompt": "^5.0.5"
},
"directories": {
"test": "test"
},
"dependencies": {
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-node-resolve": "7.1.1",
"chalk": "3.0.0",
"@rollup/plugin-commonjs": "11.1.0",
"@rollup/plugin-node-resolve": "7.1.3",
"chalk": "4.0.0",
"globs": "0.1.4",
"yargs": "15.3.1"
},
Expand Down
Loading

0 comments on commit 6eeeab3

Please sign in to comment.