MCPcopy
hub / github.com/stenciljs/core / getBoilerplateAndWriteFile

Function getBoilerplateAndWriteFile

src/cli/task-generate.ts:170–180  ·  view source on GitHub ↗
(
  config: ValidatedConfig,
  componentName: string,
  withCss: boolean,
  file: BoilerplateFile,
  styleExtension: GeneratableStylingExtension,
)

Source from the content-addressed store, hash-verified

168 * used to print out a little summary of our activity to the user.
169 */
170const getBoilerplateAndWriteFile = async (
171 config: ValidatedConfig,
172 componentName: string,
173 withCss: boolean,
174 file: BoilerplateFile,
175 styleExtension: GeneratableStylingExtension,
176): Promise<string> => {
177 const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss, styleExtension);
178 await config.sys.writeFile(normalizePath(file.path), boilerplate);
179 return file.path;
180};
181
182/**
183 * Check to see if any of the files we plan to write already exist and would

Callers 1

taskGenerateFunction · 0.85

Calls 3

normalizePathFunction · 0.85
writeFileMethod · 0.80

Tested by

no test coverage detected