pentonville 1.0.401 → 1.0.403
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/.gitattributes +20 -0
- package/package.json +3 -5
- package/build/gulp/index.js +0 -78
package/.gitattributes
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Default behavior
|
|
2
|
+
* text=auto
|
|
3
|
+
|
|
4
|
+
# LF line endings
|
|
5
|
+
*.json text eol=lf
|
|
6
|
+
*.mjs text eol=lf
|
|
7
|
+
*.cjs text eol=lf
|
|
8
|
+
*.mts text eol=lf
|
|
9
|
+
*.js text eol=lf
|
|
10
|
+
*.ts text eol=lf
|
|
11
|
+
*.sh text eol=lf
|
|
12
|
+
.editorconfig text eol=lf
|
|
13
|
+
.eslintignore text eol=lf
|
|
14
|
+
.eslintrc text eol=lf
|
|
15
|
+
.gitattributes text eol=lf
|
|
16
|
+
.gitignore text eol=lf
|
|
17
|
+
.npmignore text eol=lf
|
|
18
|
+
.npmrc text eol=lf
|
|
19
|
+
.nvmrc text eol=lf
|
|
20
|
+
.husky/* text eol=lf
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pentonville",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.403",
|
|
4
4
|
"description": "Pentonville",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Pentonville",
|
|
@@ -28,8 +28,6 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build",
|
|
29
29
|
"lint": "eslint .",
|
|
30
30
|
"lint:fix": "npm run lint -- --fix",
|
|
31
|
-
"gulp": "gulp --color",
|
|
32
|
-
"pre-commit": "npm run lint && npm run build && git add lib && npm run gulp -- pre-commit",
|
|
33
31
|
"prepare": "husky install"
|
|
34
32
|
},
|
|
35
33
|
"devDependencies": {
|
|
@@ -40,16 +38,16 @@
|
|
|
40
38
|
"@babel/preset-env": "^7.21.4",
|
|
41
39
|
"@babel/preset-react": "^7.18.6",
|
|
42
40
|
"@babel/register": "^7.21.0",
|
|
41
|
+
"@sequencemedia/hooks": "^1.0.394",
|
|
43
42
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
44
43
|
"core-js": "^3.30.1",
|
|
45
|
-
"eslint": "^8.
|
|
44
|
+
"eslint": "^8.39.0",
|
|
46
45
|
"eslint-config-standard": "^17.0.0",
|
|
47
46
|
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
48
47
|
"eslint-plugin-import": "^2.27.5",
|
|
49
48
|
"eslint-plugin-node": "^11.1.0",
|
|
50
49
|
"eslint-plugin-promise": "^6.1.1",
|
|
51
50
|
"eslint-plugin-react": "^7.32.2",
|
|
52
|
-
"gulp": "^4.0.2",
|
|
53
51
|
"husky": "^8.0.3",
|
|
54
52
|
"prop-types": "15.7.2",
|
|
55
53
|
"react": "16.14.0",
|
package/build/gulp/index.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import debug from 'debug'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
exec
|
|
5
|
-
} from 'child_process'
|
|
6
|
-
|
|
7
|
-
const log = debug('pentonville:build:gulp:pre-commit')
|
|
8
|
-
|
|
9
|
-
log('`pentonville` is awake')
|
|
10
|
-
|
|
11
|
-
const PACKAGE_VERSION_CHANGES = /-+\s+"version":\s"(\d+\.\d+\.\d+)",\s+\++\s+"version":\s"(\d+\.\d+\.\d+)",\s+/s
|
|
12
|
-
|
|
13
|
-
const HAS_STAGED_CHANGES = /Changes to be committed/s
|
|
14
|
-
|
|
15
|
-
const NOT_STAGED_CHANGES = /Changes not staged for commit/s
|
|
16
|
-
|
|
17
|
-
const OPTIONS = {
|
|
18
|
-
maxBuffer: 1024 * 500
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const hasPackageVersionChanges = () => (
|
|
22
|
-
new Promise((resolve, reject) => {
|
|
23
|
-
exec('git diff HEAD origin/master package.json', OPTIONS, (e, v) => (!e) ? resolve(PACKAGE_VERSION_CHANGES.test(v)) : reject(e))
|
|
24
|
-
})
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
export const notPackageVersionChanges = () => (
|
|
28
|
-
new Promise((resolve, reject) => {
|
|
29
|
-
exec('git diff HEAD origin/master package.json', OPTIONS, (e, v) => (!e) ? resolve(PACKAGE_VERSION_CHANGES.test(v) !== true) : reject(e))
|
|
30
|
-
})
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
export const hasStagedChanges = () => (
|
|
34
|
-
new Promise((resolve, reject) => {
|
|
35
|
-
exec('git status', OPTIONS, (e, v) => (!e) ? resolve(HAS_STAGED_CHANGES.test(v)) : reject(e))
|
|
36
|
-
})
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
export const notStagedChanges = () => (
|
|
40
|
-
new Promise((resolve, reject) => {
|
|
41
|
-
exec('git status', OPTIONS, (e, v) => (!e) ? resolve(NOT_STAGED_CHANGES.test(v)) : reject(e))
|
|
42
|
-
})
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
export const notPushedChanges = () => (
|
|
46
|
-
new Promise((resolve, reject) => {
|
|
47
|
-
exec('git log origin/master..HEAD', OPTIONS, (e, v) => (!e) ? resolve(!!v) : reject(e))
|
|
48
|
-
})
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
export const patchPackageVersion = () => (
|
|
52
|
-
new Promise((resolve, reject) => {
|
|
53
|
-
exec('npm version patch -m %s -n --no-git-tag-version --no-verify', OPTIONS, (e) => (!e) ? resolve() : reject(e))
|
|
54
|
-
})
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
export const addPackageVersionChanges = () => (
|
|
58
|
-
new Promise((resolve, reject) => {
|
|
59
|
-
exec('git add package.json package-lock.json', OPTIONS, (e) => (!e) ? resolve() : reject(e))
|
|
60
|
-
})
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
export default async function preCommit () {
|
|
64
|
-
log('pre-commit')
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
if (await notStagedChanges()) return
|
|
68
|
-
|
|
69
|
-
if (await hasStagedChanges()) {
|
|
70
|
-
if (await notPackageVersionChanges()) {
|
|
71
|
-
await patchPackageVersion()
|
|
72
|
-
await addPackageVersionChanges()
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
} catch ({ code = 'NONE', message = 'No error message defined' }) {
|
|
76
|
-
log({ code, message })
|
|
77
|
-
}
|
|
78
|
-
}
|