@form8ion/git 1.1.0 → 2.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/lib/index.js CHANGED
@@ -1,14 +1,18 @@
1
1
  import simpleGit from 'simple-git';
2
2
  import { info } from '@travi/cli-messages';
3
3
  import { promises } from 'node:fs';
4
- import { fileExists } from '@form8ion/core';
4
+ import '@form8ion/core';
5
5
 
6
6
  function scaffoldIgnore ({projectRoot, files = [], directories = []}) {
7
7
  return promises.appendFile(`${projectRoot}/.gitignore`, `\n${directories.join('\n')}\n\n${files.join('\n')}`);
8
8
  }
9
9
 
10
10
  async function liftIgnore ({projectRoot, results: {vcsIgnore}}) {
11
- if (vcsIgnore) await scaffoldIgnore({projectRoot, ...vcsIgnore});
11
+ if (vcsIgnore) {
12
+ info('Updating files and directories to be ignored from version control', {level: 'secondary'});
13
+
14
+ await scaffoldIgnore({projectRoot, ...vcsIgnore});
15
+ }
12
16
 
13
17
  return {};
14
18
  }
@@ -27,7 +31,9 @@ async function scaffolder ({projectRoot}) {
27
31
  }
28
32
 
29
33
  function tester ({projectRoot}) {
30
- return fileExists(`${projectRoot}/.gitignore`);
34
+ const git = simpleGit({baseDir: projectRoot});
35
+
36
+ return git.checkIsRepo('root');
31
37
  }
32
38
 
33
39
  function scaffoldAttributes ({projectRoot}) {
package/lib/index.js.map CHANGED
@@ -1 +1 @@
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"],"names":["fs","writeIgnores"],"mappings":";;;;;AAEe,uBAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;AACtE,EAAE,OAAOA,QAAE,CAAC,UAAU,CAAC,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1G;;ACFe,yBAAc,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE;AACpE,EAAE,IAAI,SAAS,EAAE,MAAMC,cAAY,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC;AACjE;AACA,EAAE,OAAO,EAAE,CAAC;AACZ;;ACDe,yBAAc,EAAE,CAAC,WAAW,CAAC,EAAE;AAC9C,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;AACtC;AACA,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AAChD;AACA,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;AACpB,IAAI,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AACjC,IAAI,GAAG,CAAC,IAAI,EAAE;AACd,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,EAAE,CAAC;AACZ;;ACde,eAAQ,EAAE,CAAC,WAAW,CAAC,EAAE;AACxC,EAAE,OAAO,UAAU,CAAC,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AACjD;;ACFe,2BAAQ,EAAE,CAAC,WAAW,CAAC,EAAE;AACxC,EAAE,OAAOD,QAAE,CAAC,SAAS,CAAC,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC,CAAC;AACtE;;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,CAAC;AACtC,GAAG,CAAC,CAAC;AACL;AACA,EAAE,OAAO,EAAE,CAAC;AACZ;;;;"}
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 {info} from '@travi/cli-messages';\n\nimport writeIgnores from './writer.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 await writeIgnores({projectRoot, ...vcsIgnore});\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":["fs","writeIgnores"],"mappings":";;;;;AAEe,uBAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;AACtE,EAAE,OAAOA,QAAE,CAAC,UAAU,CAAC,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzG;;ACAe,yBAAc,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE;AACpE,EAAE,IAAI,SAAS,EAAE;AACjB,IAAI,IAAI,CAAC,mEAAmE,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;;AAEnG,IAAI,MAAMC,cAAY,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC;AACnD;;AAEA,EAAE,OAAO,EAAE;AACX;;ACPe,yBAAc,EAAE,CAAC,WAAW,CAAC,EAAE;AAC9C,EAAE,IAAI,CAAC,6BAA6B,CAAC;;AAErC,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;;AAE/C,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC;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,OAAOD,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,10 +2,10 @@
2
2
  "name": "@form8ion/git",
3
3
  "description": "form8ion plugin for managing projects versioned with git",
4
4
  "license": "MIT",
5
- "version": "1.1.0",
5
+ "version": "2.0.0-beta.1",
6
6
  "type": "module",
7
7
  "engines": {
8
- "node": "^18.17 || >=20.6.1"
8
+ "node": "^18.19.0 || ^20.9.0 || >=22.11.0"
9
9
  },
10
10
  "author": "Matt Travi <npm@travi.org> (https://matt.travi.org)",
11
11
  "repository": "form8ion/git",
@@ -32,7 +32,7 @@
32
32
  "lint:peer": "npm ls >/dev/null",
33
33
  "pretest:integration:base": "run-s build",
34
34
  "test:integration": "run-s 'test:integration:base -- --profile noWip'",
35
- "test:integration:base": "NODE_OPTIONS=\"--loader=testdouble --enable-source-maps\" DEBUG=any cucumber-js test/integration",
35
+ "test:integration:base": "NODE_OPTIONS=--enable-source-maps DEBUG=any cucumber-js test/integration",
36
36
  "test:integration:debug": "DEBUG=test run-s test:integration",
37
37
  "test:integration:wip": "run-s 'test:integration:base -- --profile wip'",
38
38
  "test:integration:wip:debug": "DEBUG=test run-s 'test:integration:wip'",
@@ -52,38 +52,38 @@
52
52
  "access": "public",
53
53
  "provenance": true
54
54
  },
55
- "packageManager": "npm@10.8.1+sha256.b8807aebb9656758e2872fa6e7c564b506aa2faa9297439a478d471d2fe32483",
55
+ "packageManager": "npm@11.0.0",
56
56
  "dependencies": {
57
57
  "@form8ion/core": "^4.3.0",
58
58
  "@travi/cli-messages": "^1.1.1",
59
59
  "simple-git": "^3.25.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@cucumber/cucumber": "10.8.0",
63
- "@form8ion/commitlint-config": "1.0.76",
64
- "@form8ion/eslint-config": "7.0.9",
62
+ "@cucumber/cucumber": "11.2.0",
63
+ "@form8ion/commitlint-config": "2.0.3",
64
+ "@form8ion/eslint-config": "7.0.12",
65
65
  "@form8ion/eslint-config-cucumber": "1.4.1",
66
- "@form8ion/remark-lint-preset": "6.0.3",
66
+ "@form8ion/remark-lint-preset": "6.0.6",
67
67
  "@travi/any": "3.1.2",
68
- "c8": "10.1.2",
69
- "chai": "5.1.1",
68
+ "c8": "10.1.3",
69
+ "chai": "5.1.2",
70
70
  "cross-env": "7.0.3",
71
71
  "cz-conventional-changelog": "3.3.0",
72
72
  "gherkin-lint": "4.2.4",
73
- "husky": "9.0.11",
74
- "jest-when": "3.6.0",
73
+ "husky": "9.1.7",
74
+ "jest-when": "3.7.0",
75
75
  "lockfile-lint": "4.14.0",
76
- "ls-engines": "0.9.2",
77
- "mock-fs": "5.2.0",
78
- "npm-run-all2": "6.2.0",
79
- "publint": "0.2.8",
76
+ "ls-engines": "0.9.3",
77
+ "mock-fs": "5.4.1",
78
+ "npm-run-all2": "7.0.2",
79
+ "publint": "0.3.2",
80
80
  "remark-cli": "12.0.1",
81
81
  "remark-toc": "9.0.0",
82
82
  "remark-usage": "11.0.1",
83
- "rimraf": "5.0.7",
84
- "rollup": "4.18.0",
83
+ "rimraf": "6.0.1",
84
+ "rollup": "4.32.1",
85
85
  "rollup-plugin-auto-external": "2.0.0",
86
86
  "testdouble": "3.20.2",
87
- "vitest": "1.6.0"
87
+ "vitest": "3.0.4"
88
88
  }
89
89
  }