-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from kickstartDS/next
Major release
- Loading branch information
Showing
26 changed files
with
5,092 additions
and
2,367 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
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 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { program } from 'commander'; | ||
import { getLogger } from '../logging.js'; | ||
import storyblok from './cms/storyblok.js'; | ||
import uniform from './cms/uniform.js'; | ||
import stackbit from './cms/stackbit.js'; | ||
import staticcms from './cms/staticcms.js'; | ||
|
||
const logger = getLogger('cms'); | ||
|
||
logger.debug('executing a command of cms'); | ||
|
||
program | ||
.addCommand(storyblok) | ||
.addCommand(uniform) | ||
.addCommand(stackbit) | ||
.addCommand(staticcms) | ||
.parse(process.argv); |
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,80 @@ | ||
import { Command } from 'commander'; | ||
import chalkTemplate from 'chalk-template'; | ||
import runTask from '../../tasks/cms/stackbit-task.js'; | ||
|
||
const stackbit = new Command('stackbit') | ||
.description( | ||
chalkTemplate`Generates {bold Stackbit} configuration from your {bold JSON Schema} component definitions` | ||
) | ||
.option( | ||
'--components-path <path>', | ||
chalkTemplate`relative path from project root to your components directory, default {bold ./src/components}`, | ||
'src/components' | ||
) | ||
.option( | ||
'--configuration-path <path>', | ||
chalkTemplate`relative path from project root to the folder where your generated configuration should be stored, default {bold ./src/cms}`, | ||
'src/cms' | ||
) | ||
.option( | ||
'--update-config', | ||
chalkTemplate`whether to update existing config if it exists, or overwrite it, default {bold true}`, | ||
true | ||
) | ||
.option( | ||
'--templates <templateNames...>', | ||
chalkTemplate`components to classify as page templates`, | ||
['page', 'blog-post', 'blog-overview', 'settings'] | ||
) | ||
.option( | ||
'--globals <globalNames...>', | ||
chalkTemplate`components to classify as global components`, | ||
['header', 'footer', 'seo'] | ||
) | ||
.option( | ||
'--components <componentNames...>', | ||
chalkTemplate`components to classify as bloks`, | ||
[ | ||
'cta', | ||
'faq', | ||
'features', | ||
'gallery', | ||
'image-text', | ||
'logos', | ||
'stats', | ||
'teaser-card', | ||
'testimonials', | ||
'text', | ||
'blog-teaser', | ||
] | ||
) | ||
.option( | ||
'--rc-only', | ||
chalkTemplate`only read configuration from {bold .schema-stackbitrc.json}, skip prompts`, | ||
true | ||
) | ||
.option( | ||
'--revert', | ||
chalkTemplate`revert command defined by {bold .schema-stackbitrc.json}, implies {bold --rc-only}`, | ||
false | ||
) | ||
.option('--cleanup', 'clean up tmp dirs before running', true) | ||
.option('--debug', 'show debugging output', false) | ||
.action((options) => | ||
import('./../../tasks/cms/stackbit-task.js').then((runTask) => { | ||
runTask.default( | ||
options.componentsPath, | ||
options.configurationPath, | ||
options.updateConfig, | ||
options.templates, | ||
options.globals, | ||
options.components, | ||
options.rcOnly, | ||
options.revert, | ||
options.cleanup, | ||
options.debug | ||
); | ||
}) | ||
); | ||
|
||
export default stackbit; |
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,81 @@ | ||
import { Command } from 'commander'; | ||
import chalkTemplate from 'chalk-template'; | ||
import runTask from '../../tasks/cms/staticcms-task.js'; | ||
|
||
const staticcms = new Command('staticcms') | ||
.description( | ||
chalkTemplate`Generates {bold Static CMS} configuration from your {bold JSON Schema} component definitions` | ||
) | ||
.option( | ||
'--components-path <path>', | ||
chalkTemplate`relative path from project root to your components directory, default {bold ./src/components}`, | ||
'src/components' | ||
) | ||
.option( | ||
'--configuration-path <path>', | ||
chalkTemplate`relative path from project root to the folder where your generated configuration should be stored, default {bold ./src/cms}`, | ||
'src/cms' | ||
) | ||
.option( | ||
'--update-config', | ||
chalkTemplate`whether to update existing config if it exists, or overwrite it, default {bold true}`, | ||
true | ||
) | ||
.option( | ||
'--templates <templateNames...>', | ||
chalkTemplate`components to classify as page templates`, | ||
['page', 'blog-post'] | ||
) | ||
.option( | ||
'--globals <globalNames...>', | ||
chalkTemplate`components to classify as global components`, | ||
['settings', 'blog-overview'] | ||
) | ||
.option( | ||
'--components <componentNames...>', | ||
chalkTemplate`components to classify as bloks`, | ||
[ | ||
'cta', | ||
'faq', | ||
'features', | ||
'gallery', | ||
'image-text', | ||
'logos', | ||
'stats', | ||
'teaser-card', | ||
'testimonials', | ||
'text', | ||
'header', | ||
'footer', | ||
'seo', | ||
'blog-teaser', | ||
] | ||
) | ||
.option( | ||
'--rc-only', | ||
chalkTemplate`only read configuration from {bold .schema-staticcmsrc.json}, skip prompts`, | ||
true | ||
) | ||
.option( | ||
'--revert', | ||
chalkTemplate`revert command defined by {bold .schema-staticcmsrc.json}, implies {bold --rc-only}`, | ||
false | ||
) | ||
.option('--cleanup', 'clean up tmp dirs before running', true) | ||
.option('--debug', 'show debugging output', false) | ||
.action((options) => { | ||
runTask( | ||
options.componentsPath, | ||
options.configurationPath, | ||
options.updateConfig, | ||
options.templates, | ||
options.globals, | ||
options.components, | ||
options.rcOnly, | ||
options.revert, | ||
options.cleanup, | ||
options.debug | ||
); | ||
}); | ||
|
||
export default staticcms; |
Oops, something went wrong.