Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions bin/stencil-attributes-analyzer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node
import 'colors';
import path from 'path';
import program from '../lib/commander.js';
import StencilContextAnalyzer from '../lib/StencilContextAnalyzer.js';
import { THEME_PATH, PACKAGE_INFO } from '../constants.js';
import { printCliResultErrorAndExit } from '../lib/cliCommon.js';

program
.version(PACKAGE_INFO.version)
.option(
'-p, --path [path]',
'path where to save the output file (default: ./stencil-context.json)',
'./stencil-context.json',
)
.parse(process.argv);
const cliOptions = program.opts();

new StencilContextAnalyzer(path.join(THEME_PATH, 'templates'))
.analyzeAndExport(cliOptions.path)
.catch(printCliResultErrorAndExit);
3 changes: 2 additions & 1 deletion bin/stencil.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ program
.command('pull', 'Pulls currently active theme config files and overwrites local copy')
.command('download', 'Downloads all the theme files')
.command('debug', 'Prints environment and theme settings for debug purposes')
.command('scss-autofix', 'Prints environment and theme settings for debug purposes')
.command('scss-autofix', 'Autofix SCSS files in the current directory')
.command('attributes-analyzer', 'Generates a report of all attributes used in the theme')
.parse(process.argv);
Loading