create-gasket-app 7.4.13 → 7.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/commands/create.js
CHANGED
|
@@ -23,6 +23,7 @@ import installModules from '../scaffold/actions/install-modules.js';
|
|
|
23
23
|
import linkModules from '../scaffold/actions/link-modules.js';
|
|
24
24
|
import postCreateHooks from '../scaffold/actions/post-create-hooks.js';
|
|
25
25
|
import printReport from '../scaffold/actions/print-report.js';
|
|
26
|
+
import gitInit from '../scaffold/actions/git-init.js';
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Parses comma separated option input to array
|
|
@@ -132,6 +133,7 @@ async function handleTemplate(context) {
|
|
|
132
133
|
await copyTemplate({ context });
|
|
133
134
|
await customizeTemplate({ context });
|
|
134
135
|
await installTemplateDep({ context });
|
|
136
|
+
await gitInit({ context });
|
|
135
137
|
printReport({ context });
|
|
136
138
|
return;
|
|
137
139
|
}
|
package/lib/internal.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ export function loadTemplate(params: { context: PartialCreateContext }): Promise
|
|
|
131
131
|
export function copyTemplate(params: { context: PartialCreateContext }): Promise<void>;
|
|
132
132
|
export function customizeTemplate(params: { context: PartialCreateContext }): Promise<void>;
|
|
133
133
|
export function installTemplateDeps(params: { context: PartialCreateContext }): Promise<void>;
|
|
134
|
+
export function gitInit(params: { context: PartialCreateContext }): Promise<void>;
|
|
134
135
|
|
|
135
136
|
|
|
136
137
|
/** Presets */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { withSpinner } from '../with-spinner.js';
|
|
2
|
+
import { runShellCommand } from '@gasket/utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Initialize git repository, create main branch, and make initial commit
|
|
6
|
+
* @type {import('../../internal.d.js').gitInit}
|
|
7
|
+
*/
|
|
8
|
+
async function gitInit({ context }) {
|
|
9
|
+
await runShellCommand('git', ['init'], { cwd: context.dest });
|
|
10
|
+
await runShellCommand('git', ['checkout', '-b', 'main'], { cwd: context.dest });
|
|
11
|
+
await runShellCommand('git', ['add', '.'], { cwd: context.dest });
|
|
12
|
+
await runShellCommand('git', ['commit', '-m', '🎉 Created new repository with create-gasket-app'], { cwd: context.dest });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default withSpinner('Initialize git repo', gitInit);
|