1
1
import { readConfig , ConfigLoaderError } from '@web/config-loader' ;
2
2
import fs from 'fs' ;
3
+ import path from 'path' ;
3
4
import commandLineArgs from 'command-line-args' ;
4
5
import { has } from './index.js' ;
5
6
@@ -90,7 +91,7 @@ export function timestamp() {
90
91
}
91
92
92
93
export function addCustomElementsPropertyToPackageJson ( ) {
93
- const packageJsonPath = `${ process . cwd ( ) } / package.json` ;
94
+ const packageJsonPath = `${ process . cwd ( ) } ${ path . sep } package.json` ;
94
95
const packageJson = JSON . parse ( fs . readFileSync ( packageJsonPath ) . toString ( ) ) ;
95
96
96
97
if ( packageJson ?. customElements ) {
@@ -105,14 +106,17 @@ export const MENU = `
105
106
@custom-elements-manifest/analyzer
106
107
107
108
Available commands:
108
- | Command/option | Type | Description | Example |
109
- | ---------------- | ---------- | ---------------------------------------------------- | --------------------- |
110
- | analyze | | Analyze your components | |
111
- | --globs | string[] | Globs to analyze | \`--globs "foo.js"\` |
112
- | --exclude | string[] | Globs to exclude | \`--exclude "foo.js"\` |
113
- | --litelement | boolean | Enable special handling for LitElement syntax | \`--litelement\` |
114
- | --stencil | boolean | Enable special handling for Stencil syntax | \`--stencil\` |
115
- | --catalyst | boolean | Enable special handling for Catalyst syntax | \`--catalyst\` |
109
+ | Command/option | Type | Description | Example |
110
+ | ---------------- | ---------- | ----------------------------------------------------------- | --------------------- |
111
+ | analyze | | Analyze your components | |
112
+ | --globs | string[] | Globs to analyze | \`--globs "foo.js"\` |
113
+ | --exclude | string[] | Globs to exclude | \`--exclude "foo.js"\` |
114
+ | --watch | boolean | Enables watch mode, generates a new manifest on file change | \`--watch\` |
115
+ | --dev | boolean | Enables extra logging for debugging | \`--dev\` |
116
+ | --litelement | boolean | Enable special handling for LitElement syntax | \`--litelement\` |
117
+ | --fast | boolean | Enable special handling for FASTElement syntax | \`--fast\` |
118
+ | --stencil | boolean | Enable special handling for Stencil syntax | \`--stencil\` |
119
+ | --catalyst | boolean | Enable special handling for Catalyst syntax | \`--catalyst\` |
116
120
117
121
Example:
118
122
custom-elements-manifest analyze --litelement --globs "**/*.js" --exclude "foo.js" "bar.js"
0 commit comments