@ntbjs/ntb-dam-utils 1.0.0 → 1.0.2
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 +16 -2
- package/index.js +2 -2
- package/package.json +1 -1
- package/.editorconfig +0 -17
- package/.eslintrc.js +0 -31
- package/.husky/pre-commit +0 -9
- package/.lintstagedrc.js +0 -26
- package/.prettierrc +0 -29
package/README.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
# NTB DAM Utils
|
|
2
2
|
|
|
3
|
-
To install
|
|
4
|
-
|
|
3
|
+
### To install:
|
|
4
|
+
Get an npm token and add to a .npmrc file containing:
|
|
5
|
+
`//registry.npmjs.org/:_authToken=<token>`
|
|
6
|
+
|
|
7
|
+
Then run:
|
|
8
|
+
`npm i @ntbjs/ntb-dam-utils `
|
|
9
|
+
|
|
10
|
+
### To contribute
|
|
11
|
+
Add new code and functions to master. Add new tag ie. v1.1.1, pipelines will then automaticly publish new tag to private npm repo.
|
|
12
|
+
|
|
13
|
+
When updates are made one have update tag in projects that are using this resource.
|
|
14
|
+
|
|
15
|
+
### Contains:
|
|
16
|
+
- List of owners
|
|
17
|
+
- Index config
|
|
18
|
+
- List of origins
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { owners } = require("./src/config/owners");
|
|
1
|
+
const { owners, ownersLocale } = require("./src/config/owners");
|
|
2
2
|
const { origins } = require("./src/config/origins");
|
|
3
3
|
const { indexes } = require("./src/config/indexes");
|
|
4
4
|
|
|
5
|
-
module.exports = { owners, origins, indexes };
|
|
5
|
+
module.exports = { owners, ownersLocale, origins, indexes };
|
package/package.json
CHANGED
package/.editorconfig
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
root = true
|
|
2
|
-
|
|
3
|
-
[*]
|
|
4
|
-
charset = utf-8
|
|
5
|
-
end_of_line = lf
|
|
6
|
-
indent_size = 2
|
|
7
|
-
indent_style = space
|
|
8
|
-
insert_final_newline = true
|
|
9
|
-
max_line_length = 100
|
|
10
|
-
trim_trailing_whitespace = true
|
|
11
|
-
|
|
12
|
-
[*.md]
|
|
13
|
-
max_line_length = 0
|
|
14
|
-
trim_trailing_whitespace = false
|
|
15
|
-
|
|
16
|
-
[COMMIT_EDITMSG]
|
|
17
|
-
max_line_length = 0
|
package/.eslintrc.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
parser: "@babel/eslint-parser",
|
|
4
|
-
env: {
|
|
5
|
-
node: true,
|
|
6
|
-
es6: true
|
|
7
|
-
},
|
|
8
|
-
extends: ["eslint:recommended", "plugin:import/errors", "plugin:import/warnings"],
|
|
9
|
-
plugins: ["prettier", "import"],
|
|
10
|
-
rules: {
|
|
11
|
-
// Eslint importer rules for sorting imports
|
|
12
|
-
"import/no-unresolved": 1,
|
|
13
|
-
"import/named": 1,
|
|
14
|
-
"import/namespace": 1,
|
|
15
|
-
"import/no-named-as-default": 0,
|
|
16
|
-
"import/export": 1,
|
|
17
|
-
"import/no-cycle": 2,
|
|
18
|
-
"import/no-useless-path-segments": 1,
|
|
19
|
-
"import/order": [
|
|
20
|
-
1,
|
|
21
|
-
{
|
|
22
|
-
groups: ["builtin", "external", "parent", "sibling", "index"],
|
|
23
|
-
"newlines-between": "always-and-inside-groups",
|
|
24
|
-
alphabetize: {
|
|
25
|
-
order: "asc",
|
|
26
|
-
caseInsensitive: true
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
};
|
package/.husky/pre-commit
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
. "$(dirname "$0")/_/husky.sh"
|
|
3
|
-
|
|
4
|
-
# Fixes issues with running the git commit hook when using nvm in WSL2 or installed with Homebrew
|
|
5
|
-
# This loads nvm.sh and sets the correct PATH before running hook
|
|
6
|
-
export NVM_DIR="$HOME/.nvm"
|
|
7
|
-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
8
|
-
|
|
9
|
-
npx lint-staged
|
package/.lintstagedrc.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const { ESLint } = require("eslint");
|
|
2
|
-
|
|
3
|
-
const removeIgnoredFiles = async files => {
|
|
4
|
-
const eslint = new ESLint();
|
|
5
|
-
const isIgnored = await Promise.all(
|
|
6
|
-
files.map(file => {
|
|
7
|
-
return eslint.isPathIgnored(file);
|
|
8
|
-
})
|
|
9
|
-
);
|
|
10
|
-
const filteredFiles = files.filter((_, i) => !isIgnored[i]);
|
|
11
|
-
return filteredFiles.length ? filteredFiles.join(" ") : null;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
"**/*.js": async files => {
|
|
16
|
-
const filesToLint = await removeIgnoredFiles(files);
|
|
17
|
-
if (filesToLint) return [`eslint --fix --max-warnings=0 ${filesToLint}`];
|
|
18
|
-
return [];
|
|
19
|
-
},
|
|
20
|
-
"*.{css,scss}": "prettier --write",
|
|
21
|
-
"**/*.json": async files => {
|
|
22
|
-
const filesToLint = await removeIgnoredFiles(files);
|
|
23
|
-
if (filesToLint) return [`prettier --write ${filesToLint}`];
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
26
|
-
};
|
package/.prettierrc
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tabWidth": 2,
|
|
3
|
-
"singleQuote": false,
|
|
4
|
-
"trailingComma": "none",
|
|
5
|
-
"printWidth": 100,
|
|
6
|
-
"bracketSpacing": true,
|
|
7
|
-
"jsxBracketSameLine": false,
|
|
8
|
-
"semi": true,
|
|
9
|
-
"requirePragma": false,
|
|
10
|
-
"proseWrap": "preserve",
|
|
11
|
-
"arrowParens": "avoid",
|
|
12
|
-
"htmlWhitespaceSensitivity": "css",
|
|
13
|
-
"quoteProps": "as-needed",
|
|
14
|
-
"overrides": [
|
|
15
|
-
{
|
|
16
|
-
"files": "*.js",
|
|
17
|
-
"options": {
|
|
18
|
-
"parser": "babel"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"files": "*.json",
|
|
23
|
-
"options": {
|
|
24
|
-
"parser": "json",
|
|
25
|
-
"printWidth": 80
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|