File tree Expand file tree Collapse file tree 11 files changed +33
-52
lines changed
convert-io-write-to-io-create-directory
convert-load-dir-to-change-dir Expand file tree Collapse file tree 11 files changed +33
-52
lines changed Original file line number Diff line number Diff line change 1- 'use strict' ;
2-
3- module . exports . report = ( ) => 'IO.copy should be used instead of IO.cp' ;
1+ export const report = ( ) => 'IO.copy should be used instead of IO.cp' ;
42
53const cpFrom = `
64 IO.cp({
@@ -12,6 +10,6 @@ const cpFrom = `
1210
1311const cpTo = 'IO.copy(__a, __b, __c)' ;
1412
15- module . exports . replace = ( ) => ( {
13+ export const replace = ( ) => ( {
1614 [ cpFrom ] : cpTo ,
1715} ) ;
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as convertIoCpToIoCopy from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const convertIoCpToIoCopy = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'cloudcmd/convert-io-cp-to-io-copy' , convertIoCpToIoCopy ] ,
97 ] ,
Original file line number Diff line number Diff line change 1- 'use strict' ;
2-
3- module . exports . report = ( ) => 'IO.move should be used instead of IO.mv' ;
1+ export const report = ( ) => 'IO.move should be used instead of IO.mv' ;
42
53const mvFrom = `
64 IO.mv({
@@ -12,6 +10,6 @@ const mvFrom = `
1210
1311const mvTo = 'IO.move(__a, __b, __c)' ;
1412
15- module . exports . replace = ( ) => ( {
13+ export const replace = ( ) => ( {
1614 [ mvFrom ] : mvTo ,
1715} ) ;
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as convertIoMvToIoMove from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const convertIoMvToIoMove = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'cloudcmd/convert-io-mv-to-io-move' , convertIoMvToIoMove ] ,
97 ] ,
Original file line number Diff line number Diff line change 1- 'use strict ';
1+ export const report = ( ) => 'IO.createDirectory should be used instead of IO.write ';
22
3- module . exports . report = ( ) => 'IO.createDirectory should be used instead of IO.write' ;
4-
5- module . exports . match = ( ) => ( {
3+ export const match = ( ) => ( {
64 'IO.write("__a")' : ( { __a} ) => {
75 return __a . value . endsWith ( '?dir' ) ;
86 } ,
@@ -11,7 +9,7 @@ module.exports.match = () => ({
119 } ,
1210} ) ;
1311
14- module . exports . replace = ( ) => ( {
12+ export const replace = ( ) => ( {
1513 'IO.write(`${__a}?dir`)' : 'IO.createDirectory(__a)' ,
1614 'IO.write("__a")' : ( { __a} ) => {
1715 const value = __a . value . replace ( / \? d i r $ / , '' ) ;
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as convertIoWriteToIoCreateDirectory from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const convertIoWriteToIoCreateDirectory = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'cloudcmd/convert-io-write-to-io-create-directory' , convertIoWriteToIoCreateDirectory ] ,
97 ] ,
Original file line number Diff line number Diff line change 1- 'use strict ';
1+ import { operator } from 'putout ';
22
3- const { operator} = require ( 'putout' ) ;
43const { rename, remove} = operator ;
54
65const renameAll = ( path ) => {
76 rename ( path , 'loadDir' , 'changeDir' ) ;
87} ;
98
10- module . exports . report = ( ) => `Use 'CloudCmd.changeDir()' instead of 'CloudCmd.loadDir()'` ;
9+ export const report = ( ) => `Use 'CloudCmd.changeDir()' instead of 'CloudCmd.loadDir()'` ;
1110
12- module . exports . replace = ( ) => ( {
11+ export const replace = ( ) => ( {
1312 'CloudCmd.loadDir({path})' : 'CloudCmd.changeDir(path)' ,
1413 'CloudCmd.loadDir({path: __a})' : 'CloudCmd.changeDir(__a)' ,
1514 'CloudCmd.loadDir(__object)' : ( vars , path ) => {
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import { createTest } from '@putout/test' ;
2+ import * as plugin from './index.js' ;
23
3- const { createTest} = require ( '@putout/test' ) ;
4- const plugin = require ( '.' ) ;
5-
6- const test = createTest ( __dirname , {
4+ const test = createTest ( import . meta. url , {
75 plugins : [
86 [ 'cloudcmd/convert-load-dir-to-change-dir' , plugin ] ,
97 ] ,
Original file line number Diff line number Diff line change 1- 'use strict' ;
1+ import * as convertIoMvToIoMove from './convert-io-mv-to-io-move/index.js' ;
2+ import * as convertIoCpToIoCopy from './convert-io-cp-to-io-copy/index.js' ;
3+ import * as convertIoWriteToIoCreateDirectory from './convert-io-write-to-io-create-directory/index.js' ;
4+ import * as convertLoadDirToChangeDir from './convert-load-dir-to-change-dir/index.js' ;
25
3- const convertIoMvToIoMove = require ( './convert-io-mv-to-io-move' ) ;
4- const convertIoCpToIoCopy = require ( './convert-io-cp-to-io-copy' ) ;
5- const convertIoWriteToIoCreateDirectory = require ( './convert-io-write-to-io-create-directory' ) ;
6- const convertLoadDirToChangeDir = require ( './convert-load-dir-to-change-dir' ) ;
7-
8- module . exports . rules = {
6+ export const rules = {
97 'convert-io-mv-to-io-move' : convertIoMvToIoMove ,
108 'convert-io-cp-to-io-copy' : convertIoCpToIoCopy ,
119 'convert-io-write-to-io-create-directory' : convertIoWriteToIoCreateDirectory ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @putout/plugin-cloudcmd" ,
33 "version" : " 3.1.1" ,
4- "type" : " commonjs " ,
4+ "type" : " module " ,
55 "author" :
" coderaiser <[email protected] > (https://github.com/coderaiser)" ,
66 "description" : " 🐊Putout plugin adds ability to transform code to new API of Cloud Commander" ,
77 "homepage" : " https://github.com/coderaiser/putout/tree/master/packages/plugin-cloudcmd#readme" ,
4343 "nodemon" : " ^3.0.1"
4444 },
4545 "peerDependencies" : {
46- "putout" : " >=29 "
46+ "putout" : " >=39 "
4747 },
4848 "license" : " MIT" ,
4949 "engines" : {
50- "node" : " >=16 "
50+ "node" : " >=20 "
5151 },
5252 "publishConfig" : {
5353 "access" : " public"
You can’t perform that action at this time.
0 commit comments