@digipair/skill-git 0.89.0 → 0.91.0-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/.swcrc +28 -0
- package/README.md +7 -0
- package/eslint.config.mjs +22 -0
- package/package.json +23 -7
- package/rollup.config.cjs +28 -0
- package/src/lib/skill-git.spec.ts +7 -0
- package/src/lib/skill-git.ts +76 -0
- package/tsconfig.json +13 -0
- package/tsconfig.lib.json +19 -0
- package/index.cjs.d.ts +0 -1
- package/index.cjs.js +0 -6957
- package/index.esm.js +0 -6943
- package/libs/skill-git/src/lib/skill-git.d.ts +0 -5
- /package/{index.d.ts → src/index.d.ts} +0 -0
- /package/{libs/skill-git/src/index.d.ts → src/index.ts} +0 -0
- /package/{schema.fr.json → src/schema.fr.json} +0 -0
- /package/{schema.json → src/schema.json} +0 -0
package/.swcrc
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"jsc": {
|
|
3
|
+
"target": "es2017",
|
|
4
|
+
"parser": {
|
|
5
|
+
"syntax": "typescript",
|
|
6
|
+
"decorators": true,
|
|
7
|
+
"dynamicImport": true
|
|
8
|
+
},
|
|
9
|
+
"transform": {
|
|
10
|
+
"decoratorMetadata": true,
|
|
11
|
+
"legacyDecorator": true
|
|
12
|
+
},
|
|
13
|
+
"keepClassNames": true,
|
|
14
|
+
"externalHelpers": true,
|
|
15
|
+
"loose": true
|
|
16
|
+
},
|
|
17
|
+
"module": {
|
|
18
|
+
"type": "es6"
|
|
19
|
+
},
|
|
20
|
+
"sourceMaps": true,
|
|
21
|
+
"exclude": [
|
|
22
|
+
"jest.config.ts",
|
|
23
|
+
".*\\.spec.tsx?$",
|
|
24
|
+
".*\\.test.tsx?$",
|
|
25
|
+
"./src/jest-setup.ts$",
|
|
26
|
+
"./**/jest-setup.ts$"
|
|
27
|
+
]
|
|
28
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import baseConfig from '../../eslint.config.mjs';
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
...baseConfig,
|
|
5
|
+
{
|
|
6
|
+
files: ['**/*.json'],
|
|
7
|
+
rules: {
|
|
8
|
+
'@nx/dependency-checks': [
|
|
9
|
+
'error',
|
|
10
|
+
{
|
|
11
|
+
ignoredFiles: [
|
|
12
|
+
'{projectRoot}/eslint.config.{js,cjs,mjs}',
|
|
13
|
+
'{projectRoot}/rollup.config.{js,ts,mjs,mts,cjs,cts}',
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
languageOptions: {
|
|
19
|
+
parser: await import('jsonc-eslint-parser'),
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
];
|
package/package.json
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digipair/skill-git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.91.0-0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/libs/skill-git/index.cjs.js",
|
|
6
|
+
"module": "dist/libs/skill-git/index.esm.js",
|
|
7
|
+
"types": "dist/libs/skill-git/index.esm.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./libs/skill-git/package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"development": "./dist/libs/skill-git/src/index.ts",
|
|
12
|
+
"types": "./dist/libs/skill-git/index.esm.d.ts",
|
|
13
|
+
"import": "./dist/libs/skill-git/index.esm.js",
|
|
14
|
+
"default": "./dist/libs/skill-git/index.cjs.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
4
17
|
"keywords": [
|
|
5
18
|
"digipair",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
19
|
+
"web",
|
|
20
|
+
"service"
|
|
8
21
|
],
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
"nx": {
|
|
23
|
+
"name": "skill-git"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@digipair/engine": "0.91.0-0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const { withNx } = require('@nx/rollup/with-nx');
|
|
2
|
+
|
|
3
|
+
module.exports = withNx(
|
|
4
|
+
{
|
|
5
|
+
main: 'libs/skill-git/src/index.ts',
|
|
6
|
+
outputPath: 'dist/libs/skill-git',
|
|
7
|
+
tsConfig: 'libs/skill-git/tsconfig.lib.json',
|
|
8
|
+
compiler: 'swc',
|
|
9
|
+
format: ['esm', "cjs"],
|
|
10
|
+
assets: [
|
|
11
|
+
{
|
|
12
|
+
input: 'libs/skill-git/',
|
|
13
|
+
glob: 'package.json',
|
|
14
|
+
output: '.'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
input: 'libs/skill-git/src/',
|
|
18
|
+
glob: '*.json',
|
|
19
|
+
output: '.'
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
|
|
25
|
+
// e.g.
|
|
26
|
+
// output: { sourcemap: true },
|
|
27
|
+
}
|
|
28
|
+
);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { PinsSettings } from '@digipair/engine';
|
|
2
|
+
import { simpleGit } from 'simple-git';
|
|
3
|
+
|
|
4
|
+
class GitService {
|
|
5
|
+
async commit(params: any, _pinsSettingsList: PinsSettings[], context: any) {
|
|
6
|
+
const now = new Date();
|
|
7
|
+
const {
|
|
8
|
+
path = context.privates.GIT_PATH || '.',
|
|
9
|
+
selector = '*',
|
|
10
|
+
message = `${now.getUTCFullYear()}-${(now.getUTCMonth() + 1)
|
|
11
|
+
.toString()
|
|
12
|
+
.padStart(2, '0')}-${now.getUTCDate().toString().padStart(2, '0')}-${now
|
|
13
|
+
.getUTCHours()
|
|
14
|
+
.toString()
|
|
15
|
+
.padStart(2, '0')}:${now.getUTCMinutes().toString().padStart(2, '0')}:${now
|
|
16
|
+
.getUTCSeconds()
|
|
17
|
+
.toString()
|
|
18
|
+
.padStart(2, '0')}:${now.getUTCMilliseconds().toString().padStart(3, '0')}`,
|
|
19
|
+
} = params;
|
|
20
|
+
|
|
21
|
+
return await simpleGit(path).add(selector).commit(message);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async push(params: any, _pinsSettingsList: PinsSettings[], context: any) {
|
|
25
|
+
const { path = context.privates.GIT_PATH || '.', options = [] } = params;
|
|
26
|
+
|
|
27
|
+
return await simpleGit(path).push(options);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async show(params: any, _pinsSettingsList: PinsSettings[], context: any) {
|
|
31
|
+
const { path = context.privates.GIT_PATH || '.', options = [] } = params;
|
|
32
|
+
|
|
33
|
+
return await simpleGit(path).show(options);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async log(params: any, _pinsSettingsList: PinsSettings[], context: any) {
|
|
37
|
+
const {
|
|
38
|
+
path = context.privates.GIT_PATH || '.',
|
|
39
|
+
file,
|
|
40
|
+
format,
|
|
41
|
+
from,
|
|
42
|
+
mailMap,
|
|
43
|
+
maxCount,
|
|
44
|
+
multiLine,
|
|
45
|
+
splitter,
|
|
46
|
+
strictDate,
|
|
47
|
+
symmetric,
|
|
48
|
+
to,
|
|
49
|
+
} = params;
|
|
50
|
+
|
|
51
|
+
return await simpleGit(path).log({
|
|
52
|
+
file,
|
|
53
|
+
format,
|
|
54
|
+
from,
|
|
55
|
+
mailMap,
|
|
56
|
+
maxCount,
|
|
57
|
+
multiLine,
|
|
58
|
+
splitter,
|
|
59
|
+
strictDate,
|
|
60
|
+
symmetric,
|
|
61
|
+
to,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const commit = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
|
|
67
|
+
new GitService().commit(params, pinsSettingsList, context);
|
|
68
|
+
|
|
69
|
+
export const push = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
|
|
70
|
+
new GitService().push(params, pinsSettingsList, context);
|
|
71
|
+
|
|
72
|
+
export const show = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
|
|
73
|
+
new GitService().show(params, pinsSettingsList, context);
|
|
74
|
+
|
|
75
|
+
export const log = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
|
|
76
|
+
new GitService().log(params, pinsSettingsList, context);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "src",
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
"tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
|
|
7
|
+
"emitDeclarationOnly": true,
|
|
8
|
+
"module": "esnext",
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"types": ["node"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*.ts"],
|
|
14
|
+
"references": [
|
|
15
|
+
{
|
|
16
|
+
"path": "../engine/tsconfig.lib.json"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
package/index.cjs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/index";
|