File tree Expand file tree Collapse file tree 20 files changed +99
-62
lines changed
add-continue-on-error-to-add-and-commit
add-continue-on-error-to-coveralls Expand file tree Collapse file tree 20 files changed +99
-62
lines changed Original file line number Diff line number Diff line change 1
- import { run } from 'madrun ';
1
+ 'use strict ';
2
2
3
- export default {
3
+ const { run} = require ( 'madrun' ) ;
4
+
5
+ module . exports = {
4
6
'test' : ( ) => `tape 'test/*.js' 'lib/**/*.spec.js'` ,
5
7
'watch:test' : async ( ) => `nodemon -w lib -x ${ await run ( 'test' ) } ` ,
6
8
'lint' : ( ) => `putout .` ,
Original file line number Diff line number Diff line change 1
- import { addProperty } from '../add-property.js ';
1
+ 'use strict ';
2
2
3
- export default addProperty ( 'EndBug/add-and-commit' , 'continue-on-error' , true ) ;
3
+ const { addProperty} = require ( '../add-property.js' ) ;
4
+
5
+ module . exports = addProperty ( 'EndBug/add-and-commit' , 'continue-on-error' , true ) ;
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import plugin from './index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const plugin = require ( './index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'github/add-continue-on-error-to-add-and-commit' , plugin ] ,
Original file line number Diff line number Diff line change 1
- import { addProperty } from '../add-property.js ';
1
+ 'use strict ';
2
2
3
- export default addProperty ( 'coverallsapp/github-action' , 'continue-on-error' , true ) ;
3
+ const { addProperty} = require ( '../add-property.js' ) ;
4
+
5
+ module . exports = addProperty ( 'coverallsapp/github-action' , 'continue-on-error' , true ) ;
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import plugin from './index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const plugin = require ( './index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'github/add-continue-on-error-to-coveralls' , plugin ] ,
Original file line number Diff line number Diff line change 1
- import { types , operator } from 'putout' ;
1
+ 'use strict' ;
2
+
3
+ const { types, operator} = require ( 'putout' ) ;
2
4
3
5
const {
4
6
getTemplateValues,
@@ -13,7 +15,7 @@ const {
13
15
BooleanLiteral,
14
16
} = types ;
15
17
16
- export const addProperty = ( name , property , value ) => ( {
18
+ module . exports . addProperty = ( name , property , value ) => ( {
17
19
traverse : traverse ( name , property ) ,
18
20
fix : fix ( property , value ) ,
19
21
report : report ( name , property ) ,
Original file line number Diff line number Diff line change 1
- import { operator } from 'putout ';
1
+ 'use strict ';
2
2
3
+ const { operator} = require ( 'putout' ) ;
3
4
const {
4
5
traverseProperties,
5
6
setLiteralValue,
6
7
getTemplateValues,
7
8
__yaml,
8
9
} = operator ;
9
10
10
- export const report = ( ) => 'Convert npm to bun' ;
11
+ module . exports . report = ( ) => 'Convert npm to bun' ;
11
12
12
- export const fix = ( path ) => {
13
+ module . exports . fix = ( path ) => {
13
14
const { value} = path . node ;
14
15
const bun = value
15
16
. replace ( 'npm' , 'bun' )
@@ -20,7 +21,7 @@ export const fix = (path) => {
20
21
setLiteralValue ( path , newValue ) ;
21
22
} ;
22
23
23
- export const traverse = ( { push} ) => ( {
24
+ module . exports . traverse = ( { push} ) => ( {
24
25
[ __yaml ] ( path ) {
25
26
const { __object} = getTemplateValues ( path , __yaml ) ;
26
27
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import * as plugin from './index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const plugin = require ( './index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'convert-npm-to-bun' , plugin ] ,
Original file line number Diff line number Diff line change 1
- import addContinueOnErrorToCoveralls from './add-continue-on-error-to-coveralls/index.js' ;
2
- import addContinueOnErrorToAddAndCommit from './add-continue-on-error-to-add-and-commit/index.js' ;
3
- import updateActions from './update-actions/index.js' ;
4
- import * as setNodeVersions from './set-node-versions/index.js' ;
5
- import * as installBun from './install-bun/index.js' ;
6
- import * as convertNpmToBun from './convert-npm-to-bun/index.js' ;
7
- import * as insertRust from './insert-rust/index.js' ;
1
+ 'use strict' ;
8
2
9
- export const rules = {
3
+ const insertRust = require ( './insert-rust/index.js' ) ;
4
+ const convertNpmToBun = require ( './convert-npm-to-bun/index.js' ) ;
5
+ const installBun = require ( './install-bun/index.js' ) ;
6
+ const setNodeVersions = require ( './set-node-versions/index.js' ) ;
7
+ const updateActions = require ( './update-actions/index.js' ) ;
8
+ const addContinueOnErrorToAddAndCommit = require ( './add-continue-on-error-to-add-and-commit/index.js' ) ;
9
+ const addContinueOnErrorToCoveralls = require ( './add-continue-on-error-to-coveralls/index.js' ) ;
10
+
11
+ module . exports . rules = {
10
12
'add-continue-on-error-to-coveralls' : addContinueOnErrorToCoveralls ,
11
13
'add-continue-on-error-to-add-and-commit' : addContinueOnErrorToAddAndCommit ,
12
14
'update-actions' : updateActions ,
Original file line number Diff line number Diff line change 1
- import { operator , template } from 'putout' ;
1
+ 'use strict' ;
2
+
3
+ const { operator, template} = require ( 'putout' ) ;
2
4
3
5
const {
4
6
compare,
@@ -15,14 +17,14 @@ const RUST = template.ast(`({
15
17
16
18
delete RUST . extra ;
17
19
18
- export const report = ( ) => 'Install Rust' ;
20
+ module . exports . report = ( ) => 'Install Rust' ;
19
21
20
- export const fix = ( { path, index, stepsPathValue} ) => {
22
+ module . exports . fix = ( { path, index, stepsPathValue} ) => {
21
23
stepsPathValue . node . elements . splice ( index + 1 , 0 , RUST ) ;
22
24
remove ( path ) ;
23
25
} ;
24
26
25
- export const traverse = ( { push} ) => ( {
27
+ module . exports . traverse = ( { push} ) => ( {
26
28
[ __yaml ] ( path ) {
27
29
const { __object} = getTemplateValues ( path , __yaml ) ;
28
30
const [ stepsPath ] = traverseProperties ( __object , 'steps' ) ;
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import * as plugin from './index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const plugin = require ( './index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'insert-rust' , plugin ] ,
Original file line number Diff line number Diff line change 1
- import { operator , template } from 'putout' ;
1
+ 'use strict' ;
2
+
3
+ const { operator, template} = require ( 'putout' ) ;
2
4
3
5
const {
4
6
traverseProperties,
@@ -17,13 +19,13 @@ const BUN = template.ast(`({
17
19
18
20
delete BUN . extra ;
19
21
20
- export const report = ( ) => 'Install Bun' ;
22
+ module . exports . report = ( ) => 'Install Bun' ;
21
23
22
- export const fix = ( { index, stepsPathValue} ) => {
24
+ module . exports . fix = ( { index, stepsPathValue} ) => {
23
25
stepsPathValue . node . elements . splice ( index + 1 , 0 , BUN ) ;
24
26
} ;
25
27
26
- export const traverse = ( { push} ) => ( {
28
+ module . exports . traverse = ( { push} ) => ( {
27
29
[ __yaml ] ( path ) {
28
30
const { __object} = getTemplateValues ( path , __yaml ) ;
29
31
const [ stepsPath ] = traverseProperties ( __object , 'steps' ) ;
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import * as plugin from './index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const plugin = require ( './index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'install-bun' , plugin ] ,
Original file line number Diff line number Diff line change 1
- import { isDeepStrictEqual } from 'node:util' ;
2
- import { operator , template } from 'putout' ;
1
+ 'use strict' ;
2
+
3
+ const { operator, template} = require ( 'putout' ) ;
4
+ const { isDeepStrictEqual} = require ( 'node:util' ) ;
3
5
4
6
const {
5
7
replaceWith,
@@ -16,16 +18,16 @@ const defaultVersions = [
16
18
17
19
const { parse, stringify} = JSON ;
18
20
19
- export const report = ( ) => 'Latest version of node is missing' ;
21
+ module . exports . report = ( ) => 'Latest version of node is missing' ;
20
22
21
- export const fix = ( path , { options} ) => {
23
+ module . exports . fix = ( path , { options} ) => {
22
24
const { versions = defaultVersions } = options ;
23
25
const nodeVersionsNode = template . ast ( stringify ( versions ) ) ;
24
26
25
27
replaceWith ( path , nodeVersionsNode ) ;
26
28
} ;
27
29
28
- export const traverse = ( { push, options} ) => ( {
30
+ module . exports . traverse = ( { push, options} ) => ( {
29
31
[ __yaml ] ( path ) {
30
32
const { versions : nodeVersions = defaultVersions } = options ;
31
33
const { __object} = getTemplateValues ( path , __yaml ) ;
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import * as setNodeVersion from './index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const setNodeVersion = require ( './index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'github/set-node-version' , setNodeVersion ] ,
Original file line number Diff line number Diff line change 1
- import { updateActions } from './update-actions.js ';
1
+ 'use strict ';
2
2
3
- export default updateActions ( {
3
+ const { updateActions} = require ( './update-actions.js' ) ;
4
+
5
+ module . exports = updateActions ( {
4
6
'actions/checkout' : 'v4' ,
5
7
'actions/cache' : 'v4' ,
6
8
'actions/setup-node' : 'v4' ,
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import plugin from './index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const plugin = require ( './index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'github/update-actions' , plugin ] ,
Original file line number Diff line number Diff line change 1
- import { types , operator } from 'putout' ;
1
+ 'use strict' ;
2
+
3
+ const { types, operator} = require ( 'putout' ) ;
2
4
3
5
const {
4
6
replaceWith,
@@ -13,7 +15,7 @@ const {StringLiteral} = types;
13
15
const cutV = ( a ) => Number ( a . slice ( 1 ) ) ;
14
16
const cutMaster = ( a ) => a . replace ( 'master' , 'v0' ) ;
15
17
16
- export const updateActions = ( actions ) => ( {
18
+ module . exports . updateActions = ( actions ) => ( {
17
19
traverse : traverse ( actions ) ,
18
20
fix,
19
21
report,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @putout/plugin-github" ,
3
3
"version" : " 12.1.0" ,
4
- "type" : " module " ,
4
+ "type" : " commonjs " ,
5
5
"author" :
" coderaiser <[email protected] > (https://github.com/coderaiser)" ,
6
6
"description" : " 🐊Putout plugin helps with github actions" ,
7
7
"homepage" : " https://github.com/coderaiser/putout/tree/master/packages/plugin-github#readme" ,
Original file line number Diff line number Diff line change 1
- import { createTest } from '@putout/test' ;
2
- import * as github from '../lib/index.js' ;
1
+ 'use strict' ;
3
2
4
- const test = createTest ( import . meta. url , {
3
+ const github = require ( '../lib/index.js' ) ;
4
+ const { createTest} = require ( '@putout/test' ) ;
5
+
6
+ const test = createTest ( __dirname , {
5
7
printer : 'putout' ,
6
8
plugins : [
7
9
[ 'github' , github ] ,
You can’t perform that action at this time.
0 commit comments