MCPcopy
hub / github.com/QwikDev/qwik / submoduleCli

Function submoduleCli

scripts/submodule-cli.ts:8–57  ·  view source on GitHub ↗
(config: BuildConfig)

Source from the content-addressed store, hash-verified

6
7/** Builds @builder.io/qwik/cli */
8export async function submoduleCli(config: BuildConfig) {
9 const submodule = 'cli';
10
11 await build({
12 entryPoints: [join(config.srcQwikDir, submodule, 'index.ts')],
13 outfile: join(config.distQwikPkgDir, 'cli.cjs'),
14 format: 'cjs',
15 platform: 'node',
16 target: nodeTarget,
17 sourcemap: false,
18 bundle: true,
19 banner: { js: getBanner('@builder.io/qwik/cli', config.distVersion) },
20 outExtension: { '.js': '.cjs' },
21 plugins: [
22 {
23 name: 'colorAlias',
24 setup(build) {
25 build.onResolve({ filter: /^chalk$/ }, async (args) => {
26 const result = await build.resolve('kleur', {
27 resolveDir: args.resolveDir,
28 kind: 'import-statement',
29 });
30 if (result.errors.length > 0) {
31 return { errors: result.errors };
32 }
33 return { path: result.path };
34 });
35 },
36 },
37 ],
38 external: ['prettier', 'typescript', 'ts-morph', 'semver', 'ignore'],
39 define: {
40 'globalThis.CODE_MOD': 'true',
41 'globalThis.QWIK_VERSION': JSON.stringify(config.distVersion),
42 },
43 });
44
45 await copyStartersDir(config, config.distQwikPkgDir, ['features', 'adapters']);
46
47 const tmplSrc = join(config.startersDir, 'templates');
48 const tmplDist = join(config.distQwikPkgDir, 'templates');
49
50 if (existsSync(tmplDist)) {
51 rmSync(tmplDist, { recursive: true });
52 }
53
54 await copyDir(config, tmplSrc, tmplDist);
55
56 console.log('📠', submodule);
57}

Callers 1

buildFunction · 0.90

Calls 5

getBannerFunction · 0.90
copyStartersDirFunction · 0.90
copyDirFunction · 0.90
joinFunction · 0.85
buildFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…