-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update of deps incl. bug fixes (Node >= 20)
- Loading branch information
1 parent
d5ea70d
commit 4c04617
Showing
15 changed files
with
3,777 additions
and
4,584 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run hooks:commit-msg | ||
npm run hooks:commit-msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run hooks:pre-commit | ||
npm run hooks:pre-commit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import globals from "globals"; | ||
import js from "@eslint/js"; | ||
|
||
export default [ | ||
js.configs.recommended, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
ecmaVersion: 2023, | ||
sourceType: "module", | ||
}, | ||
rules: { | ||
"block-scoped-var": 1, | ||
"keyword-spacing": 2, | ||
"space-unary-ops": 2, | ||
camelcase: 1, | ||
"no-warning-comments": 1, | ||
"no-debugger": 2, | ||
"default-case": 1, | ||
"no-unused-vars": 2, | ||
"no-trailing-spaces": 2, | ||
semi: [1, "always"], | ||
quotes: [1, "double"], | ||
"key-spacing": [ | ||
1, | ||
{ | ||
beforeColon: false, | ||
}, | ||
], | ||
"comma-spacing": [ | ||
1, | ||
{ | ||
before: false, | ||
after: true, | ||
}, | ||
], | ||
"no-shadow": 2, | ||
"no-irregular-whitespace": 2, | ||
}, | ||
}, | ||
{ | ||
ignores: [ | ||
"eslint.config.js", | ||
|
||
// Ignore node_files | ||
"node_modules/", | ||
|
||
// Ignore plugin generators (which are copies of the generators) | ||
"plugin-generators/", | ||
|
||
// Ignore test files | ||
"test/", | ||
], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const generatorArguments = { | ||
generator: { | ||
type: String, | ||
required: false, | ||
description: "Name of the generator to invoke (without the \x1b[33mgenerator-ui5-\x1b[0m prefix)", | ||
}, | ||
subcommand: { | ||
type: String, | ||
required: false, | ||
description: "Name of the subcommand to invoke (without the \x1b[33>mgenerator:\x1b[0m prefix)", | ||
}, | ||
}; | ||
|
||
export default function defineGeneratorArguments(generator) { | ||
Object.keys(generatorArguments).forEach((argName) => { | ||
// register the argument for being displayed in the help | ||
generator.argument(argName, generatorArguments[argName]); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import path from "path"; | ||
import os from "os"; | ||
import getNPMConfig from "./getNPMConfig.js"; | ||
|
||
// the command line options of the generator | ||
export const generatorOptions = { | ||
pluginsHome: { | ||
type: String, | ||
description: "Home directory of the plugin generators", | ||
default: path.join(os.homedir(), ".npm", "_generator-easy-ui5", "plugin-generators"), | ||
hide: true, // shouldn't be needed | ||
npmConfig: true, | ||
}, | ||
plugins: { | ||
type: Boolean, | ||
alias: "p", | ||
description: "List detailed information about installed plugin generators", | ||
}, | ||
pluginsWithDevDeps: { | ||
type: Boolean, | ||
alias: "dev", | ||
description: "Installs the plugin generators with dev dependencies (compat mode)", | ||
}, | ||
ghBaseUrl: { | ||
type: String, | ||
description: "Base URL for the Octokit API (defaults to https://api.github.com if undefined)", | ||
hide: true, // shouldn't be needed | ||
npmConfig: true, | ||
}, | ||
ghAuthToken: { | ||
type: String, | ||
description: "GitHub authToken to optionally access private generator repositories", | ||
npmConfig: true, | ||
}, | ||
ghOrg: { | ||
type: String, | ||
description: "GitHub organization to lookup for available generators", | ||
default: "ui5-community", | ||
hide: true, // we don't want to recommend to use this option | ||
}, | ||
ghThreshold: { | ||
type: Number, | ||
default: 100, | ||
hide: true, // shouldn't be needed | ||
}, | ||
subGeneratorPrefix: { | ||
type: String, | ||
description: "Prefix used for the lookup of the available generators", | ||
default: "generator-ui5-", | ||
hide: true, // we don't want to recommend to use this option | ||
}, | ||
addGhBaseUrl: { | ||
type: String, | ||
description: "Base URL for the Octokit API for the additional generators (defaults to https://api.github.com if undefined)", | ||
hide: true, // shouldn't be needed | ||
npmConfig: true, | ||
}, | ||
addGhOrg: { | ||
type: String, | ||
description: "GitHub organization to lookup for additional available generators", | ||
hide: true, // we don't want to recommend to use this option | ||
npmConfig: true, | ||
}, | ||
addSubGeneratorPrefix: { | ||
type: String, | ||
description: "Prefix used for the lookup of the additional available generators", | ||
default: "generator-", | ||
hide: true, // we don't want to recommend to use this option | ||
npmConfig: true, | ||
}, | ||
embed: { | ||
type: Boolean, | ||
description: "Embeds the selected plugin generator", | ||
hide: true, // shouldn't be needed | ||
}, | ||
list: { | ||
type: Boolean, | ||
description: "List the available subcommands of the generator", | ||
}, | ||
skipUpdate: { | ||
type: Boolean, | ||
description: "Skip the update of the plugin generator", | ||
}, | ||
forceUpdate: { | ||
type: Boolean, | ||
description: "Force the update of the plugin generator", | ||
}, | ||
offline: { | ||
type: Boolean, | ||
alias: "o", | ||
description: "Running easy-ui5 in offline mode", | ||
}, | ||
verbose: { | ||
type: Boolean, | ||
description: "Enable detailed logging", | ||
}, | ||
next: { | ||
type: Boolean, | ||
description: "Preview the next mode to consume subgenerators from bestofui5.org", | ||
}, | ||
skipNested: { | ||
type: Boolean, | ||
description: "Skips the nested generators and runs only the first subgenerator", | ||
}, | ||
}; | ||
|
||
export default function defineGeneratorOptions(generator) { | ||
Object.keys(generatorOptions).forEach((optionName) => { | ||
const initialValue = generator.options[optionName]; | ||
// register the option for being displayed in the help | ||
generator.option(optionName, generatorOptions[optionName]); | ||
const defaultedValue = generator.options[optionName]; | ||
if (generatorOptions[optionName].npmConfig) { | ||
// if a value is set, use the set value (parameter has higher precedence than npm config) | ||
// => generator.option(...) applies the default value to generator.options[...] used as last resort | ||
generator.options[optionName] = initialValue || getNPMConfig(optionName) || defaultedValue; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import getNPMConfig from "./getNPMConfig.js"; | ||
|
||
// apply proxy settings to GLOBAL_AGENT to support the proxy configuration for node-fetch using the GLOBAL_AGENT | ||
// ==> the configuration is derived from the environment variables ([GLOBAL_AGENT_](HTTP|HTTPS|NO)_PROXY) and the npm config ((http|https|no)-proxy) | ||
// ==> empty values will allow to override the more general proxy settings and make the proxy value undefined | ||
let HTTP_PROXY, HTTPS_PROXY, NO_PROXY; | ||
if (global?.GLOBAL_AGENT) { | ||
HTTP_PROXY = process.env.GLOBAL_AGENT_HTTP_PROXY ?? process.env.HTTP_PROXY ?? process.env.http_proxy ?? getNPMConfig("http-proxy", "") ?? getNPMConfig("proxy", ""); | ||
global.GLOBAL_AGENT.HTTP_PROXY = HTTP_PROXY = HTTP_PROXY || global.GLOBAL_AGENT.HTTP_PROXY; | ||
HTTPS_PROXY = process.env.GLOBAL_AGENT_HTTPS_PROXY ?? process.env.HTTPS_PROXY ?? process.env.https_proxy ?? getNPMConfig("https-proxy", "") ?? getNPMConfig("proxy", ""); | ||
global.GLOBAL_AGENT.HTTPS_PROXY = HTTPS_PROXY = HTTPS_PROXY || global.GLOBAL_AGENT.HTTPS_PROXY; | ||
NO_PROXY = process.env.GLOBAL_AGENT_NO_PROXY ?? process.env.NO_PROXY ?? process.env.no_proxy ?? getNPMConfig("no-proxy", ""); | ||
global.GLOBAL_AGENT.NO_PROXY = NO_PROXY = NO_PROXY || global.GLOBAL_AGENT.NO_PROXY; | ||
} | ||
|
||
export { HTTP_PROXY, HTTPS_PROXY, NO_PROXY }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import libnpmconfig from "libnpmconfig"; | ||
|
||
// helper to retrieve config entries from npm | ||
// --> npm config set easy-ui5_addGhOrg XYZ | ||
let npmConfig; | ||
|
||
export default function getNPMConfig(configName, prefix = "easy-ui5_") { | ||
if (!npmConfig) { | ||
npmConfig = libnpmconfig.read(); | ||
} | ||
return npmConfig && npmConfig[`${prefix}${configName}`]; | ||
} |
Oops, something went wrong.