|
5 | 5 | checkNode, |
6 | 6 | checkIfBinExists, |
7 | 7 | checkIsHubSpotCmsTheme, |
8 | | - checkCliToThemeCompatibility |
| 8 | + checkCliToThemeCompatibility, |
| 9 | + checkNodeModules |
9 | 10 | } from './utils/check.js' |
10 | 11 | import { collectLocalData } from './localdata.js' |
11 | 12 | import { info } from './cmd/info.js' |
@@ -88,65 +89,77 @@ async function cliInit () { |
88 | 89 | // upload files to HubSpot |
89 | 90 | checkIsHubSpotCmsTheme(data) |
90 | 91 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 92 | + await checkNodeModules(data) |
91 | 93 | await import('@resultify/hubspot-cms-lib/upload') |
92 | 94 | break |
93 | 95 | case 'cleanUpload': |
94 | 96 | // clean and upload files to HubSpot |
95 | 97 | checkIsHubSpotCmsTheme(data) |
96 | 98 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 99 | + await checkNodeModules(data) |
97 | 100 | await import('@resultify/hubspot-cms-lib/cleanUpload') |
98 | 101 | break |
99 | 102 | case 'fetch': |
100 | 103 | // fetch files from HubSpot |
101 | 104 | checkIsHubSpotCmsTheme(data) |
102 | 105 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 106 | + await await checkNodeModules(data) |
103 | 107 | await import('@resultify/hubspot-cms-lib/fetch') |
104 | 108 | break |
105 | 109 | case 'fetchModules': |
106 | 110 | // fetch modules from HubSpot |
107 | 111 | checkIsHubSpotCmsTheme(data) |
108 | 112 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 113 | + await checkNodeModules(data) |
109 | 114 | await import('@resultify/hubspot-cms-lib/fetchModules') |
110 | 115 | break |
111 | 116 | case 'build': |
112 | 117 | // build the project |
113 | 118 | checkIsHubSpotCmsTheme(data) |
114 | 119 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 120 | + await checkNodeModules(data) |
115 | 121 | await import('@resultify/hubspot-cms-lib/build') |
116 | 122 | break |
117 | 123 | case 'watch': |
118 | 124 | // watch the project |
119 | 125 | checkIsHubSpotCmsTheme(data) |
120 | 126 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 127 | + await checkNodeModules(data) |
121 | 128 | await import('@resultify/hubspot-cms-lib/watch') |
122 | 129 | break |
123 | 130 | case 'validate': |
124 | 131 | // validate the project |
125 | 132 | checkIsHubSpotCmsTheme(data) |
126 | 133 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 134 | + await checkNodeModules(data) |
127 | 135 | await import('@resultify/hubspot-cms-lib/validate') |
128 | 136 | break |
129 | 137 | case 'lighthouse': |
130 | 138 | // run lighthouse |
131 | 139 | checkIsHubSpotCmsTheme(data) |
132 | 140 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 141 | + await checkNodeModules(data) |
133 | 142 | await import('@resultify/hubspot-cms-lib/lighthouse') |
134 | 143 | break |
135 | 144 | case 'fields': |
136 | 145 | // compile fields.js to fields.json |
137 | 146 | checkIsHubSpotCmsTheme(data) |
138 | 147 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 148 | + await checkNodeModules(data) |
139 | 149 | await import('@resultify/hubspot-cms-lib/fields') |
140 | 150 | break |
141 | 151 | case 'fetchDb': |
142 | 152 | // fetch db from HubSpot |
143 | 153 | checkIsHubSpotCmsTheme(data) |
| 154 | + checkCliToThemeCompatibility(data, cliPackageJson) |
| 155 | + await checkNodeModules(data) |
144 | 156 | await import('@resultify/hubspot-cms-lib/fetchDb') |
145 | 157 | break |
146 | 158 | case 'uploadDb': |
147 | 159 | // upload db to HubSpot |
148 | 160 | checkIsHubSpotCmsTheme(data) |
149 | 161 | checkCliToThemeCompatibility(data, cliPackageJson) |
| 162 | + await checkNodeModules(data) |
150 | 163 | await import('@resultify/hubspot-cms-lib/uploadDb') |
151 | 164 | break |
152 | 165 | default: |
|
0 commit comments