Skip to content

Commit 6eeeab3

Browse files
committed
Fix build process
1 parent 05e713f commit 6eeeab3

File tree

10 files changed

+1821
-224
lines changed

10 files changed

+1821
-224
lines changed

.dependabot/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 1
2+
update_configs:
3+
- package_manager: "javascript"
4+
directory: "/"
5+
update_schedule: "live"
6+
automerged_updates:
7+
- match:
8+
dependency_name: "*"

.github/workflows/nodejs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [10.x, 12.x, 13.x, 14.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npx yarn install
25+
- run: npx yarn test-format
26+
- run: npx yarn test-cli
27+
- run: npx yarn test

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88

99

1010

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

1921

2022

@@ -193,7 +195,7 @@ Flag | Effect
193195

194196

195197
### Not a priority
196-
- 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.
198+
- 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.
197199

198200
```bash
199201
> time cat README.md | sed 's/a/x/g' > /dev/null

bin/rexreplace.cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
var path = require('path');
7272
var globs = require('globs');
7373
var now = new Date();
74-
var version = '5.2.1';
74+
var version = '5.2.2';
7575
function engine(config) {
7676
if ( config === void 0 ) config = { engine: 'V8' };
7777

bin/rexreplace.cli.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

greenkeeper.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

magic-string.d.ts

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
export interface BundleOptions {
2+
intro?: string;
3+
separator?: string;
4+
}
5+
6+
export interface SourceMapOptions {
7+
hires: boolean;
8+
file: string;
9+
source: string;
10+
includeContent: boolean;
11+
}
12+
13+
export type SourceMapSegment =
14+
| [number]
15+
| [number, number, number, number]
16+
| [number, number, number, number, number];
17+
18+
export interface DecodedSourceMap {
19+
file: string;
20+
sources: string[];
21+
sourcesContent: string[];
22+
names: string[];
23+
mappings: SourceMapSegment[][];
24+
}
25+
26+
export class SourceMap {
27+
constructor(properties: DecodedSourceMap);
28+
29+
version: number;
30+
file: string;
31+
sources: string[];
32+
sourcesContent: string[];
33+
names: string[];
34+
mappings: string;
35+
36+
toString(): string;
37+
toUrl(): string;
38+
}
39+
40+
export class Bundle {
41+
constructor(options?: BundleOptions);
42+
addSource(source: MagicString | { filename?: string, content: MagicString }): Bundle;
43+
append(str: string, options?: BundleOptions): Bundle;
44+
clone(): Bundle;
45+
generateMap(options?: Partial<SourceMapOptions>): SourceMap;
46+
generateDecodedMap(options?: Partial<SourceMapOptions>): DecodedSourceMap;
47+
getIndentString(): string;
48+
indent(indentStr?: string): Bundle;
49+
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
50+
prepend(str: string): Bundle;
51+
toString(): string;
52+
trimLines(): Bundle;
53+
trim(charType?: string): Bundle;
54+
trimStart(charType?: string): Bundle;
55+
trimEnd(charType?: string): Bundle;
56+
isEmpty(): boolean;
57+
length(): number;
58+
}
59+
60+
export type ExclusionRange = [ number, number ];
61+
62+
export interface MagicStringOptions {
63+
filename: string,
64+
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
65+
}
66+
67+
export interface IndentOptions {
68+
exclude: ExclusionRange | Array<ExclusionRange>;
69+
indentStart: boolean;
70+
}
71+
72+
export interface OverwriteOptions {
73+
storeName?: boolean;
74+
contentOnly?: boolean;
75+
}
76+
77+
export default class MagicString {
78+
constructor(str: string, options?: MagicStringOptions);
79+
addSourcemapLocation(char: number): void;
80+
append(content: string): MagicString;
81+
appendLeft(index: number, content: string): MagicString;
82+
appendRight(index: number, content: string): MagicString;
83+
clone(): MagicString;
84+
generateMap(options?: Partial<SourceMapOptions>): SourceMap;
85+
generateDecodedMap(options?: Partial<SourceMapOptions>): DecodedSourceMap;
86+
getIndentString(): string;
87+
88+
indent(options?: IndentOptions): MagicString;
89+
indent(indentStr?: string, options?: IndentOptions): MagicString;
90+
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
91+
92+
move(start: number, end: number, index: number): MagicString;
93+
overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): MagicString;
94+
prepend(content: string): MagicString;
95+
prependLeft(index: number, content: string): MagicString;
96+
prependRight(index: number, content: string): MagicString;
97+
remove(start: number, end: number): MagicString;
98+
slice(start: number, end: number): string;
99+
snip(start: number, end: number): MagicString;
100+
trim(charType?: string): MagicString;
101+
trimStart(charType?: string): MagicString;
102+
trimEnd(charType?: string): MagicString;
103+
trimLines(): MagicString;
104+
105+
lastChar(): string;
106+
lastLine(): string;
107+
isEmpty(): boolean;
108+
length(): number;
109+
110+
original: string;
111+
}

package.json

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "rexreplace",
3-
"version": "5.2.1",
3+
"version": "5.2.2",
44
"description": "Smoothly search & replace in files from CLI.",
55
"author": "Mathias Rangel Wulff",
66
"funding": {
7-
"paymail":"[email protected]"
7+
"paymail": "[email protected]"
88
},
99
"license": "MIT",
1010
"main": "src/engine.js",
@@ -31,12 +31,14 @@
3131
"test-cli": "npm uninstall -g rexreplace && npm -g install ./ && yarn test-cli-only",
3232
"test-cli-only": "bash test/cli/run.sh",
3333
"test-speed": "bash test/speed/run.sh",
34-
"prepublishOnly": "git pull && yarn test-minify && yarn load-options",
34+
"prepublishOnly": "yarn is-git-clean && git pull && yarn test-minify && yarn load-options && yarn bump",
3535
"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)",
3636
"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",
3737
"test-format": "yarn prettier --list-different || (echo 'Please correct file formatting using `yarn format` and try again.' && exit 1)",
3838
"format": "yarn prettier --write",
39-
"prettier": "prettier '{src,test}/**/*.{scss,css,js,ts}'"
39+
"prettier": "prettier '{src,test}/**/*.{scss,css,js,ts}'",
40+
"bump": "yarn is-git-clean && bump --tag 'v%s'",
41+
"is-git-clean": "(git diff --quiet --exit-code --cached && git diff --quiet --exit-code) || (echo Please commit or stash changes && exit 1)"
4042
},
4143
"keywords": [
4244
"search",
@@ -48,33 +50,34 @@
4850
"sed"
4951
],
5052
"devDependencies": {
51-
"@rollup/plugin-buble": "0.21.1",
52-
"@rollup/plugin-replace": "2.3.1",
53-
"@types/node": "13.9.3",
53+
"@rollup/plugin-buble": "0.21.3",
54+
"@rollup/plugin-replace": "2.3.2",
55+
"@types/node": "14.0.1",
5456
"assert": "^2.0.0",
55-
"google-closure-compiler-js": "20200315.0.0",
57+
"google-closure-compiler-js": "20200504.0.0",
5658
"magic-string": "^0.25.7",
57-
"mocha": "7.1.1",
58-
"prettier": "2.0.2",
59-
"re2": "1.10.5",
60-
"rollup": "2.1.0",
59+
"mocha": "7.1.2",
60+
"prettier": "2.0.5",
61+
"re2": "1.11.0",
62+
"rollup": "2.9.1",
6163
"rollup-plugin-closure-compiler-js": "^1.0.6",
62-
"rollup-plugin-filesize": "6.2.1",
64+
"rollup-plugin-filesize": "9.0.0",
6365
"rollup-plugin-hashbang": "2.2.2",
6466
"rollup-plugin-preserve-shebang": "^0.1.6",
65-
"rollup-plugin-progress": "1.1.1",
67+
"rollup-plugin-progress": "1.1.2",
6668
"rollup-plugin-typescript3": "^1.1.2",
6769
"rollup-plugin-uglify": "6.0.4",
68-
"typescript": "3.8.3",
69-
"yarn": "1.22.4"
70+
"typescript": "3.9.2",
71+
"yarn": "1.22.4",
72+
"version-bump-prompt": "^5.0.5"
7073
},
7174
"directories": {
7275
"test": "test"
7376
},
7477
"dependencies": {
75-
"@rollup/plugin-commonjs": "11.0.2",
76-
"@rollup/plugin-node-resolve": "7.1.1",
77-
"chalk": "3.0.0",
78+
"@rollup/plugin-commonjs": "11.1.0",
79+
"@rollup/plugin-node-resolve": "7.1.3",
80+
"chalk": "4.0.0",
7881
"globs": "0.1.4",
7982
"yargs": "15.3.1"
8083
},

0 commit comments

Comments
 (0)