@form8ion/git 2.2.0 → 3.0.0-beta.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 +2 -2
- package/lib/index.js +8 -8
- package/lib/index.js.map +1 -1
- package/package.json +29 -26
- package/src/attributes/scaffolder.js +1 -1
- package/src/ignore/lifter.js +1 -1
- package/src/ignore/scaffolder.js +1 -1
- package/src/ignore/tester.js +1 -1
- package/src/lifter.js +1 -1
- package/src/scaffolder.js +1 -1
- package/src/tester.js +1 -1
package/README.md
CHANGED
|
@@ -105,7 +105,7 @@ $ npm test
|
|
|
105
105
|
|
|
106
106
|
[renovate-link]: https://renovatebot.com
|
|
107
107
|
|
|
108
|
-
[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=
|
|
108
|
+
[renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=renovate
|
|
109
109
|
|
|
110
110
|
[PRs-link]: https://makeapullrequest.com
|
|
111
111
|
|
|
@@ -117,7 +117,7 @@ $ npm test
|
|
|
117
117
|
|
|
118
118
|
[coverage-link]: https://codecov.io/github/form8ion/git
|
|
119
119
|
|
|
120
|
-
[coverage-badge]: https://img.shields.io/codecov/c/github/form8ion/git?logo=codecov
|
|
120
|
+
[coverage-badge]: https://img.shields.io/codecov/c/github/form8ion/git/master?logo=codecov
|
|
121
121
|
|
|
122
122
|
[slsa-badge]: https://slsa.dev/images/gh-badge-level2.svg
|
|
123
123
|
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ function writeGitIgnore({projectRoot, ignores}) {
|
|
|
8
8
|
return write({projectRoot, name: 'git', ignores});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function scaffoldeIgnore({projectRoot}) {
|
|
12
12
|
return writeGitIgnore({projectRoot, ignores: []});
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -30,7 +30,7 @@ async function appendToIgnoreFile({projectRoot, ignores}) {
|
|
|
30
30
|
await writeGitIgnore({projectRoot, ignores: [...existingIgnores, ...ignores]});
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
async function liftIgnore
|
|
33
|
+
async function liftIgnore({projectRoot, results: {vcsIgnore}}) {
|
|
34
34
|
if (vcsIgnore) {
|
|
35
35
|
info('Updating files and directories to be ignored from version control', {level: 'secondary'});
|
|
36
36
|
|
|
@@ -42,30 +42,30 @@ async function liftIgnore ({projectRoot, results: {vcsIgnore}}) {
|
|
|
42
42
|
return {};
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
async function
|
|
45
|
+
async function scaffoldGit({projectRoot}) {
|
|
46
46
|
info('Initializing Git Repository');
|
|
47
47
|
|
|
48
48
|
const git = simpleGit({baseDir: projectRoot});
|
|
49
49
|
|
|
50
50
|
await Promise.all([
|
|
51
|
-
|
|
51
|
+
scaffoldeIgnore({projectRoot}),
|
|
52
52
|
git.init()
|
|
53
53
|
]);
|
|
54
54
|
|
|
55
55
|
return {};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
function
|
|
58
|
+
function projectVersionedWithGit({projectRoot}) {
|
|
59
59
|
const git = simpleGit({baseDir: projectRoot});
|
|
60
60
|
|
|
61
61
|
return git.checkIsRepo('root');
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function scaffoldAttributes
|
|
64
|
+
function scaffoldAttributes({projectRoot}) {
|
|
65
65
|
return promises.writeFile(`${projectRoot}/.gitattributes`, '* text=auto');
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
async function
|
|
68
|
+
async function liftGit({projectRoot, results}) {
|
|
69
69
|
await Promise.all([
|
|
70
70
|
scaffoldAttributes({projectRoot}),
|
|
71
71
|
liftIgnore({projectRoot, results})
|
|
@@ -74,5 +74,5 @@ async function lifter ({projectRoot, results}) {
|
|
|
74
74
|
return {};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export {
|
|
77
|
+
export { liftGit as lift, scaffoldGit as scaffold, projectVersionedWithGit as test };
|
|
78
78
|
//# sourceMappingURL=index.js.map
|
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/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,
|
|
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 scaffoldeIgnore({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 liftIgnore({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 scaffoldGit({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 projectVersionedWithGit({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 scaffoldAttributes({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 liftGit({projectRoot, results}) {\n await Promise.all([\n scaffoldAttributes({projectRoot}),\n liftIgnore({projectRoot, results})\n ]);\n\n return {};\n}\n"],"names":["write","appendIgnores","scaffoldIgnore","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,SAAS,eAAe,CAAC,CAAC,WAAW,CAAC,EAAE;AACvD,EAAE,OAAOA,cAAK,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE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AAS,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;;AAE/C,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;AACpB,IAAIC,eAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AACjC,IAAI,GAAG,CAAC,IAAI;AACZ,GAAG,CAAC;;AAEJ,EAAE,OAAO,EAAE;AACX;;ACde,SAAS,uBAAuB,CAAC,CAAC,WAAW,CAAC,EAAE;AAC/D,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;;AAE/C,EAAE,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC;AAChC;;ACJe,SAAS,kBAAkB,CAAC,CAAC,WAAW,CAAC,EAAE;AAC1D,EAAE,OAAOC,QAAE,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC;AACrE;;ACDe,eAAe,OAAO,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE;AAC9D,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,47 +2,51 @@
|
|
|
2
2
|
"name": "@form8ion/git",
|
|
3
3
|
"description": "form8ion plugin for managing projects versioned with git",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "3.0.0-beta.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "^
|
|
8
|
+
"node": "^22.22.2 || >=24.15"
|
|
9
9
|
},
|
|
10
10
|
"author": "Matt Travi <npm@travi.org> (https://matt.travi.org)",
|
|
11
|
-
"repository":
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/form8ion/git.git"
|
|
14
|
+
},
|
|
12
15
|
"bugs": "https://github.com/form8ion/git/issues",
|
|
13
|
-
"homepage": "https://
|
|
16
|
+
"homepage": "https://www.npmjs.com/package/@form8ion/git",
|
|
14
17
|
"runkitExampleFilename": "./example.js",
|
|
15
18
|
"exports": "./lib/index.js",
|
|
16
19
|
"main": "./lib/index.js",
|
|
17
20
|
"sideEffects": false,
|
|
18
21
|
"scripts": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"pregenerate:md": "run-s build",
|
|
26
|
-
"test:unit": "cross-env NODE_ENV=test c8 run-s test:unit:base",
|
|
27
|
-
"test:unit:base": "DEBUG=any vitest run",
|
|
22
|
+
"pretest": "run-s build",
|
|
23
|
+
"test": "npm-run-all --print-label --parallel lint:* --parallel test:*",
|
|
24
|
+
"lint:engines": "ls-engines",
|
|
25
|
+
"lint:gherkin": "gherkin-lint --config=.gherkin-lintrc.json",
|
|
26
|
+
"lint:js": "eslint . --cache",
|
|
27
|
+
"lint:js:fix": "run-s 'lint:js -- --fix'",
|
|
28
28
|
"lint:lockfile": "lockfile-lint",
|
|
29
|
-
"prepare": "husky",
|
|
30
29
|
"lint:md": "remark . --frail",
|
|
31
|
-
"generate:md": "remark . --output",
|
|
32
30
|
"lint:peer": "npm ls >/dev/null",
|
|
33
|
-
"
|
|
31
|
+
"lint:publish": "publint --strict",
|
|
32
|
+
"test:unit": "run-s 'test:unit:base -- --coverage'",
|
|
33
|
+
"test:unit:base": "NODE_ENV=test DEBUG=any vitest run src/",
|
|
34
34
|
"test:integration": "run-s 'test:integration:base -- --profile noWip'",
|
|
35
|
+
"pretest:integration:base": "run-s build",
|
|
35
36
|
"test:integration:base": "NODE_OPTIONS=--enable-source-maps DEBUG=any cucumber-js test/integration",
|
|
36
37
|
"test:integration:debug": "DEBUG=test run-s test:integration",
|
|
38
|
+
"test:integration:focus": "run-s 'test:integration:base -- --profile focus'",
|
|
37
39
|
"test:integration:wip": "run-s 'test:integration:base -- --profile wip'",
|
|
38
40
|
"test:integration:wip:debug": "DEBUG=test run-s 'test:integration:wip'",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
41
|
+
"prebuild": "run-s clean",
|
|
42
|
+
"build": "npm-run-all --print-label --parallel build:*",
|
|
43
|
+
"build:js": "rollup --config",
|
|
44
|
+
"clean": "rimraf ./lib",
|
|
45
|
+
"pregenerate:md": "run-s build",
|
|
46
|
+
"generate:md": "remark . --output",
|
|
47
|
+
"prepack": "run-s build",
|
|
48
|
+
"prepare": "husky",
|
|
49
|
+
"watch": "run-s 'build:js -- --watch'"
|
|
46
50
|
},
|
|
47
51
|
"files": [
|
|
48
52
|
"example.js",
|
|
@@ -63,13 +67,12 @@
|
|
|
63
67
|
"devDependencies": {
|
|
64
68
|
"@cucumber/cucumber": "11.3.0",
|
|
65
69
|
"@form8ion/commitlint-config": "2.0.11",
|
|
66
|
-
"@form8ion/eslint-config": "7.0.
|
|
70
|
+
"@form8ion/eslint-config": "7.1.0-beta.1",
|
|
67
71
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
68
72
|
"@form8ion/remark-lint-preset": "6.0.7",
|
|
69
73
|
"@travi/any": "3.3.0",
|
|
70
|
-
"
|
|
74
|
+
"@vitest/coverage-v8": "4.1.4",
|
|
71
75
|
"chai": "6.2.2",
|
|
72
|
-
"cross-env": "10.1.0",
|
|
73
76
|
"cz-conventional-changelog": "3.3.0",
|
|
74
77
|
"gherkin-lint": "4.2.4",
|
|
75
78
|
"husky": "9.1.7",
|
package/src/ignore/lifter.js
CHANGED
|
@@ -2,7 +2,7 @@ import {info} from '@travi/cli-messages';
|
|
|
2
2
|
|
|
3
3
|
import appendIgnores from './appender.js';
|
|
4
4
|
|
|
5
|
-
export default async function ({projectRoot, results: {vcsIgnore}}) {
|
|
5
|
+
export default async function liftIgnore({projectRoot, results: {vcsIgnore}}) {
|
|
6
6
|
if (vcsIgnore) {
|
|
7
7
|
info('Updating files and directories to be ignored from version control', {level: 'secondary'});
|
|
8
8
|
|
package/src/ignore/scaffolder.js
CHANGED
package/src/ignore/tester.js
CHANGED
package/src/lifter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {scaffold as scaffoldAttributes} from './attributes/index.js';
|
|
2
2
|
import {lift as liftIgnore} from './ignore/index.js';
|
|
3
3
|
|
|
4
|
-
export default async function ({projectRoot, results}) {
|
|
4
|
+
export default async function liftGit({projectRoot, results}) {
|
|
5
5
|
await Promise.all([
|
|
6
6
|
scaffoldAttributes({projectRoot}),
|
|
7
7
|
liftIgnore({projectRoot, results})
|
package/src/scaffolder.js
CHANGED
|
@@ -3,7 +3,7 @@ import {info} from '@travi/cli-messages';
|
|
|
3
3
|
|
|
4
4
|
import {scaffold as scaffoldIgnore} from './ignore/index.js';
|
|
5
5
|
|
|
6
|
-
export default async function ({projectRoot}) {
|
|
6
|
+
export default async function scaffoldGit({projectRoot}) {
|
|
7
7
|
info('Initializing Git Repository');
|
|
8
8
|
|
|
9
9
|
const git = simpleGit({baseDir: projectRoot});
|