-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,821 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
|
@@ -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", | ||
|
@@ -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" | ||
}, | ||
|
Oops, something went wrong.