@form8ion/git 2.1.0 → 2.1.1
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/lib/index.js +12 -4
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ $ npm test
|
|
|
123
123
|
|
|
124
124
|
[license-link]: LICENSE
|
|
125
125
|
|
|
126
|
-
[license-badge]: https://img.shields.io/github/license/form8ion/git.svg
|
|
126
|
+
[license-badge]: https://img.shields.io/github/license/form8ion/git.svg?logo=opensourceinitiative
|
|
127
127
|
|
|
128
128
|
[npm-link]: https://www.npmjs.com/package/@form8ion/git
|
|
129
129
|
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import simpleGit from 'simple-git';
|
|
2
2
|
import { info } from '@travi/cli-messages';
|
|
3
|
-
import { write, read } from '@form8ion/ignore-file';
|
|
3
|
+
import { write, exists, read } from '@form8ion/ignore-file';
|
|
4
4
|
import '@form8ion/core';
|
|
5
5
|
import { promises } from 'node:fs';
|
|
6
6
|
|
|
@@ -8,8 +8,12 @@ function writeGitIgnore({projectRoot, ignores}) {
|
|
|
8
8
|
return write({projectRoot, name: 'git', ignores});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function scaffoldIgnore ({projectRoot
|
|
12
|
-
return writeGitIgnore({projectRoot, ignores: [
|
|
11
|
+
function scaffoldIgnore ({projectRoot}) {
|
|
12
|
+
return writeGitIgnore({projectRoot, ignores: []});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function gitignoreExists({projectRoot} = {}) {
|
|
16
|
+
return exists({projectRoot, name: 'git'});
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
function readGitIgnore({projectRoot}) {
|
|
@@ -17,7 +21,11 @@ function readGitIgnore({projectRoot}) {
|
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
async function appendToIgnoreFile({projectRoot, ignores}) {
|
|
20
|
-
|
|
24
|
+
let existingIgnores = [];
|
|
25
|
+
|
|
26
|
+
if (await gitignoreExists({projectRoot})) {
|
|
27
|
+
existingIgnores = await readGitIgnore({projectRoot});
|
|
28
|
+
}
|
|
21
29
|
|
|
22
30
|
await writeGitIgnore({projectRoot, ignores: [...existingIgnores, ...ignores]});
|
|
23
31
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/ignore/writer.js","../src/ignore/scaffolder.js","../src/ignore/reader.js","../src/ignore/appender.js","../src/ignore/lifter.js","../src/scaffolder.js","../src/tester.js","../src/attributes/scaffolder.js","../src/lifter.js"],"sourcesContent":["import {write} from '@form8ion/ignore-file';\n\nexport default function writeGitIgnore({projectRoot, ignores}) {\n return write({projectRoot, name: 'git', ignores});\n}\n","import write from './writer.js';\n\nexport default function ({projectRoot,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/ignore/writer.js","../src/ignore/scaffolder.js","../src/ignore/existence-checker.js","../src/ignore/reader.js","../src/ignore/appender.js","../src/ignore/lifter.js","../src/scaffolder.js","../src/tester.js","../src/attributes/scaffolder.js","../src/lifter.js"],"sourcesContent":["import {write} from '@form8ion/ignore-file';\n\nexport default function writeGitIgnore({projectRoot, ignores}) {\n return write({projectRoot, name: 'git', ignores});\n}\n","import write from './writer.js';\n\nexport default function ({projectRoot}) {\n return write({projectRoot, ignores: []});\n}\n","import {exists} from '@form8ion/ignore-file';\n\nexport default function gitignoreExists({projectRoot} = {}) {\n return exists({projectRoot, name: 'git'});\n}\n","import {read} from '@form8ion/ignore-file';\n\nexport default function readGitIgnore({projectRoot}) {\n return read({projectRoot, name: 'git'});\n}\n","import gitignoreExists from './existence-checker.js';\nimport readGitIgnore from './reader.js';\nimport writeGitIgnore from './writer.js';\n\nexport default async function appendToIgnoreFile({projectRoot, ignores}) {\n let existingIgnores = [];\n\n if (await gitignoreExists({projectRoot})) {\n existingIgnores = await readGitIgnore({projectRoot});\n }\n\n await writeGitIgnore({projectRoot, ignores: [...existingIgnores, ...ignores]});\n}\n","import {info} from '@travi/cli-messages';\n\nimport appendIgnores from './appender.js';\n\nexport default async function ({projectRoot, results: {vcsIgnore}}) {\n if (vcsIgnore) {\n info('Updating files and directories to be ignored from version control', {level: 'secondary'});\n\n const {directories = [], files = []} = vcsIgnore;\n\n await appendIgnores({projectRoot, ignores: [...directories, ...files]});\n }\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 simpleGit from 'simple-git';\n\nexport default function ({projectRoot}) {\n const git = simpleGit({baseDir: projectRoot});\n\n return git.checkIsRepo('root');\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"],"names":["write","appendIgnores","fs"],"mappings":";;;;;;AAEe,SAAS,cAAc,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE;AAC/D,EAAE,OAAO,KAAK,CAAC,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACnD;;ACFe,uBAAQ,EAAE,CAAC,WAAW,CAAC,EAAE;AACxC,EAAE,OAAOA,cAAK,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC1C;;ACFe,SAAS,eAAe,CAAC,CAAC,WAAW,CAAC,GAAG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;AACpB,IAAI,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AACjC,IAAI,GAAG,CAAC,IAAI;AACZ,GAAG,CAAC;;AAEJ,EAAE,OAAO,EAAE;AACX;;ACde,eAAQ,EAAE,CAAC,WAAW,CAAC,EAAE;AACxC,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;;AAE/C,EAAE,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;AAChC;;ACJe,2BAAQ,EAAE,CAAC,WAAW,CAAC,EAAE;AACxC,EAAE,OAAOC,QAAE,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC;AACrE;;ACDe,qBAAc,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;AACrC,GAAG,CAAC;;AAEJ,EAAE,OAAO,EAAE;AACX;;;;"}
|
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": "2.1.
|
|
5
|
+
"version": "2.1.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "^18.19.0 || ^20.9.0 || >=22.11.0"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"access": "public",
|
|
53
53
|
"provenance": true
|
|
54
54
|
},
|
|
55
|
-
"packageManager": "npm@11.0.
|
|
55
|
+
"packageManager": "npm@11.1.0+sha512.acf301ad9b9ddba948fcb72341e2f0fcae477f56a95cc2a092934d133a7461062633cefbf93d5934a3dc0768674e2edee9f04dcfcc4bb4c327ff0e3a7d552a1b",
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@form8ion/core": "^4.3.0",
|
|
58
58
|
"@form8ion/ignore-file": "^1.0.0",
|
|
@@ -72,7 +72,6 @@
|
|
|
72
72
|
"cz-conventional-changelog": "3.3.0",
|
|
73
73
|
"gherkin-lint": "4.2.4",
|
|
74
74
|
"husky": "9.1.7",
|
|
75
|
-
"jest-when": "3.7.0",
|
|
76
75
|
"lockfile-lint": "4.14.0",
|
|
77
76
|
"ls-engines": "0.9.3",
|
|
78
77
|
"mock-fs": "5.4.1",
|
|
@@ -85,6 +84,7 @@
|
|
|
85
84
|
"rollup": "4.32.1",
|
|
86
85
|
"rollup-plugin-auto-external": "2.0.0",
|
|
87
86
|
"testdouble": "3.20.2",
|
|
88
|
-
"vitest": "3.0.5"
|
|
87
|
+
"vitest": "3.0.5",
|
|
88
|
+
"vitest-when": "0.6.0"
|
|
89
89
|
}
|
|
90
90
|
}
|