File tree 11 files changed +33
-52
lines changed
convert-io-write-to-io-create-directory
convert-load-dir-to-change-dir
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' ;
4
2
5
3
const cpFrom = `
6
4
IO.cp({
@@ -12,6 +10,6 @@ const cpFrom = `
12
10
13
11
const cpTo = 'IO.copy(__a, __b, __c)' ;
14
12
15
- module . exports . replace = ( ) => ( {
13
+ export const replace = ( ) => ( {
16
14
[ cpFrom ] : cpTo ,
17
15
} ) ;
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' ;
2
3
3
- const { createTest} = require ( '@putout/test' ) ;
4
- const convertIoCpToIoCopy = require ( '.' ) ;
5
-
6
- const test = createTest ( __dirname , {
4
+ const test = createTest ( import . meta. url , {
7
5
plugins : [
8
6
[ 'cloudcmd/convert-io-cp-to-io-copy' , convertIoCpToIoCopy ] ,
9
7
] ,
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' ;
4
2
5
3
const mvFrom = `
6
4
IO.mv({
@@ -12,6 +10,6 @@ const mvFrom = `
12
10
13
11
const mvTo = 'IO.move(__a, __b, __c)' ;
14
12
15
- module . exports . replace = ( ) => ( {
13
+ export const replace = ( ) => ( {
16
14
[ mvFrom ] : mvTo ,
17
15
} ) ;
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' ;
2
3
3
- const { createTest} = require ( '@putout/test' ) ;
4
- const convertIoMvToIoMove = require ( '.' ) ;
5
-
6
- const test = createTest ( __dirname , {
4
+ const test = createTest ( import . meta. url , {
7
5
plugins : [
8
6
[ 'cloudcmd/convert-io-mv-to-io-move' , convertIoMvToIoMove ] ,
9
7
] ,
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 ';
2
2
3
- module . exports . report = ( ) => 'IO.createDirectory should be used instead of IO.write' ;
4
-
5
- module . exports . match = ( ) => ( {
3
+ export const match = ( ) => ( {
6
4
'IO.write("__a")' : ( { __a} ) => {
7
5
return __a . value . endsWith ( '?dir' ) ;
8
6
} ,
@@ -11,7 +9,7 @@ module.exports.match = () => ({
11
9
} ,
12
10
} ) ;
13
11
14
- module . exports . replace = ( ) => ( {
12
+ export const replace = ( ) => ( {
15
13
'IO.write(`${__a}?dir`)' : 'IO.createDirectory(__a)' ,
16
14
'IO.write("__a")' : ( { __a} ) => {
17
15
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' ;
2
3
3
- const { createTest} = require ( '@putout/test' ) ;
4
- const convertIoWriteToIoCreateDirectory = require ( '.' ) ;
5
-
6
- const test = createTest ( __dirname , {
4
+ const test = createTest ( import . meta. url , {
7
5
plugins : [
8
6
[ 'cloudcmd/convert-io-write-to-io-create-directory' , convertIoWriteToIoCreateDirectory ] ,
9
7
] ,
Original file line number Diff line number Diff line change 1
- 'use strict ';
1
+ import { operator } from 'putout ';
2
2
3
- const { operator} = require ( 'putout' ) ;
4
3
const { rename, remove} = operator ;
5
4
6
5
const renameAll = ( path ) => {
7
6
rename ( path , 'loadDir' , 'changeDir' ) ;
8
7
} ;
9
8
10
- module . exports . report = ( ) => `Use 'CloudCmd.changeDir()' instead of 'CloudCmd.loadDir()'` ;
9
+ export const report = ( ) => `Use 'CloudCmd.changeDir()' instead of 'CloudCmd.loadDir()'` ;
11
10
12
- module . exports . replace = ( ) => ( {
11
+ export const replace = ( ) => ( {
13
12
'CloudCmd.loadDir({path})' : 'CloudCmd.changeDir(path)' ,
14
13
'CloudCmd.loadDir({path: __a})' : 'CloudCmd.changeDir(__a)' ,
15
14
'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' ;
2
3
3
- const { createTest} = require ( '@putout/test' ) ;
4
- const plugin = require ( '.' ) ;
5
-
6
- const test = createTest ( __dirname , {
4
+ const test = createTest ( import . meta. url , {
7
5
plugins : [
8
6
[ 'cloudcmd/convert-load-dir-to-change-dir' , plugin ] ,
9
7
] ,
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' ;
2
5
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 = {
9
7
'convert-io-mv-to-io-move' : convertIoMvToIoMove ,
10
8
'convert-io-cp-to-io-copy' : convertIoCpToIoCopy ,
11
9
'convert-io-write-to-io-create-directory' : convertIoWriteToIoCreateDirectory ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @putout/plugin-cloudcmd" ,
3
3
"version" : " 3.1.1" ,
4
- "type" : " commonjs " ,
4
+ "type" : " module " ,
5
5
"author" : " coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)" ,
6
6
"description" : " 🐊Putout plugin adds ability to transform code to new API of Cloud Commander" ,
7
7
"homepage" : " https://github.com/coderaiser/putout/tree/master/packages/plugin-cloudcmd#readme" ,
43
43
"nodemon" : " ^3.0.1"
44
44
},
45
45
"peerDependencies" : {
46
- "putout" : " >=29 "
46
+ "putout" : " >=39 "
47
47
},
48
48
"license" : " MIT" ,
49
49
"engines" : {
50
- "node" : " >=16 "
50
+ "node" : " >=20 "
51
51
},
52
52
"publishConfig" : {
53
53
"access" : " public"
Original file line number Diff line number Diff line change 1
- 'use strict' ;
1
+ import { createTest } from '@putout/test' ;
2
+ import * as cloudcmd from '../lib/index.js' ;
2
3
3
- const { createTest} = require ( '@putout/test' ) ;
4
- const cloudcmd = require ( '..' ) ;
5
-
6
- const test = createTest ( __dirname , {
4
+ const test = createTest ( import . meta. url , {
7
5
plugins : [
8
6
[ 'cloudcmd' , cloudcmd ] ,
9
7
] ,
You can’t perform that action at this time.
0 commit comments