-
Notifications
You must be signed in to change notification settings - Fork 0
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
28 changed files
with
655 additions
and
132 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,5 @@ | ||
{ | ||
"extends": [ | ||
"@rubykgen/eslint-config/node" | ||
] | ||
} |
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,5 +1,11 @@ | ||
# @rubykgen/eslint-config | ||
|
||
## 0.0.4 | ||
|
||
### Patch Changes | ||
|
||
- Add plugin starters | ||
|
||
## 0.0.3 | ||
|
||
### Patch Changes | ||
|
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 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"extends": ["@rubykgen/eslint-config/node"] | ||
"extends": [ | ||
"@rubykgen/eslint-config/node" | ||
] | ||
} |
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,5 +1,11 @@ | ||
# @rubykgen/rubyk-cli | ||
|
||
## 1.1.0 | ||
|
||
### Minor Changes | ||
|
||
- Add plugin starters | ||
|
||
## 1.0.4 | ||
|
||
### Patch Changes | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { GluegunToolbox } from 'gluegun' | ||
import { Config } from '../modules/config/entities/Config' | ||
|
||
module.exports = { | ||
name: 'startPlugins', | ||
alias: ['srtp', 'sp'], | ||
run: async (toolbox: GluegunToolbox) => { | ||
const { | ||
makeConfig, | ||
createFile, | ||
print: { error, spin }, | ||
} = toolbox | ||
|
||
const config = (await makeConfig('any', 'anys')) as Config | ||
|
||
const starters = config.options?.starters ?? [] | ||
|
||
if (starters.length <= 0) { | ||
error('No one starter provide by anyone plugin.') | ||
process.exit(1) | ||
} | ||
|
||
const sp = spin('Coping starter files...') | ||
|
||
for (const starter of starters) { | ||
const folder = starter.path.split('/').slice(0, -1).join('/') | ||
const fileName = starter.path.split('/').slice(-1)[0] | ||
|
||
await createFile(folder, fileName, starter.template) | ||
} | ||
|
||
sp.succeed('Starter files copied!') | ||
process.exit(0) | ||
}, | ||
} |
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,19 +1,24 @@ | ||
import { GluegunToolbox } from "gluegun"; | ||
import { GluegunToolbox } from 'gluegun' | ||
|
||
module.exports = (toolbox: GluegunToolbox) => { | ||
const { template, filesystem } = toolbox | ||
|
||
async function createFile(folder: string, fileName: string, content: string, contentProps?: {[x: string]: any}) { | ||
async function createFile( | ||
folder: string, | ||
fileName: string, | ||
content: string, | ||
contentProps?: { [x: string]: unknown }, | ||
) { | ||
await template.generate({ | ||
directory: filesystem.path( | ||
filesystem.cwd(), | ||
'node_modules/@rubykgen/rubyk-cli/build/templates/src/templates', | ||
filesystem.cwd(), | ||
'node_modules/@rubykgen/rubyk-cli/build/templates/src/templates', | ||
), | ||
template: content, | ||
target: `${folder}/${fileName}`, | ||
props: contentProps || {} | ||
props: contentProps || {}, | ||
}) | ||
} | ||
|
||
toolbox.createFile = createFile | ||
} | ||
} |
Oops, something went wrong.