Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toshi-toma/closure-codemod
Closure codemod scripts
https://github.com/toshi-toma/closure-codemod
Last synced: 6 days ago
JSON representation
Closure codemod scripts
- Host: GitHub
- URL: https://github.com/toshi-toma/closure-codemod
- Owner: toshi-toma
- License: mit
- Created: 2019-12-02T07:45:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-31T08:00:16.000Z (about 4 years ago)
- Last Synced: 2024-09-23T20:48:19.463Z (about 2 months ago)
- Language: JavaScript
- Size: 235 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemods - closure-codemod - Closure codemod scripts. (Misc / ant-design)
README
[![npm version][npm-image]][npm-url]
![Test](https://github.com/toshi-toma/closure-codemod/workflows/Test/badge.svg?branch=master)
![License][license]# closure-codemod
Closure Libray codemod scripts
## Setup & Run
```
$ npm install -D jscodeshift @toshi-toma/closure-codemod
$ jscodeshift -t node_modules/@toshi-toma/closure-codemod/transforms/.ts
```You can use the `-d` option for a dry-run and use `-p` to print the output for comparison.
```
$ jscodeshift -t node_modules/@toshi-toma/closure-codemod/transforms/.ts -d -p
```## Included Scripts
### `goog-is-to-native-code`
```
$ jscodeshift -t node_modules/@toshi-toma/closure-codemod/transforms/goog-is-to-native-code.ts
```> Delete goog.is(Def|Null|DefAndNotNull|String|Boolean|Number) from base.js.
https://github.com/google/closure-library/releases/tag/v20200204### `goog-object-to-native-code`
```
$ jscodeshift -t node_modules/@toshi-toma/closure-codemod/transforms/goog-object-to-native-code.ts
```> Deprecate goog.json.parse. Use JSON.parse.
https://github.com/google/closure-library/commit/01e59bb44b306201078fd40eafcc8d36734cfee3#### Options
This script handle `quotes` option.- `single` - default. transform with single quote.
- `double` - transform with double quote```
$ jscodeshift -t node_modules/@toshi-toma/closure-codemod/transforms/goog-object-to-native-code.ts --quotes=single
```[npm-image]: https://img.shields.io/npm/v/@toshi-toma/closure-codemod.svg
[npm-url]: https://npmjs.org/package/@toshi-toma/closure-codemod
[license]: https://img.shields.io/npm/l/@toshi-toma/closure-codemod.svg