@form8ion/git 1.0.0-alpha.5 → 1.1.0
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/README.md +1 -1
- package/example.js +1 -1
- package/lib/index.js +17 -5
- package/lib/index.js.map +1 -1
- package/package.json +2 -3
package/README.md
CHANGED
package/example.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import touch from 'touch';
|
|
2
1
|
import simpleGit from 'simple-git';
|
|
3
2
|
import { info } from '@travi/cli-messages';
|
|
4
|
-
import { fileExists } from '@form8ion/core';
|
|
5
3
|
import { promises } from 'node:fs';
|
|
4
|
+
import { fileExists } from '@form8ion/core';
|
|
5
|
+
|
|
6
|
+
function scaffoldIgnore ({projectRoot, files = [], directories = []}) {
|
|
7
|
+
return promises.appendFile(`${projectRoot}/.gitignore`, `\n${directories.join('\n')}\n\n${files.join('\n')}`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async function liftIgnore ({projectRoot, results: {vcsIgnore}}) {
|
|
11
|
+
if (vcsIgnore) await scaffoldIgnore({projectRoot, ...vcsIgnore});
|
|
12
|
+
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
6
15
|
|
|
7
16
|
async function scaffolder ({projectRoot}) {
|
|
8
17
|
info('Initializing Git Repository');
|
|
@@ -10,7 +19,7 @@ async function scaffolder ({projectRoot}) {
|
|
|
10
19
|
const git = simpleGit({baseDir: projectRoot});
|
|
11
20
|
|
|
12
21
|
await Promise.all([
|
|
13
|
-
|
|
22
|
+
scaffoldIgnore({projectRoot}),
|
|
14
23
|
git.init()
|
|
15
24
|
]);
|
|
16
25
|
|
|
@@ -25,8 +34,11 @@ function scaffoldAttributes ({projectRoot}) {
|
|
|
25
34
|
return promises.writeFile(`${projectRoot}/.gitattributes`, '* text=auto');
|
|
26
35
|
}
|
|
27
36
|
|
|
28
|
-
async function lifter ({projectRoot}) {
|
|
29
|
-
await
|
|
37
|
+
async function lifter ({projectRoot, results}) {
|
|
38
|
+
await Promise.all([
|
|
39
|
+
scaffoldAttributes({projectRoot}),
|
|
40
|
+
liftIgnore({projectRoot, results})
|
|
41
|
+
]);
|
|
30
42
|
|
|
31
43
|
return {};
|
|
32
44
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/scaffolder.js","../src/tester.js","../src/attributes/scaffolder.js","../src/lifter.js"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/ignore/writer.js","../src/ignore/lifter.js","../src/scaffolder.js","../src/tester.js","../src/attributes/scaffolder.js","../src/lifter.js"],"sourcesContent":["import {promises as fs} from 'node:fs';\n\nexport default function ({projectRoot, files = [], directories = []}) {\n return fs.appendFile(`${projectRoot}/.gitignore`, `\\n${directories.join('\\n')}\\n\\n${files.join('\\n')}`);\n}\n","import writeIgnores from './writer.js';\n\nexport default async function ({projectRoot, results: {vcsIgnore}}) {\n if (vcsIgnore) await writeIgnores({projectRoot, ...vcsIgnore});\n\n return {};\n}\n","import simpleGit from 'simple-git';\nimport {info} from '@travi/cli-messages';\n\nimport {scaffold as scaffoldIgnore} from './ignore/index.js';\n\nexport default async function ({projectRoot}) {\n info('Initializing Git Repository');\n\n const git = simpleGit({baseDir: projectRoot});\n\n await Promise.all([\n scaffoldIgnore({projectRoot}),\n git.init()\n ]);\n\n return {};\n}\n","import {fileExists} from '@form8ion/core';\n\nexport default function ({projectRoot}) {\n return fileExists(`${projectRoot}/.gitignore`);\n}\n","import {promises as fs} from 'node:fs';\n\nexport default function ({projectRoot}) {\n return fs.writeFile(`${projectRoot}/.gitattributes`, '* text=auto');\n}\n","import {scaffold as scaffoldAttributes} from './attributes/index.js';\nimport {lift as liftIgnore} from './ignore/index.js';\n\nexport default async function ({projectRoot, results}) {\n await Promise.all([\n scaffoldAttributes({projectRoot}),\n liftIgnore({projectRoot, results})\n ]);\n\n return {};\n}\n"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BAAc,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE;AACvD,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;AACpB,IAAI,kBAAkB,CAAC,CAAC,WAAW,CAAC,CAAC;AACrC,IAAI,UAAU,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AACtC,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,EAAE,CAAC;AACZ;;;;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@form8ion/git",
|
|
3
3
|
"description": "form8ion plugin for managing projects versioned with git",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.1.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "^18.17 || >=20.6.1"
|
|
@@ -56,8 +56,7 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@form8ion/core": "^4.3.0",
|
|
58
58
|
"@travi/cli-messages": "^1.1.1",
|
|
59
|
-
"simple-git": "^3.25.0"
|
|
60
|
-
"touch": "^3.1.1"
|
|
59
|
+
"simple-git": "^3.25.0"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@cucumber/cucumber": "10.8.0",
|