diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 25ad6adc3..000000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -build/ -test/baselines/ -.eslintrc.js -.prettierrc.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index da8c58021..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,64 +0,0 @@ -module.exports = { - parser: "@typescript-eslint/parser", // Specifies the ESLint parser - parserOptions: { - ecmaVersion: "latest", // Allows for the parsing of modern ECMAScript features - sourceType: "module", // Allows for the use of imports - project: "./tsconfig.json", - }, - extends: [ - "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin - "plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. - ], - plugins: [], - rules: { - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-use-before-define": [ - "error", - { - functions: false, - typedefs: false, - classes: false, - }, - ], - "@typescript-eslint/no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - argsIgnorePattern: "^_", - }, - ], - "@typescript-eslint/explicit-function-return-type": [ - "warn", - { - allowExpressions: true, - allowTypedFunctionExpressions: true, - }, - ], - "@typescript-eslint/no-object-literal-type-assertion": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()! - "@typescript-eslint/no-inferrable-types": [ - "error", - { - ignoreParameters: true, - ignoreProperties: true, - }, - ], - // Avoid runtime imports that are unnecessary - "@typescript-eslint/consistent-type-imports": [ - "error", - { - disallowTypeAnnotations: false, - }, - ], - }, - overrides: [ - { - files: ["*.test.ts"], - rules: { - "@typescript-eslint/explicit-function-return-type": "off", - }, - }, - ], -}; diff --git a/.github/create_pullrequest.ts b/.github/create_pullrequest.ts index 047a40a73..300fbf5cf 100644 --- a/.github/create_pullrequest.ts +++ b/.github/create_pullrequest.ts @@ -11,7 +11,7 @@ const options: AxiosRequestConfig = { method: "POST", }; -(async () => { +void (async () => { // Create PR let createPrResponse: AxiosResponse; diff --git a/.github/create_templates.ts b/.github/create_templates.ts index 2fa911e3d..6a814efc2 100644 --- a/.github/create_templates.ts +++ b/.github/create_templates.ts @@ -13,10 +13,7 @@ function getTemplateDir(templateName: string): string { return path.join(outDir, templateName); } -async function generateTemplates( - templateName: string, - answers: Answers, -): Promise { +async function generateTemplates(templateName: string, answers: Answers): Promise { const files = await createAdapter(answers, ["adapterName", "title"]); const templateDir = getTemplateDir(templateName); @@ -51,6 +48,7 @@ const adapterAnswers: Answers = { adminFeatures: ["custom", "tab"], adminUi: "json", tabReact: "no", + eslintConfig: "official", // Use official ESLint config as default and main rules }; const templates: Record = { @@ -119,15 +117,15 @@ const templates: Record = { }, }; -(async () => { +void (async () => { console.log(); console.log(green("Removing old templates")); console.log(green("======================")); const directories = (await fs.readdir(outDir)) - .filter((entry) => !/^\./.test(entry)) // Don't delete dotfiles/dotdirs - .map((entry) => path.join(outDir, entry)) - .filter((entry) => fs.statSync(entry).isDirectory()); - await Promise.all(directories.map((dir) => fs.remove(dir))); + .filter(entry => !/^\./.test(entry)) // Don't delete dotfiles/dotdirs + .map(entry => path.join(outDir, entry)) + .filter(entry => fs.statSync(entry).isDirectory()); + await Promise.all(directories.map(dir => fs.remove(dir))); console.log(); console.log(green("Creating templates")); @@ -185,15 +183,13 @@ const templates: Record = { } } if (hadError) { - console.error( - red("At least one template had lint or check errors!"), - ); + console.error(red("At least one template had lint or check errors!")); process.exit(1); } } })(); // Make sure errors fail the build -process.on("unhandledRejection", (e) => { +process.on("unhandledRejection", e => { throw e; }); diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index b781eb9a4..e46988fba 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -26,7 +26,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [18.x, 20.x, 22.x, 24.x] + node-version: [20.x, 22.x, 24.x] os: [ubuntu-latest] steps: @@ -42,11 +42,8 @@ jobs: - name: Install dependencies run: npm ci - - name: Run component tests - run: npm t - env: - REQUEST_TIMEOUT: 20000 - TESTING: true + - name: Verify formatting + run: npm run format - name: Lint source code run: npm run lint @@ -54,6 +51,12 @@ jobs: - name: Compile TypeScript code run: npm run build + - name: Run component tests + run: npm t + env: + REQUEST_TIMEOUT: 20000 + TESTING: true + - name: Start the CLI on a production environment run: | npm ci --omit=dev diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index a66503cb8..000000000 --- a/.prettierignore +++ /dev/null @@ -1,8 +0,0 @@ -package.json -package-lock.json -build/ -src/lib/core/licenses.ts -templates/ -test/baselines/ -CHANGELOG.md -.github/**/*.yml diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 995c84027..000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - semi: true, - trailingComma: "all", - singleQuote: false, - printWidth: 80, - useTabs: true, - tabWidth: 4, - endOfLine: "lf", -}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dcdf8688..3168b1ccc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ --> ## __WORK IN PROGRESS__ +* IMPORTANT: The adapter creator requires Node.js 20.x or newer to run! +* (@Apollon77/@copilot) Added option to use official @iobroker/eslint-config with ESLint 9 format as primary configuration (#1186) · [Migration guide](docs/updates/20251012_eslint9_official_config.md) +* (@Apollon77/@copilot) Upgraded custom ESLint configuration to ESLint 9 with flat config format (#1186) · [Migration guide](docs/updates/20251012_eslint9_official_config.md) +* (@Apollon77/@copilot) Add VIS widget ESLint configuration support in main config files (#1186) * (@Apollon77/@copilot) Adapt Dependabot schedule to run on specific day of month between 2-28 (#1200) · [Migration guide](docs/updates/20250102_dependabot_day_schedule.md) * (@hacki11) Support git-ssh in devcontainer (#1136) [Migration guide](docs/updates/20250401_devcontainer_ssh.md) * (@Apollon77/@copilot) Add config.yml to GitHub issue templates with forum link (#1069) · [Migration guide](docs/updates/20250920_github_issue_template_config.md) diff --git a/bin/create-adapter.js b/bin/create-adapter.js old mode 100644 new mode 100755 diff --git a/docs/updates/20251012_eslint9_official_config.md b/docs/updates/20251012_eslint9_official_config.md new file mode 100644 index 000000000..0d222657e --- /dev/null +++ b/docs/updates/20251012_eslint9_official_config.md @@ -0,0 +1,364 @@ +# ESLint 9 with Flat Config and Official ioBroker ESLint Configuration + +ESLint 9 with the new flat config format is now the default for new adapters. You have two migration options: + +## Option 1: Migrate to Official ioBroker ESLint Config (Recommended) + +The official `@iobroker/eslint-config` package provides a standardized, maintained ESLint configuration that includes Prettier integration. This is the recommended approach for most adapters as it ensures consistency across the ioBroker ecosystem and reduces maintenance overhead. + +### Benefits +- Centrally maintained configuration +- Automatic updates with best practices +- Prettier integration included +- Consistent code style across ioBroker adapters +- Less configuration to maintain + +### Step 1: Update dependencies + +Remove old ESLint-related dependencies and add the official config: + +```diff + "devDependencies": { +- "eslint": "^8.x.x", +- "@typescript-eslint/eslint-plugin": "^7.x.x", +- "@typescript-eslint/parser": "^7.x.x", +- "eslint-config-prettier": "^x.x.x", +- "eslint-plugin-prettier": "^x.x.x", ++ "@iobroker/eslint-config": "^2.2.0", + // ... other dependencies + } +``` + +### Step 2: Create eslint.config.mjs + +Replace your `.eslintrc.js` or `.eslintrc.json` with `eslint.config.mjs`: + +**For TypeScript adapters:** +```js +// iobroker eslint configuration +import iobrokerEslintConfig from '@iobroker/eslint-config/iobroker.config.mjs'; + +export default [ + ...iobrokerEslintConfig, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build', + 'dist', + 'admin/build/', + 'admin/words.js', + 'admin/admin.d.ts', + '**/adapter-config.d.ts', + ] + } +]; +``` + +**For JavaScript adapters:** +```js +// iobroker eslint configuration +import iobrokerEslintConfig from '@iobroker/eslint-config/iobroker.config.mjs'; + +export default [ + ...iobrokerEslintConfig, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'admin/words.js', + ] + } +]; +``` + +### Step 3: Create prettier.config.mjs + +If using Prettier, create `prettier.config.mjs`: + +```js +// iobroker prettier configuration file +import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; + +export default { + ...prettierConfig, + // Adjust these to match your preferences: + useTabs: true, // or false for spaces + singleQuote: false, // or true for single quotes +}; +``` + +### Step 4: Update lint script + +Update your `package.json` lint script: + +```diff + "scripts": { +- "lint": "eslint .", ++ "lint": "eslint -c eslint.config.mjs .", + // ... other scripts + } +``` + +### Step 5: Delete old config files + +Remove these files if they exist: +- `.eslintrc.js` or `.eslintrc.json` +- `.eslintignore` (ignores are now in `eslint.config.mjs`) +- `.prettierrc.js` (replaced by `prettier.config.mjs`) + +### Step 6: Update VSCode settings (optional) + +Add Prettier extension to `.vscode/extensions.json` for TypeScript projects: + +```diff + "recommendations": [ + "dbaeumer.vscode-eslint", ++ "esbenp.prettier-vscode", + // ... other extensions + ] +``` + +--- + +## Option 2: Upgrade to ESLint 9 with Custom Configuration + +If you prefer to maintain your own ESLint configuration, you can upgrade to ESLint 9 while keeping full control over your rules. + +### Benefits +- Full control over all ESLint rules +- Custom rule configurations +- Flexibility for project-specific needs + +### Step 1: Update ESLint dependencies + +Upgrade ESLint and related packages to version 9: + +```diff + "devDependencies": { +- "eslint": "^8.x.x", ++ "eslint": "^9.15.0", ++ "@eslint/js": "^9.15.0", +- "@typescript-eslint/eslint-plugin": "^7.x.x", +- "@typescript-eslint/parser": "^7.x.x", ++ "@typescript-eslint/eslint-plugin": "^8.15.0", ++ "@typescript-eslint/parser": "^8.15.0", + // ... other dependencies + } +``` + +### Step 2: Convert to flat config format + +Create `eslint.config.mjs` to replace `.eslintrc.js`: + +**For TypeScript adapters:** +```js +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import globals from 'globals'; + +export default [ + js.configs.recommended, + { + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + globals: { + ...globals.node, + ...globals.mocha, + }, + parserOptions: { + projectService: true, + }, + }, + rules: { + 'prefer-template': 'error', + 'no-unused-vars': 'off', + }, + }, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parser: tseslint.parser, + }, + plugins: { + '@typescript-eslint': tseslint.plugin, + }, + rules: { + ...tseslint.configs.recommended.rules, + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], + }, + }, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build', + 'dist', + 'admin/build/', + 'admin/words.js', + 'admin/admin.d.ts', + '**/adapter-config.d.ts', + ], + }, +]; +``` + +**For JavaScript adapters:** +```js +import js from '@eslint/js'; +import globals from 'globals'; + +export default [ + js.configs.recommended, + { + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + globals: { + ...globals.node, + ...globals.mocha, + }, + }, + rules: { + 'prefer-template': 'error', + 'no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], + }, + }, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'admin/words.js', + ], + }, +]; +``` + +### Step 3: Add globals package + +If you're using globals in your config: + +```bash +npm install --save-dev globals +``` + +### Step 4: Update lint script + +Update your `package.json` lint script: + +```diff + "scripts": { +- "lint": "eslint .", ++ "lint": "eslint -c eslint.config.mjs .", + // ... other scripts + } +``` + +### Step 5: Delete old config files + +Remove these files: +- `.eslintrc.js` or `.eslintrc.json` +- `.eslintignore` (ignores are now in `eslint.config.mjs`) + +### Step 6: Add VIS widget support (if applicable) + +If your adapter includes VIS widgets, add special configuration for them: + +```js +export default [ + // ... your existing config + { + files: ['widgets/**/*.js'], + languageOptions: { + ecmaVersion: 5, + sourceType: 'script', + globals: { + ...globals.browser, + $: 'readonly', + jQuery: 'readonly', + vis: 'readonly', + }, + }, + rules: { + 'no-var': 'off', + 'prefer-const': 'off', + 'prefer-template': 'off', + }, + }, +]; +``` + +--- + +## Common Steps for Both Options + +### Install dependencies + +After updating your `package.json`: + +```bash +npm install +``` + +### Run lint and fix issues + +```bash +npm run lint +``` + +Fix any issues reported. Many can be auto-fixed: + +```bash +npm run lint -- --fix +``` + +### Test your adapter + +Ensure everything still works: + +```bash +npm test +npm run build # for TypeScript adapters +``` + +--- + +## Key Differences in ESLint 9 + +- **Flat config format**: Uses JavaScript modules instead of JSON/commonjs +- **No `.eslintignore`**: Ignores are now part of the config file +- **Different plugin loading**: Plugins are imported and used differently +- **Improved performance**: Faster execution with the new architecture + +## Need Help? + +- [ESLint 9 Migration Guide](https://eslint.org/docs/latest/use/migrate-to-9.0.0) +- [ESLint Flat Config Documentation](https://eslint.org/docs/latest/use/configure/configuration-files) +- [ioBroker Forum](https://forum.iobroker.net) diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..05018aa74 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,36 @@ +// ioBroker eslint configuration file for create-adapter +import iobrokerConfig from "@iobroker/eslint-config"; + +export default [ + ...iobrokerConfig, + + // Specify files to exclude from linting + { + ignores: ["build/", "test/baselines/", ".eslintrc.js", ".prettierrc.js", "node-modules/"], + }, + + // Custom rules for this project + { + rules: { + // Allow require() imports where needed (e.g., conditional requires in tools) + "@typescript-eslint/no-require-imports": "off", + + // TypeScript handles function overloads properly + "no-redeclare": "off", + + // Relax some strict rules for this project + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/require-await": "off", + "jsdoc/no-blank-blocks": "off", + "jsdoc/require-param-description": "off", + + // Allow import() type annotations in specific cases + "@typescript-eslint/consistent-type-imports": [ + "error", + { + disallowTypeAnnotations: false, + }, + ], + }, + }, +]; diff --git a/maintenance/cacheLicenses.ts b/maintenance/cacheLicenses.ts index 92d64a2e2..6714b3150 100644 --- a/maintenance/cacheLicenses.ts +++ b/maintenance/cacheLicenses.ts @@ -22,15 +22,9 @@ const licenseUrls = { const startMarker = "/** BEGIN LICENSES */"; const endMarker = "/** END LICENSES */"; -const licenseCacheFile = path.resolve( - __dirname, - "../src/lib/core/", - "licenses.ts", -); +const licenseCacheFile = path.resolve(__dirname, "../src/lib/core/", "licenses.ts"); -async function loadLicense( - shortName: keyof typeof licenseUrls, -): Promise { +async function loadLicense(shortName: keyof typeof licenseUrls): Promise { try { let options: AxiosRequestConfig = { url: licenseUrls[shortName], @@ -51,22 +45,18 @@ async function loadLicense( } } -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type async function loadLicenses() { const licenses = {} as Record; - for (const shortName of Object.keys( - licenseUrls, - ) as (keyof typeof licenseUrls)[]) { + for (const shortName of Object.keys(licenseUrls) as (keyof typeof licenseUrls)[]) { licenses[shortName] = await loadLicense(shortName); } return licenses; } -(async function main() { +void (async function main() { const argv = await yargs.option("force", { type: "boolean" }).parseAsync(); let templateContent = await fs.readFile(licenseCacheFile, "utf8"); - const startMarkerEnd = - templateContent.indexOf(startMarker) + startMarker.length; + const startMarkerEnd = templateContent.indexOf(startMarker) + startMarker.length; const endMarkerStart = templateContent.indexOf(endMarker); if (endMarkerStart < startMarkerEnd + 100 || !!argv.force) { // < 100 Bytes is not enough for all licenses, so we need to fetch them @@ -77,10 +67,6 @@ async function loadLicenses() { templateContent.substr(endMarkerStart); await fs.writeFile(licenseCacheFile, templateContent, "utf8"); } else { - console.log( - green( - `Licenses are already cached. Run this with the parameter --force to update them`, - ), - ); + console.log(green(`Licenses are already cached. Run this with the parameter --force to update them`)); } })(); diff --git a/maintenance/generateTemplateIndex.ts b/maintenance/generateTemplateIndex.ts index 7a6cd6071..f40908cfe 100644 --- a/maintenance/generateTemplateIndex.ts +++ b/maintenance/generateTemplateIndex.ts @@ -5,35 +5,33 @@ import { enumFilesRecursiveSync } from "../src/lib/tools"; const templateDir = path.join(__dirname, "../templates"); -const allTemplateFiles = enumFilesRecursiveSync( - templateDir, - (name, parentDir) => { - // Don't include the index file - if (name === "index.ts" && parentDir === templateDir) return false; - // Don't include *.raw.* files - if (/\.raw\./.test(name)) return false; - // But include all directories and .ts-files in /templates - const fullName = path.join(parentDir, name); - const isDirectory = fs.statSync(fullName).isDirectory(); - return isDirectory || /\.ts$/.test(name); - }, -); +const allTemplateFiles = enumFilesRecursiveSync(templateDir, (name, parentDir) => { + // Don't include the index file + if (name === "index.ts" && parentDir === templateDir) { + return false; + } + // Don't include *.raw.* files + if (/\.raw\./.test(name)) { + return false; + } + // But include all directories and .ts-files in /templates + const fullName = path.join(parentDir, name); + const isDirectory = fs.statSync(fullName).isDirectory(); + return isDirectory || /\.ts$/.test(name); +}); function normalizePath(file: string): string { return path.relative(templateDir, file).replace(/[\\/]/g, "/"); } function getRequirePath(normalizedPath: string): string { - return "./" + normalizedPath.replace(/\.ts$/, ""); + return `./${normalizedPath.replace(/\.ts$/, "")}`; } const templatePaths = allTemplateFiles .map(normalizePath) - .map((file) => [file, getRequirePath(file)] as [string, string]) - .map( - ([file, req]) => - `\t{ name: "${file}", templateFunction: require("${req}") },`, - ) + .map(file => [file, getRequirePath(file)] as [string, string]) + .map(([file, req]) => `\t{ name: "${file}", templateFunction: require("${req}") },`) .sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())); const indexContent = ` @@ -49,7 +47,4 @@ ${templatePaths.join(os.EOL)} export = templates; `.trimLeft(); -fs.writeFileSync( - path.resolve(__dirname, "../templates", "index.ts"), - indexContent, -); +fs.writeFileSync(path.resolve(__dirname, "../templates", "index.ts"), indexContent); diff --git a/package-lock.json b/package-lock.json index ef2f45da9..09cc7a9cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,65 +9,62 @@ "version": "2.6.5", "license": "MIT", "dependencies": { - "@iobroker/adapter-dev": "^1.4.0", - "@typescript-eslint/parser": "^7.18.0", + "@iobroker/adapter-dev": "^1.5.0", "alcalzone-shared": "^4.0.8", "ansi-colors": "^4.1.3", "axios": "^1.12.2", - "debug": "^4.4.1", + "debug": "^4.4.3", "enquirer": "^2.4.1", - "eslint": "^8.57.1", - "fs-extra": "^11.3.1", + "eslint": "^9.37.0", + "fs-extra": "^11.3.2", "json5": "^2.2.3", "p-limit": "^5.0.0", "prettier": "^3.6.2", - "semver": "^7.7.2", - "typescript": "~5.9.2", + "semver": "^7.7.3", + "typescript": "~5.9.3", "yargs": "^17.7.2" }, "bin": { "create-adapter": "bin/create-adapter.js" }, "devDependencies": { - "@alcalzone/release-script": "^3.8.0", - "@tsconfig/node18": "^18.2.4", + "@alcalzone/release-script": "^4.0.0", + "@iobroker/eslint-config": "^2.2.0", + "@tsconfig/node20": "^20.1.6", "@types/chai": "^4.3.20", "@types/chai-as-promised": "^7.1.8", "@types/debug": "4.1.12", - "@types/eslint": "^8.56.12", + "@types/eslint": "^9.6.1", "@types/fs-extra": "^11.0.4", - "@types/json5": "2.2.0", + "@types/json5": "^2.2.0", "@types/mocha": "^10.0.10", - "@types/node": "^18.19.123", + "@types/node": "^20.19.21", "@types/proxyquire": "^1.3.31", - "@types/semver": "^7.7.0", - "@types/sinon": "^10.0.20", + "@types/semver": "^7.7.1", + "@types/sinon": "^17.0.4", "@types/sinon-chai": "^3.2.12", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^7.18.0", "chai": "^4.5.0", "chai-as-promised": "^7.1.2", "copyfiles": "^2.4.1", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.4", "execa": "^8.0.1", "jsonschema": "^1.5.0", - "mocha": "^11.7.1", + "mocha": "^11.7.4", "proxyquire": "^2.1.3", "rimraf": "^4.4.1", - "sinon": "^15.2.0", + "sinon": "^21.0.0", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", - "tsx": "^4.20.5" + "tsx": "^4.20.6" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@alcalzone/pak": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.10.2.tgz", - "integrity": "sha512-v+kM7HlfIVNLDlGBcbZvrG3yVK3rPLH5kIoGRJbCcoHwpUqQbfEMzXAy1ZrfP+zbI5phHw2PhgrXZr3z6nh7Ow==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.11.0.tgz", + "integrity": "sha512-S6s2Xug8VJ04Xgam7kV+dUydVB2gJmTem+Kr7oxneeXndWddgoQxphQNI9WqgpsifTkonC9wiAbj3qkMFlNeAA==", "dev": true, "license": "MIT", "dependencies": { @@ -190,24 +187,24 @@ } }, "node_modules/@alcalzone/release-script": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-3.8.0.tgz", - "integrity": "sha512-9H3imn8o9n3Ekpkie9TMgPeJfgT6WmklCMtOZ1wuwvMw/obNA0Ao1ZZ8CJfHk1YNjiLGmWn0kQFEGTqz4DoD7w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script/-/release-script-4.0.0.tgz", + "integrity": "sha512-lA6+R/7EBpLCpX2gtgs2YruA3iQ9/XGCTHcHdiSu+Q1yW4CVRJ+fYtqXaIJwasnQMiYnvYiyiMzWLQwQxO3Y8A==", "dev": true, "license": "MIT", "dependencies": { - "@alcalzone/release-script-core": "3.7.0", - "@alcalzone/release-script-plugin-changelog": "3.7.0", - "@alcalzone/release-script-plugin-exec": "3.7.0", - "@alcalzone/release-script-plugin-git": "3.8.0", - "@alcalzone/release-script-plugin-package": "3.7.3", - "@alcalzone/release-script-plugin-version": "3.7.0", - "alcalzone-shared": "^4.0.1", + "@alcalzone/release-script-core": "4.0.0", + "@alcalzone/release-script-plugin-changelog": "4.0.0", + "@alcalzone/release-script-plugin-exec": "4.0.0", + "@alcalzone/release-script-plugin-git": "4.0.0", + "@alcalzone/release-script-plugin-package": "4.0.0", + "@alcalzone/release-script-plugin-version": "4.0.0", + "alcalzone-shared": "^5.0.0", "axios": "^1.6.2", "enquirer": "^2.3.6", "fs-extra": "^10.1.0", "picocolors": "1.0.0", - "semver": "^7.5.2", + "semver": "^7.7.2", "source-map-support": "^0.5.21", "yargs": "^17.4.1" }, @@ -215,20 +212,20 @@ "release-script": "bin/release.js" }, "engines": { - "node": ">=12.20" + "node": ">=18" } }, "node_modules/@alcalzone/release-script-core": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-core/-/release-script-core-3.7.0.tgz", - "integrity": "sha512-4np4dBziwX/aNRhS/gpK8bwa0wpLe7oomzJ7YTUXf5bUtV/UTpN2a9tm5Bp7ElnisKj6N3AqHl4lVXRo4L9hYg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-core/-/release-script-core-4.0.0.tgz", + "integrity": "sha512-vwBhNzsUBpGDCVrL0fAkOkdsxCaGOC43UOgTbB4U27noBgz+J9rscc53DiafKniSyfK6+NgWzHcjwY1vtyvaEQ==", "dev": true, "license": "MIT", "dependencies": { "execa": "^5.1.1" }, "engines": { - "node": ">=12.20" + "node": ">=18" } }, "node_modules/@alcalzone/release-script-core/node_modules/execa": { @@ -328,18 +325,28 @@ } }, "node_modules/@alcalzone/release-script-plugin-changelog": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-changelog/-/release-script-plugin-changelog-3.7.0.tgz", - "integrity": "sha512-AlLOIjIPP42uBmvcdYkfijYDzolyY6JmfbTmdxQDBLyrgYXnuUr2GaKxbpeWSbvcAuUhNvHCAyI6LI90X3OTEg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-changelog/-/release-script-plugin-changelog-4.0.0.tgz", + "integrity": "sha512-jFC8TCTWhFr0dkgFkKRKuEqCTvNqqpTAullbXbOK33oOyBHvsk8M6ma8fOFx3caH1WLQCWwmzt+nr7+Pwx3AqQ==", "dev": true, "license": "MIT", "dependencies": { - "@alcalzone/release-script-core": "3.7.0", - "alcalzone-shared": "^4.0.1", + "@alcalzone/release-script-core": "4.0.0", + "alcalzone-shared": "^5.0.0", "fs-extra": "^10.1.0" }, "engines": { - "node": ">=12.20" + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-changelog/node_modules/alcalzone-shared": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/alcalzone-shared/-/alcalzone-shared-5.0.0.tgz", + "integrity": "sha512-X73hgVWcrIKUUB6jZgHj5flRbTft8AAoJ2MqRKEcAX1whW3OeGkxsQ6ol4nd4/rKxd1eoCRXUGW3cIhXrXU4Sg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" } }, "node_modules/@alcalzone/release-script-plugin-changelog/node_modules/fs-extra": { @@ -358,31 +365,41 @@ } }, "node_modules/@alcalzone/release-script-plugin-exec": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-exec/-/release-script-plugin-exec-3.7.0.tgz", - "integrity": "sha512-ZhlKGhxa71mLyYB1/ojzik2RKcSAeIjuwKzlWRd6oUvKoZPe7eAjLYneXx5viQC6tvDJE4dvN1NlkFGWsSlZYA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-exec/-/release-script-plugin-exec-4.0.0.tgz", + "integrity": "sha512-STEQrbI91p+ZklKrSQq9obJ/OWMNC8U9GGYyy0Z36gMkfBTWYPu6B9aF+dMCBRdHvvacrvvMaux/uirt9EH3tQ==", "dev": true, "license": "MIT", "dependencies": { - "@alcalzone/release-script-core": "3.7.0", - "alcalzone-shared": "^4.0.1" + "@alcalzone/release-script-core": "4.0.0", + "alcalzone-shared": "^5.0.0" }, "engines": { - "node": ">=12.20" + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-exec/node_modules/alcalzone-shared": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/alcalzone-shared/-/alcalzone-shared-5.0.0.tgz", + "integrity": "sha512-X73hgVWcrIKUUB6jZgHj5flRbTft8AAoJ2MqRKEcAX1whW3OeGkxsQ6ol4nd4/rKxd1eoCRXUGW3cIhXrXU4Sg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" } }, "node_modules/@alcalzone/release-script-plugin-git": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-git/-/release-script-plugin-git-3.8.0.tgz", - "integrity": "sha512-rI9EqSmvMWaNZ5xxOUBZjD4WOv1Enl+/ZxhUoTROq+K/9RYYHQaAXilGWNvnz2DYr14Q+Yx/fs54GXgAVf0scg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-git/-/release-script-plugin-git-4.0.0.tgz", + "integrity": "sha512-MYNDC/fQxoNsAjaeikGtIpeBUT9+qyyGGZ1V6UQ+U6Rr59gwbSHo9G/ifstx17FpDFPoZYg7ew899LV1hvUrrQ==", "dev": true, "license": "MIT", "dependencies": { - "@alcalzone/release-script-core": "3.7.0", + "@alcalzone/release-script-core": "4.0.0", "fs-extra": "^10.1.0" }, "engines": { - "node": ">=12.20" + "node": ">=18" } }, "node_modules/@alcalzone/release-script-plugin-git/node_modules/fs-extra": { @@ -401,20 +418,30 @@ } }, "node_modules/@alcalzone/release-script-plugin-package": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-package/-/release-script-plugin-package-3.7.3.tgz", - "integrity": "sha512-5oKSwbvHs9jRhARJ04eQ7xqig3a7NmPJlhtBxAqUM8+0cjs2g/V1xTxM6o8aZ09uRSdq80YGVxJm871SyszAWQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-package/-/release-script-plugin-package-4.0.0.tgz", + "integrity": "sha512-Abxl9Ix/UtAvQTW3dzxHvl7L1ONigxV924KH6HIeqsOe/m2geeKTekbMxz76+EkBDusckKHWUq9pQWKOPv2ZNQ==", "dev": true, "license": "MIT", "dependencies": { - "@alcalzone/pak": "^0.10.1", - "@alcalzone/release-script-core": "3.7.0", - "alcalzone-shared": "^4.0.1", + "@alcalzone/pak": "^0.11.0", + "@alcalzone/release-script-core": "4.0.0", + "alcalzone-shared": "^5.0.0", "fs-extra": "^10.1.0", - "semver": "^7.5.2" + "semver": "^7.7.2" }, "engines": { - "node": ">=12.20" + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-package/node_modules/alcalzone-shared": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/alcalzone-shared/-/alcalzone-shared-5.0.0.tgz", + "integrity": "sha512-X73hgVWcrIKUUB6jZgHj5flRbTft8AAoJ2MqRKEcAX1whW3OeGkxsQ6ol4nd4/rKxd1eoCRXUGW3cIhXrXU4Sg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" } }, "node_modules/@alcalzone/release-script-plugin-package/node_modules/fs-extra": { @@ -433,20 +460,30 @@ } }, "node_modules/@alcalzone/release-script-plugin-version": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-version/-/release-script-plugin-version-3.7.0.tgz", - "integrity": "sha512-030NGQeB+mglVz/58cx0WO4QiFChaSd/pz35mnOrUc9PbKWRpzisTVOt4IhCV/++YiAVibJO31NMNzvipPdx4Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@alcalzone/release-script-plugin-version/-/release-script-plugin-version-4.0.0.tgz", + "integrity": "sha512-ZbgGum7M1X0paDFYtcrlZRptPXy4SPqMDAZU6JgU/JSmifBSvuwEJpF42vt5POICrz3FkEmNUUdp9pZ44gYFXQ==", "dev": true, "license": "MIT", "dependencies": { - "@alcalzone/release-script-core": "3.7.0", - "alcalzone-shared": "^4.0.1", + "@alcalzone/release-script-core": "4.0.0", + "alcalzone-shared": "^5.0.0", "fs-extra": "^10.1.0", - "semver": "^7.5.2", + "semver": "^7.7.2", "tiny-glob": "^0.2.9" }, "engines": { - "node": ">=12.20" + "node": ">=18" + } + }, + "node_modules/@alcalzone/release-script-plugin-version/node_modules/alcalzone-shared": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/alcalzone-shared/-/alcalzone-shared-5.0.0.tgz", + "integrity": "sha512-X73hgVWcrIKUUB6jZgHj5flRbTft8AAoJ2MqRKEcAX1whW3OeGkxsQ6ol4nd4/rKxd1eoCRXUGW3cIhXrXU4Sg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" } }, "node_modules/@alcalzone/release-script-plugin-version/node_modules/fs-extra": { @@ -464,6 +501,16 @@ "node": ">=12" } }, + "node_modules/@alcalzone/release-script/node_modules/alcalzone-shared": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/alcalzone-shared/-/alcalzone-shared-5.0.0.tgz", + "integrity": "sha512-X73hgVWcrIKUUB6jZgHj5flRbTft8AAoJ2MqRKEcAX1whW3OeGkxsQ6ol4nd4/rKxd1eoCRXUGW3cIhXrXU4Sg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/@alcalzone/release-script/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -479,6 +526,35 @@ "node": ">=12" } }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.56.0.tgz", + "integrity": "sha512-c6EW+aA1w2rjqOMjbL93nZlwxp6c1Ln06vTYs5FjRRhmJXK8V/OrSXdT+pUr4aRYgjCgu8/OkiZr0tzeVrRSbw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "^1.0.8", + "@typescript-eslint/types": "^8.42.0", + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~5.1.0" + }, + "engines": { + "node": ">=20.11.0" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", @@ -896,9 +972,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" @@ -922,16 +998,76 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", + "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.0.tgz", + "integrity": "sha512-WUFvV4WoIwW8Bv0KeKCIIEgdSiFOsulyN0xrMu+7z43q/hkOLXjvb5u7UC9jDxvRzcrbEmuZBX5yJZz1741jog==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.16.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz", + "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==", + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -939,7 +1075,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -955,6 +1091,27 @@ "concat-map": "0.0.1" } }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -968,12 +1125,37 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "version": "9.37.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.37.0.tgz", + "integrity": "sha512-jaS+NJ+hximswBG6pjNX0uEJZkrT0zwpVi3BA3vX22aFGjJjmgSTSmPpZCRKmoBL5VY/M6p0xsSJx7rk7sy5gg==", "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.0.tgz", + "integrity": "sha512-sB5uyeq+dwCWyPi31B2gQlVlo+j5brPlWx4yZBrEaRo/nhdDE8Xke1gsGgtiBdaBTxuTkceLVuVt/pclrasb0A==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.16.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@esm2cjs/execa": { @@ -1090,23 +1272,32 @@ } }, "node_modules/@google-cloud/common": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-5.0.2.tgz", - "integrity": "sha512-V7bmBKYQyu0eVG2BFejuUjlBt+zrya6vtsKdY+JxMM/dNntPF41vZ9+LhOshEUH01zOHEqBSvI7Dad7ZS6aUeA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-6.0.0.tgz", + "integrity": "sha512-IXh04DlkLMxWgYLIUYuHHKXKOUwPDzDgke1ykkkJPe48cGIS9kkL2U/o0pm4ankHLlvzLF/ma1eO86n/bkumIA==", "license": "Apache-2.0", "dependencies": { "@google-cloud/projectify": "^4.0.0", "@google-cloud/promisify": "^4.0.0", - "arrify": "^2.0.1", - "duplexify": "^4.1.1", + "arrify": "^2.0.0", + "duplexify": "^4.1.3", "extend": "^3.0.2", - "google-auth-library": "^9.0.0", + "google-auth-library": "^10.0.0-rc.1", "html-entities": "^2.5.2", - "retry-request": "^7.0.0", - "teeny-request": "^9.0.0" + "retry-request": "^8.0.0", + "teeny-request": "^10.0.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" + } + }, + "node_modules/@google-cloud/common/node_modules/@google-cloud/promisify": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.1.0.tgz", + "integrity": "sha512-G/FQx5cE/+DqBbOpA5jKsegGwdPniU6PuIEMt+qxWgFxvxuFOzVmp6zYchtYuwAWV5/8Dgs0yAmjvNZv3uXLQg==", + "license": "Apache-2.0", + "engines": { + "node": ">=18" } }, "node_modules/@google-cloud/projectify": { @@ -1119,38 +1310,38 @@ } }, "node_modules/@google-cloud/promisify": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-4.1.0.tgz", - "integrity": "sha512-G/FQx5cE/+DqBbOpA5jKsegGwdPniU6PuIEMt+qxWgFxvxuFOzVmp6zYchtYuwAWV5/8Dgs0yAmjvNZv3uXLQg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-5.0.0.tgz", + "integrity": "sha512-N8qS6dlORGHwk7WjGXKOSsLjIjNINCPicsOX6gyyLiYk7mq3MtII96NZ9N2ahwA2vnkLmZODOIH9rlNniYWvCQ==", "license": "Apache-2.0", "engines": { "node": ">=18" } }, "node_modules/@google-cloud/translate": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/@google-cloud/translate/-/translate-8.5.1.tgz", - "integrity": "sha512-xqIRV+lTaszgPHw0ulUQ3CUhnbPnsnYlh90mBh3PomU5SUGRlJc5bjN0UEP6MICnrj3AugxYQSelNn+rxGj2Ig==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@google-cloud/translate/-/translate-9.2.0.tgz", + "integrity": "sha512-LBKoXMXsM6jyqD9RDO74E3Q8uUn9TWy7YwIrF+WS4I9erdI+VZHxmdffi4sFfQ196FeprfwMMAFa8Oy6u7G8xw==", "license": "Apache-2.0", "dependencies": { - "@google-cloud/common": "^5.0.0", - "@google-cloud/promisify": "^4.0.0", + "@google-cloud/common": "^6.0.0", + "@google-cloud/promisify": "^5.0.0", "arrify": "^2.0.0", "extend": "^3.0.2", - "google-gax": "^4.0.3", + "google-gax": "^5.0.0", "is-html": "^2.0.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } }, "node_modules/@grpc/grpc-js": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.13.4.tgz", - "integrity": "sha512-GsFaMXCkMqkKIvwCQjCrwH+GHbPKBjhwo/8ZuUkWHqbI73Kky9I+pQltrlT0+MWpedCoosda53lgjYfyEPgxBg==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.0.tgz", + "integrity": "sha512-N8Jx6PaYzcTRNzirReJCtADVoq4z7+1KQ4E70jTg/koQiMoUSN1kbNjPOqpPbhMFhfU1/l7ixspPl8dNY+FoUg==", "license": "Apache-2.0", "dependencies": { - "@grpc/proto-loader": "^0.7.13", + "@grpc/proto-loader": "^0.8.0", "@js-sdsl/ordered-map": "^4.4.2" }, "engines": { @@ -1158,14 +1349,14 @@ } }, "node_modules/@grpc/proto-loader": { - "version": "0.7.15", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.15.tgz", - "integrity": "sha512-tMXdRCfYVixjuFK+Hk0Q1s38gV9zDiDJfWL3h1rv4Qc39oILCu1TRTDt7+fGUI8K4G1Fj125Hx/ru3azECWTyQ==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.0.tgz", + "integrity": "sha512-rc1hOQtjIWGxcxpb9aHAfLpIctjEnsDehj0DAiVfBlmT84uvR0uUtN2hEi/ecvWVjXUGf5qPF4qEgiLOx1YIMQ==", "license": "Apache-2.0", "dependencies": { "lodash.camelcase": "^4.3.0", "long": "^5.0.0", - "protobufjs": "^7.2.5", + "protobufjs": "^7.5.3", "yargs": "^17.7.2" }, "bin": { @@ -1175,41 +1366,26 @@ "node": ">=6" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "node": ">=18.18.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "license": "ISC", + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "license": "Apache-2.0", "dependencies": { - "brace-expansion": "^1.1.7" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" }, "engines": { - "node": "*" + "node": ">=18.18.0" } }, "node_modules/@humanwhocodes/module-importer": { @@ -1225,27 +1401,35 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "license": "BSD-3-Clause" + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@iobroker/adapter-dev": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@iobroker/adapter-dev/-/adapter-dev-1.4.0.tgz", - "integrity": "sha512-ZmZA+hiqURuD24aY92jyDsBX1LAx2bU9Q/T5peb3OjSbLSZoLId7hvhvX2bp6rnAx/NE8DfPRmX7qT0M+rn0gw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@iobroker/adapter-dev/-/adapter-dev-1.5.0.tgz", + "integrity": "sha512-L1FhO7oxaz4hNMobvgbanSGyn2LaCESGKqPPJhXWU00vVEw5Cc166xdnU63Dk+JDnV5zl/HzOcFANGisETAWIg==", "license": "MIT", "dependencies": { "@esm2cjs/execa": "^6.1.1-cjs.1", - "@google-cloud/translate": "^8.5.0", + "@google-cloud/translate": "^9.2.0", "ansi-colors": "^4.1.3", - "axios": "^1.7.9", - "esbuild": "^0.25.0", - "fs-extra": "^11.3.0", + "axios": "^1.11.0", + "deepl-node": "^1.19.0", + "esbuild": "^0.25.9", + "fs-extra": "^11.3.1", + "rimraf": "^5.0.10", "tiny-glob": "^0.2.9", - "yargs": "^17.7.2" + "yargs": "^18.0.0" }, "bin": { "build-adapter": "bin/build-adapter.js", @@ -1256,29 +1440,10 @@ "node": ">=16.0.0" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz", - "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", - "dev": true, + "node_modules/@iobroker/adapter-dev/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "license": "MIT", "engines": { "node": ">=12" @@ -1287,11 +1452,10 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, + "node_modules/@iobroker/adapter-dev/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "license": "MIT", "engines": { "node": ">=12" @@ -1300,18 +1464,219 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, + "node_modules/@iobroker/adapter-dev/node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/emoji-regex": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.5.0.tgz", + "integrity": "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==", "license": "MIT" }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "node_modules/@iobroker/adapter-dev/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/yargs": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "license": "MIT", + "dependencies": { + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^7.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/@iobroker/adapter-dev/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/@iobroker/eslint-config": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@iobroker/eslint-config/-/eslint-config-2.2.0.tgz", + "integrity": "sha512-89U2d81BUrReVgVFUJwjxYsHSbvjAt8w8OoKavtNp//wkG7JU4n/VnISMEvQqaQt7i0sWc/xSx27TYDx9FXAYg==", "dev": true, + "peerDependencies": { + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "^9.34.0", + "@typescript-eslint/eslint-plugin": "^8.40.0", + "@typescript-eslint/parser": "^8.40.0", + "eslint": ">=9.32.0", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-import": "^2.30.0", + "eslint-plugin-jsdoc": "^54.1.1", + "eslint-plugin-prettier": "^5.5.4", + "eslint-plugin-react": "^7.37.5", + "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-unicorn": "^60.0.0", + "globals": "^16.3.0", + "prettier": ">=3.6.2", + "typescript-eslint": "^8.40.0" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.0.tgz", + "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", @@ -1329,7 +1694,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" @@ -1345,7 +1709,6 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", @@ -1373,7 +1736,9 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1386,7 +1751,9 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 8" } @@ -1395,7 +1762,9 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1408,7 +1777,6 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, "license": "MIT", "optional": true, "engines": { @@ -1421,6 +1789,7 @@ "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -1492,6 +1861,14 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "license": "BSD-3-Clause" }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", @@ -1513,13 +1890,13 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^3.0.0" + "@sinonjs/commons": "^3.0.1" } }, "node_modules/@sinonjs/samsam": { @@ -1533,13 +1910,6 @@ "type-detect": "^4.1.0" } }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", - "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", - "dev": true, - "license": "(Unlicense OR Apache-2.0)" - }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -1549,19 +1919,13 @@ "node": ">= 10" } }, - "node_modules/@tsconfig/node18": { - "version": "18.2.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.4.tgz", - "integrity": "sha512-5xxU8vVs9/FNcvm3gE07fPbn9tl6tqGGWA9tSlwsUEkBxtRnTsNmwrV8gasZ9F/EobaSv9+nu8AxUKccw77JpQ==", + "node_modules/@tsconfig/node20": { + "version": "20.1.6", + "resolved": "https://registry.npmjs.org/@tsconfig/node20/-/node20-20.1.6.tgz", + "integrity": "sha512-sz+Hqx9zwZDpZIV871WSbUzSqNIsXzghZydypnfgzPKLltVJfkINfUeTct31n/tTSa9ZE1ZOfKdRre1uHHquYQ==", "dev": true, "license": "MIT" }, - "node_modules/@types/caseless": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", - "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", - "license": "MIT" - }, "node_modules/@types/chai": { "version": "4.3.20", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz", @@ -1590,9 +1954,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.12", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz", - "integrity": "sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", "dev": true, "license": "MIT", "dependencies": { @@ -1604,7 +1968,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, "license": "MIT" }, "node_modules/@types/fs-extra": { @@ -1622,7 +1985,6 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, "license": "MIT" }, "node_modules/@types/json5": { @@ -1646,12 +2008,6 @@ "@types/node": "*" } }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", - "license": "MIT" - }, "node_modules/@types/mocha": { "version": "10.0.10", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", @@ -1667,12 +2023,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "18.19.123", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.123.tgz", - "integrity": "sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==", + "version": "20.19.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.21.tgz", + "integrity": "sha512-CsGG2P3I5y48RPMfprQGfy4JPRZ6csfC3ltBZSRItG3ngggmNY/qs2uZKp4p9VbrpqNNSMzUZNFZKzgOGnd/VA==", "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.21.0" } }, "node_modules/@types/proxyquire": { @@ -1682,46 +2038,17 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/request": { - "version": "2.48.13", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.13.tgz", - "integrity": "sha512-FGJ6udDNUCjd19pp0Q3iTiDkwhYup7J8hpMW9c4k53NrccQFFWKRho6hvtPPEhnXWKvukfwAlB6DbDz4yhH5Gg==", - "license": "MIT", - "dependencies": { - "@types/caseless": "*", - "@types/node": "*", - "@types/tough-cookie": "*", - "form-data": "^2.5.5" - } - }, - "node_modules/@types/request/node_modules/form-data": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", - "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.35", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/@types/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", "dev": true, "license": "MIT" }, "node_modules/@types/sinon": { - "version": "10.0.20", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.20.tgz", - "integrity": "sha512-2APKKruFNCAZgx3daAyACGzWuJ028VVCUDk6o2rw/Z4PXT0ogwdV4KUegW0MwVs0Zu59auPXbbuBJHF12Sx1Eg==", + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.4.tgz", + "integrity": "sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==", "dev": true, "license": "MIT", "dependencies": { @@ -1746,12 +2073,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/tough-cookie": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", - "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", - "license": "MIT" - }, "node_modules/@types/yargs": { "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", @@ -1770,119 +2091,157 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", - "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.0.tgz", + "integrity": "sha512-hA8gxBq4ukonVXPy0OKhiaUh/68D0E88GSmtC1iAEnGaieuDi38LhS7jdCHRLi6ErJBNDGCzvh5EnzdPwUc0DA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/type-utils": "7.18.0", - "@typescript-eslint/utils": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/type-utils": "8.46.0", + "@typescript-eslint/utils": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "graphemer": "^1.4.0", - "ignore": "^5.3.1", + "ignore": "^7.0.0", "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", - "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", - "license": "BSD-2-Clause", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.0.tgz", + "integrity": "sha512-n1H6IcDhmmUEG7TNVSspGmiHHutt7iVKtZwRppD7e04wha5MrkV1h3pti9xQLcCMt6YWsncpoT0HMjkH1FNwWQ==", + "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.0.tgz", + "integrity": "sha512-OEhec0mH+U5Je2NZOeK1AbVCdm0ChyapAyTeXVIYTPXDJ3F07+cu87PPXcGoYqZ7M9YJVvFnfpGg1UmCIqM+QQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.46.0", + "@typescript-eslint/types": "^8.46.0", + "debug": "^4.3.4" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.0.tgz", + "integrity": "sha512-lWETPa9XGcBes4jqAMYD9fW0j4n6hrPtTJwWDmtqgFO/4HF4jmdH/Q6wggTw5qIT5TXjKzbt7GsZUBnWoO3dqw==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.0.tgz", + "integrity": "sha512-WrYXKGAHY836/N7zoK/kzi6p8tXFhasHh8ocFL9VZSAkvH956gfeRfcnhs3xzRy8qQ/dq3q44v1jvQieMFg2cw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", - "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.0.tgz", + "integrity": "sha512-hy+lvYV1lZpVs2jRaEYvgCblZxUoJiPyCemwbQZ+NGulWkQRy0HRPYAoef/CNSzaLt+MLvMptZsHXHlkEilaeg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/utils": "8.46.0", "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.0.tgz", + "integrity": "sha512-bHGGJyVjSE4dJJIO5yyEWt/cHyNwga/zXGJbJJ8TiO01aVREK6gCTu3L+5wrkb1FbDkQ+TKjMNe9R/QQQP9+rA==", + "dev": true, "license": "MIT", + "peer": true, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1890,89 +2249,91 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", - "license": "BSD-2-Clause", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.0.tgz", + "integrity": "sha512-ekDCUfVpAKWJbRfm8T1YRrCot1KFxZn21oV76v5Fj4tr7ELyk84OS+ouvYdcDAwZL89WpEkEj2DKQ+qg//+ucg==", + "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/project-service": "8.46.0", + "@typescript-eslint/tsconfig-utils": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.0.tgz", + "integrity": "sha512-nD6yGWPj1xiOm4Gk0k6hLSZz2XkNXhuYmyIrOWcHoPuAhjT9i5bAG+xbWPgFeNR8HPHHtpNKdYUXJl/D3x7f5g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.0.tgz", + "integrity": "sha512-FrvMpAK+hTbFy7vH5j1+tMYHMSKLE6RzluFJlkFNKD0p9YsUT75JlBSmr5so3QRzvMwU5/bIEdeNrxm8du8l3Q==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "@typescript-eslint/types": "7.18.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.46.0", + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", - "license": "ISC" - }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, "engines": { - "node": ">=6.5" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/acorn": { @@ -1996,6 +2357,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/adm-zip": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz", + "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==", + "license": "MIT", + "engines": { + "node": ">=12.0" + } + }, "node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", @@ -2066,19 +2436,189 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "license": "Python-2.0" }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/arrify": { @@ -2100,12 +2640,40 @@ "node": "*" } }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/axios": { "version": "1.12.2", "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", @@ -2143,6 +2711,17 @@ ], "license": "MIT" }, + "node_modules/baseline-browser-mapping": { + "version": "2.8.16", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.16.tgz", + "integrity": "sha512-OMu3BGQ4E7P1ErFsIPpbJh0qvDudM/UuJeHgkAvfWe+0HFJCXh+t/l8L6fVLR55RI/UbKrVLnAXZSVwd9ysWYw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, "node_modules/bignumber.js": { "version": "9.3.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", @@ -2165,7 +2744,9 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -2180,6 +2761,41 @@ "dev": true, "license": "ISC" }, + "node_modules/browserslist": { + "version": "4.26.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.3.tgz", + "integrity": "sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.8.9", + "caniuse-lite": "^1.0.30001746", + "electron-to-chromium": "^1.5.227", + "node-releases": "^2.0.21", + "update-browserslist-db": "^1.1.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -2193,6 +2809,40 @@ "dev": true, "license": "MIT" }, + "node_modules/builtin-modules": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.0.0.tgz", + "integrity": "sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -2206,6 +2856,24 @@ "node": ">= 0.4" } }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2228,6 +2896,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001750", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001750.tgz", + "integrity": "sha512-cuom0g5sdX6rw00qOoLNSFCJ9/mYIsuSOA+yzpDw8eopiFqcVwQvZHqov0vmEighRxX++cfC0Vg1G+1Iy/mSpQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0", + "peer": true + }, "node_modules/chai": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", @@ -2276,6 +2966,14 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", @@ -2305,6 +3003,48 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/clean-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", + "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/clean-regexp/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2349,6 +3089,17 @@ "node": ">= 0.8" } }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2430,6 +3181,21 @@ "node": ">=10" } }, + "node_modules/core-js-compat": { + "version": "3.46.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.46.0.tgz", + "integrity": "sha512-p9hObIIEENxSV8xIu+V68JjSeARg6UVMG5mR+JEUguG3sI6MsiS1njz2jHmyJDvA+8jX/sytkBHup6kxhM9law==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "browserslist": "^4.26.3" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -2451,27 +3217,93 @@ "node": ">= 8" } }, - "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">= 12" } }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, "license": "MIT", "engines": { @@ -2500,6 +3332,77 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "license": "MIT" }, + "node_modules/deepl-node": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/deepl-node/-/deepl-node-1.20.0.tgz", + "integrity": "sha512-2MNJgJgQQWHAieaKYJyxYe1g21P8MYOtMbcS7ApyBHT8856c6EYO9RRNevodGaIf0oiKMzwyenJ59O7B0NQyGw==", + "license": "MIT", + "dependencies": { + "@types/node": ">=12.0", + "adm-zip": "^0.5.16", + "axios": "^1.7.4", + "form-data": "^3.0.0", + "loglevel": ">=1.6.2", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=12.0" + } + }, + "node_modules/deepl-node/node_modules/form-data": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.4.tgz", + "integrity": "sha512-f0cRzm6dkyVYV3nPoooP8XlccPQukegwhAnpoLcXy+X+A8KfpGOoXwDr9FLZd3wzgLaBGQBE3lY93Zm/i1JvIQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2510,37 +3413,27 @@ } }, "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "esutils": "^2.0.2" }, "engines": { - "node": ">=6.0.0" + "node": ">=0.10.0" } }, "node_modules/dunder-proto": { @@ -2573,7 +3466,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, "license": "MIT" }, "node_modules/ecdsa-sig-formatter": { @@ -2585,6 +3477,14 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/electron-to-chromium": { + "version": "1.5.234", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.234.tgz", + "integrity": "sha512-RXfEp2x+VRYn8jbKfQlRImzoJU01kyDvVPBmG39eU2iuRVhuS6vQNocB8J0/8GrIMLnPzgz4eW6WiRnJkTuNWg==", + "dev": true, + "license": "ISC", + "peer": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2613,6 +3513,76 @@ "node": ">=8.6" } }, + "node_modules/es-abstract": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", + "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -2631,6 +3601,35 @@ "node": ">= 0.4" } }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-object-atoms": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", @@ -2658,6 +3657,39 @@ "node": ">= 0.4" } }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/esbuild": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", @@ -2721,59 +3753,63 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "version": "9.37.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.37.0.tgz", + "integrity": "sha512-XyLmROnACWqSxiGYArdef1fItQd47weqB7iwtfr9JHwRrqIXZdcFMvvEcL9xHCmL0SNsOvF0c42lWyM1U5dgig==", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.0", + "@eslint/config-helpers": "^0.4.0", + "@eslint/core": "^0.16.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.37.0", + "@eslint/plugin-kit": "^0.4.0", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -2782,6 +3818,7 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -2792,76 +3829,431 @@ "eslint": ">=7.0.0" } }, - "node_modules/eslint-plugin-prettier": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", - "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.11.7" + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", + "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^3.2.7" }, "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint-plugin-prettier" - }, - "peerDependencies": { - "@types/eslint": ">=8.0.0", - "eslint": ">=8.0.0", - "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", - "prettier": ">=3.0.0" + "node": ">=4" }, "peerDependenciesMeta": { - "@types/eslint": { - "optional": true - }, - "eslint-config-prettier": { + "eslint": { "optional": true } } }, - "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "license": "BSD-2-Clause", + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "ms": "^2.1.1" } }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "license": "Apache-2.0", + "node_modules/eslint-plugin-import": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", + "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.9", + "array.prototype.findlastindex": "^1.2.6", + "array.prototype.flat": "^1.3.3", + "array.prototype.flatmap": "^1.3.3", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.1", + "hasown": "^2.0.2", + "is-core-module": "^2.16.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.1", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.9", + "tsconfig-paths": "^3.15.0" + }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=4" }, - "funding": { - "url": "https://opencollective.com/eslint" + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, - "node_modules/eslint/node_modules/brace-expansion": { + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "node_modules/eslint/node_modules/minimatch": { + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-jsdoc": { + "version": "54.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-54.7.0.tgz", + "integrity": "sha512-u5Na4he2+6kY1rWqxzbQaAwJL3/tDCuT5ElDRc5UJ9stOeQeQ5L1JJ1kRRu7ldYMlOHMCJLsY8Mg/Tu3ExdZiQ==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.56.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.4.1", + "escape-string-regexp": "^4.0.0", + "espree": "^10.4.0", + "esquery": "^1.6.0", + "parse-imports-exports": "^0.2.4", + "semver": "^7.7.2", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=20.11.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.11.7" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.37.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", + "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.9", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz", + "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-react/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-unicorn": { + "version": "60.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-60.0.0.tgz", + "integrity": "sha512-QUzTefvP8stfSXsqKQ+vBQSEsXIlAiCduS/V1Em+FKgL9c21U/IIm20/e3MFy1jyCf14tHAhqC1sX8OTy6VUCg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "@eslint-community/eslint-utils": "^4.7.0", + "@eslint/plugin-kit": "^0.3.3", + "change-case": "^5.4.4", + "ci-info": "^4.3.0", + "clean-regexp": "^1.0.0", + "core-js-compat": "^3.44.0", + "esquery": "^1.6.0", + "find-up-simple": "^1.0.1", + "globals": "^16.3.0", + "indent-string": "^5.0.0", + "is-builtin-module": "^5.0.0", + "jsesc": "^3.1.0", + "pluralize": "^8.0.0", + "regexp-tree": "^0.1.27", + "regjsparser": "^0.12.0", + "semver": "^7.7.2", + "strip-indent": "^4.0.0" + }, + "engines": { + "node": "^20.10.0 || >=21.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" + }, + "peerDependencies": { + "eslint": ">=9.29.0" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/@eslint/core": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", + "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/@eslint/plugin-kit": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", + "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@eslint/core": "^0.15.2", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", @@ -2874,17 +4266,29 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -2932,15 +4336,6 @@ "node": ">=0.10.0" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -3008,13 +4403,16 @@ "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -3030,7 +4428,9 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "license": "ISC", + "peer": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -3054,21 +4454,46 @@ "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, "license": "ISC", + "peer": true, "dependencies": { "reusify": "^1.0.4" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-keys": { @@ -3089,7 +4514,9 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3113,6 +4540,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-up-simple": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", + "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -3124,33 +4565,16 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=16" } }, "node_modules/flatted": { @@ -3179,11 +4603,27 @@ } } }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", @@ -3200,7 +4640,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "license": "ISC", "engines": { "node": ">=14" @@ -3225,10 +4664,22 @@ "node": ">= 6" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/fs-extra": { - "version": "11.3.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.1.tgz", - "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", + "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", @@ -3243,6 +4694,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -3269,46 +4721,76 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gaxios": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", - "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", - "license": "Apache-2.0", + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "extend": "^3.0.2", - "https-proxy-agent": "^7.0.1", - "is-stream": "^2.0.0", - "node-fetch": "^2.6.9", - "uuid": "^9.0.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { - "node": ">=14" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gaxios/node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, "license": "MIT", - "engines": { - "node": ">=8" - }, + "peer": true, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gaxios": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.2.tgz", + "integrity": "sha512-/Szrn8nr+2TsQT1Gp8iIe/BEytJmbyfrbFh419DfGQSkEgNEhbPi7JRJuughjkTzPWgU9gBQf5AVu3DbHt0OXA==", + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "node-fetch": "^3.3.2" + }, + "engines": { + "node": ">=18" } }, "node_modules/gcp-metadata": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.1.tgz", - "integrity": "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz", + "integrity": "sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ==", "license": "Apache-2.0", "dependencies": { - "gaxios": "^6.1.1", - "google-logging-utils": "^0.0.2", + "gaxios": "^7.0.0", + "google-logging-utils": "^1.0.0", "json-bigint": "^1.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" } }, "node_modules/get-caller-file": { @@ -3320,6 +4802,18 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", @@ -3379,6 +4873,25 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-tsconfig": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz", @@ -3397,6 +4910,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -3429,6 +4943,7 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -3439,6 +4954,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -3448,46 +4964,43 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz", + "integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==", + "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, + "peer": true, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globalyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", - "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", - "license": "MIT" - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" + "define-properties": "^1.2.1", + "gopd": "^1.0.1" }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/globalyzer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", + "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", + "license": "MIT" + }, "node_modules/globrex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", @@ -3495,49 +5008,48 @@ "license": "MIT" }, "node_modules/google-auth-library": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.15.1.tgz", - "integrity": "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.4.0.tgz", + "integrity": "sha512-CmIrSy1bqMQUsPmA9+hcSbAXL80cFhu40cGMUjCaLpNKVzzvi+0uAHq8GNZxkoGYIsTX4ZQ7e4aInAqWxgn4fg==", "license": "Apache-2.0", "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", - "gaxios": "^6.1.1", - "gcp-metadata": "^6.1.0", - "gtoken": "^7.0.0", + "gaxios": "^7.0.0", + "gcp-metadata": "^7.0.0", + "google-logging-utils": "^1.0.0", + "gtoken": "^8.0.0", "jws": "^4.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/google-gax": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-4.6.1.tgz", - "integrity": "sha512-V6eky/xz2mcKfAd1Ioxyd6nmA61gao3n01C+YeuIwu3vzM9EDR6wcVzMSIbLMDXWeoi9SHYctXuKYC5uJUT3eQ==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-5.0.4.tgz", + "integrity": "sha512-HmQ6zIYBs2EikTk+kjeHmtHprNTEpsnVaKONw9cwZZwUNCkUb+D5RYrJpCxyjdvIDvJp3wLbVReolJLRZRms1g==", "license": "Apache-2.0", "dependencies": { - "@grpc/grpc-js": "^1.10.9", - "@grpc/proto-loader": "^0.7.13", - "@types/long": "^4.0.0", - "abort-controller": "^3.0.0", - "duplexify": "^4.0.0", - "google-auth-library": "^9.3.0", - "node-fetch": "^2.7.0", + "@grpc/grpc-js": "^1.12.6", + "@grpc/proto-loader": "^0.8.0", + "duplexify": "^4.1.3", + "google-auth-library": "^10.1.0", + "google-logging-utils": "^1.1.1", + "node-fetch": "^3.3.2", "object-hash": "^3.0.0", - "proto3-json-serializer": "^2.0.2", - "protobufjs": "^7.3.2", - "retry-request": "^7.0.0", - "uuid": "^9.0.1" + "proto3-json-serializer": "^3.0.0", + "protobufjs": "^7.5.3", + "retry-request": "^8.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/google-logging-utils": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-0.0.2.tgz", - "integrity": "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.1.tgz", + "integrity": "sha512-rcX58I7nqpu4mbKztFeOAObbomBbHU2oIb/d3tJfF3dizGSApqtSwYJigGCooHdnMyQBIw8BrWyK96w3YXgr6A==", "license": "Apache-2.0", "engines": { "node": ">=14" @@ -3565,19 +5077,35 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "license": "MIT" + "dev": true, + "license": "MIT", + "peer": true }, "node_modules/gtoken": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", - "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz", + "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==", "license": "MIT", "dependencies": { - "gaxios": "^6.0.0", + "gaxios": "^7.0.0", "jws": "^4.0.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" + } + }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { @@ -3589,6 +5117,37 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -3716,10 +5275,12 @@ } }, "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 4" } @@ -3749,22 +5310,159 @@ "node": ">=0.8.19" } }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-builtin-module": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-5.0.0.tgz", + "integrity": "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "builtin-modules": "^5.0.0" + }, + "engines": { + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/is-core-module": { "version": "2.16.1", @@ -3782,6 +5480,43 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3791,6 +5526,23 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -3800,6 +5552,27 @@ "node": ">=8" } }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3824,15 +5597,63 @@ "node": ">=8" } }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", @@ -3847,6 +5668,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -3862,6 +5684,57 @@ "node": ">=8" } }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -3875,6 +5748,60 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -3888,6 +5815,55 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -3901,11 +5877,29 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -3917,6 +5911,14 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -3929,6 +5931,31 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-5.1.1.tgz", + "integrity": "sha512-DYYlVP1fe4QBMh2xTIs20/YeTz2GYVbWAEZweHSZD+qQ/Cx2d5RShuhhsdk64eTjNq0FeVnteP/qVOgaywSRbg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -3990,12 +6017,22 @@ "node": "*" } }, - "node_modules/just-extend": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz", - "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==", + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } }, "node_modules/jwa": { "version": "2.0.1", @@ -4084,12 +6121,39 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/loglevel": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, "node_modules/long": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "license": "Apache-2.0" }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/loupe": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", @@ -4104,7 +6168,6 @@ "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true, "license": "ISC" }, "node_modules/math-intrinsics": { @@ -4136,7 +6199,9 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 8" } @@ -4145,7 +6210,9 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -4203,6 +6270,17 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/minipass": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", @@ -4227,9 +6305,9 @@ } }, "node_modules/mocha": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.1.tgz", - "integrity": "sha512-5EK+Cty6KheMS/YLPPMJC64g5V61gIR25KsRItHw6x4hEKT6Njp1n9LOlH4gpevuwMVS66SXaBBpg+RWZkza4A==", + "version": "11.7.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.4.tgz", + "integrity": "sha512-1jYAaY8x0kAZ0XszLWu14pzsf4KV740Gld4HXkhNTXwcHx4AUEDkPzgEHg9CM5dVcW+zv036tjpsEbLraPJj4w==", "dev": true, "license": "MIT", "dependencies": { @@ -4241,6 +6319,7 @@ "find-up": "^5.0.0", "glob": "^10.4.5", "he": "^1.2.0", + "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", "minimatch": "^9.0.5", @@ -4262,16 +6341,6 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/mocha/node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/mocha/node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -4355,50 +6424,52 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "license": "MIT" }, - "node_modules/nise": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.9.tgz", - "integrity": "sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^11.2.2", - "@sinonjs/text-encoding": "^0.7.2", - "just-extend": "^6.2.0", - "path-to-regexp": "^6.2.1" - } - }, - "node_modules/nise/node_modules/@sinonjs/fake-timers": { - "version": "11.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.3.1.tgz", - "integrity": "sha512-EVJO7nW5M/F5Tur0Rf2z/QoMo+1Ia963RiMtapiQrEWvY0iBUvADo8Beegwjpnle5BHkyHuoxSTW3jF43H1XRA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@sinonjs/commons": "^3.0.1" + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" } }, "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "license": "MIT", "dependencies": { - "whatwg-url": "^5.0.0" + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" }, "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" } }, + "node_modules/node-releases": { + "version": "2.0.23", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.23.tgz", + "integrity": "sha512-cCmFDMSm26S6tQSDpBCg/NR8NENrVPhAJSf+XbxBG4rPFaaonlEoE9wHQmun+cls499TQGSb7ZyPBRlzgKfpeg==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", @@ -4459,6 +6530,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", @@ -4468,6 +6550,126 @@ "node": ">= 6" } }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.9.tgz", + "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -4510,6 +6712,25 @@ "node": ">= 0.8.0" } }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/p-limit": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", @@ -4571,7 +6792,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true, "license": "BlueOak-1.0.0" }, "node_modules/parent-module": { @@ -4586,6 +6806,25 @@ "node": ">=6" } }, + "node_modules/parse-imports-exports": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz", + "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "parse-statements": "1.0.11" + } + }, + "node_modules/parse-statements": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz", + "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4599,6 +6838,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -4624,7 +6864,6 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", @@ -4641,28 +6880,11 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } }, - "node_modules/path-to-regexp": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", - "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -4684,7 +6906,9 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8.6" }, @@ -4692,6 +6916,28 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -4722,6 +6968,7 @@ "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-diff": "^1.1.2" }, @@ -4736,16 +6983,29 @@ "dev": true, "license": "MIT" }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, "node_modules/proto3-json-serializer": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-2.0.2.tgz", - "integrity": "sha512-SAzp/O4Yh02jGdRc+uIrGoe87dkN/XtwxfZ4ZyafJHymd79ozp5VG5nyZ7ygqPM5+cpLDjjGnYFUkngonyDPOQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-3.0.2.tgz", + "integrity": "sha512-AnMIfnoK2Ml3F/ZVl5PxcwIoefMxj4U/lomJ5/B2eIGdxw4UkbV1YamtsMQsEkZATdMCKMbnI1iG9RQaJbxBGw==", "license": "Apache-2.0", "dependencies": { - "protobufjs": "^7.2.5" + "protobufjs": "^7.4.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } }, "node_modules/protobufjs": { @@ -4803,6 +7063,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -4817,7 +7078,8 @@ "url": "https://feross.org/support" } ], - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/randombytes": { "version": "2.1.0", @@ -4829,32 +7091,125 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regjsparser": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "jsesc": "~3.0.2" }, - "engines": { - "node": ">= 6" + "bin": { + "regjsparser": "bin/parser" } }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "node_modules/regjsparser/node_modules/jsesc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, "license": "MIT", - "engines": { - "node": ">= 14.18.0" + "peer": true, + "bin": { + "jsesc": "bin/jsesc" }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" + "engines": { + "node": ">=6" } }, "node_modules/require-directory": { @@ -4907,24 +7262,25 @@ } }, "node_modules/retry-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-7.0.2.tgz", - "integrity": "sha512-dUOvLMJ0/JJYEn8NrpOaGNE7X3vpI5XlZS/u0ANjqtcZVKnIxP7IgCFwrKTxENw29emmwug53awKtaMm4i9g5w==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-8.0.2.tgz", + "integrity": "sha512-JzFPAfklk1kjR1w76f0QOIhoDkNkSqW8wYKT08n9yysTmZfB+RQ2QoXoTAeOi1HD9ZipTyTAZg3c4pM/jeqgSw==", "license": "MIT", "dependencies": { - "@types/request": "^2.48.8", "extend": "^3.0.2", - "teeny-request": "^9.0.0" + "teeny-request": "^10.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, "license": "MIT", + "peer": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -4988,6 +7344,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -5003,10 +7360,40 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "queue-microtask": "^1.2.2" } }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -5027,10 +7414,55 @@ ], "license": "MIT" }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -5049,6 +7481,58 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5070,6 +7554,86 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -5077,18 +7641,16 @@ "license": "ISC" }, "node_modules/sinon": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.2.0.tgz", - "integrity": "sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==", - "deprecated": "16.1.1", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.0.tgz", + "integrity": "sha512-TOgRcwFPbfGtpqvZw+hyqJDvqfapr1qUlOizROIk4bBLjlsjlB00Pg6wMFXNtJRpu+eCZuVOaLatG7M8105kAw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^3.0.0", - "@sinonjs/fake-timers": "^10.3.0", - "@sinonjs/samsam": "^8.0.0", - "diff": "^5.1.0", - "nise": "^5.1.4", + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", "supports-color": "^7.2.0" }, "funding": { @@ -5107,15 +7669,6 @@ "sinon": ">=4.0.0" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5137,58 +7690,203 @@ "source-map": "^0.6.0" } }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0", + "peer": true + }, + "node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", + "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", + "dev": true, + "license": "CC0-1.0", + "peer": true + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/stream-events": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", "license": "MIT", "dependencies": { - "stubs": "^3.0.0" + "stubs": "^3.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" } }, - "node_modules/stream-shift": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", - "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", - "license": "MIT" - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "safe-buffer": "~5.2.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { @@ -5208,7 +7906,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -5217,6 +7914,17 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -5230,6 +7938,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strip-indent": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.1.1.tgz", + "integrity": "sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -5279,6 +8001,7 @@ "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@pkgr/core": "^0.2.9" }, @@ -5290,19 +8013,18 @@ } }, "node_modules/teeny-request": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-9.0.0.tgz", - "integrity": "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-10.1.0.tgz", + "integrity": "sha512-3ZnLvgWF29jikg1sAQ1g0o+lr5JX6sVgYvfUJazn7ZjJroDBUTWp44/+cFVX0bULjv4vci+rBD+oGVAkWqhUbw==", "license": "Apache-2.0", "dependencies": { "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.9", - "stream-events": "^1.0.5", - "uuid": "^9.0.0" + "node-fetch": "^3.3.2", + "stream-events": "^1.0.5" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/teeny-request/node_modules/agent-base": { @@ -5330,12 +8052,6 @@ "node": ">= 6" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "license": "MIT" - }, "node_modules/through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -5401,7 +8117,9 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "is-number": "^7.0.0" }, @@ -5409,28 +8127,60 @@ "node": ">=8.0" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" - }, "node_modules/ts-api-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", - "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, "license": "MIT", + "peer": true, "engines": { - "node": ">=16" + "node": ">=18.12" }, "peerDependencies": { - "typescript": ">=4.2.0" + "typescript": ">=4.8.4" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" } }, "node_modules/tsx": { - "version": "4.20.5", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.5.tgz", - "integrity": "sha512-+wKjMNU9w/EaQayHXb7WA7ZaHY6hN8WgfvHNQ3t1PnU91/7O8TcTnIhCDYTZwnt8JsO9IBqZ30Ln1r7pPF52Aw==", + "version": "4.20.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.6.tgz", + "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==", "dev": true, "license": "MIT", "dependencies": { @@ -5469,22 +8219,92 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "license": "(MIT OR CC0-1.0)", + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typescript": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", - "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -5494,10 +8314,55 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.46.0.tgz", + "integrity": "sha512-6+ZrB6y2bT2DX3K+Qd9vn7OFOJR+xSLDj+Aw/N3zBwUt27uTw2sw2TE2+UcY1RiyBZkaGbTkVg9SSdPNUG6aUw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.46.0", + "@typescript-eslint/parser": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/utils": "8.46.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "license": "MIT" }, "node_modules/universalify": { @@ -5519,6 +8384,46 @@ "node": ">=8" } }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/update-browserslist-db/node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC", + "peer": true + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -5535,32 +8440,21 @@ "license": "MIT" }, "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "engines": { + "node": ">= 8" } }, "node_modules/which": { @@ -5578,6 +8472,107 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -5616,7 +8611,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", diff --git a/package.json b/package.json index 28d28a7a1..2365cffaa 100644 --- a/package.json +++ b/package.json @@ -27,58 +27,55 @@ "url": "https://github.com/ioBroker/create-adapter/issues" }, "engines": { - "node": ">=18" + "node": ">=20" }, "publishConfig": { "access": "public" }, "devDependencies": { - "@alcalzone/release-script": "^3.8.0", - "@tsconfig/node18": "^18.2.4", + "@alcalzone/release-script": "^4.0.0", + "@iobroker/eslint-config": "^2.2.0", + "@tsconfig/node20": "^20.1.6", "@types/chai": "^4.3.20", "@types/chai-as-promised": "^7.1.8", "@types/debug": "4.1.12", - "@types/eslint": "^8.56.12", + "@types/eslint": "^9.6.1", "@types/fs-extra": "^11.0.4", - "@types/json5": "2.2.0", + "@types/json5": "^2.2.0", "@types/mocha": "^10.0.10", - "@types/node": "^18.19.123", + "@types/node": "^20.19.21", "@types/proxyquire": "^1.3.31", - "@types/semver": "^7.7.0", - "@types/sinon": "^10.0.20", + "@types/semver": "^7.7.1", + "@types/sinon": "^17.0.4", "@types/sinon-chai": "^3.2.12", "@types/yargs": "^17.0.33", - "@typescript-eslint/eslint-plugin": "^7.18.0", "chai": "^4.5.0", "chai-as-promised": "^7.1.2", "copyfiles": "^2.4.1", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.4", "execa": "^8.0.1", "jsonschema": "^1.5.0", - "mocha": "^11.7.1", + "mocha": "^11.7.4", "proxyquire": "^2.1.3", "rimraf": "^4.4.1", - "sinon": "^15.2.0", + "sinon": "^21.0.0", "sinon-chai": "^3.7.0", "source-map-support": "^0.5.21", - "tsx": "^4.20.5" + "tsx": "^4.20.6" }, "dependencies": { - "@iobroker/adapter-dev": "^1.4.0", - "@typescript-eslint/parser": "^7.18.0", + "@iobroker/adapter-dev": "^1.5.0", "alcalzone-shared": "^4.0.8", "ansi-colors": "^4.1.3", "axios": "^1.12.2", - "debug": "^4.4.1", + "debug": "^4.4.3", "enquirer": "^2.4.1", - "eslint": "^8.57.1", - "fs-extra": "^11.3.1", + "eslint": "^9.37.0", + "fs-extra": "^11.3.2", "json5": "^2.2.3", "p-limit": "^5.0.0", "prettier": "^3.6.2", - "semver": "^7.7.2", - "typescript": "~5.9.2", + "semver": "^7.7.3", + "typescript": "~5.9.3", "yargs": "^17.7.2" }, "scripts": { @@ -95,10 +92,12 @@ "pretest": "npm run linkTemplates", "test": "npm run test:ts && npm run test:baselines && npm run test:templates", "test:watch": "mocha src/**/*.test.ts --watch", - "lint:ts": "eslint {src,test,.github,maintenance}/**/*.ts", + "lint:ts": "eslint --no-warn-ignored */**/*.ts", "lint": "npm run lint:ts", "release": "release-script", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "format": "prettier --write \"src/**/*.ts\" \"templates/**/*.ts\"", + "format:verify": "prettier --check \"src/**/*.ts\" \"templates/**/*.ts\"" }, "readme": "README.md" } diff --git a/prettier.config.mjs b/prettier.config.mjs new file mode 100644 index 000000000..3ab1728fa --- /dev/null +++ b/prettier.config.mjs @@ -0,0 +1,10 @@ +// ioBroker prettier configuration file +import prettierConfig from "@iobroker/eslint-config/prettier.config.mjs"; + +export default { + ...prettierConfig, + // Use tabs for indentation (project preference) + useTabs: true, + // Keep double quotes as this project prefers them + singleQuote: false, +}; diff --git a/src/@types/enquirer/index.d.ts b/src/@types/enquirer/index.d.ts index febc72461..f0b361eb8 100644 --- a/src/@types/enquirer/index.d.ts +++ b/src/@types/enquirer/index.d.ts @@ -1,102 +1,261 @@ -/* eslint-disable @typescript-eslint/explicit-member-accessibility */ // This file patches the broken enquirer typings import "enquirer"; import { EventEmitter } from "events"; declare module "enquirer" { + /** + * + */ export interface BasePromptOptions { + /** + * + */ name: string | (() => string); + /** + * + */ type: string | (() => string); + /** + * + */ message: string | (() => string) | (() => Promise); + /** + * + */ initial?: any; + /** + * + */ required?: boolean; + /** + * + */ format?(value: string): string | Promise; + /** + * + */ result?(value: string): string | Promise; - skip?: - | ((state: Record) => boolean | Promise) - | boolean; - validate?( - value: string, - ): boolean | Promise | string | Promise; - onSubmit?( - name: string, - value: any, - prompt: Prompt, - ): boolean | Promise; - onCancel?( - name: string, - value: any, - prompt: Prompt, - ): boolean | Promise; + /** + * + */ + skip?: ((state: Record) => boolean | Promise) | boolean; + /** + * + */ + validate?(value: string): boolean | Promise | string | Promise; + /** + * + */ + onSubmit?(name: string, value: any, prompt: Prompt): boolean | Promise; + /** + * + */ + onCancel?(name: string, value: any, prompt: Prompt): boolean | Promise; + /** + * + */ stdin?: NodeJS.ReadStream; + /** + * + */ stdout?: NodeJS.WriteStream; } + /** + * + */ export interface Choice { + /** + * + */ name?: string; + /** + * + */ message?: string; + /** + * + */ value?: string; + /** + * + */ hint?: string; + /** + * + */ disabled?: boolean | string; } + /** + * + */ export interface ArrayPromptOptions extends BasePromptOptions { - type: - | "autocomplete" - | "editable" - | "form" - | "multiselect" - | "select" - | "survey" - | "list" - | "scale"; + /** + * + */ + type: "autocomplete" | "editable" | "form" | "multiselect" | "select" | "survey" | "list" | "scale"; + /** + * + */ choices: string[] | Choice[]; + /** + * + */ maxChoices?: number; + /** + * + */ muliple?: boolean; + /** + * + */ initial?: number | number[] | string; + /** + * + */ hint?: string; + /** + * + */ delay?: number; + /** + * + */ separator?: boolean; + /** + * + */ sort?: boolean; + /** + * + */ linebreak?: boolean; + /** + * + */ edgeLength?: number; + /** + * + */ align?: "left" | "right"; + /** + * + */ scroll?: boolean; } + /** + * + */ export interface BooleanPromptOptions extends BasePromptOptions { + /** + * + */ type: "confirm"; + /** + * + */ initial?: boolean; } + /** + * + */ export interface StringPromptOptions extends BasePromptOptions { + /** + * + */ type: "input" | "invisible" | "list" | "password" | "text"; + /** + * + */ hint?: string; + /** + * + */ initial?: string; + /** + * + */ multiline?: boolean; } + /** + * + */ export interface NumberPromptOptions extends BasePromptOptions { + /** + * + */ type: "numeral"; + /** + * + */ min?: number; + /** + * + */ max?: number; + /** + * + */ delay?: number; + /** + * + */ float?: boolean; + /** + * + */ round?: boolean; + /** + * + */ major?: number; + /** + * + */ minor?: number; + /** + * + */ initial?: number; } + /** + * + */ export interface SnippetPromptOptions extends BasePromptOptions { + /** + * + */ type: "snippet"; + /** + * + */ newline?: string; } + /** + * + */ export interface SortPromptOptions extends BasePromptOptions { + /** + * + */ type: "sort"; + /** + * + */ hint?: string; + /** + * + */ drag?: boolean; + /** + * + */ numbered?: boolean; } @@ -133,17 +292,12 @@ declare module "enquirer" { * @param type * @param fn `Prompt` class, or a function that returns a `Prompt` class. */ - register( - type: string, - fn: typeof BasePrompt | (() => typeof BasePrompt), - ): this; + register(type: string, fn: typeof BasePrompt | (() => typeof BasePrompt)): this; /** * Register a custom prompt type. */ - register(type: { - [key: string]: typeof BasePrompt | (() => typeof BasePrompt); - }): this; + register(type: { [key: string]: typeof BasePrompt | (() => typeof BasePrompt) }): this; /** * Prompt function that takes a "question" object or array of question objects, @@ -174,7 +328,6 @@ declare module "enquirer" { | (PromptOptions | ((this: Enquirer) => PromptOptions))[], ): Promise; - // eslint-disable-next-line @typescript-eslint/no-unused-vars class Prompt extends BasePrompt {} } } diff --git a/src/cli.ts b/src/cli.ts index 1093dd5eb..42b632b03 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,12 +1,4 @@ -import { - blueBright, - bold, - gray, - green, - red, - reset, - underline, -} from "ansi-colors"; +import { blueBright, bold, gray, green, red, reset, underline } from "ansi-colors"; import { prompt } from "enquirer"; import * as fs from "fs-extra"; import * as path from "path"; @@ -19,17 +11,9 @@ import type { File } from "./lib/createAdapter"; import { createFiles, writeFiles } from "./lib/createAdapter"; import { LocalMigrationContext } from "./lib/localMigrationContext"; import { fetchPackageVersion } from "./lib/packageVersions"; -import { - error, - executeCommand, - executeNpmCommand, - getOwnVersion, - isWindows, -} from "./lib/tools"; +import { error, executeCommand, executeNpmCommand, getOwnVersion, isWindows } from "./lib/tools"; -export type ConditionalTitle = ( - answers: Record, -) => string | undefined; +export type ConditionalTitle = (answers: Record) => string | undefined; /** Define command line arguments */ const argv = yargs @@ -83,16 +67,13 @@ async function checkAdapterExistence(name: string): Promise { try { await fetchPackageVersion(`iobroker.${name}`); return `The adapter ioBroker.${name} already exists!`; - } catch (e) { + } catch { return true; } } const creatorOptions = { - checkAdapterExistence: - !argv.skipAdapterExistenceCheck && !argv.migrate - ? checkAdapterExistence - : undefined, + checkAdapterExistence: !argv.skipAdapterExistenceCheck && !argv.migrate ? checkAdapterExistence : undefined, }; /** Asks a series of questions on the CLI */ @@ -100,14 +81,14 @@ async function ask(): Promise { let answers: Record = { cli: true, target: "directory" }; let migrationContext: MigrationContextBase | undefined; - if (!!argv.replay) { + if (argv.replay) { const replayFile = path.resolve(argv.replay); const json = await fs.readFile(replayFile, "utf8"); answers = JSON.parse(json); answers.replay = replayFile; } - if (!!argv.migrate) { + if (argv.migrate) { try { const migrationDir = path.resolve(argv.migrate); const ctx = new LocalMigrationContext(migrationDir); @@ -116,9 +97,7 @@ async function ask(): Promise { migrationContext = ctx; } catch (error) { console.error(error); - throw new Error( - "Please ensure that --migrate points to a valid adapter directory", - ); + throw new Error("Please ensure that --migrate points to a valid adapter directory"); } if (await migrationContext.fileExists(".create-adapter.json")) { // it's just not worth trying to figure out things if the adapter was already created with create-adapter @@ -146,15 +125,11 @@ async function ask(): Promise { } while (true) { let answer: Record; - if (answers.hasOwnProperty(q.name as string)) { + if (Object.prototype.hasOwnProperty.call(answers, q.name as string)) { // answer was loaded using the "replay" feature answer = { [q.name as string]: answers[q.name as string] }; } else { - if ( - answers.expert !== "yes" && - q.expert && - q.initial !== undefined - ) { + if (answers.expert !== "yes" && q.expert && q.initial !== undefined) { // In non-expert mode, prefill the default answer for expert questions answer = { [q.name as string]: q.initial }; } else { @@ -162,32 +137,22 @@ async function ask(): Promise { try { answer = await prompt(q); // Cancel the process if necessary - if (answer[q.name as string] == undefined) + if (answer[q.name as string] == undefined) { throw new Error(); + } } catch (e) { - error( - (e as Error).message || - "Adapter creation canceled!", - ); + error((e as Error).message || "Adapter creation canceled!"); return process.exit(1); } } // Apply an optional transformation if (typeof q.resultTransform === "function") { - const transformed = q.resultTransform( - answer[q.name as string], - ); - answer[q.name as string] = - transformed instanceof Promise - ? await transformed - : transformed; + const transformed = q.resultTransform(answer[q.name as string]); + answer[q.name as string] = transformed instanceof Promise ? await transformed : transformed; } // Test the result if (q.action != undefined) { - const testResult = await q.action( - answer[q.name as string], - creatorOptions, - ); + const testResult = await q.action(answer[q.name as string], creatorOptions); if (typeof testResult === "string") { error(testResult); continue; @@ -204,19 +169,15 @@ async function ask(): Promise { const questionsAndText: (QuestionGroup | string | ConditionalTitle)[] = [ "", green.bold("====================================================="), - green.bold( - ` Welcome to the ioBroker adapter creator v${getOwnVersion()}!`, - ), + green.bold(` Welcome to the ioBroker adapter creator v${getOwnVersion()}!`), green.bold("====================================================="), "", gray(`You can cancel at any point by pressing Ctrl+C.`), - (answers) => (!!answers.replay ? green(`Replaying file`) : undefined), - (answers) => (!!answers.replay ? green(answers.replay) : undefined), + answers => (answers.replay ? green(`Replaying file`) : undefined), + answers => (answers.replay ? green(answers.replay) : undefined), ...questionGroups, "", - underline( - "That's it. Please wait a minute while I get this working...", - ), + underline("That's it. Please wait a minute while I get this working..."), ]; for (const entry of questionsAndText) { @@ -231,11 +192,7 @@ async function ask(): Promise { } } else { // only print the headline if any of the questions are necessary - if ( - entry.questions.find((qq) => - testCondition(qq.condition, answers), - ) - ) { + if (entry.questions.find(qq => testCondition(qq.condition, answers))) { console.log(); console.log(underline(entry.headline)); } @@ -262,16 +219,17 @@ let gitCommit: boolean; /** Whether dev-server should be installed */ let devServer: boolean; -/** CLI-specific functionality for creating the adapter directory */ -async function setupProject_CLI( - answers: Answers, - files: File[], -): Promise { +/** + * CLI-specific functionality for creating the adapter directory + * + * @param answers + * @param files + */ +async function setupProject_CLI(answers: Answers, files: File[]): Promise { const rootDirName = path.basename(rootDir); // make sure we are working in a directory called ioBroker. const targetDir = - rootDirName.toLowerCase() === - `iobroker.${answers.adapterName.toLowerCase()}` + rootDirName.toLowerCase() === `iobroker.${answers.adapterName.toLowerCase()}` ? rootDir : path.join(rootDir, `ioBroker.${answers.adapterName}`); await writeFiles(targetDir, files); @@ -291,10 +249,7 @@ async function setupProject_CLI( if (devServer) { logProgress("Installing dev-server"); - await executeNpmCommand( - ["install", "--global", "@iobroker/dev-server"], - { cwd: targetDir }, - ); + await executeNpmCommand(["install", "--global", "@iobroker/dev-server"], { cwd: targetDir }); await executeCommand( isWindows ? "iobroker-dev-server.cmd" : "iobroker-dev-server", ["setup", "--adminPort", `${answers.devServerPort}`], @@ -329,17 +284,9 @@ async function setupProject_CLI( console.log(); console.log(); console.log(blueBright("All done! Have fun programming! ") + red("♥")); - console.log( - blueBright(`Just open `) + - bold(reset(targetDir)) + - blueBright(` in your favorite editor.`), - ); + console.log(blueBright(`Just open `) + bold(reset(targetDir)) + blueBright(` in your favorite editor.`)); console.log(); - console.log( - gray( - "Hint: try CTRL-clicking the path if you have the editor open already.", - ), - ); + console.log(gray("Hint: try CTRL-clicking the path if you have the editor open already.")); } // Enable CI testing without stalling @@ -353,23 +300,28 @@ if (process.env.TEST_STARTUP) { if (installDependencies) { maxSteps++; - needsBuildStep = - answers.language === "TypeScript" || - answers.adminUi === "react" || - answers.tabReact === "yes"; - if (needsBuildStep) maxSteps++; + needsBuildStep = answers.language === "TypeScript" || answers.adminUi === "react" || answers.tabReact === "yes"; + if (needsBuildStep) { + maxSteps++; + } } devServer = answers.devServer === "yes"; - if (devServer) maxSteps++; + if (devServer) { + maxSteps++; + } gitCommit = answers.gitCommit === "yes"; - if (gitCommit) maxSteps++; + if (gitCommit) { + maxSteps++; + } logProgress("Generating files"); const files = await createFiles(answers); await setupProject_CLI(answers, files); -})().catch((error) => console.error(error)); +})().catch(error => console.error(error)); process.on("exit", () => { - if (fs.pathExistsSync("npm-debug.log")) fs.removeSync("npm-debug.log"); + if (fs.pathExistsSync("npm-debug.log")) { + fs.removeSync("npm-debug.log"); + } }); diff --git a/src/index.ts b/src/index.ts index 71ed829ad..ca2673084 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,16 +1,14 @@ import type { Answers } from "./lib/core/questions"; -import { - checkAnswers, - formatAnswers, - validateAnswers, -} from "./lib/core/questions"; +import { checkAnswers, formatAnswers, validateAnswers } from "./lib/core/questions"; import type { File } from "./lib/createAdapter"; import { createFiles } from "./lib/createAdapter"; -export async function createAdapter( - answers: Answers, - disableValidation: (keyof Answers)[] = [], -): Promise { +/** + * + * @param answers + * @param disableValidation + */ +export async function createAdapter(answers: Answers, disableValidation: (keyof Answers)[] = []): Promise { // Check all answers checkAnswers(answers); answers = (await formatAnswers(answers)) as Answers; diff --git a/src/lib/core.test.ts b/src/lib/core.test.ts index f45b16591..510247fb8 100644 --- a/src/lib/core.test.ts +++ b/src/lib/core.test.ts @@ -1,14 +1,10 @@ import { readdir, readFile } from "fs/promises"; import { join, resolve } from "path"; -const testAllFiles = async ( - assertion: (content: string, filename: string) => void, -) => { +const testAllFiles = async (assertion: (content: string, filename: string) => void) => { const baseDir = resolve(__dirname, "./core"); const files = await readdir(baseDir); - for (const file of files.filter( - (f) => f.endsWith(".ts") && !f.endsWith(".test.ts"), - )) { + for (const file of files.filter(f => f.endsWith(".ts") && !f.endsWith(".test.ts"))) { const content = await readFile(join(baseDir, file), { encoding: "utf8", }); @@ -22,47 +18,32 @@ const testAllFiles = async ( */ describe("./core directory", () => { it("should not contain any imports from base directory (../)", async () => { - testAllFiles((content, file) => - content.should.not.match( - /import .+ from "\.\./gi, - `${file} contains an import from the base directory`, - ), + await testAllFiles((content, file) => + content.should.not.match(/import .+ from "\.\./gi, `${file} contains an import from the base directory`), ); }); it('should not contain any imports from "os"', async () => { await testAllFiles((content, file) => - content.should.not.match( - /import .+ from "os";/gi, - `${file} contains an import from "os"`, - ), + content.should.not.match(/import .+ from "os";/gi, `${file} contains an import from "os"`), ); }); it('should not contain any imports from "fs"', async () => { await testAllFiles((content, file) => - content.should.not.match( - /import .+ from "fs";/gi, - `${file} contains an import from "fs"`, - ), + content.should.not.match(/import .+ from "fs";/gi, `${file} contains an import from "fs"`), ); }); it('should not contain any imports from "fs-extra"', async () => { await testAllFiles((content, file) => - content.should.not.match( - /import .+ from "fs-extra";/gi, - `${file} contains an import from "fs-extra"`, - ), + content.should.not.match(/import .+ from "fs-extra";/gi, `${file} contains an import from "fs-extra"`), ); }); it('should not contain any imports from "path"', async () => { await testAllFiles((content, file) => - content.should.not.match( - /import .+ from "path";/gi, - `${file} contains an import from "path"`, - ), + content.should.not.match(/import .+ from "path";/gi, `${file} contains an import from "path"`), ); }); }); diff --git a/src/lib/core/actionsAndTransformers.test.ts b/src/lib/core/actionsAndTransformers.test.ts index 4138e769c..a8003965a 100644 --- a/src/lib/core/actionsAndTransformers.test.ts +++ b/src/lib/core/actionsAndTransformers.test.ts @@ -66,9 +66,7 @@ describe("actionsAndTransformers/checkAdapterName()", () => { }); it("should return an error if the adapter already exists", async () => { - checkAdapterExistence.resolves( - "The adapter ioBroker.foo already exists!", - ); + checkAdapterExistence.resolves("The adapter ioBroker.foo already exists!"); const result = await checkAdapterName("foo", { checkAdapterExistence, }); @@ -170,11 +168,7 @@ describe("actionsAndTransformers/checkTitle()", () => { }); it("should return an error if the title contains iobroker or adapter", async () => { - const forbidden = [ - "iobroker adapter", - "adapter test foo", - "this is for iobroker", - ]; + const forbidden = ["iobroker adapter", "adapter test foo", "this is for iobroker"]; for (const name of forbidden) { const result = await checkTitle(name); result.should.be.a("string").and.match(/must not/); diff --git a/src/lib/core/actionsAndTransformers.ts b/src/lib/core/actionsAndTransformers.ts index 982005f5e..9a920728e 100644 --- a/src/lib/core/actionsAndTransformers.ts +++ b/src/lib/core/actionsAndTransformers.ts @@ -2,15 +2,19 @@ import { yellow } from "ansi-colors"; import type { Answers } from "./questions"; const emailRegex = - /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; export type CheckResult = true | string; -export async function checkMinSelections( - category: string, - min: number, - answers: any[], -): Promise { - if (answers.length >= min) return true; +/** + * + * @param category + * @param min + * @param answers + */ +export async function checkMinSelections(category: string, min: number, answers: any[]): Promise { + if (answers.length >= min) { + return true; + } return `Please enter at least ${min} ${category}`; } @@ -31,22 +35,38 @@ function isAdapterNameValid(name: string): CheckResult { return true; } +/** + * + * @param name + * @param options + */ export async function checkAdapterName< T extends { + /** + * + */ checkAdapterExistence?: (name: string) => Promise; }, >(name: string, options?: T): Promise { const validCheck = isAdapterNameValid(name); - if (typeof validCheck === "string") return validCheck; + if (typeof validCheck === "string") { + return validCheck; + } if (options && options.checkAdapterExistence) { const existenceCheck = await options.checkAdapterExistence(name); - if (typeof existenceCheck === "string") return existenceCheck; + if (typeof existenceCheck === "string") { + return existenceCheck; + } } return true; } +/** + * + * @param title + */ export function checkTitle(title?: string): CheckResult { if (!isNotEmpty(title)) { return "Please enter a title!"; @@ -61,6 +81,10 @@ function isNotEmpty(answer?: string): answer is string { return answer != undefined && answer.length > 0 && answer.trim().length > 0; } +/** + * + * @param name + */ export async function checkAuthorName(name?: string): Promise { if (!isNotEmpty(name)) { return "Please enter a valid name!"; @@ -68,6 +92,10 @@ export async function checkAuthorName(name?: string): Promise { return true; } +/** + * + * @param email + */ export async function checkEmail(email: string): Promise { if (!emailRegex.test(email)) { return "Please enter a valid email address!"; @@ -75,50 +103,70 @@ export async function checkEmail(email: string): Promise { return true; } -export async function checkTypeScriptTools( - tools: Exclude, -): Promise { +/** + * + * @param tools + */ +export async function checkTypeScriptTools(tools: Exclude): Promise { if (tools.indexOf("Prettier") > -1 && tools.indexOf("ESLint") === -1) { return "ESLint must be selected to use Prettier!"; } return true; } +/** + * + * @param name + */ export function transformAdapterName(name: string): string { const startsWithIoBroker = /^ioBroker\./i; if (startsWithIoBroker.test(name)) { name = name.replace(startsWithIoBroker, ""); - console.log( - yellow(`You don't have to prefix the name with "ioBroker."`), - ); + console.log(yellow(`You don't have to prefix the name with "ioBroker."`)); } return name; } +/** + * + * @param description + */ export function transformDescription(description: string): string | undefined { description = description.trim(); - if (description.length === 0) return undefined; + if (description.length === 0) { + return undefined; + } return description; } +/** + * + * @param keywords + */ export function transformKeywords(keywords: string): string[] | undefined { const keywordsArray = keywords .trim() .split(",") - .map((k) => k.trim()) - .filter((k) => !!k); - if (keywordsArray.length === 0) return undefined; + .map(k => k.trim()) + .filter(k => !!k); + if (keywordsArray.length === 0) { + return undefined; + } return keywordsArray; } -export function transformContributors( - contributors: string, -): string[] | undefined { +/** + * + * @param contributors + */ +export function transformContributors(contributors: string): string[] | undefined { const contributorsArray = contributors .trim() .split(",") - .map((c) => c.trim()) - .filter((c) => !!c); - if (contributorsArray.length === 0) return undefined; + .map(c => c.trim()) + .filter(c => !!c); + if (contributorsArray.length === 0) { + return undefined; + } return contributorsArray; } diff --git a/src/lib/core/licenses.ts b/src/lib/core/licenses.ts index 542b66172..acb6417dd 100644 --- a/src/lib/core/licenses.ts +++ b/src/lib/core/licenses.ts @@ -3,49 +3,61 @@ // Since this is auto-generated, we will not unit-test this file // istanbul ignore +/** + * + */ export interface License { + /** + * + */ id: string; + /** + * + */ name: string; + /** + * + */ text: string; } -export const licenses: Record = /** BEGIN LICENSES */{ +export const licenses: Record = /** BEGIN LICENSES */ { "GNU AGPLv3": { - "id": "AGPL-3.0", - "name": "GNU Affero General Public License v3.0", - "text": " GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate. Many developers of free software are heartened and\nencouraged by the resulting cooperation. However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community. It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server. Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals. This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n \"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\n\n A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n \"keep intact all notices\".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\n\n A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Remote Network Interaction; Use with the GNU General Public License.\n\n Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software. This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time. Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n \n Copyright (C) \n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as published\n by the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source. For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code. There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n.\n" + id: "AGPL-3.0", + name: "GNU Affero General Public License v3.0", + text: ' GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n A secondary benefit of defending all users\' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate. Many developers of free software are heartened and\nencouraged by the resulting cooperation. However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community. It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server. Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals. This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n "This License" refers to version 3 of the GNU Affero General Public License.\n\n "Copyright" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n "The Program" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as "you". "Licensees" and\n"recipients" may be individuals or organizations.\n\n To "modify" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a "modified version" of the\nearlier work or a work "based on" the earlier work.\n\n A "covered work" means either the unmodified Program or a work based\non the Program.\n\n To "propagate" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To "convey" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays "Appropriate Legal Notices"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The "source code" for a work means the preferred form of the work\nfor making modifications to it. "Object code" means any non-source\nform of a work.\n\n A "Standard Interface" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The "System Libraries" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n"Major Component", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The "Corresponding Source" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work\'s\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users\' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work\'s\nusers, your or third parties\' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program\'s source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n "keep intact all notices".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n"aggregate" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation\'s users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A "User Product" is either (1) a "consumer product", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, "normally used" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n "Installation Information" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n "Additional permissions" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered "further\nrestrictions" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An "entity transaction" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party\'s predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A "contributor" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor\'s "contributor version".\n\n A contributor\'s "essential patent claims" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, "control" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor\'s essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a "patent license" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To "grant" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. "Knowingly relying" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient\'s use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is "discriminatory" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others\' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Remote Network Interaction; Use with the GNU General Public License.\n\n Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software. This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time. Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License "or any later version" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy\'s\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe "copyright" line and a pointer to where the full notice is found.\n\n \n Copyright (C) \n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as published\n by the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source. For example, if your program is a web application, its\ninterface could display a "Source" link that leads users to an archive\nof the code. There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a "copyright disclaimer" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n.\n', }, "GNU GPLv3": { - "id": "GPL-3.0", - "name": "GNU General Public License v3.0", - "text": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n \"This License\" refers to version 3 of the GNU General Public License.\n\n \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n \"The Program\" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as \"you\". \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The \"source code\" for a work means the preferred form of the work\nfor making modifications to it. \"Object code\" means any non-source\nform of a work.\n\n A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n \"keep intact all notices\".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor's \"contributor version\".\n\n A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n \n Copyright (C) \n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n Copyright (C) \n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License. Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n.\n" + id: "GPL-3.0", + name: "GNU General Public License v3.0", + text: ' GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n Preamble\n\n The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works. By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users. We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors. You can apply it to\nyour programs, too.\n\n When we speak of free software, we are referring to freedom, not\nprice. Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights. Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received. You must make sure that they, too, receive\nor can get the source code. And you must show them these terms so they\nknow their rights.\n\n Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n For the developers\' and authors\' protection, the GPL clearly explains\nthat there is no warranty for this free software. For both users\' and\nauthors\' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so. This is fundamentally incompatible with the aim of\nprotecting users\' freedom to change the software. The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable. Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts. If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary. To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n The precise terms and conditions for copying, distribution and\nmodification follow.\n\n TERMS AND CONDITIONS\n\n 0. Definitions.\n\n "This License" refers to version 3 of the GNU General Public License.\n\n "Copyright" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n "The Program" refers to any copyrightable work licensed under this\nLicense. Each licensee is addressed as "you". "Licensees" and\n"recipients" may be individuals or organizations.\n\n To "modify" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy. The resulting work is called a "modified version" of the\nearlier work or a work "based on" the earlier work.\n\n A "covered work" means either the unmodified Program or a work based\non the Program.\n\n To "propagate" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy. Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n To "convey" a work means any kind of propagation that enables other\nparties to make or receive copies. Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n An interactive user interface displays "Appropriate Legal Notices"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License. If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n 1. Source Code.\n\n The "source code" for a work means the preferred form of the work\nfor making modifications to it. "Object code" means any non-source\nform of a work.\n\n A "Standard Interface" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n The "System Libraries" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form. A\n"Major Component", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n The "Corresponding Source" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities. However, it does not include the work\'s\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work. For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n The Corresponding Source for a work in source code form is that\nsame work.\n\n 2. Basic Permissions.\n\n All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met. This License explicitly affirms your unlimited\npermission to run the unmodified Program. The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work. This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force. You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright. Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n Conveying under any other circumstances is permitted solely under\nthe conditions stated below. Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n 3. Protecting Users\' Legal Rights From Anti-Circumvention Law.\n\n No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work\'s\nusers, your or third parties\' legal rights to forbid circumvention of\ntechnological measures.\n\n 4. Conveying Verbatim Copies.\n\n You may convey verbatim copies of the Program\'s source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n 5. Conveying Modified Source Versions.\n\n You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n a) The work must carry prominent notices stating that you modified\n it, and giving a relevant date.\n\n b) The work must carry prominent notices stating that it is\n released under this License and any conditions added under section\n 7. This requirement modifies the requirement in section 4 to\n "keep intact all notices".\n\n c) You must license the entire work, as a whole, under this\n License to anyone who comes into possession of a copy. This\n License will therefore apply, along with any applicable section 7\n additional terms, to the whole of the work, and all its parts,\n regardless of how they are packaged. This License gives no\n permission to license the work in any other way, but it does not\n invalidate such permission if you have separately received it.\n\n d) If the work has interactive user interfaces, each must display\n Appropriate Legal Notices; however, if the Program has interactive\n interfaces that do not display Appropriate Legal Notices, your\n work need not make them do so.\n\n A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n"aggregate" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation\'s users\nbeyond what the individual works permit. Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n 6. Conveying Non-Source Forms.\n\n You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n a) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by the\n Corresponding Source fixed on a durable physical medium\n customarily used for software interchange.\n\n b) Convey the object code in, or embodied in, a physical product\n (including a physical distribution medium), accompanied by a\n written offer, valid for at least three years and valid for as\n long as you offer spare parts or customer support for that product\n model, to give anyone who possesses the object code either (1) a\n copy of the Corresponding Source for all the software in the\n product that is covered by this License, on a durable physical\n medium customarily used for software interchange, for a price no\n more than your reasonable cost of physically performing this\n conveying of source, or (2) access to copy the\n Corresponding Source from a network server at no charge.\n\n c) Convey individual copies of the object code with a copy of the\n written offer to provide the Corresponding Source. This\n alternative is allowed only occasionally and noncommercially, and\n only if you received the object code with such an offer, in accord\n with subsection 6b.\n\n d) Convey the object code by offering access from a designated\n place (gratis or for a charge), and offer equivalent access to the\n Corresponding Source in the same way through the same place at no\n further charge. You need not require recipients to copy the\n Corresponding Source along with the object code. If the place to\n copy the object code is a network server, the Corresponding Source\n may be on a different server (operated by you or a third party)\n that supports equivalent copying facilities, provided you maintain\n clear directions next to the object code saying where to find the\n Corresponding Source. Regardless of what server hosts the\n Corresponding Source, you remain obligated to ensure that it is\n available for as long as needed to satisfy these requirements.\n\n e) Convey the object code using peer-to-peer transmission, provided\n you inform other peers where the object code and Corresponding\n Source of the work are being offered to the general public at no\n charge under subsection 6d.\n\n A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n A "User Product" is either (1) a "consumer product", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling. In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage. For a particular\nproduct received by a particular user, "normally used" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product. A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n "Installation Information" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source. The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information. But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed. Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n 7. Additional Terms.\n\n "Additional permissions" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law. If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit. (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.) You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n a) Disclaiming warranty or limiting liability differently from the\n terms of sections 15 and 16 of this License; or\n\n b) Requiring preservation of specified reasonable legal notices or\n author attributions in that material or in the Appropriate Legal\n Notices displayed by works containing it; or\n\n c) Prohibiting misrepresentation of the origin of that material, or\n requiring that modified versions of such material be marked in\n reasonable ways as different from the original version; or\n\n d) Limiting the use for publicity purposes of names of licensors or\n authors of the material; or\n\n e) Declining to grant rights under trademark law for use of some\n trade names, trademarks, or service marks; or\n\n f) Requiring indemnification of licensors and authors of that\n material by anyone who conveys the material (or modified versions of\n it) with contractual assumptions of liability to the recipient, for\n any liability that these contractual assumptions directly impose on\n those licensors and authors.\n\n All other non-permissive additional terms are considered "further\nrestrictions" within the meaning of section 10. If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term. If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n 8. Termination.\n\n You may not propagate or modify a covered work except as expressly\nprovided under this License. Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License. If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n 9. Acceptance Not Required for Having Copies.\n\n You are not required to accept this License in order to receive or\nrun a copy of the Program. Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance. However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work. These actions infringe copyright if you do\nnot accept this License. Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n 10. Automatic Licensing of Downstream Recipients.\n\n Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License. You are not responsible\nfor enforcing compliance by third parties with this License.\n\n An "entity transaction" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations. If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party\'s predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License. For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n 11. Patents.\n\n A "contributor" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based. The\nwork thus licensed is called the contributor\'s "contributor version".\n\n A contributor\'s "essential patent claims" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version. For\npurposes of this definition, "control" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor\'s essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n In the following three paragraphs, a "patent license" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement). To "grant" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients. "Knowingly relying" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient\'s use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n A patent license is "discriminatory" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License. You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n 12. No Surrender of Others\' Freedom.\n\n If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License. If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all. For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n 13. Use with the GNU Affero General Public License.\n\n Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work. The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n 14. Revised Versions of this License.\n\n The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time. Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License "or any later version" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation. If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy\'s\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n Later license versions may give you additional or different\npermissions. However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n 15. Disclaimer of Warranty.\n\n THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n 16. Limitation of Liability.\n\n IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n 17. Interpretation of Sections 15 and 16.\n\n If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n END OF TERMS AND CONDITIONS\n\n How to Apply These Terms to Your New Programs\n\n If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n To do so, attach the following notices to the program. It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe "copyright" line and a pointer to where the full notice is found.\n\n \n Copyright (C) \n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n\nAlso add information on how to contact you by electronic and paper mail.\n\n If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n Copyright (C) \n This program comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `show c\' for details.\n\nThe hypothetical commands `show w\' and `show c\' should show the appropriate\nparts of the General Public License. Of course, your program\'s commands\nmight be different; for a GUI interface, you would use an "about box".\n\n You should also get your employer (if you work as a programmer) or school,\nif any, to sign a "copyright disclaimer" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n.\n\n The GNU General Public License does not permit incorporating your program\ninto proprietary programs. If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library. If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License. But first, please read\n.\n', }, "GNU LGPLv3": { - "id": "LGPL-3.0", - "name": "GNU Lesser General Public License v3.0", - "text": " GNU LESSER GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n 0. Additional Definitions.\n\n As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library. The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n 1. Exception to Section 3 of the GNU GPL.\n\n You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n 2. Conveying Modified Versions.\n\n If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n a) under this License, provided that you make a good faith effort to\n ensure that, in the event an Application does not supply the\n function or data, the facility still operates, and performs\n whatever part of its purpose remains meaningful, or\n\n b) under the GNU GPL, with none of the additional permissions of\n this License applicable to that copy.\n\n 3. Object Code Incorporating Material from Library Header Files.\n\n The object code form of an Application may incorporate material from\na header file that is part of the Library. You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n a) Give prominent notice with each copy of the object code that the\n Library is used in it and that the Library and its use are\n covered by this License.\n\n b) Accompany the object code with a copy of the GNU GPL and this license\n document.\n\n 4. Combined Works.\n\n You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n a) Give prominent notice with each copy of the Combined Work that\n the Library is used in it and that the Library and its use are\n covered by this License.\n\n b) Accompany the Combined Work with a copy of the GNU GPL and this license\n document.\n\n c) For a Combined Work that displays copyright notices during\n execution, include the copyright notice for the Library among\n these notices, as well as a reference directing the user to the\n copies of the GNU GPL and this license document.\n\n d) Do one of the following:\n\n 0) Convey the Minimal Corresponding Source under the terms of this\n License, and the Corresponding Application Code in a form\n suitable for, and under terms that permit, the user to\n recombine or relink the Application with a modified version of\n the Linked Version to produce a modified Combined Work, in the\n manner specified by section 6 of the GNU GPL for conveying\n Corresponding Source.\n\n 1) Use a suitable shared library mechanism for linking with the\n Library. A suitable mechanism is one that (a) uses at run time\n a copy of the Library already present on the user's computer\n system, and (b) will operate properly with a modified version\n of the Library that is interface-compatible with the Linked\n Version.\n\n e) Provide Installation Information, but only if you would otherwise\n be required to provide such information under section 6 of the\n GNU GPL, and only to the extent that such information is\n necessary to install and execute a modified version of the\n Combined Work produced by recombining or relinking the\n Application with a modified version of the Linked Version. (If\n you use option 4d0, the Installation Information must accompany\n the Minimal Corresponding Source and Corresponding Application\n Code. If you use option 4d1, you must provide the Installation\n Information in the manner specified by section 6 of the GNU GPL\n for conveying Corresponding Source.)\n\n 5. Combined Libraries.\n\n You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n a) Accompany the combined library with a copy of the same work based\n on the Library, uncombined with any other library facilities,\n conveyed under the terms of this License.\n\n b) Give prominent notice with the combined library that part of it\n is a work based on the Library, and explaining where to find the\n accompanying uncombined form of the same work.\n\n 6. Revised Versions of the GNU Lesser General Public License.\n\n The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n" + id: "LGPL-3.0", + name: "GNU Lesser General Public License v3.0", + text: ' GNU LESSER GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n 0. Additional Definitions.\n\n As used herein, "this License" refers to version 3 of the GNU Lesser\nGeneral Public License, and the "GNU GPL" refers to version 3 of the GNU\nGeneral Public License.\n\n "The Library" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n An "Application" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n A "Combined Work" is a work produced by combining or linking an\nApplication with the Library. The particular version of the Library\nwith which the Combined Work was made is also called the "Linked\nVersion".\n\n The "Minimal Corresponding Source" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n The "Corresponding Application Code" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n 1. Exception to Section 3 of the GNU GPL.\n\n You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n 2. Conveying Modified Versions.\n\n If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n a) under this License, provided that you make a good faith effort to\n ensure that, in the event an Application does not supply the\n function or data, the facility still operates, and performs\n whatever part of its purpose remains meaningful, or\n\n b) under the GNU GPL, with none of the additional permissions of\n this License applicable to that copy.\n\n 3. Object Code Incorporating Material from Library Header Files.\n\n The object code form of an Application may incorporate material from\na header file that is part of the Library. You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n a) Give prominent notice with each copy of the object code that the\n Library is used in it and that the Library and its use are\n covered by this License.\n\n b) Accompany the object code with a copy of the GNU GPL and this license\n document.\n\n 4. Combined Works.\n\n You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n a) Give prominent notice with each copy of the Combined Work that\n the Library is used in it and that the Library and its use are\n covered by this License.\n\n b) Accompany the Combined Work with a copy of the GNU GPL and this license\n document.\n\n c) For a Combined Work that displays copyright notices during\n execution, include the copyright notice for the Library among\n these notices, as well as a reference directing the user to the\n copies of the GNU GPL and this license document.\n\n d) Do one of the following:\n\n 0) Convey the Minimal Corresponding Source under the terms of this\n License, and the Corresponding Application Code in a form\n suitable for, and under terms that permit, the user to\n recombine or relink the Application with a modified version of\n the Linked Version to produce a modified Combined Work, in the\n manner specified by section 6 of the GNU GPL for conveying\n Corresponding Source.\n\n 1) Use a suitable shared library mechanism for linking with the\n Library. A suitable mechanism is one that (a) uses at run time\n a copy of the Library already present on the user\'s computer\n system, and (b) will operate properly with a modified version\n of the Library that is interface-compatible with the Linked\n Version.\n\n e) Provide Installation Information, but only if you would otherwise\n be required to provide such information under section 6 of the\n GNU GPL, and only to the extent that such information is\n necessary to install and execute a modified version of the\n Combined Work produced by recombining or relinking the\n Application with a modified version of the Linked Version. (If\n you use option 4d0, the Installation Information must accompany\n the Minimal Corresponding Source and Corresponding Application\n Code. If you use option 4d1, you must provide the Installation\n Information in the manner specified by section 6 of the GNU GPL\n for conveying Corresponding Source.)\n\n 5. Combined Libraries.\n\n You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n a) Accompany the combined library with a copy of the same work based\n on the Library, uncombined with any other library facilities,\n conveyed under the terms of this License.\n\n b) Give prominent notice with the combined library that part of it\n is a work based on the Library, and explaining where to find the\n accompanying uncombined form of the same work.\n\n 6. Revised Versions of the GNU Lesser General Public License.\n\n The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License "or any later version"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy\'s public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n', }, "Mozilla Public License 2.0": { - "id": "MPL-2.0", - "name": "Mozilla Public License 2.0", - "text": "Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor\"\n means each individual or legal entity that creates, contributes to\n the creation of, or owns Covered Software.\n\n1.2. \"Contributor Version\"\n means the combination of the Contributions of others (if any) used\n by a Contributor and that particular Contributor's Contribution.\n\n1.3. \"Contribution\"\n means Covered Software of a particular Contributor.\n\n1.4. \"Covered Software\"\n means Source Code Form to which the initial Contributor has attached\n the notice in Exhibit A, the Executable Form of such Source Code\n Form, and Modifications of such Source Code Form, in each case\n including portions thereof.\n\n1.5. \"Incompatible With Secondary Licenses\"\n means\n\n (a) that the initial Contributor has attached the notice described\n in Exhibit B to the Covered Software; or\n\n (b) that the Covered Software was made available under the terms of\n version 1.1 or earlier of the License, but not also under the\n terms of a Secondary License.\n\n1.6. \"Executable Form\"\n means any form of the work other than Source Code Form.\n\n1.7. \"Larger Work\"\n means a work that combines Covered Software with other material, in\n a separate file or files, that is not Covered Software.\n\n1.8. \"License\"\n means this document.\n\n1.9. \"Licensable\"\n means having the right to grant, to the maximum extent possible,\n whether at the time of the initial grant or subsequently, any and\n all of the rights conveyed by this License.\n\n1.10. \"Modifications\"\n means any of the following:\n\n (a) any file in Source Code Form that results from an addition to,\n deletion from, or modification of the contents of Covered\n Software; or\n\n (b) any new file in Source Code Form that contains any Covered\n Software.\n\n1.11. \"Patent Claims\" of a Contributor\n means any patent claim(s), including without limitation, method,\n process, and apparatus claims, in any patent Licensable by such\n Contributor that would be infringed, but for the grant of the\n License, by the making, using, selling, offering for sale, having\n made, import, or transfer of either its Contributions or its\n Contributor Version.\n\n1.12. \"Secondary License\"\n means either the GNU General Public License, Version 2.0, the GNU\n Lesser General Public License, Version 2.1, the GNU Affero General\n Public License, Version 3.0, or any later versions of those\n licenses.\n\n1.13. \"Source Code Form\"\n means the form of the work preferred for making modifications.\n\n1.14. \"You\" (or \"Your\")\n means an individual or a legal entity exercising rights under this\n License. For legal entities, \"You\" includes any entity that\n controls, is controlled by, or is under common control with You. For\n purposes of this definition, \"control\" means (a) the power, direct\n or indirect, to cause the direction or management of such entity,\n whether by contract or otherwise, or (b) ownership of more than\n fifty percent (50%) of the outstanding shares or beneficial\n ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n Licensable by such Contributor to use, reproduce, make available,\n modify, display, perform, distribute, and otherwise exploit its\n Contributions, either on an unmodified basis, with Modifications, or\n as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n for sale, have made, import, and otherwise transfer either its\n Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n or\n\n(b) for infringements caused by: (i) Your and any other third party's\n modifications of Covered Software, or (ii) the combination of its\n Contributions with other software (except as part of its Contributor\n Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n Form, as described in Section 3.1, and You must inform recipients of\n the Executable Form how they can obtain a copy of such Source Code\n Form by reasonable means in a timely manner, at a charge no more\n than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n License, or sublicense it under different terms, provided that the\n license for the Executable Form does not attempt to limit or alter\n the recipients' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n* *\n* 6. Disclaimer of Warranty *\n* ------------------------- *\n* *\n* Covered Software is provided under this License on an \"as is\" *\n* basis, without warranty of any kind, either expressed, implied, or *\n* statutory, including, without limitation, warranties that the *\n* Covered Software is free of defects, merchantable, fit for a *\n* particular purpose or non-infringing. The entire risk as to the *\n* quality and performance of the Covered Software is with You. *\n* Should any Covered Software prove defective in any respect, You *\n* (not any Contributor) assume the cost of any necessary servicing, *\n* repair, or correction. This disclaimer of warranty constitutes an *\n* essential part of this License. No use of any Covered Software is *\n* authorized under this License except under this disclaimer. *\n* *\n************************************************************************\n\n************************************************************************\n* *\n* 7. Limitation of Liability *\n* -------------------------- *\n* *\n* Under no circumstances and under no legal theory, whether tort *\n* (including negligence), contract, or otherwise, shall any *\n* Contributor, or anyone who distributes Covered Software as *\n* permitted above, be liable to You for any direct, indirect, *\n* special, incidental, or consequential damages of any character *\n* including, without limitation, damages for lost profits, loss of *\n* goodwill, work stoppage, computer failure or malfunction, or any *\n* and all other commercial damages or losses, even if such party *\n* shall have been informed of the possibility of such damages. This *\n* limitation of liability shall not apply to liability for death or *\n* personal injury resulting from such party's negligence to the *\n* extent applicable law prohibits such limitation. Some *\n* jurisdictions do not allow the exclusion or limitation of *\n* incidental or consequential damages, so this exclusion and *\n* limitation may not apply to You. *\n* *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party's ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice\n---------------------------------------------------------\n\n This Source Code Form is \"Incompatible With Secondary Licenses\", as\n defined by the Mozilla Public License, v. 2.0.\n" + id: "MPL-2.0", + name: "Mozilla Public License 2.0", + text: 'Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. "Contributor"\n means each individual or legal entity that creates, contributes to\n the creation of, or owns Covered Software.\n\n1.2. "Contributor Version"\n means the combination of the Contributions of others (if any) used\n by a Contributor and that particular Contributor\'s Contribution.\n\n1.3. "Contribution"\n means Covered Software of a particular Contributor.\n\n1.4. "Covered Software"\n means Source Code Form to which the initial Contributor has attached\n the notice in Exhibit A, the Executable Form of such Source Code\n Form, and Modifications of such Source Code Form, in each case\n including portions thereof.\n\n1.5. "Incompatible With Secondary Licenses"\n means\n\n (a) that the initial Contributor has attached the notice described\n in Exhibit B to the Covered Software; or\n\n (b) that the Covered Software was made available under the terms of\n version 1.1 or earlier of the License, but not also under the\n terms of a Secondary License.\n\n1.6. "Executable Form"\n means any form of the work other than Source Code Form.\n\n1.7. "Larger Work"\n means a work that combines Covered Software with other material, in\n a separate file or files, that is not Covered Software.\n\n1.8. "License"\n means this document.\n\n1.9. "Licensable"\n means having the right to grant, to the maximum extent possible,\n whether at the time of the initial grant or subsequently, any and\n all of the rights conveyed by this License.\n\n1.10. "Modifications"\n means any of the following:\n\n (a) any file in Source Code Form that results from an addition to,\n deletion from, or modification of the contents of Covered\n Software; or\n\n (b) any new file in Source Code Form that contains any Covered\n Software.\n\n1.11. "Patent Claims" of a Contributor\n means any patent claim(s), including without limitation, method,\n process, and apparatus claims, in any patent Licensable by such\n Contributor that would be infringed, but for the grant of the\n License, by the making, using, selling, offering for sale, having\n made, import, or transfer of either its Contributions or its\n Contributor Version.\n\n1.12. "Secondary License"\n means either the GNU General Public License, Version 2.0, the GNU\n Lesser General Public License, Version 2.1, the GNU Affero General\n Public License, Version 3.0, or any later versions of those\n licenses.\n\n1.13. "Source Code Form"\n means the form of the work preferred for making modifications.\n\n1.14. "You" (or "Your")\n means an individual or a legal entity exercising rights under this\n License. For legal entities, "You" includes any entity that\n controls, is controlled by, or is under common control with You. For\n purposes of this definition, "control" means (a) the power, direct\n or indirect, to cause the direction or management of such entity,\n whether by contract or otherwise, or (b) ownership of more than\n fifty percent (50%) of the outstanding shares or beneficial\n ownership of such entity.\n\n2. License Grants and Conditions\n--------------------------------\n\n2.1. Grants\n\nEach Contributor hereby grants You a world-wide, royalty-free,\nnon-exclusive license:\n\n(a) under intellectual property rights (other than patent or trademark)\n Licensable by such Contributor to use, reproduce, make available,\n modify, display, perform, distribute, and otherwise exploit its\n Contributions, either on an unmodified basis, with Modifications, or\n as part of a Larger Work; and\n\n(b) under Patent Claims of such Contributor to make, use, sell, offer\n for sale, have made, import, and otherwise transfer either its\n Contributions or its Contributor Version.\n\n2.2. Effective Date\n\nThe licenses granted in Section 2.1 with respect to any Contribution\nbecome effective for each Contribution on the date the Contributor first\ndistributes such Contribution.\n\n2.3. Limitations on Grant Scope\n\nThe licenses granted in this Section 2 are the only rights granted under\nthis License. No additional rights or licenses will be implied from the\ndistribution or licensing of Covered Software under this License.\nNotwithstanding Section 2.1(b) above, no patent license is granted by a\nContributor:\n\n(a) for any code that a Contributor has removed from Covered Software;\n or\n\n(b) for infringements caused by: (i) Your and any other third party\'s\n modifications of Covered Software, or (ii) the combination of its\n Contributions with other software (except as part of its Contributor\n Version); or\n\n(c) under Patent Claims infringed by Covered Software in the absence of\n its Contributions.\n\nThis License does not grant any rights in the trademarks, service marks,\nor logos of any Contributor (except as may be necessary to comply with\nthe notice requirements in Section 3.4).\n\n2.4. Subsequent Licenses\n\nNo Contributor makes additional grants as a result of Your choice to\ndistribute the Covered Software under a subsequent version of this\nLicense (see Section 10.2) or under the terms of a Secondary License (if\npermitted under the terms of Section 3.3).\n\n2.5. Representation\n\nEach Contributor represents that the Contributor believes its\nContributions are its original creation(s) or it has sufficient rights\nto grant the rights to its Contributions conveyed by this License.\n\n2.6. Fair Use\n\nThis License is not intended to limit any rights You have under\napplicable copyright doctrines of fair use, fair dealing, or other\nequivalents.\n\n2.7. Conditions\n\nSections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted\nin Section 2.1.\n\n3. Responsibilities\n-------------------\n\n3.1. Distribution of Source Form\n\nAll distribution of Covered Software in Source Code Form, including any\nModifications that You create or to which You contribute, must be under\nthe terms of this License. You must inform recipients that the Source\nCode Form of the Covered Software is governed by the terms of this\nLicense, and how they can obtain a copy of this License. You may not\nattempt to alter or restrict the recipients\' rights in the Source Code\nForm.\n\n3.2. Distribution of Executable Form\n\nIf You distribute Covered Software in Executable Form then:\n\n(a) such Covered Software must also be made available in Source Code\n Form, as described in Section 3.1, and You must inform recipients of\n the Executable Form how they can obtain a copy of such Source Code\n Form by reasonable means in a timely manner, at a charge no more\n than the cost of distribution to the recipient; and\n\n(b) You may distribute such Executable Form under the terms of this\n License, or sublicense it under different terms, provided that the\n license for the Executable Form does not attempt to limit or alter\n the recipients\' rights in the Source Code Form under this License.\n\n3.3. Distribution of a Larger Work\n\nYou may create and distribute a Larger Work under terms of Your choice,\nprovided that You also comply with the requirements of this License for\nthe Covered Software. If the Larger Work is a combination of Covered\nSoftware with a work governed by one or more Secondary Licenses, and the\nCovered Software is not Incompatible With Secondary Licenses, this\nLicense permits You to additionally distribute such Covered Software\nunder the terms of such Secondary License(s), so that the recipient of\nthe Larger Work may, at their option, further distribute the Covered\nSoftware under the terms of either this License or such Secondary\nLicense(s).\n\n3.4. Notices\n\nYou may not remove or alter the substance of any license notices\n(including copyright notices, patent notices, disclaimers of warranty,\nor limitations of liability) contained within the Source Code Form of\nthe Covered Software, except that You may alter any license notices to\nthe extent required to remedy known factual inaccuracies.\n\n3.5. Application of Additional Terms\n\nYou may choose to offer, and to charge a fee for, warranty, support,\nindemnity or liability obligations to one or more recipients of Covered\nSoftware. However, You may do so only on Your own behalf, and not on\nbehalf of any Contributor. You must make it absolutely clear that any\nsuch warranty, support, indemnity, or liability obligation is offered by\nYou alone, and You hereby agree to indemnify every Contributor for any\nliability incurred by such Contributor as a result of warranty, support,\nindemnity or liability terms You offer. You may include additional\ndisclaimers of warranty and limitations of liability specific to any\njurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation\n---------------------------------------------------\n\nIf it is impossible for You to comply with any of the terms of this\nLicense with respect to some or all of the Covered Software due to\nstatute, judicial order, or regulation then You must: (a) comply with\nthe terms of this License to the maximum extent possible; and (b)\ndescribe the limitations and the code they affect. Such description must\nbe placed in a text file included with all distributions of the Covered\nSoftware under this License. Except to the extent prohibited by statute\nor regulation, such description must be sufficiently detailed for a\nrecipient of ordinary skill to be able to understand it.\n\n5. Termination\n--------------\n\n5.1. The rights granted under this License will terminate automatically\nif You fail to comply with any of its terms. However, if You become\ncompliant, then the rights granted under this License from a particular\nContributor are reinstated (a) provisionally, unless and until such\nContributor explicitly and finally terminates Your grants, and (b) on an\nongoing basis, if such Contributor fails to notify You of the\nnon-compliance by some reasonable means prior to 60 days after You have\ncome back into compliance. Moreover, Your grants from a particular\nContributor are reinstated on an ongoing basis if such Contributor\nnotifies You of the non-compliance by some reasonable means, this is the\nfirst time You have received notice of non-compliance with this License\nfrom such Contributor, and You become compliant prior to 30 days after\nYour receipt of the notice.\n\n5.2. If You initiate litigation against any entity by asserting a patent\ninfringement claim (excluding declaratory judgment actions,\ncounter-claims, and cross-claims) alleging that a Contributor Version\ndirectly or indirectly infringes any patent, then the rights granted to\nYou by any and all Contributors for the Covered Software under Section\n2.1 of this License shall terminate.\n\n5.3. In the event of termination under Sections 5.1 or 5.2 above, all\nend user license agreements (excluding distributors and resellers) which\nhave been validly granted by You or Your distributors under this License\nprior to termination shall survive termination.\n\n************************************************************************\n* *\n* 6. Disclaimer of Warranty *\n* ------------------------- *\n* *\n* Covered Software is provided under this License on an "as is" *\n* basis, without warranty of any kind, either expressed, implied, or *\n* statutory, including, without limitation, warranties that the *\n* Covered Software is free of defects, merchantable, fit for a *\n* particular purpose or non-infringing. The entire risk as to the *\n* quality and performance of the Covered Software is with You. *\n* Should any Covered Software prove defective in any respect, You *\n* (not any Contributor) assume the cost of any necessary servicing, *\n* repair, or correction. This disclaimer of warranty constitutes an *\n* essential part of this License. No use of any Covered Software is *\n* authorized under this License except under this disclaimer. *\n* *\n************************************************************************\n\n************************************************************************\n* *\n* 7. Limitation of Liability *\n* -------------------------- *\n* *\n* Under no circumstances and under no legal theory, whether tort *\n* (including negligence), contract, or otherwise, shall any *\n* Contributor, or anyone who distributes Covered Software as *\n* permitted above, be liable to You for any direct, indirect, *\n* special, incidental, or consequential damages of any character *\n* including, without limitation, damages for lost profits, loss of *\n* goodwill, work stoppage, computer failure or malfunction, or any *\n* and all other commercial damages or losses, even if such party *\n* shall have been informed of the possibility of such damages. This *\n* limitation of liability shall not apply to liability for death or *\n* personal injury resulting from such party\'s negligence to the *\n* extent applicable law prohibits such limitation. Some *\n* jurisdictions do not allow the exclusion or limitation of *\n* incidental or consequential damages, so this exclusion and *\n* limitation may not apply to You. *\n* *\n************************************************************************\n\n8. Litigation\n-------------\n\nAny litigation relating to this License may be brought only in the\ncourts of a jurisdiction where the defendant maintains its principal\nplace of business and such litigation shall be governed by laws of that\njurisdiction, without reference to its conflict-of-law provisions.\nNothing in this Section shall prevent a party\'s ability to bring\ncross-claims or counter-claims.\n\n9. Miscellaneous\n----------------\n\nThis License represents the complete agreement concerning the subject\nmatter hereof. If any provision of this License is held to be\nunenforceable, such provision shall be reformed only to the extent\nnecessary to make it enforceable. Any law or regulation which provides\nthat the language of a contract shall be construed against the drafter\nshall not be used to construe this License against a Contributor.\n\n10. Versions of the License\n---------------------------\n\n10.1. New Versions\n\nMozilla Foundation is the license steward. Except as provided in Section\n10.3, no one other than the license steward has the right to modify or\npublish new versions of this License. Each version will be given a\ndistinguishing version number.\n\n10.2. Effect of New Versions\n\nYou may distribute the Covered Software under the terms of the version\nof the License under which You originally received the Covered Software,\nor under the terms of any subsequent version published by the license\nsteward.\n\n10.3. Modified Versions\n\nIf you create software not governed by this License, and you want to\ncreate a new license for such software, you may create and use a\nmodified version of this License if you rename the license and remove\nany references to the name of the license steward (except to note that\nsuch modified license differs from this License).\n\n10.4. Distributing Source Code Form that is Incompatible With Secondary\nLicenses\n\nIf You choose to distribute Source Code Form that is Incompatible With\nSecondary Licenses under the terms of this version of the License, the\nnotice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice\n-------------------------------------------\n\n This Source Code Form is subject to the terms of the Mozilla Public\n License, v. 2.0. If a copy of the MPL was not distributed with this\n file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular\nfile, then You may include the notice in a location (such as a LICENSE\nfile in a relevant directory) where a recipient would be likely to look\nfor such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - "Incompatible With Secondary Licenses" Notice\n---------------------------------------------------------\n\n This Source Code Form is "Incompatible With Secondary Licenses", as\n defined by the Mozilla Public License, v. 2.0.\n', }, "Apache License 2.0": { - "id": "Apache-2.0", - "name": "Apache License 2.0", - "text": " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n" + id: "Apache-2.0", + name: "Apache License 2.0", + text: ' Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n "License" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n "Licensor" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n "Legal Entity" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n "control" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n "You" (or "Your") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n "Source" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n "Object" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n "Work" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n "Derivative Works" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n "Contribution" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, "submitted"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as "Not a Contribution."\n\n "Contributor" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a "NOTICE" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an "AS IS" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets "[]"\n replaced with your own identifying information. (Don\'t include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same "printed page" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the "License");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an "AS IS" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n', }, "MIT License": { - "id": "MIT", - "name": "MIT License", - "text": "MIT License\n\nCopyright (c) [year] [fullname] <[email]>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n" + id: "MIT", + name: "MIT License", + text: 'MIT License\n\nCopyright (c) [year] [fullname] <[email]>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n', }, "The Unlicense": { - "id": "Unlicense", - "name": "The Unlicense", - "text": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to \n" - } -}/** END LICENSES */; + id: "Unlicense", + name: "The Unlicense", + text: 'This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to \n', + }, +}; /** END LICENSES */ export type LicenseType = | "Qhull" @@ -614,4 +626,4 @@ export type LicenseType = | "OLDAP-2.5" | "Artistic-1.0-Perl" | "gSOAP-1.3b" - | "NPOSL-3.0"; \ No newline at end of file + | "NPOSL-3.0"; diff --git a/src/lib/core/migrationContextBase.ts b/src/lib/core/migrationContextBase.ts index 32c9fcbdc..fd318b9ef 100644 --- a/src/lib/core/migrationContextBase.ts +++ b/src/lib/core/migrationContextBase.ts @@ -1,3 +1,6 @@ +/** + * + */ export abstract class MigrationContextBase { public packageJson!: Record; public ioPackageJson!: Record; @@ -5,9 +8,7 @@ export abstract class MigrationContextBase { public abstract joinPath(...parts: string[]): string; public abstract readTextFile(fileName: string): Promise; - public abstract readJsonFile( - fileName: string, - ): Promise>; + public abstract readJsonFile(fileName: string): Promise>; public abstract directoryExists(dirName: string): Promise; public abstract fileExists(dirName: string): Promise; @@ -18,10 +19,20 @@ export abstract class MigrationContextBase { filter?: (fileName: string) => boolean, ): Promise; + /** + * + * @param packageName + */ public hasDevDependency(packageName: string): boolean { - return this.packageJson.devDependencies?.hasOwnProperty(packageName); + if (this.packageJson.devDependencies) { + return Object.prototype.hasOwnProperty.call(this.packageJson.devDependencies, packageName); + } + return false; } + /** + * + */ public async getMainFileContent(): Promise { if ( !this.packageJson.main || @@ -34,19 +45,10 @@ export abstract class MigrationContextBase { try { const tsMains = [ - this.joinPath( - "src", - this.packageJson.main.replace(/\.js$/, ".ts"), - ), - this.packageJson.main - .replace(/\.js$/, ".ts") - .replace(/^dist([\\/])/, "src$1"), - this.packageJson.main - .replace(/\.js$/, ".ts") - .replace(/^build([\\/])/, "src$1"), - this.packageJson.main - .replace(/\.js$/, ".ts") - .replace(/^(build|dist)[\\/]/, ""), + this.joinPath("src", this.packageJson.main.replace(/\.js$/, ".ts")), + this.packageJson.main.replace(/\.js$/, ".ts").replace(/^dist([\\/])/, "src$1"), + this.packageJson.main.replace(/\.js$/, ".ts").replace(/^build([\\/])/, "src$1"), + this.packageJson.main.replace(/\.js$/, ".ts").replace(/^(build|dist)[\\/]/, ""), ]; for (const tsMain of tsMains) { if (await this.fileExists(tsMain)) { @@ -61,10 +63,14 @@ export abstract class MigrationContextBase { } } + /** + * + * @param either + * @param or + */ public async analyzeCode(either: string, or: string): Promise { const content = await this.getMainFileContent(); - const eitherCount = (content.match(new RegExp(either, "g")) || []) - .length; + const eitherCount = (content.match(new RegExp(either, "g")) || []).length; const orCount = (content.match(new RegExp(or, "g")) || []).length; return eitherCount >= orCount; } diff --git a/src/lib/core/questions.test.ts b/src/lib/core/questions.test.ts index 16140aadb..92b1aaa40 100644 --- a/src/lib/core/questions.test.ts +++ b/src/lib/core/questions.test.ts @@ -4,7 +4,7 @@ import { questions, testCondition } from "./questions"; describe("questions/questions", () => { it("should be an array of question objects", () => { questions.should.be.an("array"); - questions.forEach((q) => { + questions.forEach(q => { q.should.have.property("type"); expect(typeof q.type).to.equal("string"); }); @@ -18,39 +18,21 @@ describe("questions/testCondition()", () => { }); it(`for a "value" condition, it should return whether the answer equals the desired value`, () => { - testCondition( - { name: "prop", value: "foo" }, - { prop: "foo" }, - ).should.equal(true); + testCondition({ name: "prop", value: "foo" }, { prop: "foo" }).should.equal(true); - testCondition( - { name: "prop", value: "bar" }, - { prop: "foo" }, - ).should.equal(false); + testCondition({ name: "prop", value: "bar" }, { prop: "foo" }).should.equal(false); }); it(`for a "contains" condition, it should return whether the answer array contains the desired value`, () => { - testCondition( - { name: "prop", contains: "foo" }, - { prop: ["bar", "foo"] }, - ).should.equal(true); + testCondition({ name: "prop", contains: "foo" }, { prop: ["bar", "foo"] }).should.equal(true); - testCondition( - { name: "prop", contains: "baz" }, - { prop: ["bar", "foo"] }, - ).should.equal(false); + testCondition({ name: "prop", contains: "baz" }, { prop: ["bar", "foo"] }).should.equal(false); }); it(`for a "doesNotContain" condition, it should return whether the answer array contains the desired value`, () => { - testCondition( - { name: "prop", doesNotContain: "foo" }, - { prop: ["bar", "foo"] }, - ).should.equal(false); + testCondition({ name: "prop", doesNotContain: "foo" }, { prop: ["bar", "foo"] }).should.equal(false); - testCondition( - { name: "prop", doesNotContain: "baz" }, - { prop: ["bar", "foo"] }, - ).should.equal(true); + testCondition({ name: "prop", doesNotContain: "baz" }, { prop: ["bar", "foo"] }).should.equal(true); }); it("should return false for invalid conditions", () => { diff --git a/src/lib/core/questions.ts b/src/lib/core/questions.ts index c7f0a2e0f..28178ba79 100644 --- a/src/lib/core/questions.ts +++ b/src/lib/core/questions.ts @@ -21,76 +21,102 @@ import type { MigrationContextBase } from "./migrationContextBase"; // This is being used to simulate wrong options for conditions on the type level const __misused: unique symbol = Symbol.for("__misused"); -type QuestionAction = ( - value: T, - options?: unknown, -) => CheckResult | Promise; +type QuestionAction = (value: T, options?: unknown) => CheckResult | Promise; export type AnswerValue = string | boolean | number; -export type Condition = { name: string } & ( - | { value: AnswerValue | AnswerValue[] } - | { contains: AnswerValue } - | { doesNotContain: AnswerValue } - | { [__misused]: undefined } +export type Condition = { + /** + * + */ + name: string; +} & ( + | { + /** + * + */ + value: AnswerValue | AnswerValue[]; + } + | { + /** + * + */ + contains: AnswerValue; + } + | { + /** + * + */ + doesNotContain: AnswerValue; + } + | { + /** + * + */ + [__misused]: undefined; + } ); -export function testCondition( - condition: Condition | Condition[] | undefined, - answers: Record, -): boolean { - if (condition == undefined) return true; +/** + * + * @param condition + * @param answers + */ +export function testCondition(condition: Condition | Condition[] | undefined, answers: Record): boolean { + if (condition == undefined) { + return true; + } function testSingleCondition(cond: Condition): boolean { if ("value" in cond) { return answers[cond.name] === cond.value; } else if ("contains" in cond) { - return ( - answers[cond.name] && - (answers[cond.name] as AnswerValue[]).indexOf(cond.contains) > - -1 - ); + return answers[cond.name] && (answers[cond.name] as AnswerValue[]).indexOf(cond.contains) > -1; } else if ("doesNotContain" in cond) { - return ( - !answers[cond.name] || - (answers[cond.name] as AnswerValue[]).indexOf( - cond.doesNotContain, - ) === -1 - ); + return !answers[cond.name] || (answers[cond.name] as AnswerValue[]).indexOf(cond.doesNotContain) === -1; } return false; } if (isArray(condition)) { - return condition.every((cond) => testSingleCondition(cond)); - } else { - return testSingleCondition(condition); + return condition.every(cond => testSingleCondition(cond)); } + return testSingleCondition(condition); } export type MigrateFunc = ( context: MigrationContextBase, answers: Record, question: Question, -) => - | Promise - | AnswerValue - | AnswerValue[] - | undefined; +) => Promise | AnswerValue | AnswerValue[] | undefined; export type TransformResult = ( val: AnswerValue | AnswerValue[], -) => - | AnswerValue - | AnswerValue[] - | undefined - | Promise; +) => AnswerValue | AnswerValue[] | undefined | Promise; +/** + * + */ export interface QuestionMeta { + /** + * + */ label: string; /** One or more conditions that need(s) to be fulfilled for this question to be asked */ condition?: Condition | Condition[]; + /** + * + */ replay?: (answers: Record) => void; + /** + * + */ migrate?: MigrateFunc; + /** + * + */ resultTransform?: TransformResult; + /** + * + */ action?: QuestionAction; /** Whether an answer for this question is optional */ optional?: boolean; @@ -102,9 +128,21 @@ export interface QuestionMeta { } export type Question = SpecificPromptOptions & QuestionMeta; +/** + * + */ export interface QuestionGroup { + /** + * + */ title: string; + /** + * + */ headline: string; + /** + * + */ questions: Question[]; } @@ -138,7 +176,7 @@ export const questionGroups: QuestionGroup[] = [ message: "Please enter the name of your project:", resultTransform: transformAdapterName, action: checkAdapterName, - migrate: (ctx) => ctx.ioPackageJson.common?.name, + migrate: ctx => ctx.ioPackageJson.common?.name, }, { type: "input", @@ -146,9 +184,7 @@ export const questionGroups: QuestionGroup[] = [ label: "Title", message: "Which title should be shown in the admin UI?", action: checkTitle, - migrate: (ctx) => - ctx.ioPackageJson.common?.titleLang?.en || - ctx.ioPackageJson.common?.title, + migrate: ctx => ctx.ioPackageJson.common?.titleLang?.en || ctx.ioPackageJson.common?.title, }, { type: "input", @@ -158,36 +194,28 @@ export const questionGroups: QuestionGroup[] = [ hint: "(optional)", optional: true, resultTransform: transformDescription, - migrate: (ctx) => - ctx.ioPackageJson.common?.desc?.en || - ctx.ioPackageJson.common?.desc, + migrate: ctx => ctx.ioPackageJson.common?.desc?.en || ctx.ioPackageJson.common?.desc, }, { type: "input", name: "keywords", label: "Keywords", - message: - "Enter some keywords (separated by commas) to describe your project:", + message: "Enter some keywords (separated by commas) to describe your project:", hint: "(optional)", optional: true, resultTransform: transformKeywords, - migrate: (ctx) => - ( - ctx.ioPackageJson.common?.keywords || - ctx.packageJson.common?.keywords || - [] - ).join(","), + migrate: ctx => + (ctx.ioPackageJson.common?.keywords || ctx.packageJson.common?.keywords || []).join(","), }, { type: "input", name: "contributors", label: "Contributors", - message: - "If you have any contributors, please enter their names (seperated by commas):", + message: "If you have any contributors, please enter their names (seperated by commas):", hint: "(optional)", optional: true, resultTransform: transformContributors, - migrate: (ctx) => + migrate: ctx => (ctx.packageJson.contributors || []) .map((c: Record) => c.name) .filter((name: string) => !!name) @@ -233,36 +261,33 @@ export const questionGroups: QuestionGroup[] = [ { message: "Visualization", value: "vis" }, ], action: checkMinSelections.bind(undefined, "feature", 1), - migrate: async (ctx) => + migrate: async ctx => [ (await ctx.directoryExists("admin")) ? "adapter" : null, (await ctx.directoryExists("widgets")) ? "vis" : null, - ].filter((f) => !!f) as string[], + ].filter(f => !!f) as string[], }), styledMultiselect({ condition: { name: "features", contains: "adapter" }, name: "adminFeatures", label: "Admin Features", expert: true, - message: - "Which additional features should be available in the admin?", + message: "Which additional features should be available in the admin?", hint: "(optional)", initial: [], choices: [ { message: "An extra tab", value: "tab" }, { message: "Custom options for states", value: "custom" }, ], - migrate: async (ctx) => + migrate: async ctx => [ - (await ctx.fileExists("admin/tab.html")) || - (await ctx.fileExists("admin/tab_m.html")) + (await ctx.fileExists("admin/tab.html")) || (await ctx.fileExists("admin/tab_m.html")) ? "tab" : null, - (await ctx.fileExists("admin/custom.html")) || - (await ctx.fileExists("admin/custom_m.html")) + (await ctx.fileExists("admin/custom.html")) || (await ctx.fileExists("admin/custom_m.html")) ? "custom" : null, - ].filter((f) => !!f) as string[], + ].filter(f => !!f) as string[], }), { condition: { name: "features", contains: "adapter" }, @@ -272,23 +297,19 @@ export const questionGroups: QuestionGroup[] = [ message: "Which category does your adapter fall into?", choices: [ { - message: - "Alarm / security (Home, car, boat, ...)", + message: "Alarm / security (Home, car, boat, ...)", value: "alarm", }, { - message: - "Calendars (also schedules, etc., ...)", + message: "Calendars (also schedules, etc., ...)", value: "date-and-time", }, { - message: - "Cars / Vehicles (trip information, vehicle status, aux. heating, ...)", + message: "Cars / Vehicles (trip information, vehicle status, aux. heating, ...)", value: "vehicle", }, { - message: - "Climate control (A/C, Heaters, air filters, ...)", + message: "Climate control (A/C, Heaters, air filters, ...)", value: "climate-control", }, { @@ -296,54 +317,44 @@ export const questionGroups: QuestionGroup[] = [ value: "protocols", }, { - message: - "Data storage (SQL/NoSQL, file storage, logging, ...)", + message: "Data storage (SQL/NoSQL, file storage, logging, ...)", value: "storage", }, { - message: - "Data transmission (for other services via REST api, websockets, ...)", + message: "Data transmission (for other services via REST api, websockets, ...)", value: "communication", }, { - message: - "Garden (Mowers, watering, ...)", + message: "Garden (Mowers, watering, ...)", value: "garden", }, { - message: - "General purpose (like admin, web, discovery, ...)", + message: "General purpose (like admin, web, discovery, ...)", value: "general", }, { - message: - "Geo positioning (transmission and receipt of position data)", + message: "Geo positioning (transmission and receipt of position data)", value: "geoposition", }, { - message: - "Hardware (low-level, multi-purpose)", + message: "Hardware (low-level, multi-purpose)", value: "hardware", }, { - message: - "Health (Fitness sensors, weight, pulse, ...)", + message: "Health (Fitness sensors, weight, pulse, ...)", value: "health", }, { - message: - "Household devices (Vacuums, kitchen, ...)", + message: "Household devices (Vacuums, kitchen, ...)", value: "household", }, { message: "Lighting control", value: "lighting" }, { - message: - "Logic (Scripts, rules, parsers, scenes, ...)", + message: "Logic (Scripts, rules, parsers, scenes, ...)", value: "logic", }, { - message: - "Messaging (E-Mail, Telegram, WhatsApp, ...)", + message: "Messaging (E-Mail, Telegram, WhatsApp, ...)", value: "messaging", }, { @@ -355,49 +366,41 @@ export const questionGroups: QuestionGroup[] = [ value: "metering", }, { - message: - "Miscellaneous data (Import/export of contacts, gasoline prices, ...)", + message: "Miscellaneous data (Import/export of contacts, gasoline prices, ...)", value: "misc-data", }, { - message: - "Miscellaneous utilities (Data import/emport, backup, ...)", + message: "Miscellaneous utilities (Data import/emport, backup, ...)", value: "utility", }, { - message: - "Multimedia (TV, audio, remote controls, ...)", + message: "Multimedia (TV, audio, remote controls, ...)", value: "multimedia", }, { - message: - "Network infrastructure (Hardware, printers, phones, ...)", + message: "Network infrastructure (Hardware, printers, phones, ...)", value: "infrastructure", }, { - message: - "Network utilities (Ping, UPnP, network discovery, ...)", + message: "Network utilities (Ping, UPnP, network discovery, ...)", value: "network", }, { - message: - "Smart home systems (3rd party, hardware and software)", + message: "Smart home systems (3rd party, hardware and software)", value: "iot-systems", }, { - message: - "Visualizations (VIS, MaterialUI, mobile views, ...)", + message: "Visualizations (VIS, MaterialUI, mobile views, ...)", value: "visualization", }, // visualization-icons and visualization-widgets are a separate question for // VIS projects { - message: - "Weather (Forecast, air quality, statistics, ...)", + message: "Weather (Forecast, air quality, statistics, ...)", value: "weather", }, ], - migrate: (ctx) => ctx.ioPackageJson.common?.type, + migrate: ctx => ctx.ioPackageJson.common?.type, }, { condition: { name: "features", contains: "vis" }, @@ -409,7 +412,7 @@ export const questionGroups: QuestionGroup[] = [ { message: "Icons for VIS", value: "visualization-icons" }, { message: "VIS widgets", value: "visualization-widgets" }, ], - migrate: (ctx) => ctx.ioPackageJson.common?.type, + migrate: ctx => ctx.ioPackageJson.common?.type, }, { condition: { name: "features", contains: "vis" }, @@ -424,8 +427,7 @@ export const questionGroups: QuestionGroup[] = [ value: "main", }, { - message: - "The adapter also works without the visualization of the widget", + message: "The adapter also works without the visualization of the widget", value: "additional", }, ], @@ -452,7 +454,7 @@ export const questionGroups: QuestionGroup[] = [ }, { message: "never", value: "none" }, ], - migrate: (ctx) => ctx.ioPackageJson.common?.mode, + migrate: ctx => ctx.ioPackageJson.common?.mode, }, { condition: { name: "startMode", value: "schedule" }, @@ -460,12 +462,10 @@ export const questionGroups: QuestionGroup[] = [ name: "scheduleStartOnChange", label: "Schedule", expert: true, - message: - "Should the adapter also be started when the configuration is changed?", + message: "Should the adapter also be started when the configuration is changed?", initial: "no", choices: ["yes", "no"], - migrate: (ctx) => - ctx.ioPackageJson.common?.allowInit ? "yes" : "no", + migrate: ctx => (ctx.ioPackageJson.common?.allowInit ? "yes" : "no"), }, { condition: { name: "features", contains: "adapter" }, @@ -481,7 +481,7 @@ export const questionGroups: QuestionGroup[] = [ value: "local", }, ], - migrate: (ctx) => ctx.ioPackageJson.common?.connectionType, + migrate: ctx => ctx.ioPackageJson.common?.connectionType, }, { condition: { name: "features", contains: "adapter" }, @@ -492,13 +492,11 @@ export const questionGroups: QuestionGroup[] = [ message: `How will the adapter receive its data?`, choices: [ { - message: - "Request it regularly from the service or device", + message: "Request it regularly from the service or device", value: "poll", }, { - message: - "The service or device actively sends new data", + message: "The service or device actively sends new data", value: "push", }, { @@ -507,7 +505,7 @@ export const questionGroups: QuestionGroup[] = [ value: "assumption", }, ], - migrate: (ctx) => ctx.ioPackageJson.common?.dataSource, + migrate: ctx => ctx.ioPackageJson.common?.dataSource, }, { condition: { name: "features", contains: "adapter" }, @@ -519,12 +517,8 @@ export const questionGroups: QuestionGroup[] = [ hint: "(To some device or some service)", initial: "no", choices: ["yes", "no"], - migrate: (ctx) => - ctx.ioPackageJson.instanceObjects?.some( - (o: any) => o._id === "info.connection", - ) - ? "yes" - : "no", + migrate: ctx => + ctx.ioPackageJson.instanceObjects?.some((o: any) => o._id === "info.connection") ? "yes" : "no", }, ], }, @@ -555,15 +549,10 @@ export const questionGroups: QuestionGroup[] = [ type: "select", name: "language", label: "Programming Language", - message: - "Which language do you want to use to code the adapter?", + message: "Which language do you want to use to code the adapter?", choices: ["JavaScript", "TypeScript"], - migrate: async (ctx) => - (await ctx.hasFilesWithExtension( - "src", - ".ts", - (f) => !f.endsWith(".d.ts"), - )) + migrate: async ctx => + (await ctx.hasFilesWithExtension("src", ".ts", f => !f.endsWith(".d.ts"))) ? "TypeScript" : "JavaScript", }, @@ -574,11 +563,10 @@ export const questionGroups: QuestionGroup[] = [ label: "Node.js version", expert: true, optional: true, - message: - "What's the minimum Node.js version you want to support?", + message: "What's the minimum Node.js version you want to support?", initial: "20", choices: ["20", "22", "24"], - migrate: (ctx) => { + migrate: ctx => { if (ctx.hasDevDependency("@tsconfig/node18")) { return "20"; // For migrations upgrade to Node.js 20 as minimum } else if (ctx.hasDevDependency("@tsconfig/node20")) { @@ -587,9 +575,8 @@ export const questionGroups: QuestionGroup[] = [ return "22"; } else if (ctx.hasDevDependency("@tsconfig/node24")) { return "24"; - } else { - return "20"; } + return "20"; }, }, { @@ -597,8 +584,7 @@ export const questionGroups: QuestionGroup[] = [ type: "select", name: "adminUi", label: "Admin UI", - message: - "Which framework would you like to use for the Admin UI?", + message: "Which framework would you like to use for the Admin UI?", initial: "json", choices: [ { @@ -639,9 +625,8 @@ export const questionGroups: QuestionGroup[] = [ message: "Use React for the tab UI?", initial: "no", choices: ["yes", "no"], - migrate: async (ctx) => - (await ctx.fileExists("admin/src/tab.jsx")) || - (await ctx.fileExists("admin/src/tab.tsx")) + migrate: async ctx => + (await ctx.fileExists("admin/src/tab.jsx")) || (await ctx.fileExists("admin/src/tab.tsx")) ? "yes" : "no", }, @@ -663,17 +648,13 @@ export const questionGroups: QuestionGroup[] = [ hint: "(Requires VSCode and Docker, starts a fresh ioBroker in a Docker container with only your adapter installed)", }, ], - migrate: async (ctx) => + migrate: async ctx => [ ctx.hasDevDependency("eslint") ? "ESLint" : null, - ctx.hasDevDependency("typescript") - ? "type checking" - : null, + ctx.hasDevDependency("typescript") ? "type checking" : null, ctx.hasDevDependency("prettier") ? "Prettier" : null, - (await ctx.directoryExists(".devcontainer")) - ? "devcontainer" - : null, - ].filter((f) => !!f) as string[], + (await ctx.directoryExists(".devcontainer")) ? "devcontainer" : null, + ].filter(f => !!f) as string[], }), styledMultiselect({ condition: { name: "language", value: "TypeScript" }, @@ -694,16 +675,34 @@ export const questionGroups: QuestionGroup[] = [ }, ], action: checkTypeScriptTools, - migrate: async (ctx) => + migrate: async ctx => [ ctx.hasDevDependency("eslint") ? "ESLint" : null, ctx.hasDevDependency("prettier") ? "Prettier" : null, ctx.hasDevDependency("nyc") ? "code coverage" : null, - (await ctx.directoryExists(".devcontainer")) - ? "devcontainer" - : null, - ].filter((f) => !!f) as string[], + (await ctx.directoryExists(".devcontainer")) ? "devcontainer" : null, + ].filter(f => !!f) as string[], }), + { + condition: { name: "tools", contains: "ESLint" }, + type: "select", + name: "eslintConfig", + label: "ESLint Configuration", + message: "Do you want to configure ESLint by yourself or use the official ioBroker ESLint config?", + initial: "official", + choices: [ + { + message: "Use official ioBroker ESLint config (includes prettier)", + hint: "(recommended)", + value: "official", + }, + { + message: "Configure ESLint by yourself", + value: "custom", + }, + ], + migrate: () => "custom", // Default to custom for existing projects + }, { condition: [ { name: "features", contains: "adapter" }, @@ -728,23 +727,16 @@ export const questionGroups: QuestionGroup[] = [ value: "words.js", }, ], - migrate: async (ctx) => - (await ctx.fileExists("admin/i18n/en/translations.json")) - ? "JSON" - : "words.js", + migrate: async ctx => ((await ctx.fileExists("admin/i18n/en/translations.json")) ? "JSON" : "words.js"), }, { type: "select", name: "releaseScript", label: "Release Script", - message: - "Would you like to automate new releases with one simple command?", + message: "Would you like to automate new releases with one simple command?", initial: "yes", choices: ["yes", "no"], - migrate: async (ctx) => - ctx.hasDevDependency("@alcalzone/release-script") - ? "yes" - : "no", + migrate: async ctx => (ctx.hasDevDependency("@alcalzone/release-script") ? "yes" : "no"), }, { condition: [ @@ -766,8 +758,7 @@ export const questionGroups: QuestionGroup[] = [ type: "numeral", name: "devServerPort", label: "dev-server Admin Port", - message: - "Please choose the port number on which dev-server should present the admin web interface:", + message: "Please choose the port number on which dev-server should present the admin web interface:", initial: 8081, min: 1024, max: 0xffff, @@ -781,8 +772,7 @@ export const questionGroups: QuestionGroup[] = [ message: "Do you prefer tab or space indentation?", initial: "Tab", choices: ["Tab", "Space (4)"], - migrate: async (ctx) => - (await ctx.analyzeCode("\t", " ")) ? "Tab" : "Space (4)", + migrate: async ctx => ((await ctx.analyzeCode("\t", " ")) ? "Tab" : "Space (4)"), }, { condition: { name: "features", contains: "adapter" }, @@ -792,8 +782,7 @@ export const questionGroups: QuestionGroup[] = [ message: "Do you prefer double or single quotes?", initial: "double", choices: ["double", "single"], - migrate: async (ctx) => - (await ctx.analyzeCode('"', "'")) ? "double" : "single", + migrate: async ctx => ((await ctx.analyzeCode('"', "'")) ? "double" : "single"), }, ], }, @@ -807,7 +796,7 @@ export const questionGroups: QuestionGroup[] = [ label: "Author Name", message: "Please enter your name (or nickname):", action: checkAuthorName, - migrate: (ctx) => ctx.packageJson.author?.name, + migrate: ctx => ctx.packageJson.author?.name, }, { type: "input", @@ -816,11 +805,7 @@ export const questionGroups: QuestionGroup[] = [ message: "What's your name/org on GitHub?", initial: ((answers: Answers) => answers.authorName) as any, action: checkAuthorName, - migrate: (ctx) => - ctx.ioPackageJson.common?.extIcon?.replace( - /^\w+:\/\/[^\/]+\.com\/([^\/]+)\/.+$/, - "$1", - ), + migrate: ctx => ctx.ioPackageJson.common?.extIcon?.replace(/^\w+:\/\/[^/]+\.com\/([^/]+)\/.+$/, "$1"), }, { type: "input", @@ -828,7 +813,7 @@ export const questionGroups: QuestionGroup[] = [ label: "Adapter E-Mail", message: "What's your email address?", action: checkEmail, - migrate: (ctx) => ctx.packageJson.author?.email, + migrate: ctx => ctx.packageJson.author?.email, }, { type: "select", @@ -846,10 +831,7 @@ export const questionGroups: QuestionGroup[] = [ hint: "(requires you to setup SSH keys)", }, ], - migrate: (ctx) => - ctx.packageJson.repository?.url?.match(/^git@/) - ? "SSH" - : "HTTPS", + migrate: ctx => (ctx.packageJson.repository?.url?.match(/^git@/) ? "SSH" : "HTTPS"), }, { condition: { name: "cli", value: true }, @@ -879,10 +861,7 @@ export const questionGroups: QuestionGroup[] = [ hint: "(deprecated)", }, ], - migrate: (ctx) => - ctx.ioPackageJson.common?.extIcon?.match(/\/main\/admin\//i) - ? "main" - : "master", + migrate: ctx => (ctx.ioPackageJson.common?.extIcon?.match(/\/main\/admin\//i) ? "main" : "master"), }, { type: "select", @@ -900,57 +879,96 @@ export const questionGroups: QuestionGroup[] = [ "MIT License", "The Unlicense", ], - migrate: (ctx) => - Object.keys(licenses).find( - (k) => licenses[k].id === ctx.packageJson.license, - ), + migrate: ctx => Object.keys(licenses).find(k => licenses[k].id === ctx.packageJson.license), }, { type: "select", name: "dependabot", label: "Dependabot", expert: true, - message: - "Do you want to receive regular dependency updates through Pull Requests?", + message: "Do you want to receive regular dependency updates through Pull Requests?", hint: "(recommended)", initial: "yes", choices: ["yes", "no"], - migrate: async (ctx) => - (await ctx.fileExists(".github/dependabot.yml")) - ? "yes" - : "no", + migrate: async ctx => ((await ctx.fileExists(".github/dependabot.yml")) ? "yes" : "no"), }, ], }, ]; /** Only the questions */ -export const questions = questionGroups - .map((q) => q.questions) - .reduce((arr, next) => arr.concat(...next), []); +export const questions = questionGroups.map(q => q.questions).reduce((arr, next) => arr.concat(...next), []); +/** + * + */ export interface BaseAdapterSettings { + /** + * + */ key: string; + /** + * + */ label?: string; + /** + * + */ defaultValue?: T; } +/** + * + */ export interface StringAdapterSettings extends BaseAdapterSettings { + /** + * + */ inputType: "text"; } +/** + * + */ export interface NumberAdapterSettings extends BaseAdapterSettings { + /** + * + */ inputType: "number"; } +/** + * + */ export interface BooleanAdapterSettings extends BaseAdapterSettings { + /** + * + */ inputType: "checkbox"; } +/** + * + */ export interface AdapterSelectOption { + /** + * + */ value: string; + /** + * + */ text: string; } +/** + * + */ export interface SelectAdapterSettings extends BaseAdapterSettings { + /** + * + */ inputType: "select"; + /** + * + */ options: AdapterSelectOption[]; } export type AdapterSettings = @@ -981,58 +999,171 @@ export interface LicenseInformation { license?: LicenseType; } +/** + * + */ export interface Answers { /** false is used in the portal */ cli: boolean; /** "github" and "zip" are used in the portal */ target: "directory" | "github" | "zip"; + /** + * + */ adapterName: string; + /** + * + */ description?: string; + /** + * + */ keywords?: string[]; + /** + * + */ expert?: "yes" | "no"; + /** + * + */ authorName: string; + /** + * + */ authorEmail: string; + /** + * + */ authorGithub: string; + /** + * + */ contributors?: string[]; + /** + * + */ language?: "JavaScript" | "TypeScript"; + /** + * + */ features: ("adapter" | "vis")[]; + /** + * + */ adminFeatures?: ("tab" | "custom")[]; - tools?: ( - | "ESLint" - | "Prettier" - | "type checking" - | "code coverage" - | "devcontainer" - )[]; + /** + * + */ + tools?: ("ESLint" | "Prettier" | "type checking" | "code coverage" | "devcontainer")[]; + /** + * + */ + eslintConfig?: "official" | "custom"; + /** + * + */ nodeVersion?: "20" | "22" | "24"; + /** + * + */ title?: string; + /** + * + */ license?: string; // Not used on the CLI, but can be provided by the web UI for example + /** + * + */ licenseInformation?: LicenseInformation; + /** + * + */ type: string; + /** + * + */ widgetIsMainFunction?: "main" | "additional"; + /** + * + */ adminUi?: "json" | "html" | "react" | "none"; + /** + * + */ tabReact?: "yes" | "no"; + /** + * + */ i18n?: "words.js" | "JSON"; + /** + * + */ releaseScript?: "yes" | "no"; + /** + * + */ devServer?: "yes" | "no"; + /** + * + */ devServerPort?: number; + /** + * + */ indentation?: "Tab" | "Space (4)"; + /** + * + */ quotes?: "single" | "double"; + /** + * + */ gitRemoteProtocol: "HTTPS" | "SSH"; + /** + * + */ gitCommit?: "yes" | "no"; + /** + * + */ defaultBranch?: "main" | "master"; + /** + * + */ dependabot?: "yes" | "no"; + /** + * + */ startMode?: "daemon" | "schedule" | "once" | "none"; + /** + * + */ scheduleStartOnChange?: "yes" | "no"; + /** + * + */ connectionIndicator?: "yes" | "no"; + /** + * + */ connectionType?: "cloud" | "local"; + /** + * + */ dataSource?: "poll" | "push" | "assumption"; + /** + * + */ icon?: UploadedIcon; /** An array of predefined adapter options */ adapterSettings?: AdapterSettings[]; } +/** + * + * @param answers + */ export function checkAnswers(answers: Partial): void { for (const q of questions) { // We don't use dynamic question names @@ -1044,10 +1175,7 @@ export function checkAnswers(answers: Partial): void { throw new Error(`Missing answer "${questionName}"!`); } else if (!conditionFulfilled && answer != undefined) { // TODO: Find a fool-proof way to check for extraneous answers - if ( - questions.filter((qq) => (qq.name as string) === questionName) - .length > 0 - ) { + if (questions.filter(qq => (qq.name as string) === questionName).length > 0) { // For now, don't enforce conditions for questions with multiple branches continue; } @@ -1057,50 +1185,56 @@ export function checkAnswers(answers: Partial): void { } } -export async function formatAnswers( - answers: Record, -): Promise> { +/** + * + * @param answers + */ +export async function formatAnswers(answers: Record): Promise> { for (const q of questions) { const conditionFulfilled = testCondition(q.condition, answers); - if (!conditionFulfilled) continue; + if (!conditionFulfilled) { + continue; + } // Apply an optional transformation - if ( - answers[q.name as string] != undefined && - typeof q.resultTransform === "function" - ) { + if (answers[q.name as string] != undefined && typeof q.resultTransform === "function") { const transformed = q.resultTransform(answers[q.name as string]); - answers[q.name as string] = - transformed instanceof Promise - ? await transformed - : transformed; + answers[q.name as string] = transformed instanceof Promise ? await transformed : transformed; } } return answers; } -export async function validateAnswers( - answers: Answers, - disableValidation: (keyof Answers)[] = [], -): Promise { +/** + * + * @param answers + * @param disableValidation + */ +export async function validateAnswers(answers: Answers, disableValidation: (keyof Answers)[] = []): Promise { for (const q of questions) { const conditionFulfilled = testCondition(q.condition, answers); - if (!conditionFulfilled) continue; - if (q.action == undefined) continue; - if (disableValidation.indexOf(q.name as keyof Answers) > -1) continue; + if (!conditionFulfilled) { + continue; + } + if (q.action == undefined) { + continue; + } + if (disableValidation.indexOf(q.name as keyof Answers) > -1) { + continue; + } - const testResult = await q.action( - answers[q.name as keyof Answers] as any, - ); + const testResult = await q.action(answers[q.name as keyof Answers] as any); if (typeof testResult === "string") { throw new Error(testResult); } } } -export function getDefaultAnswer( - key: T, -): Answers[T] | undefined { +/** + * + * @param key + */ +export function getDefaultAnswer(key: T): Answers[T] | undefined { // Apparently, it is not possible to make the return type depend on the // given object key: https://github.com/microsoft/TypeScript/issues/31672 // So we cast to `any` until a solution emerges @@ -1125,6 +1259,10 @@ export function getDefaultAnswer( } } +/** + * + * @param answers + */ export function getIconName(answers: Answers): string { return `${answers.adapterName}.${answers.icon?.extension || "png"}`; } @@ -1133,16 +1271,8 @@ async function migrateAdminUi(context: MigrationContextBase): Promise { if (await context.fileExists("admin/jsonConfig.json")) { return "json"; } - const hasJsx = await context.hasFilesWithExtension( - "admin/src", - ".jsx", - (f) => !f.endsWith("tab.jsx"), - ); - const hasTsx = await context.hasFilesWithExtension( - "admin/src", - ".tsx", - (f) => !f.endsWith("tab.tsx"), - ); + const hasJsx = await context.hasFilesWithExtension("admin/src", ".jsx", f => !f.endsWith("tab.jsx")); + const hasTsx = await context.hasFilesWithExtension("admin/src", ".tsx", f => !f.endsWith("tab.tsx")); if (hasJsx || hasTsx) { return "react"; } diff --git a/src/lib/createAdapter.test.ts b/src/lib/createAdapter.test.ts index 1b8aa9b7f..def82b5c3 100644 --- a/src/lib/createAdapter.test.ts +++ b/src/lib/createAdapter.test.ts @@ -13,9 +13,7 @@ const fsStub = { }, }; -const { readFile, readFileFromRootDir } = proxyquire< - typeof import("./createAdapter") ->("./createAdapter", { +const { readFile, readFileFromRootDir } = proxyquire("./createAdapter", { fs: fsStub, "fs-extra": fsStub, }); @@ -26,9 +24,7 @@ describe("createAdapter/readFile()", () => { it("calls fs.readFile with the absolute path", async () => { fsStub.readFile.resolves(); await readFile("../filename", "dir/lib/what", false); - fsStub.readFile.should.have.been.calledOnceWith( - path.normalize("dir/lib/filename"), - ); + fsStub.readFile.should.have.been.calledOnceWith(path.normalize("dir/lib/filename")); }); it(`passes "utf8" as the encoding when the binary option is false`, async () => { @@ -46,21 +42,15 @@ describe("createAdapter/readFile()", () => { it(`does not pass an encoding when the binary option is true`, async () => { fsStub.readFile.resolves(); await readFile("../filename", "dir/lib/what", true); - fsStub.readFile.should.have.been.calledOnceWithExactly( - path.normalize("dir/lib/filename"), - ); + fsStub.readFile.should.have.been.calledOnceWithExactly(path.normalize("dir/lib/filename")); }); it("returns the raw value from fs.readFile", async () => { fsStub.readFile.resolves("foo"); - await readFile("../filename", "dir/lib/what", false).should.become( - "foo", - ); + await readFile("../filename", "dir/lib/what", false).should.become("foo"); fsStub.readFile.resolves("bar"); - await readFile("../filename", "dir/lib/what", false).should.become( - "bar", - ); + await readFile("../filename", "dir/lib/what", false).should.become("bar"); }); }); diff --git a/src/lib/createAdapter.ts b/src/lib/createAdapter.ts index 624a06d7e..9df9e6f8d 100644 --- a/src/lib/createAdapter.ts +++ b/src/lib/createAdapter.ts @@ -3,33 +3,49 @@ import * as os from "os"; import * as path from "path"; import templateFiles from "../../templates"; import type { Answers } from "./core/questions"; -import { - formatWithPrettier, - getOwnVersion, - indentWithSpaces, - indentWithTabs, - jsFixQuotes, - tsFixQuotes, -} from "./tools"; +import { formatWithPrettier, getOwnVersion, indentWithSpaces, indentWithTabs, jsFixQuotes, tsFixQuotes } from "./tools"; interface AnswersMeta { creatorVersion: string; } type TemplateFunctionReturnType = string | Buffer | undefined; +/** + * + */ export interface TemplateFunction { - ( - answers: Answers & AnswersMeta, - ): TemplateFunctionReturnType | Promise; + (answers: Answers & AnswersMeta): TemplateFunctionReturnType | Promise; + /** + * + */ customPath?: string | ((answers: Answers & AnswersMeta) => string); + /** + * + */ noReformat?: boolean; } +/** + * + */ export interface File { + /** + * + */ name: string; + /** + * + */ content: string | Buffer; + /** + * + */ noReformat: boolean; } +/** + * + * @param answers + */ export async function createFiles(answers: Answers): Promise { const creatorVersion: string = getOwnVersion(); const answersWithMeta: Answers & AnswersMeta = { @@ -47,25 +63,24 @@ export async function createFiles(answers: Answers): Promise { const templateResult = templateFunction(answersWithMeta); return { name: customPath, - content: - templateResult instanceof Promise - ? await templateResult - : templateResult, + content: templateResult instanceof Promise ? await templateResult : templateResult, noReformat: templateFunction.noReformat === true, }; }), ); - const necessaryFiles = files.filter( - (f) => f.content != undefined, - ) as File[]; + const necessaryFiles = files.filter(f => f.content != undefined) as File[]; return formatFiles(answers, necessaryFiles); } -/** Formats files that are not explicitly forbidden to be formatted */ +/** + * Formats files that are not explicitly forbidden to be formatted + * + * @param answers + * @param files + */ function formatFiles(answers: Answers, files: File[]): Promise { // Normalize indentation considering user preference - const indentation = - answers.indentation === "Tab" ? indentWithTabs : indentWithSpaces; + const indentation = answers.indentation === "Tab" ? indentWithTabs : indentWithSpaces; // Remove multiple subsequent empty lines (can happen during template creation). const removeEmptyLines = (text: string): string => { return ( @@ -76,32 +91,29 @@ function formatFiles(answers: Answers, files: File[]): Promise { .replace(/\n/g, os.EOL) ); }; - const trimWhitespaceLines = (text: string): string => - text && text.replace(/^[ \t]+$/gm, ""); - const formatter = (text: string): string => - trimWhitespaceLines(removeEmptyLines(indentation(text))); + const trimWhitespaceLines = (text: string): string => text && text.replace(/^[ \t]+$/gm, ""); + const formatter = (text: string): string => trimWhitespaceLines(removeEmptyLines(indentation(text))); const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1; - const formatted = files.map(async (f) => { - if (f.noReformat || typeof f.content !== "string") return f; + const formatted = files.map(async f => { + if (f.noReformat || typeof f.content !== "string") { + return f; + } if (usePrettier && /\.(jsx?|json|tsx?)$/.test(f.name)) { // Use prettier to format JS/TS/JSON code const extension = f.name.slice(f.name.lastIndexOf(".") + 1); - f.content = await formatWithPrettier( - f.content, - answers, - extension as any, - ); + f.content = await formatWithPrettier(f.content, answers, extension as any); } else { // We are using our own handmade formatters // 1st step: Apply formatters that are valid for all files f.content = formatter(f.content); // 2nd step: Apply more specialized formatters if (answers.quotes != undefined) { - if (f.name.endsWith(".js") || f.name.endsWith(".jsx")) + if (f.name.endsWith(".js") || f.name.endsWith(".jsx")) { f.content = jsFixQuotes(f.content, answers.quotes); - else if (f.name.endsWith(".ts") || f.name.endsWith(".tsx")) + } else if (f.name.endsWith(".ts") || f.name.endsWith(".tsx")) { f.content = tsFixQuotes(f.content, answers.quotes); + } } } return f; @@ -109,10 +121,12 @@ function formatFiles(answers: Answers, files: File[]): Promise { return Promise.all(formatted); } -export async function writeFiles( - targetDir: string, - files: File[], -): Promise { +/** + * + * @param targetDir + * @param files + */ +export async function writeFiles(targetDir: string, files: File[]): Promise { // write the files and make sure the target dirs exist for (const file of files) { await fs.outputFile( @@ -123,25 +137,34 @@ export async function writeFiles( } } -export async function readFile( - file: string, - relativeTo: string, - binary: boolean = false, -): Promise { +/** + * + * @param file + * @param relativeTo + * @param binary + */ +export async function readFile(file: string, relativeTo: string, binary: boolean = false): Promise { const absolutePath = path.join(relativeTo, file); - if (binary) return fs.readFile(absolutePath); - else return fs.readFile(absolutePath, "utf8"); + if (binary) { + return fs.readFile(absolutePath); + } + return fs.readFile(absolutePath, "utf8"); } /** * Reads a file that resides on the root dir. After compilation, this is one folder higher than at build time + * + * @param file + * @param relativeTo + * @param binary */ export async function readFileFromRootDir( file: string, relativeTo: string, binary: boolean = false, ): Promise { - if (await fs.pathExists(path.join(relativeTo, file))) + if (await fs.pathExists(path.join(relativeTo, file))) { return readFile(file, relativeTo, binary); - else return readFile(path.join("..", file), relativeTo, binary); + } + return readFile(path.join("..", file), relativeTo, binary); } diff --git a/src/lib/localMigrationContext.test.ts b/src/lib/localMigrationContext.test.ts index 1588e469c..a6ef2b494 100644 --- a/src/lib/localMigrationContext.test.ts +++ b/src/lib/localMigrationContext.test.ts @@ -46,36 +46,22 @@ describe("LocalMigrationContext.fileExists()", () => { describe("LocalMigrationContext.hasFilesWithExtension()", () => { it("should return true if files exist", async () => { const context = new LocalMigrationContext(__dirname); - expect(await context.hasFilesWithExtension("../..", ".json")).to.be - .true; + expect(await context.hasFilesWithExtension("../..", ".json")).to.be.true; expect(await context.hasFilesWithExtension("..", ".ts")).to.be.true; - expect( - await context.hasFilesWithExtension( - "..", - ".ts", - (f) => !f.endsWith("cli.ts"), - ), - ).to.be.true; + expect(await context.hasFilesWithExtension("..", ".ts", f => !f.endsWith("cli.ts"))).to.be.true; }); it("should return false if no files exist", async () => { const context = new LocalMigrationContext(__dirname); expect(await context.hasFilesWithExtension("..", ".xls")).to.be.false; expect(await context.hasFilesWithExtension("..", ".dts")).to.be.false; - expect( - await context.hasFilesWithExtension( - "..", - ".ts", - (f) => !f.includes("i"), - ), - ).to.be.false; + expect(await context.hasFilesWithExtension("..", ".ts", f => !f.includes("i"))).to.be.false; }); it("should return false if the directory doesn't exist", async () => { const context = new LocalMigrationContext(__dirname); expect(await context.hasFilesWithExtension("foo", ".json")).to.be.false; - expect(await context.hasFilesWithExtension("../bar", ".ts")).to.be - .false; + expect(await context.hasFilesWithExtension("../bar", ".ts")).to.be.false; }); }); @@ -115,9 +101,7 @@ describe("LocalMigrationContext.getMainFileContent()", () => { main: "build/src/cli.js", }; expect(await context.getMainFileContent()).not.to.be.empty; - expect(await context.getMainFileContent()).to.contain( - "import * as yargs", - ); + expect(await context.getMainFileContent()).to.contain("import * as yargs"); }); } @@ -128,9 +112,7 @@ describe("LocalMigrationContext.getMainFileContent()", () => { main: "bin/create-adapter.js", }; expect(await context.getMainFileContent()).not.to.be.empty; - expect(await context.getMainFileContent()).to.contain( - "#!/usr/bin/env node", - ); + expect(await context.getMainFileContent()).to.contain("#!/usr/bin/env node"); }); it("should return an empty string if no main file is found", async () => { diff --git a/src/lib/localMigrationContext.ts b/src/lib/localMigrationContext.ts index f06346a21..7f7528999 100644 --- a/src/lib/localMigrationContext.ts +++ b/src/lib/localMigrationContext.ts @@ -2,40 +2,76 @@ import { existsSync, readdir, readFile, readJson, stat } from "fs-extra"; import { MigrationContextBase } from "./core/migrationContextBase"; import path = require("path"); +/** + * + */ export class LocalMigrationContext extends MigrationContextBase { + /** + * + * @param baseDir + */ constructor(private readonly baseDir: string) { super(); } + /** + * + */ public async load(): Promise { this.packageJson = await this.readJsonFile("package.json"); this.ioPackageJson = await this.readJsonFile("io-package.json"); } + /** + * + * @param parts + */ public joinPath(...parts: string[]): string { return path.join(...parts); } + /** + * + * @param fileName + */ public readTextFile(fileName: string): Promise { return readFile(path.join(this.baseDir, fileName), { encoding: "utf8", }); } + /** + * + * @param fileName + */ public async readJsonFile(fileName: string): Promise> { return readJson(path.join(this.baseDir, fileName)); } + /** + * + * @param dirName + */ public async directoryExists(dirName: string): Promise { const fullPath = path.join(this.baseDir, dirName); return existsSync(fullPath) && (await stat(fullPath)).isDirectory(); } + /** + * + * @param dirName + */ public async fileExists(dirName: string): Promise { const fullPath = path.join(this.baseDir, dirName); return existsSync(fullPath) && (await stat(fullPath)).isFile(); } + /** + * + * @param dirName + * @param extension + * @param filter + */ public async hasFilesWithExtension( dirName: string, extension: string, @@ -44,9 +80,7 @@ export class LocalMigrationContext extends MigrationContextBase { return ( (await this.directoryExists(dirName)) && (await readdir(path.join(this.baseDir, dirName))).some( - (f) => - (!filter || filter(f)) && - f.toLowerCase().endsWith(extension.toLowerCase()), + f => (!filter || filter(f)) && f.toLowerCase().endsWith(extension.toLowerCase()), ) ); } diff --git a/src/lib/packageVersions.test.ts b/src/lib/packageVersions.test.ts index 9516172fa..b586cf04b 100644 --- a/src/lib/packageVersions.test.ts +++ b/src/lib/packageVersions.test.ts @@ -6,11 +6,12 @@ import { getPackageName, getVersionSpecifier } from "./packageVersions"; const axiosMock = stub(); const proxyquire = proxyquireModule.noPreserveCache(); -const { fetchPackageVersion, fetchPackageReferenceVersion } = proxyquire< - typeof import("./packageVersions") ->("./packageVersions", { - axios: { request: axiosMock }, -}); +const { fetchPackageVersion, fetchPackageReferenceVersion } = proxyquire( + "./packageVersions", + { + axios: { request: axiosMock }, + }, +); function returnVersions(versions: string[]) { const ret: any = { @@ -44,13 +45,11 @@ function getRandomPackageName() { function getRandomPackageVersion() { return [0, 0, 0] .map(() => Math.round(Math.random() * 10)) - .map((v) => v.toString()) + .map(v => v.toString()) .join("."); } -function getRandomPackageNameAndVersion( - version: string = getRandomPackageVersion(), -) { +function getRandomPackageNameAndVersion(version: string = getRandomPackageVersion()) { return `${getRandomPackageName()}@${version}`; } @@ -106,18 +105,13 @@ describe("packageVersions/fetchPackageVersion(latest)", () => { it("for status codes other than 200, an error is thrown", async () => { returnStatus(403); - await fetchPackageVersion( - getRandomPackageName(), - ).should.be.rejectedWith("403"); + await fetchPackageVersion(getRandomPackageName()).should.be.rejectedWith("403"); }); it("for status codes other than 200, the fallback version is returned if it is passed", async () => { returnStatus(403); const version = "1.2.3-beta"; - await fetchPackageVersion( - getRandomPackageName(), - version, - ).should.become(version); + await fetchPackageVersion(getRandomPackageName(), version).should.become(version); }); it("if the status code is 200, the latest version is extracted from the response data", async () => { @@ -149,9 +143,7 @@ describe("packageVersions/fetchPackageVersion(latest)", () => { axiosMock.should.have.been.called; expect(axiosMock.getCall(0).args[0]).to.be.an("object"); expect(axiosMock.getCall(0).args[0].url).to.include("/-/package/"); - expect(axiosMock.getCall(0).args[0].url).to.include( - encodeURIComponent("bar-baz"), - ); + expect(axiosMock.getCall(0).args[0].url).to.include(encodeURIComponent("bar-baz")); }); it("the request object should contain a default timeout of 5000ms", async () => { @@ -217,31 +209,20 @@ describe("packageVersions/fetchPackageVersion(specific)", () => { it("for status codes other than 200, an error is thrown", async () => { returnStatus(403); - await fetchPackageVersion( - getRandomPackageNameAndVersion(), - ).should.be.rejectedWith("403"); + await fetchPackageVersion(getRandomPackageNameAndVersion()).should.be.rejectedWith("403"); }); it("for status codes other than 200, the fallback version is returned if it is passed", async () => { returnStatus(403); const version = "1.2.3-beta"; - await fetchPackageVersion( - getRandomPackageNameAndVersion(), - version, - ).should.become(version); + await fetchPackageVersion(getRandomPackageNameAndVersion(), version).should.become(version); }); it("if the status code is 200, the highest matching version is extracted from the response data", async () => { returnVersions(testVersions); - await fetchPackageVersion(getRandomPackageName() + "@1").should.become( - "1.3.5", - ); - await fetchPackageVersion( - getRandomPackageName() + "@~1.2", - ).should.become("1.2.4"); - await fetchPackageVersion(getRandomPackageName() + "@2").should.become( - "2.3.4", - ); + await fetchPackageVersion(`${getRandomPackageName()}@1`).should.become("1.3.5"); + await fetchPackageVersion(`${getRandomPackageName()}@~1.2`).should.become("1.2.4"); + await fetchPackageVersion(`${getRandomPackageName()}@2`).should.become("2.3.4"); }); it("subsequent requests should return a cached version instead of issuing another request", async () => { @@ -267,9 +248,7 @@ describe("packageVersions/fetchPackageVersion(specific)", () => { axiosMock.should.have.been.called; expect(axiosMock.getCall(0).args[0]).to.be.an("object"); expect(axiosMock.getCall(0).args[0].url).to.not.include("/-/package/"); - expect(axiosMock.getCall(0).args[0].url).to.include( - encodeURIComponent("bar-baz"), - ); + expect(axiosMock.getCall(0).args[0].url).to.include(encodeURIComponent("bar-baz")); }); }); @@ -284,42 +263,24 @@ describe("packageVersions/fetchPackageReferenceVersion()", () => { it("for status codes other than 200, the requested version is returned", async () => { returnStatus(403); const version = "3.13.5"; - await fetchPackageReferenceVersion( - getRandomPackageNameAndVersion(version), - ).should.become(version); + await fetchPackageReferenceVersion(getRandomPackageNameAndVersion(version)).should.become(version); }); it("if the status code is 200, the highest matching version is extracted from the response data", async () => { returnVersions(testVersions); // cases for major version ("^") - await fetchPackageReferenceVersion( - getRandomPackageName() + "@1", - ).should.become("^1.3.5"); - await fetchPackageReferenceVersion( - getRandomPackageName() + "@^1", - ).should.become("^1.3.5"); - await fetchPackageReferenceVersion( - getRandomPackageName() + "@^1.1", - ).should.become("^1.3.5"); - await fetchPackageReferenceVersion( - getRandomPackageName() + "@^1.1.1", - ).should.become("^1.3.5"); + await fetchPackageReferenceVersion(`${getRandomPackageName()}@1`).should.become("^1.3.5"); + await fetchPackageReferenceVersion(`${getRandomPackageName()}@^1`).should.become("^1.3.5"); + await fetchPackageReferenceVersion(`${getRandomPackageName()}@^1.1`).should.become("^1.3.5"); + await fetchPackageReferenceVersion(`${getRandomPackageName()}@^1.1.1`).should.become("^1.3.5"); // cases for minor version ("~") - await fetchPackageReferenceVersion( - getRandomPackageName() + "@1.2", - ).should.become("~1.2.4"); - await fetchPackageReferenceVersion( - getRandomPackageName() + "@~1.2", - ).should.become("~1.2.4"); - await fetchPackageReferenceVersion( - getRandomPackageName() + "@~1.2.1", - ).should.become("~1.2.4"); + await fetchPackageReferenceVersion(`${getRandomPackageName()}@1.2`).should.become("~1.2.4"); + await fetchPackageReferenceVersion(`${getRandomPackageName()}@~1.2`).should.become("~1.2.4"); + await fetchPackageReferenceVersion(`${getRandomPackageName()}@~1.2.1`).should.become("~1.2.4"); // cases for exact version (no prefix) - await fetchPackageVersion( - getRandomPackageName() + "@1.2.4", - ).should.become("1.2.4"); + await fetchPackageVersion(`${getRandomPackageName()}@1.2.4`).should.become("1.2.4"); }); }); diff --git a/src/lib/packageVersions.ts b/src/lib/packageVersions.ts index 150dc10b0..24d084a22 100644 --- a/src/lib/packageVersions.ts +++ b/src/lib/packageVersions.ts @@ -6,18 +6,30 @@ import { applyHttpsProxy, getRequestTimeout } from "./tools"; const allVersionsCache = new Map(); const latestVersionCache = new Map(); +/** + * + * @param packageName + */ export function hasVersionSpecifier(packageName: string): boolean { return packageName.lastIndexOf("@") > 0; } -export function getVersionSpecifier( - packageNameAndVersion: string, -): string | undefined { +/** + * + * @param packageNameAndVersion + */ +export function getVersionSpecifier(packageNameAndVersion: string): string | undefined { const atIndex = packageNameAndVersion.lastIndexOf("@"); - if (atIndex > 0) return packageNameAndVersion.slice(atIndex + 1); + if (atIndex > 0) { + return packageNameAndVersion.slice(atIndex + 1); + } } -/** Returns only the package name from a string of the form [@scope/]package-name@version */ +/** + * Returns only the package name from a string of the form [@scope/]package-name@version + * + * @param packageNameAndVersion + */ export function getPackageName(packageNameAndVersion: string): string { const atIndex = packageNameAndVersion.lastIndexOf("@"); if (atIndex > 0) { @@ -28,13 +40,15 @@ export function getPackageName(packageNameAndVersion: string): string { /** * Returns the latest version of an npm package + * * @param packageName The npm package name * @param fallbackVersion The fallback version to return in case anything goes wrong. If this is set, no error is thrown. */ async function fetchAllPackageVersions(packageName: string): Promise { - if (allVersionsCache.has(packageName)) + if (allVersionsCache.has(packageName)) { return allVersionsCache.get(packageName)!; + } const packageURIComponent = encodeURIComponent(packageName); const url = `https://registry.npmjs.org/${packageURIComponent}`; @@ -45,42 +59,36 @@ async function fetchAllPackageVersions(packageName: string): Promise { const response = await axios.request(options); if (response.status !== 200) { - throw new Error( - `Failed to fetch the versions for ${packageName} (${response.status})`, - ); + throw new Error(`Failed to fetch the versions for ${packageName} (${response.status})`); } const allVersions = Object.keys(response.data.versions); allVersionsCache.set(packageName, allVersions); return allVersions; } -async function fetchSpecificPackageVersion( - packageNameAndVersion: string, - fallbackVersion?: string, -): Promise { +async function fetchSpecificPackageVersion(packageNameAndVersion: string, fallbackVersion?: string): Promise { // A specific version is requested, return the highest version matching the specifier try { const versionSpecifier = getVersionSpecifier(packageNameAndVersion)!; const packageName = getPackageName(packageNameAndVersion); const allVersions = await fetchAllPackageVersions(packageName); const ret = semver.maxSatisfying(allVersions, versionSpecifier); - if (!ret) - throw new Error( - `No version of ${packageName} found matching ${versionSpecifier}`, - ); + if (!ret) { + throw new Error(`No version of ${packageName} found matching ${versionSpecifier}`); + } return ret; } catch (e) { - if (fallbackVersion) return fallbackVersion; + if (fallbackVersion) { + return fallbackVersion; + } throw e; } } -async function fetchLatestPackageVersion( - packageName: string, - fallbackVersion?: string, -): Promise { - if (latestVersionCache.has(packageName)) +async function fetchLatestPackageVersion(packageName: string, fallbackVersion?: string): Promise { + if (latestVersionCache.has(packageName)) { return latestVersionCache.get(packageName)!; + } const packageURIComponent = encodeURIComponent(packageName); const url = `https://registry.npmjs.org/-/package/${packageURIComponent}/dist-tags`; @@ -91,10 +99,10 @@ async function fetchLatestPackageVersion( const response = await axios.request(options); if (response.status !== 200) { - if (fallbackVersion) return fallbackVersion; - throw new Error( - `Failed to fetch the version for ${packageName} (${response.status})`, - ); + if (fallbackVersion) { + return fallbackVersion; + } + throw new Error(`Failed to fetch the version for ${packageName} (${response.status})`); } const version = response.data.latest as string; latestVersionCache.set(packageName, version); @@ -103,45 +111,34 @@ async function fetchLatestPackageVersion( /** * Returns the latest version of an npm package + * * @param packageName The npm package name * @param fallbackVersion The fallback version to return in case anything goes wrong. If this is set, no error is thrown. */ -export async function fetchPackageVersion( - packageName: string, - fallbackVersion?: string, -): Promise { +export async function fetchPackageVersion(packageName: string, fallbackVersion?: string): Promise { if (hasVersionSpecifier(packageName)) { return fetchSpecificPackageVersion(packageName, fallbackVersion); - } else { - return fetchLatestPackageVersion(packageName, fallbackVersion); } + return fetchLatestPackageVersion(packageName, fallbackVersion); } /** * Returns the reference to the version of an npm package + * * @param packageName The npm package name (may include a version specifier like `abc@1.2.3`) */ -export async function fetchPackageReferenceVersion( - packageName: string, -): Promise { +export async function fetchPackageReferenceVersion(packageName: string): Promise { if (hasVersionSpecifier(packageName)) { const versionSpecifier = getVersionSpecifier(packageName)!; const pureVersionSpec = versionSpecifier.replace(/^[\^~]/, "").trim(); - const versionDepth = pureVersionSpec - .replace(/^(0\.)+/, "") - .split(".").length; - const version = await fetchSpecificPackageVersion( - packageName, - pureVersionSpec, - ); + const versionDepth = pureVersionSpec.replace(/^(0\.)+/, "").split(".").length; + const version = await fetchSpecificPackageVersion(packageName, pureVersionSpec); if (versionSpecifier.charAt(0) === "^" || versionDepth <= 1) { return `^${version}`; } else if (versionSpecifier.charAt(0) === "~" || versionDepth == 2) { return `~${version}`; - } else { - return version; } - } else { - return `^${await fetchLatestPackageVersion(packageName, "0.0.0")}`; + return version; } + return `^${await fetchLatestPackageVersion(packageName, "0.0.0")}`; } diff --git a/src/lib/tools.test.ts b/src/lib/tools.test.ts index 967f468ee..b4fcc766e 100644 --- a/src/lib/tools.test.ts +++ b/src/lib/tools.test.ts @@ -183,7 +183,6 @@ describe("tools/kebabCaseToUpperCamelCase()", () => { describe("tools/getOwnVersion()", () => { it("should return the version defined in package.json", () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires const expected = require("../../package.json").version; expect(getOwnVersion()).to.equal(expected); }); @@ -255,8 +254,7 @@ describe("tools/formatLicense()", () => { expected: answers.authorName, }, { - original: - "[name of copyright owner] [name of copyright owner] [name of copyright owner]", + original: "[name of copyright owner] [name of copyright owner] [name of copyright owner]", expected: `${answers.authorName} ${answers.authorName} ${answers.authorName}`, }, ]; @@ -312,13 +310,7 @@ foo( function foo() { return;} `; const expected = `foo('baz');\n\nfunction foo() {\n\treturn;\n}\n`; - expect( - await formatWithPrettier( - input, - { indentation: "Tab", quotes: "single" }, - "js", - ), - ).to.equal(expected); + expect(await formatWithPrettier(input, { indentation: "Tab", quotes: "single" }, "js")).to.equal(expected); }); it("should format TS code according to the Prettier rules", async () => { @@ -331,12 +323,8 @@ foo( function foo() { return;} `; const expected = `foo("baz");\n\nfunction foo() {\n return;\n}\n`; - expect( - await formatWithPrettier( - input, - { indentation: "Space (4)", quotes: "double" }, - "ts", - ), - ).to.equal(expected); + expect(await formatWithPrettier(input, { indentation: "Space (4)", quotes: "double" }, "ts")).to.equal( + expected, + ); }); }); diff --git a/src/lib/tools.ts b/src/lib/tools.ts index 2aceb2f81..53e5d8fc5 100644 --- a/src/lib/tools.ts +++ b/src/lib/tools.ts @@ -13,6 +13,10 @@ import { URL } from "url"; import { licenses } from "./core/licenses"; import type { Answers } from "./core/questions"; +/** + * + * @param message + */ export function error(message: string): void { console.error(bold.red(message)); console.error(); @@ -22,6 +26,7 @@ export const isWindows = /^win/.test(os.platform()); /** * Executes an npm command with update-notifier disabled and common parameters + * * @param args The npm command arguments * @param options (optional) Some options for the command execution */ @@ -53,13 +58,12 @@ export function executeNpmCommand( npm_config_update_notifier: "false", }, }; - return executeCommand( - isWindows ? "npm.cmd" : "npm", - enhancedArgs, - npmOptions, - ); + return executeCommand(isWindows ? "npm.cmd" : "npm", enhancedArgs, npmOptions); } +/** + * + */ export interface ExecuteCommandOptions { /** Whether the executed command should be logged to the stdout. Default: false */ logCommandExecution: boolean; @@ -75,6 +79,9 @@ export interface ExecuteCommandOptions { env: Record; } +/** + * + */ export interface ExecuteCommandResult { /** The exit code of the spawned process */ exitCode?: number; @@ -92,6 +99,7 @@ export function executeCommand( ): Promise; /** * Executes a command and returns the exit code and (if requested) the stdout + * * @param command The command to execute * @param args The command line arguments for the command * @param options (optional) Some options for the command execution @@ -106,7 +114,7 @@ export function executeCommand( argsOrOptions?: string[] | Partial, options?: Partial, ): Promise { - return new Promise((resolve) => { + return new Promise(resolve => { let args: string[] | undefined; if (Array.isArray(argsOrOptions)) { args = argsOrOptions; @@ -114,22 +122,25 @@ export function executeCommand( // no args were given options = argsOrOptions; } - if (options == null) options = {}; - if (args == null) args = []; + if (options == null) { + options = {}; + } + if (args == null) { + args = []; + } const spawnOptions: SpawnOptions = { - stdio: [ - options.stdin || process.stdin, - options.stdout || process.stdout, - options.stderr || process.stderr, - ], + stdio: [options.stdin || process.stdin, options.stdout || process.stdout, options.stderr || process.stderr], windowsHide: true, env: options.env ? { ...process.env, ...options.env } : process.env, }; - if (options.cwd != null) spawnOptions.cwd = options.cwd; + if (options.cwd != null) { + spawnOptions.cwd = options.cwd; + } - if (options.logCommandExecution == null) + if (options.logCommandExecution == null) { options.logCommandExecution = false; + } if (options.logCommandExecution) { console.log("executing: " + `${command} ${args.join(" ")}`); } @@ -138,35 +149,28 @@ export function executeCommand( try { let bufferedStdout: string | undefined; let bufferedStderr: string | undefined; - const cmd = spawn(command, args, spawnOptions).on( - "close", - (code, signal) => { - resolve({ - exitCode: code ?? undefined, - signal: signal ?? undefined, - stdout: bufferedStdout, - stderr: bufferedStderr, - }); - }, - ); + const cmd = spawn(command, args, spawnOptions).on("close", (code, signal) => { + resolve({ + exitCode: code ?? undefined, + signal: signal ?? undefined, + stdout: bufferedStdout, + stderr: bufferedStderr, + }); + }); // Capture stdout/stderr if requested if (options.stdout === "pipe") { bufferedStdout = ""; - cmd.stdout!.on("data", (chunk) => { - bufferedStdout += Buffer.isBuffer(chunk) - ? chunk.toString("utf8") - : chunk; + cmd.stdout!.on("data", chunk => { + bufferedStdout += Buffer.isBuffer(chunk) ? chunk.toString("utf8") : chunk; }); } if (options.stderr === "pipe") { bufferedStderr = ""; - cmd.stderr!.on("data", (chunk) => { - bufferedStderr += Buffer.isBuffer(chunk) - ? chunk.toString("utf8") - : chunk; + cmd.stderr!.on("data", chunk => { + bufferedStderr += Buffer.isBuffer(chunk) ? chunk.toString("utf8") : chunk; }); } - } catch (e) { + } catch { // doesn't matter, we return the exit code in the "close" handler } }); @@ -174,6 +178,7 @@ export function executeCommand( /** * Recursively enumerates all files in the given directory + * * @param dir The directory to scan * @param predicate An optional predicate to apply to every found file system entry * @returns A list of all files found @@ -183,12 +188,14 @@ export function enumFilesRecursiveSync( predicate?: (name: string, parentDir: string) => boolean, ): string[] { const ret = []; - if (typeof predicate !== "function") predicate = () => true; + if (typeof predicate !== "function") { + predicate = () => true; + } // enumerate all files in this directory const filesOrDirs = fs .readdirSync(dir) - .filter((f) => predicate!(f, dir)) // exclude all files starting with "." - .map((f) => path.join(dir, f)); // and prepend the full path + .filter(f => predicate(f, dir)) // exclude all files starting with "." + .map(f => path.join(dir, f)); // and prepend the full path for (const entry of filesOrDirs) { if (fs.statSync(entry).isDirectory()) { // Continue recursing this directory and remember the files there @@ -203,6 +210,7 @@ export function enumFilesRecursiveSync( /** * Recursively copies all files from the source to the target directory + * * @param sourceDir The directory to scan * @param targetDir The directory to copy to * @param predicate An optional predicate to apply to every found file system entry @@ -217,10 +225,7 @@ export function copyFilesRecursiveSync( // Copy all of them to the corresponding target dir for (const file of filesToCopy) { // Find out where it's supposed to be - const targetFileName = path.join( - targetDir, - path.relative(sourceDir, file), - ); + const targetFileName = path.join(targetDir, path.relative(sourceDir, file)); // Ensure the directory exists fs.ensureDirSync(path.dirname(targetFileName)); // And copy the file @@ -230,13 +235,11 @@ export function copyFilesRecursiveSync( /** * Adds https proxy options to an axios request if they were defined as an env variable + * * @param options The options object passed to axios */ -export function applyHttpsProxy( - options: AxiosRequestConfig, -): AxiosRequestConfig { - const proxy: string | undefined = - process.env.https_proxy || process.env.HTTPS_PROXY; +export function applyHttpsProxy(options: AxiosRequestConfig): AxiosRequestConfig { + const proxy: string | undefined = process.env.https_proxy || process.env.HTTPS_PROXY; if (proxy) { try { const proxyUrl = new URL(proxy); @@ -253,6 +256,11 @@ export function applyHttpsProxy( return options; } +/** + * + * @param licenseText + * @param answers + */ export function formatLicense(licenseText: string, answers: Answers): string { return licenseText .replace(/\[(year|yyyy)\]/g, new Date().getFullYear().toString()) @@ -260,6 +268,10 @@ export function formatLicense(licenseText: string, answers: Answers): string { .replace(/\[email\]/g, answers.authorEmail); } +/** + * + * @param answers + */ export function getFormattedLicense(answers: Answers): string { if (answers.license) { const license = licenses[answers.license]; @@ -271,28 +283,38 @@ export function getFormattedLicense(answers: Answers): string { return "TODO: enter license text here"; } -/** Replaces 4-space indentation with tabs */ +/** + * Replaces 4-space indentation with tabs + * + * @param text + */ export function indentWithTabs(text: string): string { - if (!text) return text; - return text.replace(/^( {4})+/gm, (match) => "\t".repeat(match.length / 4)); + if (!text) { + return text; + } + return text.replace(/^( {4})+/gm, match => "\t".repeat(match.length / 4)); } -/** Replaces tab indentation with 4 spaces */ +/** + * Replaces tab indentation with 4 spaces + * + * @param text + */ export function indentWithSpaces(text: string): string { - if (!text) return text; - return text.replace(/^(\t)+/gm, (match) => " ".repeat(match.length * 4)); + if (!text) { + return text; + } + return text.replace(/^(\t)+/gm, match => " ".repeat(match.length * 4)); } -/** Normalizes formatting of a JSON string */ -export function formatJsonString( - json: string, - indentation: "Tab" | "Space (4)", -): string { - return JSON.stringify( - JSON5.parse(json), - null, - indentation === "Tab" ? "\t" : 4, - ); +/** + * Normalizes formatting of a JSON string + * + * @param json + * @param indentation + */ +export function formatJsonString(json: string, indentation: "Tab" | "Space (4)"): string { + return JSON.stringify(JSON5.parse(json), null, indentation === "Tab" ? "\t" : 4); } export enum Quotemark { @@ -300,22 +322,36 @@ export enum Quotemark { "double" = '"', } -function createESLintOptions( - language: Exclude, - quotes: keyof typeof Quotemark, -): Record { - const baseOptions: Record = { - env: { - es6: true, - node: true, - mocha: true, - }, - parserOptions: { +function createESLintOptions(language: Exclude, quotes: keyof typeof Quotemark): any[] { + // ESLint 9 flat config format + const baseConfig: any = { + languageOptions: { ecmaVersion: "latest", - ecmaFeatures: { - jsx: true, - }, sourceType: "module", + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + globals: { + // Node.js + process: "readonly", + Buffer: "readonly", + __dirname: "readonly", + __filename: "readonly", + module: "readonly", + require: "readonly", + exports: "readonly", + global: "readonly", + console: "readonly", + // Mocha + describe: "readonly", + it: "readonly", + before: "readonly", + after: "readonly", + beforeEach: "readonly", + afterEach: "readonly", + }, }, rules: { quotes: [ @@ -328,43 +364,44 @@ function createESLintOptions( ], }, }; + if (language === "TypeScript") { - baseOptions.parser = "@typescript-eslint/parser"; + baseConfig.languageOptions.parser = require("@typescript-eslint/parser"); } - return baseOptions; + + return [baseConfig]; } -/** Formats a JS source file to use single quotes */ -export function jsFixQuotes( - sourceText: string, - quotes: keyof typeof Quotemark, -): string { +/** + * Formats a JS source file to use single quotes + * + * @param sourceText + * @param quotes + */ +export function jsFixQuotes(sourceText: string, quotes: keyof typeof Quotemark): string { const linter = new Linter(); - const result = linter.verifyAndFix( - sourceText, - createESLintOptions("JavaScript", quotes), - ); + const result = linter.verifyAndFix(sourceText, createESLintOptions("JavaScript", quotes)); return result.output; } -/** Formats a TS source file to use single quotes */ -export function tsFixQuotes( - sourceText: string, - quotes: keyof typeof Quotemark, -): string { +/** + * Formats a TS source file to use single quotes + * + * @param sourceText + * @param quotes + */ +export function tsFixQuotes(sourceText: string, quotes: keyof typeof Quotemark): string { const linter = new Linter(); - linter.defineParser( - "@typescript-eslint/parser", - // eslint-disable-next-line @typescript-eslint/no-var-requires - require("@typescript-eslint/parser"), - ); - const result = linter.verifyAndFix( - sourceText, - createESLintOptions("TypeScript", quotes), - ); + const result = linter.verifyAndFix(sourceText, createESLintOptions("TypeScript", quotes)); return result.output; } +/** + * + * @param sourceText + * @param answers + * @param extension + */ export function formatWithPrettier( sourceText: string, answers: Pick, @@ -385,12 +422,14 @@ export function formatWithPrettier( return prettier.format(sourceText, prettierOptions); } +/** + * + */ export function getOwnVersion(): string { for (const jsonPath of ["../../package.json", "../../../package.json"]) { try { - // eslint-disable-next-line @typescript-eslint/no-var-requires return require(jsonPath).version; - } catch (e) { + } catch { /* OK */ } } @@ -398,23 +437,36 @@ export function getOwnVersion(): string { return "unknown"; } +/** + * + * @param name + */ export function capitalize(name: string): string { return name[0].toUpperCase() + name.slice(1); } +/** + * + * @param name + */ export function kebabCaseToUpperCamelCase(name: string): string { return name - .split(/[_\-]/) - .filter((part) => part.length > 0) + .split(/[_-]/) + .filter(part => part.length > 0) .map(capitalize) .join(""); } +/** + * + */ export function getRequestTimeout(): number { let ret: number | undefined; if (process.env.REQUEST_TIMEOUT) { ret = parseInt(process.env.REQUEST_TIMEOUT, 10); } - if (ret == undefined || Number.isNaN(ret)) return 5000; + if (ret == undefined || Number.isNaN(ret)) { + return 5000; + } return ret; } diff --git a/src/lib/translation.ts b/src/lib/translation.ts index 7094f470b..23d15f203 100644 --- a/src/lib/translation.ts +++ b/src/lib/translation.ts @@ -4,18 +4,7 @@ import { getDefaultAnswer } from "./core/questions"; import type { TemplateFunction } from "./createAdapter"; import { formatJsonString } from "./tools"; -export type Languages = - | "en" - | "de" - | "ru" - | "pt" - | "nl" - | "fr" - | "it" - | "es" - | "pl" - | "uk" - | "zh-cn"; +export type Languages = "en" | "de" | "ru" | "pt" | "nl" | "fr" | "it" | "es" | "pl" | "uk" | "zh-cn"; export type TranslatedTerm = { [lang in Languages]?: string }; @@ -33,21 +22,23 @@ const titles: Record = { "zh-cn": "的适配器设置", }; +/** + * + * @param language + * @param answers + */ export async function getTranslatedSettingsForLanguage( language: Languages, answers: Answers, ): Promise> { - const adapterSettings: AdapterSettings[] = - answers.adapterSettings || getDefaultAnswer("adapterSettings")!; + const adapterSettings: AdapterSettings[] = answers.adapterSettings || getDefaultAnswer("adapterSettings")!; const translatedSettings: Record = {}; - translatedSettings[`${answers.adapterName} adapter settings`] = titles[ - language - ].replace(//gi, answers.adapterName); + translatedSettings[`${answers.adapterName} adapter settings`] = titles[language].replace( + //gi, + answers.adapterName, + ); for (const setting of adapterSettings) { - translatedSettings[setting.key] = await translateText( - setting.label || setting.key, - language, - ); + translatedSettings[setting.key] = await translateText(setting.label || setting.key, language); } return translatedSettings; @@ -55,37 +46,19 @@ export async function getTranslatedSettingsForLanguage( /** * Translates all setting strings to all languages. + * * @param answers The answers provided by the user. */ -export async function getTranslatedSettings( - answers: Answers, -): Promise> { - const languages: Languages[] = [ - "en", - "de", - "ru", - "pt", - "nl", - "fr", - "it", - "es", - "pl", - "uk", - "zh-cn", - ]; - const allTranslations = await Promise.all( - languages.map((lang) => - getTranslatedSettingsForLanguage(lang, answers), - ), - ); +export async function getTranslatedSettings(answers: Answers): Promise> { + const languages: Languages[] = ["en", "de", "ru", "pt", "nl", "fr", "it", "es", "pl", "uk", "zh-cn"]; + const allTranslations = await Promise.all(languages.map(lang => getTranslatedSettingsForLanguage(lang, answers))); const translatedSettings: Record = {}; for (let i = 0; i < allTranslations.length; i++) { const translations = allTranslations[i]; const lang = languages[i]; for (const key in translations) { - if (translations.hasOwnProperty(key)) { - const translation = - translatedSettings[key] || (translatedSettings[key] = {}); + if (Object.prototype.hasOwnProperty.call(translations, key)) { + const translation = translatedSettings[key] || (translatedSettings[key] = {}); translation[lang] = translations[key]; } } @@ -94,31 +67,31 @@ export async function getTranslatedSettings( return translatedSettings; } -export function getI18nJsonTemplate( - language: Languages, - forReact: boolean, -): TemplateFunction { - return async (answers) => { +/** + * + * @param language + * @param forReact + */ +export function getI18nJsonTemplate(language: Languages, forReact: boolean): TemplateFunction { + return async answers => { const isAdapter = answers.features.indexOf("adapter") > -1; - if (!isAdapter) return; + if (!isAdapter) { + return; + } if (forReact) { - const useReact = - answers.adminUi === "react" || answers.tabReact === "yes"; - if (!useReact) return; + const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; + if (!useReact) { + return; + } } else { - const i18nJson = - answers.i18n === "JSON" || answers.adminUi === "json"; - if (!i18nJson) return; + const i18nJson = answers.i18n === "JSON" || answers.adminUi === "json"; + if (!i18nJson) { + return; + } } - const translatedSettings = await getTranslatedSettingsForLanguage( - language, - answers, - ); + const translatedSettings = await getTranslatedSettingsForLanguage(language, answers); - return formatJsonString( - JSON.stringify(translatedSettings, null, 4), - answers.indentation || "Tab", - ); + return formatJsonString(JSON.stringify(translatedSettings, null, 4), answers.indentation || "Tab"); }; } diff --git a/templates/README.md.ts b/templates/README.md.ts index f727f03c8..f6c6458ba 100644 --- a/templates/README.md.ts +++ b/templates/README.md.ts @@ -3,14 +3,12 @@ import type { TemplateFunction } from "../src/lib/createAdapter"; import { getFormattedLicense } from "../src/lib/tools"; export = (answers => { - const isAdapter = answers.features.indexOf("adapter") > -1; const useTypeScript = answers.language === "TypeScript"; const useTypeChecking = useTypeScript || answers.tools?.includes("type checking"); const useNyc = answers.tools?.includes("code coverage"); const useESLint = answers.tools?.includes("ESLint"); - const useReact = - answers.adminUi === "react" || answers.tabReact === "yes"; + const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; const autoInitGit = answers.gitCommit === "yes"; const defaultBranch = answers.defaultBranch || "main"; const useReleaseScript = answers.releaseScript === "yes"; @@ -20,14 +18,14 @@ export = (answers => { const npmScripts: Record = {}; if (useTypeScript && !useReact) { - npmScripts["build"] = "Compile the TypeScript sources."; - npmScripts["watch"] = "Compile the TypeScript sources and watch for changes."; + npmScripts.build = "Compile the TypeScript sources."; + npmScripts.watch = "Compile the TypeScript sources and watch for changes."; } else if (useReact && !useTypeScript) { - npmScripts["build"] = "Compile the React sources."; - npmScripts["watch"] = "Compile the React sources and watch for changes."; + npmScripts.build = "Compile the React sources."; + npmScripts.watch = "Compile the React sources and watch for changes."; } else if (useReact && useTypeScript) { - npmScripts["build"] = "Compile the TypeScript and React sources."; - npmScripts["watch"] = "Compile the TypeScript and React sources and watch for changes."; + npmScripts.build = "Compile the TypeScript and React sources."; + npmScripts.watch = "Compile the TypeScript and React sources and watch for changes."; npmScripts["build:ts"] = "Compile the TypeScript sources."; npmScripts["watch:ts"] = "Compile the TypeScript sources and watch for changes."; npmScripts["build:react"] = "Compile the React sources."; @@ -45,19 +43,21 @@ export = (answers => { if (isAdapter) { npmScripts["test:integration"] = "Tests the adapter startup with an actual instance of ioBroker."; } - npmScripts["test"] = `Performs a minimal test run on package files${isAdapter ? " and your tests" : ""}.`; + npmScripts.test = `Performs a minimal test run on package files${isAdapter ? " and your tests" : ""}.`; if (useTypeChecking) { - npmScripts["check"] = "Performs a type-check on your code (without compiling anything)."; + npmScripts.check = "Performs a type-check on your code (without compiling anything)."; } if (useNyc) { - npmScripts["coverage"] = "Generates code coverage using your test files."; + npmScripts.coverage = "Generates code coverage using your test files."; } if (useESLint) { - npmScripts["lint"] = "Runs \`ESLint\` to check your code for formatting errors and potential bugs."; + npmScripts.lint = "Runs \`ESLint\` to check your code for formatting errors and potential bugs."; } - npmScripts["translate"] = "Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details."; + npmScripts.translate = + "Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details."; if (useReleaseScript) { - npmScripts["release"] = "Creates a new release, see [`@alcalzone/release-script`](https://github.com/AlCalzone/release-script#usage) for more details."; + npmScripts.release = + "Creates a new release, see [`@alcalzone/release-script`](https://github.com/AlCalzone/release-script#usage) for more details."; } const adapterNameLowerCase = answers.adapterName.toLowerCase(); @@ -89,15 +89,18 @@ You can check other adapters for examples or ask in the developer community. Usi ### Getting started You are almost done, only a few steps left: -${isGitHub ? -(`1. Clone the repository from GitHub to a directory on your PC: +${ + isGitHub + ? `1. Clone the repository from GitHub to a directory on your PC: \`\`\`bash git clone https://github.com/${answers.authorGithub}/ioBroker.${answers.adapterName} \`\`\` -`) : -(`1. Create a new repository on GitHub with the name \`ioBroker.${answers.adapterName}\` -${autoInitGit ? "" : ( -`1. Initialize the current folder as a new git repository: +` + : `1. Create a new repository on GitHub with the name \`ioBroker.${answers.adapterName}\` +${ + autoInitGit + ? "" + : `1. Initialize the current folder as a new git repository: \`\`\`bash git init -b ${defaultBranch} git add . @@ -107,21 +110,27 @@ ${autoInitGit ? "" : ( \`\`\`bash git remote add origin https://github.com/${answers.authorGithub}/ioBroker.${answers.adapterName} \`\`\` -`)} +` +} 1. Push all files to the GitHub repo${autoInitGit ? ". The creator has already set up the local repository for you" : ""}: \`\`\`bash git push origin ${defaultBranch} \`\`\` -${useDependabot ? ( -`1. Add a new secret under https://github.com/${answers.authorGithub}/ioBroker.${answers.adapterName}/settings/secrets. It must be named \`AUTO_MERGE_TOKEN\` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. -`) : ""} -`)} +${ + useDependabot + ? `1. Add a new secret under https://github.com/${answers.authorGithub}/ioBroker.${answers.adapterName}/settings/secrets. It must be named \`AUTO_MERGE_TOKEN\` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. +` + : "" +} +` +} 1. Head over to ${ - isAdapter ? ( - useTypeScript ? "[src/main.ts](src/main.ts)" - : "[main.js](main.js)" - ) : `[widgets/${answers.adapterName}.html](widgets/${answers.adapterName}.html)` -} and start programming! + isAdapter + ? useTypeScript + ? "[src/main.ts](src/main.ts)" + : "[main.js](main.js)" + : `[widgets/${answers.adapterName}.html](widgets/${answers.adapterName}.html)` + } and start programming! ### Best Practices We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should @@ -131,16 +140,22 @@ check them out. If you're already experienced, you should also take a look at th Several npm scripts are predefined for your convenience. You can run them using \`npm run \` | Script name | Description | |-------------|-------------| -${Object.entries(npmScripts).map(([name, desc]) => ( - `| \`${name}\` | ${desc} |` -)).join("\n")} +${Object.entries(npmScripts) + .map(([name, desc]) => `| \`${name}\` | ${desc} |`) + .join("\n")} -${useTypeScript || useReact ? `### Configuring the compilation +${ + useTypeScript || useReact + ? `### Configuring the compilation The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings either in \`tsconfig.json\` or by changing options for the build tasks. These options are described in detail in the -[\`@iobroker/adapter-dev\` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files).` : ""} +[\`@iobroker/adapter-dev\` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files).` + : "" +} -${isAdapter ? `### Writing tests +${ + isAdapter + ? `### Writing tests When done right, testing code is invaluable, because it gives you the confidence to change your code while knowing exactly if and when something breaks. A good read on the topic of test-driven development @@ -151,11 +166,15 @@ clear upsides. The template provides you with basic tests for the adapter startup and package files. It is recommended that you add your own tests into the mix. -` : ""}### Publishing the ${isAdapter ? "adapter" : "widget"} +` + : "" +}### Publishing the ${isAdapter ? "adapter" : "widget"} Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form \`v..\`. We **strongly recommend** that you do. The necessary steps are described in \`.github/workflows/test-and-release.yml\`. -${useReleaseScript ? `Since you installed the release script, you can create a new +${ + useReleaseScript + ? `Since you installed the release script, you can create a new release simply by calling: \`\`\`bash npm run release @@ -163,10 +182,14 @@ npm run release Additional command line options for the release script are explained in the [release-script documentation](https://github.com/AlCalzone/release-script#command-line). -` : ""}To get your ${isAdapter ? "adapter" : "widget"} released in ioBroker, please refer to the documentation +` + : "" +}To get your ${isAdapter ? "adapter" : "widget"} released in ioBroker, please refer to the documentation of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). -${useDevServer ? ` +${ + useDevServer + ? ` ### Test the adapter manually with dev-server Since you set up \`dev-server\`, you can use it to run, test and debug your adapter. @@ -178,7 +201,9 @@ dev-server watch The ioBroker.admin interface will then be available at http://localhost:${answers.devServerPort}/ Please refer to the [\`dev-server\` documentation](https://github.com/ioBroker/dev-server#command-line) for more details. -` : isGitHub ? ` +` + : isGitHub + ? ` ### Test the adapter manually with dev-server Please use \`dev-server\` to test and debug your adapter. @@ -190,7 +215,8 @@ dev-server watch \`\`\` Please refer to the [\`dev-server\` documentation](https://github.com/ioBroker/dev-server#readme) for more details. -` : ` +` + : ` ### Test the adapter manually on a local ioBroker installation In order to install the adapter locally without publishing, the following steps are recommended: 1. Create a tarball from your dev directory: @@ -207,13 +233,18 @@ In order to install the adapter locally without publishing, the following steps For later updates, the above procedure is not necessary. Just do the following: 1. Overwrite the changed files in the adapter directory (\`/opt/iobroker/node_modules/iobroker.${adapterNameLowerCase}\`) 1. Execute \`iobroker upload ${adapterNameLowerCase}\` on the ioBroker host -`} +` +} ## Changelog -${useReleaseScript ? ` -` : ""} +` + : "" +} ### ${useReleaseScript ? "**WORK IN PROGRESS**" : "0.0.1"} * (${answers.authorName}) initial release diff --git a/templates/_create-adapter.json.ts b/templates/_create-adapter.json.ts index 24c02c773..4e2cb9343 100644 --- a/templates/_create-adapter.json.ts +++ b/templates/_create-adapter.json.ts @@ -1,8 +1,7 @@ import type { TemplateFunction } from "../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - - return JSON.stringify(answers, undefined, '\t'); + return JSON.stringify(answers, undefined, "\t"); }; templateFunction.customPath = ".create-adapter.json"; diff --git a/templates/_devcontainer/README.md.ts b/templates/_devcontainer/README.md.ts index 4baa3a023..7ceabb951 100644 --- a/templates/_devcontainer/README.md.ts +++ b/templates/_devcontainer/README.md.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` # Devcontainer readme diff --git a/templates/_devcontainer/devcontainer.json.ts b/templates/_devcontainer/devcontainer.json.ts index ec6ffc3f5..dc841141c 100644 --- a/templates/_devcontainer/devcontainer.json.ts +++ b/templates/_devcontainer/devcontainer.json.ts @@ -1,17 +1,22 @@ import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const adapterNameLowerCase = answers.adapterName.toLowerCase(); const useESLint = !!answers.tools?.includes("ESLint"); const usePrettier = !!answers.tools?.includes("Prettier"); const extensions: string[] = []; - if (useESLint) extensions.push("dbaeumer.vscode-eslint"); - if (usePrettier) extensions.push("esbenp.prettier-vscode"); + if (useESLint) { + extensions.push("dbaeumer.vscode-eslint"); + } + if (usePrettier) { + extensions.push("esbenp.prettier-vscode"); + } const template = ` // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: diff --git a/templates/_devcontainer/docker-compose.yml.ts b/templates/_devcontainer/docker-compose.yml.ts index f49853cec..70e7ee5d2 100644 --- a/templates/_devcontainer/docker-compose.yml.ts +++ b/templates/_devcontainer/docker-compose.yml.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const adapterNameLowerCase = answers.adapterName.toLowerCase(); const needsParcel = answers.adminUi === "react" || answers.tabReact === "yes"; @@ -32,7 +33,9 @@ services: - LC_ALL=en_US.UTF-8 - TZ=Europe/Berlin - SETGID=1000 -${needsParcel ? (` +${ + needsParcel + ? ` parcel: container_name: parcel-${adapterNameLowerCase} build: ./parcel @@ -44,17 +47,27 @@ ${needsParcel ? (` - ..:/workspace:cached environment: - CHOKIDAR_USEPOLLING=1 -`) : ""} +` + : "" +} # Reverse proxy to load up-to-date admin sources from the repo nginx: image: nginx:latest depends_on: - iobroker -${needsParcel ? (` - parcel -`) : ""} links: +${ + needsParcel + ? ` - parcel +` + : "" +} links: - iobroker -${needsParcel ? (` - parcel -`) : ""} container_name: nginx-${adapterNameLowerCase} +${ + needsParcel + ? ` - parcel +` + : "" +} container_name: nginx-${adapterNameLowerCase} volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ..:/workspace:cached diff --git a/templates/_devcontainer/iobroker/_Dockerfile.ts b/templates/_devcontainer/iobroker/_Dockerfile.ts index d059c8884..5724f565d 100644 --- a/templates/_devcontainer/iobroker/_Dockerfile.ts +++ b/templates/_devcontainer/iobroker/_Dockerfile.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` FROM iobroker/iobroker:latest @@ -19,7 +20,7 @@ COPY node-wrapper.sh /usr/bin/node-wrapper.sh RUN chmod +x /usr/bin/node-wrapper.sh \\ && NODE_BIN="$(command -v node)" \\ # Move the original node binary to .real - && mv "$NODE_BIN" "$\{NODE_BIN\}.real" \\ + && mv "$NODE_BIN" "$\{NODE_BIN}.real" \\ # Move the wrapper in place && mv /usr/bin/node-wrapper.sh "$NODE_BIN" diff --git a/templates/_devcontainer/iobroker/boot.sh.ts b/templates/_devcontainer/iobroker/boot.sh.ts index c42dd72d4..d6aca49bd 100644 --- a/templates/_devcontainer/iobroker/boot.sh.ts +++ b/templates/_devcontainer/iobroker/boot.sh.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` #!/bin/bash diff --git a/templates/_devcontainer/iobroker/node-wrapper.sh.ts b/templates/_devcontainer/iobroker/node-wrapper.sh.ts index e07550142..6da4f546b 100644 --- a/templates/_devcontainer/iobroker/node-wrapper.sh.ts +++ b/templates/_devcontainer/iobroker/node-wrapper.sh.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` #!/bin/bash diff --git a/templates/_devcontainer/nginx/nginx.conf.ts b/templates/_devcontainer/nginx/nginx.conf.ts index f9bf4d7a0..023a4b5d7 100644 --- a/templates/_devcontainer/nginx/nginx.conf.ts +++ b/templates/_devcontainer/nginx/nginx.conf.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const adapterNameLowerCase = answers.adapterName.toLowerCase(); const needsParcel = answers.adminUi === "react" || answers.tabReact === "yes"; @@ -38,11 +39,15 @@ http { location /adapter/${adapterNameLowerCase}/ { alias /workspace/admin/; } -${needsParcel ? (` +${ + needsParcel + ? ` location /adapter/${adapterNameLowerCase}/build/ { proxy_redirect off; proxy_pass http://parcel:1234/; - }`) : ""} + }` + : "" +} } }`; return template.trim(); diff --git a/templates/_devcontainer/parcel/_Dockerfile.ts b/templates/_devcontainer/parcel/_Dockerfile.ts index eefb3ce71..612bb4f82 100644 --- a/templates/_devcontainer/parcel/_Dockerfile.ts +++ b/templates/_devcontainer/parcel/_Dockerfile.ts @@ -1,10 +1,11 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); const needsParcel = answers.adminUi === "react" || answers.tabReact === "yes"; - if (!devcontainer || !needsParcel) return; + if (!devcontainer || !needsParcel) { + return; + } const template = ` FROM node:12 diff --git a/templates/_devcontainer/parcel/run.sh.ts b/templates/_devcontainer/parcel/run.sh.ts index 77eb90627..de64793f3 100644 --- a/templates/_devcontainer/parcel/run.sh.ts +++ b/templates/_devcontainer/parcel/run.sh.ts @@ -1,10 +1,11 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); const needsParcel = answers.adminUi === "react" || answers.tabReact === "yes"; - if (!devcontainer || !needsParcel) return; + if (!devcontainer || !needsParcel) { + return; + } const template = ` #!/bin/bash @@ -15,7 +16,7 @@ npm install npm run watch:parcel `; - return template.trim().replace(/\r\n/g, '\n'); + return template.trim().replace(/\r\n/g, "\n"); }; templateFunction.customPath = ".devcontainer/parcel/run.sh"; diff --git a/templates/_devcontainer/scripts/postcreate.sh.ts b/templates/_devcontainer/scripts/postcreate.sh.ts index 6f210c86d..da4059bcd 100644 --- a/templates/_devcontainer/scripts/postcreate.sh.ts +++ b/templates/_devcontainer/scripts/postcreate.sh.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` #!/bin/bash diff --git a/templates/_devcontainer/scripts/poststart.sh.ts b/templates/_devcontainer/scripts/poststart.sh.ts index e5d24f3ac..b5cdc1274 100644 --- a/templates/_devcontainer/scripts/poststart.sh.ts +++ b/templates/_devcontainer/scripts/poststart.sh.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` #!/bin/bash diff --git a/templates/_devcontainer/scripts/wait_for_iobroker.sh.ts b/templates/_devcontainer/scripts/wait_for_iobroker.sh.ts index f8a6dd51a..abea30008 100644 --- a/templates/_devcontainer/scripts/wait_for_iobroker.sh.ts +++ b/templates/_devcontainer/scripts/wait_for_iobroker.sh.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` #!/bin/bash diff --git a/templates/_eslintignore.ts b/templates/_eslintignore.ts deleted file mode 100644 index 82c13df11..000000000 --- a/templates/_eslintignore.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { TemplateFunction } from "../src/lib/createAdapter"; - -const templateFunction: TemplateFunction = answers => { - - const useESLint = answers.tools?.includes("ESLint") - if (!useESLint) return; - - const useTypeScript = answers.language === "TypeScript"; - const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; - const usePrettier = answers.tools?.includes("Prettier"); - - const template = ` -${useReact ? "admin/build/" : ""} -${useTypeScript ? "build/" : ""} -${usePrettier ? ".prettierrc.js" : ""} -**/.eslintrc.js -admin/words.js -`; - return template.trim().replace(/\n+/g, "\n"); -}; - -templateFunction.customPath = ".eslintignore"; -export = templateFunction; diff --git a/templates/_eslintrc_javascript.json.ts b/templates/_eslintrc_javascript.json.ts deleted file mode 100644 index 194ddf0df..000000000 --- a/templates/_eslintrc_javascript.json.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as JSON5 from "json5"; -import type { TemplateFunction } from "../src/lib/createAdapter"; - -const templateFunction: TemplateFunction = answers => { - - // This version is intended for use in JS projects - if (answers.language !== "JavaScript") return; - const useReact = - answers.adminUi === "react" || answers.tabReact === "yes"; - - const useESLint = answers.tools && answers.tools.indexOf("ESLint") > -1; - if (!useESLint) return; - - const template = ` -{ - "root": true, - "env": { - "es6": true, - "node": true, - "mocha": true - }, - "extends": [ - "eslint:recommended", - ${useReact ? (`"plugin:react/recommended",`) : ""} - ], - plugins: [${useReact ? `"react"` : ""}], - ${useReact ? (` - settings: { - react: { - version: "detect", - }, - },`): ""} - "rules": { - "indent": [ - "error", - ${answers.indentation === "Tab" ? `"tab"` : "4"}, - { - "SwitchCase": 1 - } - ], - "no-console": "off", - "no-unused-vars": [ - "error", - { - "ignoreRestSiblings": true, - "argsIgnorePattern": "^_", - } - ], - "no-var": "error", - "no-trailing-spaces": "error", - "prefer-const": "error", - "quotes": [ - "error", - "${typeof answers.quotes === "string" ? answers.quotes : "double"}", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "semi": [ - "error", - "always" - ] - }, - "parserOptions": { - ecmaVersion: "latest", // Allows for the parsing of modern ECMAScript features - ${useReact ? (`ecmaFeatures: { - jsx: true, - },`) : ""} - } -} -`; - return JSON.stringify(JSON5.parse(template), null, 4); -}; - -templateFunction.customPath = ".eslintrc.json"; -export = templateFunction; diff --git a/templates/_eslintrc_typescript.js.ts b/templates/_eslintrc_typescript.js.ts deleted file mode 100644 index ef39dc8df..000000000 --- a/templates/_eslintrc_typescript.js.ts +++ /dev/null @@ -1,101 +0,0 @@ -import type { TemplateFunction } from "../src/lib/createAdapter"; - -const templateFunction: TemplateFunction = answers => { - - // This version is intended for use in TS projects - if (answers.language !== "TypeScript") return; - - const useESLint = answers.tools && answers.tools.indexOf("ESLint") > -1; - if (!useESLint) return; - const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1; - const useReact = - answers.adminUi === "react" || answers.tabReact === "yes"; - - const template = ` -module.exports = { - root: true, // Don't look outside this project for inherited configs - parser: "@typescript-eslint/parser", // Specifies the ESLint parser - parserOptions: { - ecmaVersion: "latest", // Allows for the parsing of modern ECMAScript features - sourceType: "module", // Allows for the use of imports - project: ${useReact ? `["./tsconfig.json", "./admin/tsconfig.json"]` : `"./tsconfig.json"`},${useReact ? (` - ecmaFeatures: { - jsx: true, - },`) : ""} - }, - extends: [ - "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin -${usePrettier ? (` - "plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. -`) : ""}${useReact ? (` - "plugin:react/recommended", // Supports React JSX -`) : ""} ], - plugins: [${useReact ? `"react"` : ""}],${useReact ? (` - settings: { - react: { - version: "detect", - }, - },`): ""} - rules: {${usePrettier ? "" : (` - "indent": "off", - "@typescript-eslint/indent": [ - "error", - ${answers.indentation === "Tab" ? `"tab"` : "4"}, - { - "SwitchCase": 1 - } - ], - "quotes": [ - "error", - "${typeof answers.quotes === "string" ? answers.quotes : "double"}", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ],`)} - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-use-before-define": [ - "error", - { - functions: false, - typedefs: false, - classes: false, - }, - ], - "@typescript-eslint/no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - argsIgnorePattern: "^_", - }, - ], - "@typescript-eslint/explicit-function-return-type": [ - "warn", - { - allowExpressions: true, - allowTypedFunctionExpressions: true, - }, - ], - "@typescript-eslint/no-object-literal-type-assertion": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()! - "no-var": "error", - "prefer-const": "error", - "no-trailing-spaces": "error", - }, - overrides: [ - { - files: ["*.test.ts"${useReact ? `, "*.tsx"` : ""}], - rules: { - "@typescript-eslint/explicit-function-return-type": "off", - }, - }, - ], -}; -`; - return template.trim().replace(/(\r?\n)+/g, "\n"); -}; - -templateFunction.customPath = ".eslintrc.js"; -export = templateFunction; diff --git a/templates/_github/ISSUE_TEMPLATE/bug_report.md.ts b/templates/_github/ISSUE_TEMPLATE/bug_report.md.ts index 0180f02a8..b0dddab93 100644 --- a/templates/_github/ISSUE_TEMPLATE/bug_report.md.ts +++ b/templates/_github/ISSUE_TEMPLATE/bug_report.md.ts @@ -1,4 +1,5 @@ -import { readFile, TemplateFunction } from "../../../src/lib/createAdapter"; +import type { TemplateFunction } from "../../../src/lib/createAdapter"; +import { readFile } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = _answers => { return readFile("bug_report.raw.md", __dirname); diff --git a/templates/_github/ISSUE_TEMPLATE/config.yml.ts b/templates/_github/ISSUE_TEMPLATE/config.yml.ts index faf4aa066..b6f7c9faf 100644 --- a/templates/_github/ISSUE_TEMPLATE/config.yml.ts +++ b/templates/_github/ISSUE_TEMPLATE/config.yml.ts @@ -1,4 +1,5 @@ -import { readFile, TemplateFunction } from "../../../src/lib/createAdapter"; +import type { TemplateFunction } from "../../../src/lib/createAdapter"; +import { readFile } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = _answers => { return readFile("config.raw.yml", __dirname); @@ -7,4 +8,4 @@ const templateFunction: TemplateFunction = _answers => { templateFunction.customPath = ".github/ISSUE_TEMPLATE/config.yml"; // Reformatting this would create mixed tabs and spaces templateFunction.noReformat = true; -export = templateFunction; \ No newline at end of file +export = templateFunction; diff --git a/templates/_github/auto-merge.yml.ts b/templates/_github/auto-merge.yml.ts index 22478c6a6..7e83a7da9 100644 --- a/templates/_github/auto-merge.yml.ts +++ b/templates/_github/auto-merge.yml.ts @@ -1,9 +1,11 @@ -import { readFile, TemplateFunction } from "../../src/lib/createAdapter"; +import type { TemplateFunction } from "../../src/lib/createAdapter"; +import { readFile } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useDependabot = answers.dependabot === "yes"; - if (!useDependabot) return; + if (!useDependabot) { + return; + } return readFile("auto-merge.raw.yml", __dirname); }; diff --git a/templates/_github/dependabot.yml.ts b/templates/_github/dependabot.yml.ts index ee7c6a883..5665fb1ed 100644 --- a/templates/_github/dependabot.yml.ts +++ b/templates/_github/dependabot.yml.ts @@ -1,14 +1,15 @@ import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useDependabot = answers.dependabot === "yes"; - if (!useDependabot) return; + if (!useDependabot) { + return; + } // Generate a consistent random day between 2 and 28 based on adapter name // This ensures all dependabot runs within a repository use the same day - const hash = answers.adapterName.split('').reduce((acc, char) => { - return ((acc << 5) - acc) + char.charCodeAt(0); + const hash = answers.adapterName.split("").reduce((acc, char) => { + return (acc << 5) - acc + char.charCodeAt(0); }, 0); const dayOfMonth = Math.abs(hash % 27) + 2; // Range: 2-28 diff --git a/templates/_github/workflows/dependabot-auto-merge.yml.ts b/templates/_github/workflows/dependabot-auto-merge.yml.ts index be0f60963..b7756e76f 100644 --- a/templates/_github/workflows/dependabot-auto-merge.yml.ts +++ b/templates/_github/workflows/dependabot-auto-merge.yml.ts @@ -1,9 +1,11 @@ -import { readFile, TemplateFunction } from "../../../src/lib/createAdapter"; +import type { TemplateFunction } from "../../../src/lib/createAdapter"; +import { readFile } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useDependabot = answers.dependabot === "yes"; - if (!useDependabot) return; + if (!useDependabot) { + return; + } return readFile("dependabot-auto-merge.raw.yml", __dirname); }; diff --git a/templates/_github/workflows/test-and-release.yml.ts b/templates/_github/workflows/test-and-release.yml.ts index 15f385add..9e1d82004 100644 --- a/templates/_github/workflows/test-and-release.yml.ts +++ b/templates/_github/workflows/test-and-release.yml.ts @@ -2,28 +2,24 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; import { RECOMMENDED_NODE_VERSION_FALLBACK } from "../../../src/lib/constants"; const templateFunction: TemplateFunction = answers => { - const isAdapter = answers.features?.includes("adapter"); const useTypeScript = answers.language === "TypeScript"; const useESLint = answers.tools?.includes("ESLint"); const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; const needsBuild = useTypeScript || useReact; - const sourcemapPaths = [ - ...(useTypeScript ? ["build/"] : []), - ...(useReact ? ["admin/build/"] : []), - ]; + const sourcemapPaths = [...(useTypeScript ? ["build/"] : []), ...(useReact ? ["admin/build/"] : [])]; const useReleaseScript = answers.releaseScript === "yes"; const isGitHub = answers.target === "github"; // Determine the LTS version and test versions based on the minimum Node.js version selected const minNodeVersion = answers.nodeVersion || RECOMMENDED_NODE_VERSION_FALLBACK; const ltsNodeVersion = `${minNodeVersion}.x`; - + // Filter test versions to only include versions >= the minimum version const allTestVersions = ["20.x", "22.x", "24.x"]; const minVersionNumber = parseInt(minNodeVersion, 10); const adapterTestVersions = allTestVersions.filter(version => { - const versionNumber = parseInt(version.split('.')[0], 10); + const versionNumber = parseInt(version.split(".")[0], 10); return versionNumber >= minVersionNumber; }); @@ -32,10 +28,7 @@ const templateFunction: TemplateFunction = answers => { const adapterName = answers.adapterName; const deploy = useReleaseScript && isGitHub; - const escapeDeploy = - deploy ? - (input: string) => input : - (input: string) => input.replace(/^/gm, '#'); + const escapeDeploy = deploy ? (input: string) => input : (input: string) => input.replace(/^/gm, "#"); const template = ` name: Test and Release @@ -70,12 +63,21 @@ jobs: with: node-version: '${ltsNodeVersion}' # Uncomment the following line if your adapter cannot be installed using 'npm ci' - # install-command: 'npm install'${useTypeScript ? (` - type-checking: true`) : ""}${useESLint ? (` - lint: true`) : ""} - -${isAdapter ? ( -` # Runs adapter tests on all supported node versions and OSes + # install-command: 'npm install'${ + useTypeScript + ? ` + type-checking: true` + : "" + }${ + useESLint + ? ` + lint: true` + : "" + } + +${ + isAdapter + ? ` # Runs adapter tests on all supported node versions and OSes adapter-tests: if: contains(github.event.head_commit.message, '[skip ci]') == false @@ -91,15 +93,25 @@ ${isAdapter ? ( node-version: \${{ matrix.node-version }} os: \${{ matrix.os }} # Uncomment the following line if your adapter cannot be installed using 'npm ci' - # install-command: 'npm install'${needsBuild ? (` - build: true`) : ""} -`) : ""}${deploy ? "" : (` + # install-command: 'npm install'${ + needsBuild + ? ` + build: true` + : "" + } +` + : "" +}${ + deploy + ? "" + : ` # TODO: To enable automatic npm releases, create a token on npmjs.org # Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options # Then uncomment the following block: -`)} +` + } ${escapeDeploy( -` # Deploys the final package to NPM + ` # Deploys the final package to NPM deploy: needs: [check-and-lint${isAdapter ? ", adapter-tests" : ""}] @@ -120,8 +132,12 @@ ${escapeDeploy( with: node-version: '${ltsNodeVersion}' # Uncomment the following line if your adapter cannot be installed using 'npm ci' - # install-command: 'npm install'${needsBuild ? (` - build: true`) : ""} + # install-command: 'npm install'${ + needsBuild + ? ` + build: true` + : "" + } npm-token: \${{ secrets.NPM_TOKEN }} github-token: \${{ secrets.GITHUB_TOKEN }} @@ -132,10 +148,15 @@ ${escapeDeploy( sentry: true sentry-token: \${{ secrets.SENTRY_AUTH_TOKEN }} sentry-project: "iobroker-${adapterName}" - sentry-version-prefix: "iobroker.${adapterName}"${needsBuild ? (` - sentry-sourcemap-paths: "${sourcemapPaths.join(" ")}"`) : ""} + sentry-version-prefix: "iobroker.${adapterName}"${ + needsBuild + ? ` + sentry-sourcemap-paths: "${sourcemapPaths.join(" ")}"` + : "" + } # If your sentry project is linked to a GitHub repository, you can enable the following option - # sentry-github-integration: true`)} + # sentry-github-integration: true`, +)} `; return template.trimLeft(); }; diff --git a/templates/_gitignore.ts b/templates/_gitignore.ts index c3ebf5533..1a3cba569 100644 --- a/templates/_gitignore.ts +++ b/templates/_gitignore.ts @@ -1,7 +1,6 @@ import type { TemplateFunction } from "../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useNyc = answers.tools && answers.tools.indexOf("code coverage") > -1; const useDevContainer = answers.tools && answers.tools.includes("devcontainer"); @@ -21,11 +20,15 @@ iobroker.*.tgz Thumbs.db .commitinfo -${useNyc ? ` +${ + useNyc + ? ` # NYC coverage files coverage -` : ""} +` + : "" +} # i18n intermediate files admin/i18n/flat.txt admin/i18n/*/flat.txt diff --git a/templates/_prettierignore.ts b/templates/_prettierignore.ts index 96b4b4f88..d710f321e 100644 --- a/templates/_prettierignore.ts +++ b/templates/_prettierignore.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1; - if (!usePrettier) return; + if (!usePrettier) { + return; + } const useTypeScript = answers.language === "TypeScript"; const template = ` diff --git a/templates/_prettierrc.js.ts b/templates/_prettierrc.js.ts index c33dd8889..cdaa8aae4 100644 --- a/templates/_prettierrc.js.ts +++ b/templates/_prettierrc.js.ts @@ -1,15 +1,21 @@ import type { TemplateFunction } from "../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1; - if (!usePrettier) return; + if (!usePrettier) { + return; + } + const useOfficialESLintConfig = answers.eslintConfig === "official"; + // Don't generate .prettierrc.js when using official config (prettier config is in prettier.config.mjs) + if (useOfficialESLintConfig) { + return; + } // endOfLine could be made dependent on the current OS's line ending // I need to think about it. // However leaving it on "auto" causes linting to fail on CI servers // when the adapter was developed on Windows - + // Keep this in sync with lib/tools.ts -> formatWithPrettier() const template = ` module.exports = { diff --git a/templates/_releaseconfig.json.ts b/templates/_releaseconfig.json.ts index d8e09274b..b0158c817 100644 --- a/templates/_releaseconfig.json.ts +++ b/templates/_releaseconfig.json.ts @@ -2,7 +2,9 @@ import type { TemplateFunction } from "../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { const useReleaseScript = answers.releaseScript === "yes"; - if (!useReleaseScript) return; + if (!useReleaseScript) { + return; + } const useTypeScript = answers.language === "TypeScript"; const useAdminReact = answers.adminUi === "react"; @@ -15,11 +17,10 @@ const templateFunction: TemplateFunction = answers => { if (useTypeScript || useReact) { template.exec = { before_commit: "npm run build", - } + }; } - - return JSON.stringify(template, undefined, '\t'); + return JSON.stringify(template, undefined, "\t"); }; templateFunction.customPath = ".releaseconfig.json"; diff --git a/templates/_vscode/extensions.json.ts b/templates/_vscode/extensions.json.ts index b9128d76a..a96c4631e 100644 --- a/templates/_vscode/extensions.json.ts +++ b/templates/_vscode/extensions.json.ts @@ -2,21 +2,27 @@ import * as JSON5 from "json5"; import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useESLint = answers.tools && answers.tools.indexOf("ESLint") > -1; const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1; + const useOfficialESLintConfig = useESLint && answers.eslintConfig === "official"; + const useTypeScript = answers.language === "TypeScript"; + + // Include prettier-vscode for TypeScript when using official ESLint config + const includePrettierExtension = usePrettier || (useOfficialESLintConfig && useTypeScript); - if (!useESLint && !usePrettier) return; + if (!useESLint && !includePrettierExtension) { + return; + } const template = ` { "recommendations": [ ${useESLint ? `"dbaeumer.vscode-eslint",` : ""} - ${usePrettier ? `"esbenp.prettier-vscode",` : ""} + ${includePrettierExtension ? `"esbenp.prettier-vscode",` : ""} ] } `; -return JSON.stringify(JSON5.parse(template), null, 4); + return JSON.stringify(JSON5.parse(template), null, 4); }; templateFunction.customPath = ".vscode/extensions.json"; diff --git a/templates/_vscode/launch.json.ts b/templates/_vscode/launch.json.ts index fea149d25..df00cded1 100644 --- a/templates/_vscode/launch.json.ts +++ b/templates/_vscode/launch.json.ts @@ -2,9 +2,10 @@ import * as JSON5 from "json5"; import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const devcontainer = answers.tools && answers.tools.includes("devcontainer"); - if (!devcontainer) return; + if (!devcontainer) { + return; + } const template = ` { @@ -19,13 +20,13 @@ const templateFunction: TemplateFunction = answers => { "name": "Launch ioBroker Adapter", "skipFiles": ["/**"], "args": ["--debug", "0", "--logs"], - "program": "$\{workspaceFolder\}/main.js", + "program": "$\{workspaceFolder}/main.js", "console": "integratedTerminal", } ] } `; -return JSON.stringify(JSON5.parse(template), null, 4); + return JSON.stringify(JSON5.parse(template), null, 4); }; templateFunction.customPath = ".vscode/launch.json"; diff --git a/templates/_vscode/settings.json.ts b/templates/_vscode/settings.json.ts index b2d0ade4b..ecd859a0b 100644 --- a/templates/_vscode/settings.json.ts +++ b/templates/_vscode/settings.json.ts @@ -2,28 +2,37 @@ import * as JSON5 from "json5"; import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useESLint = answers.tools && answers.tools.indexOf("ESLint") > -1; const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1; const useTypeScript = answers.language === "TypeScript"; - if (!useESLint && !usePrettier && !useTypeScript) return; + if (!useESLint && !usePrettier && !useTypeScript) { + return; + } const template = ` { ${useTypeScript ? `"typescript.tsdk": "node_modules/typescript/lib",` : ""} ${useESLint ? `"eslint.enable": true,` : ""} -${usePrettier ? (` +${ + usePrettier + ? ` "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", - ${useTypeScript ? (` + ${ + useTypeScript + ? ` "[typescript]": { "editor.codeActionsOnSave": { "source.organizeImports": true }, }, - `) : ""} -`) : ""} + ` + : "" + } +` + : "" +} "json.schemas": [ { "fileMatch": ["io-package.json"], @@ -43,7 +52,7 @@ ${usePrettier ? (` ], } `; -return JSON.stringify(JSON5.parse(template), null, 4); + return JSON.stringify(JSON5.parse(template), null, 4); }; templateFunction.customPath = ".vscode/settings.json"; diff --git a/templates/admin/_eslintrc_js_react.json.ts b/templates/admin/_eslintrc_js_react.json.ts index 2ac0ba133..0a1162039 100644 --- a/templates/admin/_eslintrc_js_react.json.ts +++ b/templates/admin/_eslintrc_js_react.json.ts @@ -1,11 +1,11 @@ import type { TemplateFunction } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; - const useReact = - answers.adminUi === "react" || answers.tabReact === "yes"; - if (useTypeScript || !useReact) return; + const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; + if (useTypeScript || !useReact) { + return; + } const template = ` { diff --git a/templates/admin/admin.dts.ts b/templates/admin/admin.dts.ts index d1f44bbc8..3320abd7e 100644 --- a/templates/admin/admin.dts.ts +++ b/templates/admin/admin.dts.ts @@ -1,14 +1,16 @@ -import { readFile, TemplateFunction } from "../../src/lib/createAdapter"; +import type { TemplateFunction } from "../../src/lib/createAdapter"; +import { readFile } from "../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; const hasTab = answers.adminFeatures && answers.adminFeatures.indexOf("tab") > -1; const useAdminHtml = answers.adminUi === "html"; const useTabReact = hasTab && answers.tabReact === "yes"; const useTypeChecking = answers.tools && answers.tools.indexOf("type checking") > -1; const hasHtml = useAdminHtml || (hasTab && !useTabReact); - if (!hasHtml || (!useTypeScript && !useTypeChecking)) return; + if (!hasHtml || (!useTypeScript && !useTypeChecking)) { + return; + } return readFile("admin.raw.d.ts", __dirname); }; diff --git a/templates/admin/admin.raw.d.ts b/templates/admin/admin.raw.d.ts index 41f934f4c..7594b9e3a 100644 --- a/templates/admin/admin.raw.d.ts +++ b/templates/admin/admin.raw.d.ts @@ -11,11 +11,18 @@ interface Window { declare const instance: number; declare const adapter: string; -/** Translates text */ +/** + * Translates text + * + * @param text + * @param arg1 + * @param arg2 + * @param arg3 + */ declare function _(text: string, arg1?: string, arg2?: string, arg3?: string): string; declare const socket: ioBrokerSocket; declare function sendTo( - instance: any | null, + instance: any, command: string, message: any, callback: (result: SendToResult) => void | Promise, @@ -28,49 +35,20 @@ interface SendToResult { // tslint:disable-next-line:class-name interface ioBrokerSocket { - emit( - command: "subscribeObjects", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "subscribeStates", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "unsubscribeObjects", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "unsubscribeStates", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; + emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; emit( event: "getObjectView", view: "system", type: "device", options: ioBroker.GetObjectViewParams, - callback: ( - err: string | undefined, - result?: any, - ) => void | Promise, - ): void; - emit( - event: "getStates", - callback: ( - err: string | undefined, - result?: Record, - ) => void, - ): void; - emit( - event: "getState", - id: string, - callback: (err: string | undefined, result?: ioBroker.State) => void, + callback: (err: string | undefined, result?: any) => void | Promise, ): void; + emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; + emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; emit( event: "setState", id: string, @@ -80,14 +58,8 @@ interface ioBrokerSocket { on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; - removeEventHandler( - event: "objectChange", - handler: ioBroker.ObjectChangeHandler, - ): void; - removeEventHandler( - event: "stateChange", - handler: ioBroker.StateChangeHandler, - ): void; + removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; // TODO: other events } diff --git a/templates/admin/custom_m.html.ts b/templates/admin/custom_m.html.ts index a4fd71973..4ed6b712e 100644 --- a/templates/admin/custom_m.html.ts +++ b/templates/admin/custom_m.html.ts @@ -1,9 +1,10 @@ import type { TemplateFunction } from "../../src/lib/createAdapter"; export = (answers => { - const supportCustom = answers.adminFeatures && answers.adminFeatures.indexOf("custom") > -1; - if (!supportCustom) return; + if (!supportCustom) { + return; + } const template = ` ` : -` +${ + useReact + ? ` ` + : ` - `} + ` +} -${useReact ? "" : -` +${ + useReact + ? "" + : ` -`} +` +} -${useReact ? (` +${ + useReact + ? `
-`) : (` +` + : `
@@ -124,7 +137,8 @@ ${useReact ? (`
-`)} +` +} diff --git a/templates/admin/jsonConfig.json.ts b/templates/admin/jsonConfig.json.ts index 8591bb9fc..1f48020aa 100644 --- a/templates/admin/jsonConfig.json.ts +++ b/templates/admin/jsonConfig.json.ts @@ -1,4 +1,5 @@ -import { AdapterSettings, getDefaultAnswer } from "../../src/lib/core/questions"; +import type { AdapterSettings } from "../../src/lib/core/questions"; +import { getDefaultAnswer } from "../../src/lib/core/questions"; import type { TemplateFunction } from "../../src/lib/createAdapter"; function generateSetting(settings: AdapterSettings): any { @@ -12,35 +13,37 @@ function generateSetting(settings: AdapterSettings): any { sm: 12, md: 6, lg: 4, - xl: 4 - }; - } else { - return { - type: settings.inputType, - label: settings.label || settings.key, - newLine: true, - xs: 12, - sm: 12, - md: 6, - lg: 4, - xl: 4 + xl: 4, }; } + return { + type: settings.inputType, + label: settings.label || settings.key, + newLine: true, + xs: 12, + sm: 12, + md: 6, + lg: 4, + xl: 4, + }; } export = (answers => { - const isAdapter = answers.features.indexOf("adapter") > -1; - const useJsonConfig = answers.adminUi === 'json'; - if (!isAdapter || !useJsonConfig) return; + const useJsonConfig = answers.adminUi === "json"; + if (!isAdapter || !useJsonConfig) { + return; + } const adapterSettings: AdapterSettings[] = answers.adapterSettings ?? getDefaultAnswer("adapterSettings")!; const items = adapterSettings.reduce>( - (old, setting) => ({... old, [setting.key]: generateSetting(setting)}), {}) + (old, setting) => ({ ...old, [setting.key]: generateSetting(setting) }), + {}, + ); const config = { i18n: true, type: "panel", - items + items, }; return JSON.stringify(config, null, 4); }) as TemplateFunction; diff --git a/templates/admin/src/app.tsx_jsx.ts b/templates/admin/src/app.tsx_jsx.ts index 949bb9b42..01f2c96c2 100644 --- a/templates/admin/src/app.tsx_jsx.ts +++ b/templates/admin/src/app.tsx_jsx.ts @@ -1,30 +1,36 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; const useReact = answers.adminUi === "react"; - if (!useReact) return; + if (!useReact) { + return; + } - const template = ` + const template = `/* eslint-disable @typescript-eslint/no-require-imports */ import React from "react"; -import { ${useTypeScript ? "Theme, " : ""}withStyles } from "@material-ui/core/styles"; +import { ${useTypeScript ? "type Theme, type StyleRules, " : ""}withStyles } from "@material-ui/core/styles"; import GenericApp from "@iobroker/adapter-react/GenericApp"; import Settings from "./components/settings"; -${useTypeScript ? -`import { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; -import { StyleRules } from "@material-ui/core/styles"; -` : ""} -${useTypeScript ? -`const styles = (_theme: Theme): StyleRules => ({ +${ + useTypeScript + ? `import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; +` + : "" +} +${ + useTypeScript + ? `const styles = (_theme: Theme): StyleRules => ({ root: {}, -});` : `/** +});` + : `/** * @type {(_theme: import("@material-ui/core/styles").Theme) => import("@material-ui/styles").StyleRules} */ const styles = (_theme) => ({ root: {}, -});`} +});` +} class App extends GenericApp { constructor(props${useTypeScript ? ": GenericAppProps" : ""}) { @@ -32,16 +38,16 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - "en": require("./i18n/en.json"), - "de": require("./i18n/de.json"), - "ru": require("./i18n/ru.json"), - "pt": require("./i18n/pt.json"), - "nl": require("./i18n/nl.json"), - "fr": require("./i18n/fr.json"), - "it": require("./i18n/it.json"), - "es": require("./i18n/es.json"), - "pl": require("./i18n/pl.json"), - "uk": require("./i18n/uk.json"), + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), "zh-cn": require("./i18n/zh-cn.json"), }, }; @@ -52,14 +58,17 @@ class App extends GenericApp { // executed when connection is ready } - render() { + render()${useTypeScript ? ": Element" : ""} { if (!this.state.loaded) { return super.render(); } return (
- this.updateNativeValue(attr, value)} /> + this.updateNativeValue(attr, value)} + /> {this.renderError()} {this.renderToast()} {this.renderSaveCloseButtons()} @@ -70,10 +79,11 @@ class App extends GenericApp { export default withStyles(styles)(App); `; - return template.trim();}; + return template; +}; -templateFunction.customPath = (answers) => { +templateFunction.customPath = answers => { const useTypeScript = answers.language === "TypeScript"; return `admin/src/app.${useTypeScript ? "tsx" : "jsx"}`; -} +}; export = templateFunction; diff --git a/templates/admin/src/components/settings.tsx_jsx.ts b/templates/admin/src/components/settings.tsx_jsx.ts index b50d75f35..22cf48746 100644 --- a/templates/admin/src/components/settings.tsx_jsx.ts +++ b/templates/admin/src/components/settings.tsx_jsx.ts @@ -1,33 +1,36 @@ -import { AdapterSettings, getDefaultAnswer } from "../../../../src/lib/core/questions"; +import { type AdapterSettings, getDefaultAnswer } from "../../../../src/lib/core/questions"; import type { TemplateFunction } from "../../../../src/lib/createAdapter"; function generateSettingsMethod(settings: AdapterSettings): string { if (settings.inputType === "select" && settings.options) { - const options = settings.options.map((opt) => ({ value: opt.value, title: opt.text })); + const options = settings.options.map(opt => ({ value: opt.value, title: opt.text })); return ` {renderSelect("${settings.label || settings.key}", "${settings.key}", ${JSON.stringify(options)})}`; } else if (settings.inputType === "checkbox") { return ` {this.renderCheckbox("${settings.label || settings.key}", "${settings.key}")}`; - } else { - return ` - {this.renderInput("${settings.label || settings.key}", "${settings.key}", "${settings.inputType}")}`; } + return ` + {this.renderInput("${settings.label || settings.key}", "${settings.key}", "${settings.inputType}")}`; } const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; const useReact = answers.adminUi === "react"; - if (!useReact) return; + if (!useReact) { + return; + } const adapterSettings: AdapterSettings[] = answers.adapterSettings ?? getDefaultAnswer("adapterSettings")!; - const template = ` -import React from "react"; + const template = `import React from "react"; import { withStyles } from "@material-ui/core/styles"; -${useTypeScript ? `import { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; -` : ""}import TextField from "@material-ui/core/TextField"; +${ + useTypeScript + ? `import type { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; +` + : "" +}import TextField from "@material-ui/core/TextField"; import Input from "@material-ui/core/Input"; import FormHelperText from "@material-ui/core/FormHelperText"; import FormControl from "@material-ui/core/FormControl"; @@ -37,9 +40,13 @@ import FormControlLabel from "@material-ui/core/FormControlLabel"; import Checkbox from "@material-ui/core/Checkbox"; import I18n from "@iobroker/adapter-react/i18n"; -${useTypeScript ? "" : `/** +${ + useTypeScript + ? "" + : `/** * @type {() => Record} - */`} + */` +} const styles = ()${useTypeScript ? ": Record" : ""} => ({ input: { marginTop: 0, @@ -73,8 +80,9 @@ const styles = ()${useTypeScript ? ": Record" : ""} }, }); -${useTypeScript ? -`interface SettingsProps { +${ + useTypeScript + ? `interface SettingsProps { classes: Record; native: Record; @@ -84,7 +92,8 @@ ${useTypeScript ? interface SettingsState { // add your state properties here dummy?: undefined; -}` : `/** +}` + : `/** * @typedef {object} SettingsProps * @property {Record} classes * @property {Record} native @@ -94,62 +103,83 @@ interface SettingsState { /** * @typedef {object} SettingsState * @property {undefined} [dummy] Delete this and add your own state properties here - */`} + */` +} -${useTypeScript ? "" : `/** +${ + useTypeScript + ? "" + : `/** * @extends {React.Component} */ -`}class Settings extends React.Component${useTypeScript ? "" : ""} { +` +}class Settings extends React.Component${useTypeScript ? "" : ""} { constructor(props${useTypeScript ? ": SettingsProps" : ""}) { super(props); this.state = {}; } - ${useTypeScript ? `renderInput(title: AdminWord, attr: string, type: string)` : `/** + ${ + useTypeScript + ? `renderInput(title: AdminWord, attr: string, type: string): React.JSX.Element` + : `/** * @param {AdminWord} title * @param {string} attr * @param {string} type */ - renderInput(title, attr, type)`} { + renderInput(title, attr, type)` + } { return ( this.props.onChange(attr, e.target.value)} + onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> ); } - ${useTypeScript ? `renderSelect( + ${ + useTypeScript + ? `renderSelect( title: AdminWord, attr: string, options: { value: string; title: AdminWord }[], style?: React.CSSProperties, - )` : `/** + ): React.JSX.Element` + : `/** * @param {AdminWord} title * @param {string} attr * @param {{ value: string; title: AdminWord }[]} options * @param {React.CSSProperties} [style] */ - renderSelect(title, attr, options, style)`} { + renderSelect(title, attr, options, style)` + } { return ( } + onChange={e => this.props.onChange(attr, e.target.value === "_" ? "" : e.target.value)} + input={ + + } > - {options.map((item) => ( - + {options.map(item => ( + {I18n.t(item.title)} ))} @@ -159,18 +189,22 @@ ${useTypeScript ? "" : `/** ); } - ${useTypeScript ? `renderCheckbox(title: AdminWord, attr: string, style?: React.CSSProperties)` : `/** + ${ + useTypeScript + ? `renderCheckbox(title: AdminWord, attr: string, style?: React.CSSProperties): React.JSX.Element` + : `/** * @param {AdminWord} title * @param {string} attr * @param {React.CSSProperties} [style] */ - renderCheckbox(title, attr, style)`} { + renderCheckbox(title, attr, style)` + } { return ( ${adapterSettings.map(generateSettingsMethod).join("
")} +
${adapterSettings.map(generateSettingsMethod).join("\n\t\t\t\t
")}
); } @@ -195,11 +229,11 @@ ${useTypeScript ? "" : `/** export default withStyles(styles)(Settings); `; - return template.trim(); + return template; }; -templateFunction.customPath = (answers) => { +templateFunction.customPath = answers => { const useTypeScript = answers.language === "TypeScript"; return `admin/src/components/settings.${useTypeScript ? "tsx" : "jsx"}`; -} +}; export = templateFunction; diff --git a/templates/admin/src/i18n/i18n.dts.ts b/templates/admin/src/i18n/i18n.dts.ts index 421370056..13a2c1d1c 100644 --- a/templates/admin/src/i18n/i18n.dts.ts +++ b/templates/admin/src/i18n/i18n.dts.ts @@ -1,17 +1,18 @@ import type { TemplateFunction } from "../../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; const useTypeChecking = answers.tools?.includes("type checking"); - if (!useTypeScript && !useTypeChecking) return; + if (!useTypeScript && !useTypeChecking) { + return; + } - const useReact = - answers.adminUi === "react" || answers.tabReact === "yes"; - if (!useReact) return; + const useReact = answers.adminUi === "react" || answers.tabReact === "yes"; + if (!useReact) { + return; + } - const template = ` -/* + const template = `/* * This file loads the translations keys from \`i18n/en.json\` file and overrides * the declarations for the translate function \`I18n.t\` available in "@iobroker/adapter-react/i18n". * Using these definitions it is ensured that all used translations in the React @@ -27,18 +28,20 @@ const templateFunction: TemplateFunction = answers => { /** * Available words in \`i18n/en.json\`. */ +// eslint-disable-next-line @typescript-eslint/consistent-type-imports declare type AdminWord = keyof typeof import("./en.json"); declare module "@iobroker/adapter-react/i18n" { /** * Translate the given string to the selected language. + * * @param word The (key) word to look up the string. Has to be defined at least in \`i18n/en.json\`. * @param args Optional arguments which will replace the first (second, third, ...) occurence of %s */ function t(word: AdminWord, ...args: string[]): string; } `; - return template.trim(); + return template; }; templateFunction.customPath = "admin/src/i18n/i18n.d.ts"; diff --git a/templates/admin/src/index.tsx_jsx.ts b/templates/admin/src/index.tsx_jsx.ts index bff53dd6a..bbb6dd836 100644 --- a/templates/admin/src/index.tsx_jsx.ts +++ b/templates/admin/src/index.tsx_jsx.ts @@ -1,13 +1,13 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; const useReact = answers.adminUi === "react"; - if (!useReact) return; - - const template = ` -import React from "react"; + if (!useReact) { + return; + } + + const template = `import React from "react"; import ReactDOM from "react-dom"; import { MuiThemeProvider } from "@material-ui/core/styles"; import theme from "@iobroker/adapter-react/Theme"; @@ -21,7 +21,7 @@ function build()${useTypeScript ? ": void" : ""} { { + onThemeChange={_theme => { themeName = _theme; build(); }} @@ -33,11 +33,11 @@ function build()${useTypeScript ? ": void" : ""} { build(); `; - return template.trim(); + return template; }; -templateFunction.customPath = (answers) => { +templateFunction.customPath = answers => { const useTypeScript = answers.language === "TypeScript"; return `admin/src/index.${useTypeScript ? "tsx" : "jsx"}`; -} +}; export = templateFunction; diff --git a/templates/admin/src/tab-app.tsx_jsx.ts b/templates/admin/src/tab-app.tsx_jsx.ts index fbd080c04..1a81bd15d 100644 --- a/templates/admin/src/tab-app.tsx_jsx.ts +++ b/templates/admin/src/tab-app.tsx_jsx.ts @@ -1,29 +1,35 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; const useReact = answers.tabReact === "yes"; - if (!useReact) return; + if (!useReact) { + return; + } - const template = ` + const template = `/* eslint-disable @typescript-eslint/no-require-imports */ import React from "react"; -import { ${useTypeScript ? "Theme, " : ""}withStyles } from "@material-ui/core/styles"; +import { ${useTypeScript ? "type Theme, type StyleRules, " : ""}withStyles } from "@material-ui/core/styles"; import GenericApp from "@iobroker/adapter-react/GenericApp"; -${useTypeScript ? -`import { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; -import { StyleRules } from "@material-ui/core/styles"; -` : ""} -${useTypeScript ? -`const styles = (_theme: Theme): StyleRules => ({ +${ + useTypeScript + ? `import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; +` + : "" +} +${ + useTypeScript + ? `const styles = (_theme: Theme): StyleRules => ({ root: {}, -});` : `/** +});` + : `/** * @type {(_theme: Theme) => import("@material-ui/styles").StyleRules} */ const styles = (_theme) => ({ root: {}, -});`} +});` +} class TabApp extends GenericApp { constructor(props${useTypeScript ? ": GenericAppProps" : ""}) { @@ -32,16 +38,16 @@ class TabApp extends GenericApp { bottomButtons: false, encryptedFields: [], translations: { - "en": require("./i18n/en.json"), - "de": require("./i18n/de.json"), - "ru": require("./i18n/ru.json"), - "pt": require("./i18n/pt.json"), - "nl": require("./i18n/nl.json"), - "fr": require("./i18n/fr.json"), - "it": require("./i18n/it.json"), - "es": require("./i18n/es.json"), - "pl": require("./i18n/pl.json"), - "uk": require("./i18n/uk.json"), + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), "zh-cn": require("./i18n/zh-cn.json"), }, }; @@ -52,7 +58,7 @@ class TabApp extends GenericApp { // executed when connection is ready } - render() { + render()${useTypeScript ? ": React.JSX.Element" : ""} { if (!this.state.loaded) { return super.render(); } @@ -69,10 +75,11 @@ class TabApp extends GenericApp { export default withStyles(styles)(TabApp); `; - return template.trim();}; + return template; +}; -templateFunction.customPath = (answers) => { +templateFunction.customPath = answers => { const useTypeScript = answers.language === "TypeScript"; return `admin/src/tab-app.${useTypeScript ? "tsx" : "jsx"}`; -} +}; export = templateFunction; diff --git a/templates/admin/src/tab.tsx_jsx.ts b/templates/admin/src/tab.tsx_jsx.ts index f3c7c0da6..c31ff9840 100644 --- a/templates/admin/src/tab.tsx_jsx.ts +++ b/templates/admin/src/tab.tsx_jsx.ts @@ -1,13 +1,13 @@ import type { TemplateFunction } from "../../../src/lib/createAdapter"; const templateFunction: TemplateFunction = answers => { - const useTypeScript = answers.language === "TypeScript"; const useReact = answers.tabReact === "yes"; - if (!useReact) return; - - const template = ` -import React from "react"; + if (!useReact) { + return; + } + + const template = `import React from "react"; import ReactDOM from "react-dom"; import { MuiThemeProvider } from "@material-ui/core/styles"; import theme from "@iobroker/adapter-react/Theme"; @@ -21,7 +21,7 @@ function build()${useTypeScript ? ": void" : ""} { { + onThemeChange={_theme => { themeName = _theme; build(); }} @@ -33,11 +33,11 @@ function build()${useTypeScript ? ": void" : ""} { build(); `; - return template.trim(); + return template; }; -templateFunction.customPath = (answers) => { +templateFunction.customPath = answers => { const useTypeScript = answers.language === "TypeScript"; return `admin/src/tab.${useTypeScript ? "tsx" : "jsx"}`; -} +}; export = templateFunction; diff --git a/templates/admin/style.css.ts b/templates/admin/style.css.ts index ce1d96a57..7ce5d58ee 100644 --- a/templates/admin/style.css.ts +++ b/templates/admin/style.css.ts @@ -1,11 +1,13 @@ -import { readFile, TemplateFunction } from "../../src/lib/createAdapter"; +import type { TemplateFunction } from "../../src/lib/createAdapter"; +import { readFile } from "../../src/lib/createAdapter"; export = (answers => { - const isAdapter = answers.features.indexOf("adapter") > -1; - const useJsonConfig = answers.adminUi === 'json'; - const noConfig = answers.adminUi === 'none'; - if (!isAdapter || useJsonConfig || noConfig) return; + const useJsonConfig = answers.adminUi === "json"; + const noConfig = answers.adminUi === "none"; + if (!isAdapter || useJsonConfig || noConfig) { + return; + } return readFile("style.raw.css", __dirname); }) as TemplateFunction; diff --git a/templates/admin/tab_m.html.ts b/templates/admin/tab_m.html.ts index 7d58d9257..01beab8dc 100644 --- a/templates/admin/tab_m.html.ts +++ b/templates/admin/tab_m.html.ts @@ -2,9 +2,10 @@ import { getIconName } from "../../src/lib/core/questions"; import type { TemplateFunction } from "../../src/lib/createAdapter"; export = (answers => { - const supportTab = answers.adminFeatures && answers.adminFeatures.indexOf("tab") > -1; - if (!supportTab) return; + if (!supportTab) { + return; + } const useReact = answers.tabReact === "yes"; @@ -12,9 +13,10 @@ export = (answers => { -${useReact ? -` ` : -` +${ + useReact + ? ` ` + : ` @@ -30,18 +32,22 @@ ${useReact ? .m span{ font-size: 0.9em; } - `} + ` +} -${useReact ? ` +${ + useReact + ? `
-` : ` +` + : `
+ - Node version: + - Operating system: + +**Additional context** +Add any other context about the problem here. diff --git a/test/baselines/adapter_JS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml b/test/baselines/adapter_JS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..d7cfe5940 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: ioBroker Community + url: https://forum.iobroker.net/ + about: Please ask and answer questions here. \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/.github/auto-merge.yml b/test/baselines/adapter_JS_OfficialESLint/.github/auto-merge.yml new file mode 100644 index 000000000..4f6d185f0 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.github/auto-merge.yml @@ -0,0 +1,17 @@ +# Configure here which dependency updates should be merged automatically. +# The recommended configuration is the following: +- match: + # Only merge patches for production dependencies + dependency_type: production + update_type: "semver:patch" +- match: + # Except for security fixes, here we allow minor patches + dependency_type: production + update_type: "security:minor" +- match: + # and development dependencies can have a minor update, too + dependency_type: development + update_type: "semver:minor" + +# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: +# https://dependabot.com/docs/config-file/#automerged_updates diff --git a/test/baselines/adapter_JS_OfficialESLint/.github/dependabot.yml b/test/baselines/adapter_JS_OfficialESLint/.github/dependabot.yml new file mode 100644 index 000000000..4936f4f1c --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone + versioning-strategy: increase + + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone diff --git a/test/baselines/adapter_JS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml b/test/baselines/adapter_JS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 000000000..baeae23b5 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,27 @@ +# Automatically merge Dependabot PRs when version comparison is within the range +# that is configured in .github/auto-merge.yml + +name: Auto-Merge Dependabot PRs + +on: + # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action + # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ + pull_request_target: + +jobs: + auto-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check if PR should be auto-merged + uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + # In order to use this, you need to go to https://github.com/settings/tokens and + # create a Personal Access Token with the permission "public_repo". + # Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN + github-token: ${{ secrets.AUTO_MERGE_TOKEN }} + # By default, squash and merge, so Github chooses nice commit messages + command: squash and merge diff --git a/test/baselines/adapter_JS_OfficialESLint/.github/workflows/test-and-release.yml b/test/baselines/adapter_JS_OfficialESLint/.github/workflows/test-and-release.yml new file mode 100644 index 000000000..462c8cbec --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.github/workflows/test-and-release.yml @@ -0,0 +1,92 @@ +name: Test and Release + +# Run this job on all pushes and pull requests +# as well as tags with a semantic version +on: + push: + branches: + - "main" + tags: + # normal versions + - "v[0-9]+.[0-9]+.[0-9]+" + # pre-releases + - "v[0-9]+.[0-9]+.[0-9]+-**" + pull_request: {} + +# Cancel previous PR/branch runs when a new commit is pushed +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + # Performs quick checks before the expensive test runs + check-and-lint: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ubuntu-latest + + steps: + - uses: ioBroker/testing-action-check@v1 + with: + node-version: '20.x' + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + lint: true + + # Runs adapter tests on all supported node versions and OSes + adapter-tests: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [20.x, 22.x, 24.x] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: ioBroker/testing-action-adapter@v1 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + +# TODO: To enable automatic npm releases, create a token on npmjs.org +# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options +# Then uncomment the following block: + +# # Deploys the final package to NPM +# deploy: +# needs: [check-and-lint, adapter-tests] +# +# # Trigger this step only when a commit on any branch is tagged with a version number +# if: | +# contains(github.event.head_commit.message, '[skip ci]') == false && +# github.event_name == 'push' && +# startsWith(github.ref, 'refs/tags/v') +# +# runs-on: ubuntu-latest +# +# # Write permissions are required to create Github releases +# permissions: +# contents: write +# +# steps: +# - uses: ioBroker/testing-action-deploy@v1 +# with: +# node-version: '20.x' +# # Uncomment the following line if your adapter cannot be installed using 'npm ci' +# # install-command: 'npm install' +# npm-token: ${{ secrets.NPM_TOKEN }} +# github-token: ${{ secrets.GITHUB_TOKEN }} +# +# # When using Sentry for error reporting, Sentry can be informed about new releases +# # To enable create a API-Token in Sentry (User settings, API keys) +# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options +# # Then uncomment and customize the following block: +# sentry: true +# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }} +# sentry-project: "iobroker-test-adapter" +# sentry-version-prefix: "iobroker.test-adapter" +# # If your sentry project is linked to a GitHub repository, you can enable the following option +# # sentry-github-integration: true diff --git a/test/baselines/adapter_JS_OfficialESLint/.gitignore b/test/baselines/adapter_JS_OfficialESLint/.gitignore new file mode 100644 index 000000000..80c28aa9d --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.gitignore @@ -0,0 +1,18 @@ +# No dot-directories except github/vscode +.*/ +!.vscode/ +!.github/ + +*.code-workspace +node_modules +nbproject + +# npm package files +iobroker.*.tgz + +Thumbs.db +.commitinfo + +# i18n intermediate files +admin/i18n/flat.txt +admin/i18n/*/flat.txt \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/.vscode/extensions.json b/test/baselines/adapter_JS_OfficialESLint/.vscode/extensions.json new file mode 100644 index 000000000..897af65d7 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/.vscode/settings.json b/test/baselines/adapter_JS_OfficialESLint/.vscode/settings.json new file mode 100644 index 000000000..80a86afdc --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + "eslint.enable": true, + "json.schemas": [ + { + "fileMatch": [ + "io-package.json" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" + }, + { + "fileMatch": [ + "admin/jsonConfig.json", + "admin/jsonConfig.json5", + "admin/jsonCustom.json", + "admin/jsonCustom.json5", + "admin/jsonTab.json", + "admin/jsonTab.json5" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" + } + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/LICENSE b/test/baselines/adapter_JS_OfficialESLint/LICENSE new file mode 100644 index 000000000..27c9a624d --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/baselines/adapter_JS_OfficialESLint/README.md b/test/baselines/adapter_JS_OfficialESLint/README.md new file mode 100644 index 000000000..373847c20 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/README.md @@ -0,0 +1,124 @@ +![Logo](admin/test-adapter.png) +# ioBroker.test-adapter + +[![NPM version](https://img.shields.io/npm/v/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +[![Downloads](https://img.shields.io/npm/dm/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +![Number of Installations](https://iobroker.live/badges/test-adapter-installed.svg) +![Current version in stable repository](https://iobroker.live/badges/test-adapter-stable.svg) + +[![NPM](https://nodei.co/npm/iobroker.test-adapter.png?downloads=true)](https://nodei.co/npm/iobroker.test-adapter/) + +**Tests:** ![Test and Release](https://github.com/AlCalzone/ioBroker.test-adapter/workflows/Test%20and%20Release/badge.svg) + +## test-adapter adapter for ioBroker + +Describe your project here + +## Developer manual +This section is intended for the developer. It can be deleted later. + +### DISCLAIMER + +Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README. +You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you. + +### Getting started + +You are almost done, only a few steps left: +1. Create a new repository on GitHub with the name `ioBroker.test-adapter` +1. Initialize the current folder as a new git repository: + ```bash + git init -b main + git add . + git commit -m "Initial commit" + ``` +1. Link your local repository with the one on GitHub: + ```bash + git remote add origin https://github.com/AlCalzone/ioBroker.test-adapter + ``` + +1. Push all files to the GitHub repo: + ```bash + git push origin main + ``` +1. Add a new secret under https://github.com/AlCalzone/ioBroker.test-adapter/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. + +1. Head over to [main.js](main.js) and start programming! + +### Best Practices +We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should +check them out. If you're already experienced, you should also take a look at them - you might learn something new :) + +### Scripts in `package.json` +Several npm scripts are predefined for your convenience. You can run them using `npm run ` +| Script name | Description | +|-------------|-------------| +| `test:js` | Executes the tests you defined in `*.test.js` files. | +| `test:package` | Ensures your `package.json` and `io-package.json` are valid. | +| `test:integration` | Tests the adapter startup with an actual instance of ioBroker. | +| `test` | Performs a minimal test run on package files and your tests. | +| `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. | +| `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. | + +### Writing tests +When done right, testing code is invaluable, because it gives you the +confidence to change your code while knowing exactly if and when +something breaks. A good read on the topic of test-driven development +is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92. +Although writing tests before the code might seem strange at first, but it has very +clear upsides. + +The template provides you with basic tests for the adapter startup and package files. +It is recommended that you add your own tests into the mix. + +### Publishing the adapter +Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form +`v..`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`. + +To get your adapter released in ioBroker, please refer to the documentation +of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). + +### Test the adapter manually on a local ioBroker installation +In order to install the adapter locally without publishing, the following steps are recommended: +1. Create a tarball from your dev directory: + ```bash + npm pack + ``` +1. Upload the resulting file to your ioBroker host +1. Install it locally (The paths are different on Windows): + ```bash + cd /opt/iobroker + npm i /path/to/tarball.tgz + ``` + +For later updates, the above procedure is not necessary. Just do the following: +1. Overwrite the changed files in the adapter directory (`/opt/iobroker/node_modules/iobroker.test-adapter`) +1. Execute `iobroker upload test-adapter` on the ioBroker host + +## Changelog + +### 0.0.1 +* (Al Calzone) initial release + +## License +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/__meta__/npm_package_files.txt b/test/baselines/adapter_JS_OfficialESLint/__meta__/npm_package_files.txt new file mode 100644 index 000000000..23b05f264 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/__meta__/npm_package_files.txt @@ -0,0 +1,10 @@ +admin/index_m.html +admin/style.css +admin/test-adapter.png +admin/words.js +lib/adapter-config.d.ts +io-package.json +LICENSE +main.js +package.json +README.md \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/admin/index_m.html b/test/baselines/adapter_JS_OfficialESLint/admin/index_m.html new file mode 100644 index 000000000..ad15ac8ca --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/admin/index_m.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ + + + +
+
+ + +
+ +
+ + +
+
+ +
+ + + + \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/admin/style.css b/test/baselines/adapter_JS_OfficialESLint/admin/style.css new file mode 100644 index 000000000..a56351f03 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/admin/style.css @@ -0,0 +1,32 @@ +/* You can delete those if you want. I just found them very helpful */ +* { + box-sizing: border-box +} +.m { + /* Don't cut off dropdowns! */ + overflow: initial; +} +.m.adapter-container, +.m.adapter-container > div.App { + /* Fix layout/scrolling issues with tabs */ + height: 100%; + width: 100%; + position: relative; +} +.m .select-wrapper + label { + /* The positioning for dropdown labels is messed up */ + transform: none !important; +} + +label > i[title] { + /* Display the help cursor for the tooltip icons and fix their positioning */ + cursor: help; + margin-left: 0.25em; +} + +.dropdown-content { + /* Don't wrap text in dropdowns */ + white-space: nowrap; +} + +/* Add your styles here */ diff --git a/test/baselines/adapter_JS_OfficialESLint/admin/test-adapter.png b/test/baselines/adapter_JS_OfficialESLint/admin/test-adapter.png new file mode 100644 index 000000000..094ebd97c Binary files /dev/null and b/test/baselines/adapter_JS_OfficialESLint/admin/test-adapter.png differ diff --git a/test/baselines/adapter_JS_OfficialESLint/admin/words.js b/test/baselines/adapter_JS_OfficialESLint/admin/words.js new file mode 100644 index 000000000..adcc82d00 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/admin/words.js @@ -0,0 +1,46 @@ +/* eslint no-unused-vars: off */ +/* eslint no-global-assign: off */ +/* global systemDictionary */ +'use strict'; + +systemDictionary = { + 'test-adapter adapter settings': { + 'en': 'Adapter settings for test-adapter', + 'de': 'Adaptereinstellungen für test-adapter', + 'ru': 'Настройки адаптера для test-adapter', + 'pt': 'Configurações do adaptador para test-adapter', + 'nl': 'Adapterinstellingen voor test-adapter', + 'fr': "Paramètres d'adaptateur pour test-adapter", + 'it': "Impostazioni dell'adattatore per test-adapter", + 'es': 'Ajustes del adaptador para test-adapter', + 'pl': 'Ustawienia adaptera dla test-adapter', + 'uk': 'Налаштування адаптера для test-adapter', + 'zh-cn': 'test-adapter的适配器设置' + }, + 'option1': { + 'en': 'option1', + 'de': "Mock translation of 'option1' to 'de'", + 'ru': "Mock translation of 'option1' to 'ru'", + 'pt': "Mock translation of 'option1' to 'pt'", + 'nl': "Mock translation of 'option1' to 'nl'", + 'fr': "Mock translation of 'option1' to 'fr'", + 'it': "Mock translation of 'option1' to 'it'", + 'es': "Mock translation of 'option1' to 'es'", + 'pl': "Mock translation of 'option1' to 'pl'", + 'uk': "Mock translation of 'option1' to 'uk'", + 'zh-cn': "Mock translation of 'option1' to 'zh-cn'" + }, + 'option2': { + 'en': 'option2', + 'de': "Mock translation of 'option2' to 'de'", + 'ru': "Mock translation of 'option2' to 'ru'", + 'pt': "Mock translation of 'option2' to 'pt'", + 'nl': "Mock translation of 'option2' to 'nl'", + 'fr': "Mock translation of 'option2' to 'fr'", + 'it': "Mock translation of 'option2' to 'it'", + 'es': "Mock translation of 'option2' to 'es'", + 'pl': "Mock translation of 'option2' to 'pl'", + 'uk': "Mock translation of 'option2' to 'uk'", + 'zh-cn': "Mock translation of 'option2' to 'zh-cn'" + } +}; \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/eslint.config.mjs b/test/baselines/adapter_JS_OfficialESLint/eslint.config.mjs new file mode 100644 index 000000000..e8c0f53f1 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/eslint.config.mjs @@ -0,0 +1,35 @@ +// ioBroker eslint template configuration file for js and ts files +// Please note that esm or react based modules need additional modules loaded. +import config from '@iobroker/eslint-config'; + +export default [ + ...config, + { + // specify files to exclude from linting here + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build', + 'dist', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + 'widgets/**/*.js' + ], + }, + { + // you may disable some 'jsdoc' warnings - but using jsdoc is highly recommended + // as this improves maintainability. jsdoc warnings will not block build process. + rules: { + // 'jsdoc/require-jsdoc': 'off', + // 'jsdoc/require-param': 'off', + // 'jsdoc/require-param-description': 'off', + // 'jsdoc/require-returns-description': 'off', + // 'jsdoc/require-returns-check': 'off', + }, + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/io-package.json b/test/baselines/adapter_JS_OfficialESLint/io-package.json new file mode 100644 index 000000000..a1fc4be24 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/io-package.json @@ -0,0 +1,91 @@ +{ + "common": { + "name": "test-adapter", + "version": "0.0.1", + "news": { + "0.0.1": { + "en": "initial release", + "de": "Erstveröffentlichung", + "ru": "Начальная версия", + "pt": "lançamento inicial", + "nl": "Eerste uitgave", + "fr": "Première version", + "it": "Versione iniziale", + "es": "Versión inicial", + "pl": "Pierwsze wydanie", + "uk": "Початкова версія", + "zh-cn": "首次出版" + } + }, + "titleLang": { + "en": "Is used to test the creator", + "de": "Mock translation of 'Is used to test the creator' to 'de'", + "ru": "Mock translation of 'Is used to test the creator' to 'ru'", + "pt": "Mock translation of 'Is used to test the creator' to 'pt'", + "nl": "Mock translation of 'Is used to test the creator' to 'nl'", + "fr": "Mock translation of 'Is used to test the creator' to 'fr'", + "it": "Mock translation of 'Is used to test the creator' to 'it'", + "es": "Mock translation of 'Is used to test the creator' to 'es'", + "pl": "Mock translation of 'Is used to test the creator' to 'pl'", + "uk": "Mock translation of 'Is used to test the creator' to 'uk'", + "zh-cn": "Mock translation of 'Is used to test the creator' to 'zh-cn'" + }, + "desc": { + "en": "test-adapter", + "de": "Mock translation of 'test-adapter' to 'de'", + "ru": "Mock translation of 'test-adapter' to 'ru'", + "pt": "Mock translation of 'test-adapter' to 'pt'", + "nl": "Mock translation of 'test-adapter' to 'nl'", + "fr": "Mock translation of 'test-adapter' to 'fr'", + "it": "Mock translation of 'test-adapter' to 'it'", + "es": "Mock translation of 'test-adapter' to 'es'", + "pl": "Mock translation of 'test-adapter' to 'pl'", + "uk": "Mock translation of 'test-adapter' to 'uk'", + "zh-cn": "Mock translation of 'test-adapter' to 'zh-cn'" + }, + "authors": [ + "Al Calzone " + ], + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "platform": "Javascript/Node.js", + "icon": "test-adapter.png", + "enabled": true, + "extIcon": "https://raw.githubusercontent.com/AlCalzone/ioBroker.test-adapter/main/admin/test-adapter.png", + "readme": "https://github.com/AlCalzone/ioBroker.test-adapter/blob/main/README.md", + "loglevel": "info", + "tier": 3, + "mode": "daemon", + "type": "general", + "compact": true, + "connectionType": "local", + "dataSource": "push", + "adminUI": { + "config": "materialize" + }, + "dependencies": [ + { + "js-controller": ">=6.0.11" + } + ], + "globalDependencies": [ + { + "admin": ">=7.0.23" + } + ] + }, + "native": { + "option1": true, + "option2": "42" + }, + "objects": [], + "instanceObjects": [] +} \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/lib/adapter-config.d.ts b/test/baselines/adapter_JS_OfficialESLint/lib/adapter-config.d.ts new file mode 100644 index 000000000..e0fbfa96b --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/lib/adapter-config.d.ts @@ -0,0 +1,19 @@ +// This file extends the AdapterConfig type from "@types/iobroker" +// using the actual properties present in io-package.json +// in order to provide typings for adapter.config properties + +import { native } from '../io-package.json'; + +type _AdapterConfig = typeof native; + +// Augment the globally declared type ioBroker.AdapterConfig +declare global { + namespace ioBroker { + interface AdapterConfig extends _AdapterConfig { + // Do not enter anything here! + } + } +} + +// this is required so the above AdapterConfig is found by TypeScript / type checking +export {}; \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/main.js b/test/baselines/adapter_JS_OfficialESLint/main.js new file mode 100644 index 000000000..1258b4964 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/main.js @@ -0,0 +1,167 @@ +'use strict'; + +/* + * Created with @iobroker/create-adapter v2.6.5 + */ + +// The adapter-core module gives you access to the core ioBroker functions +// you need to create an adapter +const utils = require('@iobroker/adapter-core'); + +// Load your modules here, e.g.: +// const fs = require('fs'); + +class TestAdapter extends utils.Adapter { + /** + * @param {Partial} [options] - Adapter options + */ + constructor(options) { + super({ + ...options, + name: 'test-adapter', + }); + this.on('ready', this.onReady.bind(this)); + this.on('stateChange', this.onStateChange.bind(this)); + // this.on('objectChange', this.onObjectChange.bind(this)); + // this.on('message', this.onMessage.bind(this)); + this.on('unload', this.onUnload.bind(this)); + } + + /** + * Is called when databases are connected and adapter received configuration. + */ + async onReady() { + // Initialize your adapter here + + // The adapters config (in the instance object everything under the attribute "native") is accessible via + // this.config: + this.log.debug('config option1: ${this.config.option1}'); + this.log.debug('config option2: ${this.config.option2}'); + + /* + For every state in the system there has to be also an object of type state + Here a simple template for a boolean variable named "testVariable" + Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables + */ + await this.setObjectNotExistsAsync('testVariable', { + type: 'state', + common: { + name: 'testVariable', + type: 'boolean', + role: 'indicator', + read: true, + write: true, + }, + native: {}, + }); + + // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. + this.subscribeStates('testVariable'); + // You can also add a subscription for multiple states. The following line watches all states starting with "lights." + // this.subscribeStates('lights.*'); + // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: + // this.subscribeStates('*'); + + /* + setState examples + you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) + */ + // the variable testVariable is set to true as command (ack=false) + await this.setState('testVariable', true); + + // same thing, but the value is flagged "ack" + // ack should be always set to true if the value is received from or acknowledged from the target system + await this.setState('testVariable', { val: true, ack: true }); + + // same thing, but the state is deleted after 30s (getState will return null afterwards) + await this.setState('testVariable', { val: true, ack: true, expire: 30 }); + + // examples for the checkPassword/checkGroup functions + const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); + this.log.info(`check user admin pw iobroker: ${pwdResult}`); + + const groupResult = await this.checkGroupAsync('admin', 'admin'); + this.log.info(`check group user admin group admin: ${groupResult}`); + } + + /** + * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param {() => void} callback - Callback function + */ + onUnload(callback) { + try { + // Here you must clear all timeouts or intervals that may still be active + // clearTimeout(timeout1); + // clearTimeout(timeout2); + // ... + // clearInterval(interval1); + + callback(); + } catch (error) { + this.log.error(`Error during unloading: ${error.message}`); + callback(); + } + } + + // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. + // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. + // /** + // * Is called if a subscribed object changes + // * @param {string} id + // * @param {ioBroker.Object | null | undefined} obj + // */ + // onObjectChange(id, obj) { + // if (obj) { + // // The object was changed + // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); + // } else { + // // The object was deleted + // this.log.info(`object ${id} deleted`); + // } + // } + + /** + * Is called if a subscribed state changes + * + * @param {string} id - State ID + * @param {ioBroker.State | null | undefined} state - State object + */ + onStateChange(id, state) { + if (state) { + // The state was changed + this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`); + } else { + // The state was deleted + this.log.info(`state ${id} deleted`); + } + } + // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. + // /** + // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... + // * Using this method requires "common.messagebox" property to be set to true in io-package.json + // * @param {ioBroker.Message} obj + // */ + // onMessage(obj) { + // if (typeof obj === 'object' && obj.message) { + // if (obj.command === 'send') { + // // e.g. send email or pushover or whatever + // this.log.info('send command'); + + // // Send response in callback if required + // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); + // } + // } + // } +} + +if (require.main !== module) { + // Export the constructor in compact mode + /** + * @param {Partial} [options] - Adapter options + */ + module.exports = options => new TestAdapter(options); +} else { + // otherwise start the instance directly + new TestAdapter(); +} diff --git a/test/baselines/adapter_JS_OfficialESLint/main.test.js b/test/baselines/adapter_JS_OfficialESLint/main.test.js new file mode 100644 index 000000000..85f2fc17f --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/main.test.js @@ -0,0 +1,29 @@ +'use strict'; + +/** + * This is a dummy TypeScript test file using chai and mocha + * + * It's automatically excluded from npm and its build output is excluded from both git and npm. + * It is advised to test all your modules with accompanying *.test.js-files + */ + +// tslint:disable:no-unused-expression + +const { expect } = require('chai'); +// import { functionToTest } from "./moduleToTest"; + +describe('module to test => function to test', () => { + // initializing logic + const expected = 5; + + it(`should return ${expected}`, () => { + const result = 5; + // assign result a value from functionToTest + expect(result).to.equal(expected); + // or using the should() syntax + result.should.equal(expected); + }); + // ... more tests => it +}); + +// ... more test suites => describe diff --git a/test/baselines/adapter_JS_OfficialESLint/package.json b/test/baselines/adapter_JS_OfficialESLint/package.json new file mode 100644 index 000000000..6c6074c16 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/package.json @@ -0,0 +1,55 @@ +{ + "name": "iobroker.test-adapter", + "version": "0.0.1", + "description": "test-adapter", + "author": { + "name": "Al Calzone", + "email": "al@calzo.ne" + }, + "contributors": [], + "homepage": "https://github.com/AlCalzone/ioBroker.test-adapter", + "license": "MIT", + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "repository": { + "type": "git", + "url": "https://github.com/AlCalzone/ioBroker.test-adapter.git" + }, + "engines": { + "node": ">= 20" + }, + "dependencies": { + "@iobroker/adapter-core": "^3.3.2" + }, + "devDependencies": { + "@iobroker/adapter-dev": "^1.5.0", + "@iobroker/eslint-config": "^2.2.0", + "@iobroker/testing": "^5.1.1" + }, + "main": "main.js", + "files": [ + "admin{,/!(src)/**}/!(tsconfig|tsconfig.*|.eslintrc).{json,json5}", + "admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}", + "lib/", + "www/", + "io-package.json", + "LICENSE", + "main.js" + ], + "scripts": { + "test:js": "mocha --config test/mocharc.custom.json \"{!(node_modules|test)/**/*.test.js,*.test.js,test/**/test!(PackageFiles|Startup).js}\"", + "test:package": "mocha test/package --exit", + "test:integration": "mocha test/integration --exit", + "test": "npm run test:js && npm run test:package", + "lint": "eslint -c eslint.config.mjs .", + "translate": "translate-adapter" + }, + "bugs": { + "url": "https://github.com/AlCalzone/ioBroker.test-adapter/issues" + }, + "readmeFilename": "README.md" +} \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/prettier.config.mjs b/test/baselines/adapter_JS_OfficialESLint/prettier.config.mjs new file mode 100644 index 000000000..e2b1d29c6 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/prettier.config.mjs @@ -0,0 +1,7 @@ +// iobroker prettier configuration file +import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; + +export default { + ...prettierConfig, + singleQuote: true, +}; \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/test/integration.js b/test/baselines/adapter_JS_OfficialESLint/test/integration.js new file mode 100644 index 000000000..fa6db2e85 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/test/integration.js @@ -0,0 +1,5 @@ +const path = require('path'); +const { tests } = require('@iobroker/testing'); + +// Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options +tests.integration(path.join(__dirname, '..')); \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/test/mocha.setup.js b/test/baselines/adapter_JS_OfficialESLint/test/mocha.setup.js new file mode 100644 index 000000000..15b9051f5 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/test/mocha.setup.js @@ -0,0 +1,14 @@ +// Don't silently swallow unhandled rejections +process.on('unhandledRejection', (e) => { + throw e; +}); + +// enable the should interface with sinon +// and load chai-as-promised and sinon-chai by default +const sinonChai = require('sinon-chai'); +const chaiAsPromised = require('chai-as-promised'); +const { should, use } = require('chai'); + +should(); +use(sinonChai); +use(chaiAsPromised); \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/test/mocharc.custom.json b/test/baselines/adapter_JS_OfficialESLint/test/mocharc.custom.json new file mode 100644 index 000000000..2e317d599 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/test/mocharc.custom.json @@ -0,0 +1,10 @@ +{ + "require": [ + "test/mocha.setup.js" + ], + "watch-files": [ + "!(node_modules|test)/**/*.test.js", + "*.test.js", + "test/**/test!(PackageFiles|Startup).js" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_JS_OfficialESLint/test/package.js b/test/baselines/adapter_JS_OfficialESLint/test/package.js new file mode 100644 index 000000000..38eacc857 --- /dev/null +++ b/test/baselines/adapter_JS_OfficialESLint/test/package.js @@ -0,0 +1,5 @@ +const path = require('path'); +const { tests } = require('@iobroker/testing'); + +// Validate the package files +tests.packageFiles(path.join(__dirname, '..')); diff --git a/test/baselines/adapter_JS_React/.create-adapter.json b/test/baselines/adapter_JS_React/.create-adapter.json index efe7c73f7..5330fe6ad 100644 --- a/test/baselines/adapter_JS_React/.create-adapter.json +++ b/test/baselines/adapter_JS_React/.create-adapter.json @@ -19,6 +19,7 @@ "tools": [ "ESLint" ], + "eslintConfig": "custom", "indentation": "Tab", "quotes": "double", "authorName": "Al Calzone", diff --git a/test/baselines/adapter_JS_React/.eslintignore b/test/baselines/adapter_JS_React/.eslintignore deleted file mode 100644 index 85e556158..000000000 --- a/test/baselines/adapter_JS_React/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -admin/build/ -**/.eslintrc.js -admin/words.js \ No newline at end of file diff --git a/test/baselines/adapter_JS_React/admin/src/app.jsx b/test/baselines/adapter_JS_React/admin/src/app.jsx index 473b61bcb..21290c7d5 100644 --- a/test/baselines/adapter_JS_React/admin/src/app.jsx +++ b/test/baselines/adapter_JS_React/admin/src/app.jsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ import React from "react"; import { withStyles } from "@material-ui/core/styles"; @@ -17,16 +18,16 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - "en": require("./i18n/en.json"), - "de": require("./i18n/de.json"), - "ru": require("./i18n/ru.json"), - "pt": require("./i18n/pt.json"), - "nl": require("./i18n/nl.json"), - "fr": require("./i18n/fr.json"), - "it": require("./i18n/it.json"), - "es": require("./i18n/es.json"), - "pl": require("./i18n/pl.json"), - "uk": require("./i18n/uk.json"), + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), "zh-cn": require("./i18n/zh-cn.json"), }, }; @@ -44,7 +45,10 @@ class App extends GenericApp { return (
- this.updateNativeValue(attr, value)} /> + this.updateNativeValue(attr, value)} + /> {this.renderError()} {this.renderToast()} {this.renderSaveCloseButtons()} @@ -53,4 +57,4 @@ class App extends GenericApp { } } -export default withStyles(styles)(App); \ No newline at end of file +export default withStyles(styles)(App); diff --git a/test/baselines/adapter_JS_React/admin/src/components/settings.jsx b/test/baselines/adapter_JS_React/admin/src/components/settings.jsx index b105ee9a0..8ab412499 100644 --- a/test/baselines/adapter_JS_React/admin/src/components/settings.jsx +++ b/test/baselines/adapter_JS_React/admin/src/components/settings.jsx @@ -79,7 +79,7 @@ class Settings extends React.Component { className={`${this.props.classes.input} ${this.props.classes.controlElement}`} value={this.props.native[attr]} type={type || "text"} - onChange={(e) => this.props.onChange(attr, e.target.value)} + onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> ); @@ -97,16 +97,24 @@ class Settings extends React.Component { className={`${this.props.classes.input} ${this.props.classes.controlElement}`} style={{ paddingTop: 5, - ...style + ...style, }} > } + onChange={e => this.props.onChange(attr, e.target.value === "_" ? "" : e.target.value)} + input={ + + } > - {options.map((item) => ( - + {options.map(item => ( + {I18n.t(item.title)} ))} @@ -127,7 +135,7 @@ class Settings extends React.Component { key={attr} style={{ paddingTop: 5, - ...style + ...style, }} className={this.props.classes.controlElement} control={ @@ -145,11 +153,12 @@ class Settings extends React.Component { render() { return (
- {this.renderCheckbox("option1", "option1")}
+ {this.renderCheckbox("option1", "option1")} +
{this.renderInput("option2", "option2", "text")}
); } } -export default withStyles(styles)(Settings); \ No newline at end of file +export default withStyles(styles)(Settings); diff --git a/test/baselines/adapter_JS_React/admin/src/index.jsx b/test/baselines/adapter_JS_React/admin/src/index.jsx index 723e773b7..60b40a933 100644 --- a/test/baselines/adapter_JS_React/admin/src/index.jsx +++ b/test/baselines/adapter_JS_React/admin/src/index.jsx @@ -12,7 +12,7 @@ function build() { { + onThemeChange={_theme => { themeName = _theme; build(); }} @@ -22,4 +22,4 @@ function build() { ); } -build(); \ No newline at end of file +build(); diff --git a/test/baselines/adapter_JS_React/eslint.config.mjs b/test/baselines/adapter_JS_React/eslint.config.mjs new file mode 100644 index 000000000..9fd0ad364 --- /dev/null +++ b/test/baselines/adapter_JS_React/eslint.config.mjs @@ -0,0 +1,88 @@ +import js from '@eslint/js'; +import react from 'eslint-plugin-react'; + +export default [ + js.configs.recommended, + { + files: ['**/*.js', '**/*.jsx'], + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + globals: { + 'process': 'readonly', + 'Buffer': 'readonly', + '__dirname': 'readonly', + '__filename': 'readonly', + 'module': 'readonly', + 'require': 'readonly', + 'exports': 'readonly', + 'global': 'readonly', + 'console': 'readonly', + 'setTimeout': 'readonly', + 'setInterval': 'readonly', + 'clearTimeout': 'readonly', + 'clearInterval': 'readonly', + 'document': 'readonly', + 'window': 'readonly', + 'describe': 'readonly', + 'it': 'readonly', + 'ioBroker': 'readonly', + }, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + plugins: { + react, + }, + rules: { + ...js.configs.recommended.rules, + ...react.configs.recommended.rules, + 'react/react-in-jsx-scope': 'off', + 'indent': [ + 'error', + 'tab', + { + 'SwitchCase': 1 + } + ], + 'quotes': [ + 'error', + 'double' + ], + // Strict rules to match official @iobroker/eslint-config + 'prefer-template': 'error', + 'no-unused-vars': [ + 'warn', + { + 'ignoreRestSiblings': true, + 'argsIgnorePattern': '^_', + 'varsIgnorePattern': '^_' + } + ], + }, + settings: { + react: { + version: 'detect', + }, + }, + }, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build/', + 'dist/', + 'admin/build/', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + ], + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_JS_React/main.js b/test/baselines/adapter_JS_React/main.js index b9a1c789f..e40ac455b 100644 --- a/test/baselines/adapter_JS_React/main.js +++ b/test/baselines/adapter_JS_React/main.js @@ -12,9 +12,8 @@ const utils = require("@iobroker/adapter-core"); // const fs = require("fs"); class TestAdapter extends utils.Adapter { - /** - * @param {Partial} [options={}] + * @param {Partial} [options] - Adapter options */ constructor(options) { super({ @@ -36,8 +35,8 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: " + this.config.option1); - this.log.debug("config option2: " + this.config.option2); + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); /* For every state in the system there has to be also an object of type state @@ -79,15 +78,16 @@ class TestAdapter extends utils.Adapter { // examples for the checkPassword/checkGroup functions const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); - this.log.info("check user admin pw iobroker: " + pwdResult); + this.log.info(`check user admin pw iobroker: ${pwdResult}`); const groupResult = await this.checkGroupAsync("admin", "admin"); - this.log.info("check group user admin group admin: " + groupResult); + this.log.info(`check group user admin group admin: ${groupResult}`); } /** * Is called when adapter shuts down - callback has to be called under any circumstances! - * @param {() => void} callback + * + * @param {() => void} callback - Callback function */ onUnload(callback) { try { @@ -98,7 +98,8 @@ class TestAdapter extends utils.Adapter { // clearInterval(interval1); callback(); - } catch (_e) { + } catch (error) { + this.log.error(`Error during unloading: ${error.message}`); callback(); } } @@ -122,8 +123,9 @@ class TestAdapter extends utils.Adapter { /** * Is called if a subscribed state changes - * @param {string} id - * @param {ioBroker.State | null | undefined} state + * + * @param {string} id - State ID + * @param {ioBroker.State | null | undefined} state - State object */ onStateChange(id, state) { if (state) { @@ -134,7 +136,6 @@ class TestAdapter extends utils.Adapter { this.log.info(`state ${id} deleted`); } } - // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. // /** // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... @@ -152,16 +153,15 @@ class TestAdapter extends utils.Adapter { // } // } // } - } if (require.main !== module) { // Export the constructor in compact mode /** - * @param {Partial} [options={}] + * @param {Partial} [options] - Adapter options */ - module.exports = (options) => new TestAdapter(options); + module.exports = options => new TestAdapter(options); } else { // otherwise start the instance directly new TestAdapter(); -} \ No newline at end of file +} diff --git a/test/baselines/adapter_JS_React/main.test.js b/test/baselines/adapter_JS_React/main.test.js index 307b4c62f..9bf897d67 100644 --- a/test/baselines/adapter_JS_React/main.test.js +++ b/test/baselines/adapter_JS_React/main.test.js @@ -24,7 +24,6 @@ describe("module to test => function to test", () => { result.should.equal(expected); }); // ... more tests => it - }); // ... more test suites => describe diff --git a/test/baselines/adapter_JS_React/package.json b/test/baselines/adapter_JS_React/package.json index 62e1d65dc..3a6612350 100644 --- a/test/baselines/adapter_JS_React/package.json +++ b/test/baselines/adapter_JS_React/package.json @@ -26,12 +26,13 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/adapter-react": "2.0.22", "@iobroker/testing": "^5.1.1", "@material-ui/core": "^4.12.4", "eslint-plugin-react": "^7.37.5", - "eslint": "^8.57.1", + "eslint": "^9.37.0", "react-dom": "^17.0.2", "react": "^17.0.2" }, @@ -57,7 +58,7 @@ "test:package": "mocha test/package --exit", "test:integration": "mocha test/integration --exit", "test": "npm run test:js && npm run test:package", - "lint": "eslint --ext .js,.jsx .", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.create-adapter.json b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.create-adapter.json index ebe7ad984..004d5dab3 100644 --- a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.create-adapter.json +++ b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.create-adapter.json @@ -22,6 +22,7 @@ "tools": [ "ESLint" ], + "eslintConfig": "custom", "indentation": "Tab", "quotes": "double", "authorName": "Al Calzone", diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.eslintignore b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.eslintignore deleted file mode 100644 index d7b786517..000000000 --- a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -build/ -**/.eslintrc.js -admin/words.js \ No newline at end of file diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.eslintrc.js b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.eslintrc.js deleted file mode 100644 index 7f997db7c..000000000 --- a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/.eslintrc.js +++ /dev/null @@ -1,69 +0,0 @@ -module.exports = { - root: true, // Don't look outside this project for inherited configs - parser: "@typescript-eslint/parser", // Specifies the ESLint parser - parserOptions: { - ecmaVersion: "latest", // Allows for the parsing of modern ECMAScript features - sourceType: "module", // Allows for the use of imports - project: "./tsconfig.json", - }, - extends: [ - "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin - ], - plugins: [], - rules: { - "indent": "off", - "@typescript-eslint/indent": [ - "error", - "tab", - { - "SwitchCase": 1 - } - ], - "quotes": [ - "error", - "double", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-use-before-define": [ - "error", - { - functions: false, - typedefs: false, - classes: false, - }, - ], - "@typescript-eslint/no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - argsIgnorePattern: "^_", - }, - ], - "@typescript-eslint/explicit-function-return-type": [ - "warn", - { - allowExpressions: true, - allowTypedFunctionExpressions: true, - }, - ], - "@typescript-eslint/no-object-literal-type-assertion": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()! - "no-var": "error", - "prefer-const": "error", - "no-trailing-spaces": "error", - }, - overrides: [ - { - files: ["*.test.ts"], - rules: { - "@typescript-eslint/explicit-function-return-type": "off", - }, - }, - ], -}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/admin.d.ts b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/admin.d.ts index 41f934f4c..7594b9e3a 100644 --- a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/admin.d.ts +++ b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/admin/admin.d.ts @@ -11,11 +11,18 @@ interface Window { declare const instance: number; declare const adapter: string; -/** Translates text */ +/** + * Translates text + * + * @param text + * @param arg1 + * @param arg2 + * @param arg3 + */ declare function _(text: string, arg1?: string, arg2?: string, arg3?: string): string; declare const socket: ioBrokerSocket; declare function sendTo( - instance: any | null, + instance: any, command: string, message: any, callback: (result: SendToResult) => void | Promise, @@ -28,49 +35,20 @@ interface SendToResult { // tslint:disable-next-line:class-name interface ioBrokerSocket { - emit( - command: "subscribeObjects", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "subscribeStates", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "unsubscribeObjects", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "unsubscribeStates", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; + emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; emit( event: "getObjectView", view: "system", type: "device", options: ioBroker.GetObjectViewParams, - callback: ( - err: string | undefined, - result?: any, - ) => void | Promise, - ): void; - emit( - event: "getStates", - callback: ( - err: string | undefined, - result?: Record, - ) => void, - ): void; - emit( - event: "getState", - id: string, - callback: (err: string | undefined, result?: ioBroker.State) => void, + callback: (err: string | undefined, result?: any) => void | Promise, ): void; + emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; + emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; emit( event: "setState", id: string, @@ -80,14 +58,8 @@ interface ioBrokerSocket { on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; - removeEventHandler( - event: "objectChange", - handler: ioBroker.ObjectChangeHandler, - ): void; - removeEventHandler( - event: "stateChange", - handler: ioBroker.StateChangeHandler, - ): void; + removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; // TODO: other events } diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/eslint.config.mjs b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/eslint.config.mjs new file mode 100644 index 000000000..8f9245ad9 --- /dev/null +++ b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/eslint.config.mjs @@ -0,0 +1,82 @@ +import js from '@eslint/js'; +import tseslint from '@typescript-eslint/eslint-plugin'; +import tsparser from '@typescript-eslint/parser'; + +export default [ + js.configs.recommended, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parser: tsparser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: './tsconfig.json', + }, + globals: { + 'process': 'readonly', + 'Buffer': 'readonly', + '__dirname': 'readonly', + '__filename': 'readonly', + 'module': 'readonly', + 'require': 'readonly', + 'exports': 'readonly', + 'global': 'readonly', + 'console': 'readonly', + 'setTimeout': 'readonly', + 'setInterval': 'readonly', + 'clearTimeout': 'readonly', + 'clearInterval': 'readonly', + 'document': 'readonly', + 'window': 'readonly', + 'describe': 'readonly', + 'it': 'readonly', + 'ioBroker': 'readonly', + 'AdminWord': 'readonly', + }, + }, + plugins: { + '@typescript-eslint': tseslint, + }, + rules: { + ...tseslint.configs.recommended.rules, + 'indent': [ + 'error', + 'tab', + { + 'SwitchCase': 1 + } + ], + 'quotes': [ + 'error', + 'double' + ], + // Strict rules to match official @iobroker/eslint-config + 'prefer-template': 'error', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + 'ignoreRestSiblings': true, + 'argsIgnorePattern': '^_', + 'varsIgnorePattern': '^_' + } + ], + }, + }, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build/', + 'dist/', + 'admin/build/', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + ], + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/package.json b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/package.json index 8b8418535..b29530070 100644 --- a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/package.json +++ b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/package.json @@ -26,13 +26,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node20": "^20.1.6", "@types/node": "^20.19.21", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -59,7 +60,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.test.ts b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.test.ts index a8d538e95..0992583bc 100644 --- a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.test.ts +++ b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.test.ts @@ -20,7 +20,5 @@ describe("module to test => function to test", () => { result.should.equal(expected); }); // ... more tests => it - }); - // ... more test suites => describe diff --git a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.ts b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.ts index e2388f1af..c5c122375 100644 --- a/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.ts +++ b/test/baselines/adapter_TS_ESLint_Tabs_DoubleQuotes_MIT/src/main.ts @@ -10,7 +10,6 @@ import * as utils from "@iobroker/adapter-core"; // import * as fs from "fs"; class TestAdapter extends utils.Adapter { - public constructor(options: Partial = {}) { super({ ...options, @@ -31,8 +30,8 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: " + this.config.option1); - this.log.debug("config option2: " + this.config.option2); + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); /* For every state in the system there has to be also an object of type state @@ -74,14 +73,16 @@ class TestAdapter extends utils.Adapter { // examples for the checkPassword/checkGroup functions const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); - this.log.info("check user admin pw iobroker: " + pwdResult); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); const groupResult = await this.checkGroupAsync("admin", "admin"); - this.log.info("check group user admin group admin: " + groupResult); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } /** * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function */ private onUnload(callback: () => void): void { try { @@ -92,7 +93,8 @@ class TestAdapter extends utils.Adapter { // clearInterval(interval1); callback(); - } catch (_e) { + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); callback(); } } @@ -114,6 +116,9 @@ class TestAdapter extends utils.Adapter { /** * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object */ private onStateChange(id: string, state: ioBroker.State | null | undefined): void { if (state) { @@ -124,30 +129,27 @@ class TestAdapter extends utils.Adapter { this.log.info(`state ${id} deleted`); } } - // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. // /** // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... // * Using this method requires "common.messagebox" property to be set to true in io-package.json // */ + // // private onMessage(obj: ioBroker.Message): void { // if (typeof obj === "object" && obj.message) { // if (obj.command === "send") { // // e.g. send email or pushover or whatever // this.log.info("send command"); - // // Send response in callback if required // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); // } // } // } - } - if (require.main !== module) { // Export the constructor in compact mode module.exports = (options: Partial | undefined) => new TestAdapter(options); } else { // otherwise start the instance directly (() => new TestAdapter())(); -} \ No newline at end of file +} diff --git a/test/baselines/adapter_TS_OfficialESLint/.create-adapter.json b/test/baselines/adapter_TS_OfficialESLint/.create-adapter.json new file mode 100644 index 000000000..64da96c2b --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.create-adapter.json @@ -0,0 +1,38 @@ +{ + "cli": true, + "target": "directory", + "adapterName": "test-adapter", + "title": "Is used to test the creator", + "startMode": "daemon", + "features": [ + "adapter" + ], + "connectionIndicator": "no", + "connectionType": "local", + "dataSource": "push", + "adminFeatures": [], + "type": "general", + "language": "TypeScript", + "adminUi": "html", + "tabReact": "no", + "releaseScript": "no", + "tools": [ + "ESLint" + ], + "eslintConfig": "official", + "indentation": "Tab", + "quotes": "double", + "authorName": "Al Calzone", + "authorGithub": "AlCalzone", + "authorEmail": "al@calzo.ne", + "gitRemoteProtocol": "HTTPS", + "dependabot": "yes", + "gitCommit": "no", + "defaultBranch": "main", + "license": "MIT License", + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "creatorVersion": "2.6.5" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md b/test/baselines/adapter_TS_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..895613958 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Something is not working as it should +title: '' +labels: '' +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '...' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots & Logfiles** +If applicable, add screenshots and logfiles to help explain your problem. + +**Versions:** + - Adapter version: + - JS-Controller version: + - Node version: + - Operating system: + +**Additional context** +Add any other context about the problem here. diff --git a/test/baselines/adapter_TS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml b/test/baselines/adapter_TS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..d7cfe5940 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: ioBroker Community + url: https://forum.iobroker.net/ + about: Please ask and answer questions here. \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/.github/auto-merge.yml b/test/baselines/adapter_TS_OfficialESLint/.github/auto-merge.yml new file mode 100644 index 000000000..4f6d185f0 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.github/auto-merge.yml @@ -0,0 +1,17 @@ +# Configure here which dependency updates should be merged automatically. +# The recommended configuration is the following: +- match: + # Only merge patches for production dependencies + dependency_type: production + update_type: "semver:patch" +- match: + # Except for security fixes, here we allow minor patches + dependency_type: production + update_type: "security:minor" +- match: + # and development dependencies can have a minor update, too + dependency_type: development + update_type: "semver:minor" + +# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: +# https://dependabot.com/docs/config-file/#automerged_updates diff --git a/test/baselines/adapter_TS_OfficialESLint/.github/dependabot.yml b/test/baselines/adapter_TS_OfficialESLint/.github/dependabot.yml new file mode 100644 index 000000000..4936f4f1c --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone + versioning-strategy: increase + + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone diff --git a/test/baselines/adapter_TS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml b/test/baselines/adapter_TS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 000000000..baeae23b5 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,27 @@ +# Automatically merge Dependabot PRs when version comparison is within the range +# that is configured in .github/auto-merge.yml + +name: Auto-Merge Dependabot PRs + +on: + # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action + # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ + pull_request_target: + +jobs: + auto-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check if PR should be auto-merged + uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + # In order to use this, you need to go to https://github.com/settings/tokens and + # create a Personal Access Token with the permission "public_repo". + # Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN + github-token: ${{ secrets.AUTO_MERGE_TOKEN }} + # By default, squash and merge, so Github chooses nice commit messages + command: squash and merge diff --git a/test/baselines/adapter_TS_OfficialESLint/.github/workflows/test-and-release.yml b/test/baselines/adapter_TS_OfficialESLint/.github/workflows/test-and-release.yml new file mode 100644 index 000000000..0c48ade1a --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.github/workflows/test-and-release.yml @@ -0,0 +1,96 @@ +name: Test and Release + +# Run this job on all pushes and pull requests +# as well as tags with a semantic version +on: + push: + branches: + - "main" + tags: + # normal versions + - "v[0-9]+.[0-9]+.[0-9]+" + # pre-releases + - "v[0-9]+.[0-9]+.[0-9]+-**" + pull_request: {} + +# Cancel previous PR/branch runs when a new commit is pushed +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + # Performs quick checks before the expensive test runs + check-and-lint: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ubuntu-latest + + steps: + - uses: ioBroker/testing-action-check@v1 + with: + node-version: '20.x' + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + type-checking: true + lint: true + + # Runs adapter tests on all supported node versions and OSes + adapter-tests: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [20.x, 22.x, 24.x] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: ioBroker/testing-action-adapter@v1 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + build: true + +# TODO: To enable automatic npm releases, create a token on npmjs.org +# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options +# Then uncomment the following block: + +# # Deploys the final package to NPM +# deploy: +# needs: [check-and-lint, adapter-tests] +# +# # Trigger this step only when a commit on any branch is tagged with a version number +# if: | +# contains(github.event.head_commit.message, '[skip ci]') == false && +# github.event_name == 'push' && +# startsWith(github.ref, 'refs/tags/v') +# +# runs-on: ubuntu-latest +# +# # Write permissions are required to create Github releases +# permissions: +# contents: write +# +# steps: +# - uses: ioBroker/testing-action-deploy@v1 +# with: +# node-version: '20.x' +# # Uncomment the following line if your adapter cannot be installed using 'npm ci' +# # install-command: 'npm install' +# build: true +# npm-token: ${{ secrets.NPM_TOKEN }} +# github-token: ${{ secrets.GITHUB_TOKEN }} +# +# # When using Sentry for error reporting, Sentry can be informed about new releases +# # To enable create a API-Token in Sentry (User settings, API keys) +# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options +# # Then uncomment and customize the following block: +# sentry: true +# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }} +# sentry-project: "iobroker-test-adapter" +# sentry-version-prefix: "iobroker.test-adapter" +# sentry-sourcemap-paths: "build/" +# # If your sentry project is linked to a GitHub repository, you can enable the following option +# # sentry-github-integration: true diff --git a/test/baselines/adapter_TS_OfficialESLint/.gitignore b/test/baselines/adapter_TS_OfficialESLint/.gitignore new file mode 100644 index 000000000..80c28aa9d --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.gitignore @@ -0,0 +1,18 @@ +# No dot-directories except github/vscode +.*/ +!.vscode/ +!.github/ + +*.code-workspace +node_modules +nbproject + +# npm package files +iobroker.*.tgz + +Thumbs.db +.commitinfo + +# i18n intermediate files +admin/i18n/flat.txt +admin/i18n/*/flat.txt \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/.vscode/extensions.json b/test/baselines/adapter_TS_OfficialESLint/.vscode/extensions.json new file mode 100644 index 000000000..2c6ac5b31 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/.vscode/settings.json b/test/baselines/adapter_TS_OfficialESLint/.vscode/settings.json new file mode 100644 index 000000000..854736cc0 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "eslint.enable": true, + "json.schemas": [ + { + "fileMatch": [ + "io-package.json" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" + }, + { + "fileMatch": [ + "admin/jsonConfig.json", + "admin/jsonConfig.json5", + "admin/jsonCustom.json", + "admin/jsonCustom.json5", + "admin/jsonTab.json", + "admin/jsonTab.json5" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" + } + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/LICENSE b/test/baselines/adapter_TS_OfficialESLint/LICENSE new file mode 100644 index 000000000..27c9a624d --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/baselines/adapter_TS_OfficialESLint/README.md b/test/baselines/adapter_TS_OfficialESLint/README.md new file mode 100644 index 000000000..f57bba69c --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/README.md @@ -0,0 +1,132 @@ +![Logo](admin/test-adapter.png) +# ioBroker.test-adapter + +[![NPM version](https://img.shields.io/npm/v/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +[![Downloads](https://img.shields.io/npm/dm/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +![Number of Installations](https://iobroker.live/badges/test-adapter-installed.svg) +![Current version in stable repository](https://iobroker.live/badges/test-adapter-stable.svg) + +[![NPM](https://nodei.co/npm/iobroker.test-adapter.png?downloads=true)](https://nodei.co/npm/iobroker.test-adapter/) + +**Tests:** ![Test and Release](https://github.com/AlCalzone/ioBroker.test-adapter/workflows/Test%20and%20Release/badge.svg) + +## test-adapter adapter for ioBroker + +Describe your project here + +## Developer manual +This section is intended for the developer. It can be deleted later. + +### DISCLAIMER + +Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README. +You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you. + +### Getting started + +You are almost done, only a few steps left: +1. Create a new repository on GitHub with the name `ioBroker.test-adapter` +1. Initialize the current folder as a new git repository: + ```bash + git init -b main + git add . + git commit -m "Initial commit" + ``` +1. Link your local repository with the one on GitHub: + ```bash + git remote add origin https://github.com/AlCalzone/ioBroker.test-adapter + ``` + +1. Push all files to the GitHub repo: + ```bash + git push origin main + ``` +1. Add a new secret under https://github.com/AlCalzone/ioBroker.test-adapter/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. + +1. Head over to [src/main.ts](src/main.ts) and start programming! + +### Best Practices +We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should +check them out. If you're already experienced, you should also take a look at them - you might learn something new :) + +### Scripts in `package.json` +Several npm scripts are predefined for your convenience. You can run them using `npm run ` +| Script name | Description | +|-------------|-------------| +| `build` | Compile the TypeScript sources. | +| `watch` | Compile the TypeScript sources and watch for changes. | +| `test:ts` | Executes the tests you defined in `*.test.ts` files. | +| `test:package` | Ensures your `package.json` and `io-package.json` are valid. | +| `test:integration` | Tests the adapter startup with an actual instance of ioBroker. | +| `test` | Performs a minimal test run on package files and your tests. | +| `check` | Performs a type-check on your code (without compiling anything). | +| `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. | +| `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. | + +### Configuring the compilation +The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings +either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the +[`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files). + +### Writing tests +When done right, testing code is invaluable, because it gives you the +confidence to change your code while knowing exactly if and when +something breaks. A good read on the topic of test-driven development +is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92. +Although writing tests before the code might seem strange at first, but it has very +clear upsides. + +The template provides you with basic tests for the adapter startup and package files. +It is recommended that you add your own tests into the mix. + +### Publishing the adapter +Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form +`v..`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`. + +To get your adapter released in ioBroker, please refer to the documentation +of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). + +### Test the adapter manually on a local ioBroker installation +In order to install the adapter locally without publishing, the following steps are recommended: +1. Create a tarball from your dev directory: + ```bash + npm pack + ``` +1. Upload the resulting file to your ioBroker host +1. Install it locally (The paths are different on Windows): + ```bash + cd /opt/iobroker + npm i /path/to/tarball.tgz + ``` + +For later updates, the above procedure is not necessary. Just do the following: +1. Overwrite the changed files in the adapter directory (`/opt/iobroker/node_modules/iobroker.test-adapter`) +1. Execute `iobroker upload test-adapter` on the ioBroker host + +## Changelog + +### 0.0.1 +* (Al Calzone) initial release + +## License +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/__meta__/npm_package_files.txt b/test/baselines/adapter_TS_OfficialESLint/__meta__/npm_package_files.txt new file mode 100644 index 000000000..7503a378d --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/__meta__/npm_package_files.txt @@ -0,0 +1,8 @@ +admin/index_m.html +admin/style.css +admin/test-adapter.png +admin/words.js +io-package.json +LICENSE +package.json +README.md \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/admin.d.ts b/test/baselines/adapter_TS_OfficialESLint/admin/admin.d.ts new file mode 100644 index 000000000..7594b9e3a --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/admin/admin.d.ts @@ -0,0 +1,65 @@ +declare let systemDictionary: Record>; + +declare let load: (settings: Record, onChange: (hasChanges: boolean) => void) => void; +declare let save: (callback: (settings: Record) => void) => void; + +// make load and save exist on the window object +interface Window { + load: typeof load; + save: typeof save; +} + +declare const instance: number; +declare const adapter: string; +/** + * Translates text + * + * @param text + * @param arg1 + * @param arg2 + * @param arg3 + */ +declare function _(text: string, arg1?: string, arg2?: string, arg3?: string): string; +declare const socket: ioBrokerSocket; +declare function sendTo( + instance: any, + command: string, + message: any, + callback: (result: SendToResult) => void | Promise, +): void; + +interface SendToResult { + error?: string | Error; + result?: any; +} + +// tslint:disable-next-line:class-name +interface ioBrokerSocket { + emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + + emit( + event: "getObjectView", + view: "system", + type: "device", + options: ioBroker.GetObjectViewParams, + callback: (err: string | undefined, result?: any) => void | Promise, + ): void; + emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; + emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; + emit( + event: "setState", + id: string, + state: unknown, + callback: (err: string | undefined, result?: any) => void, + ): void; + + on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + + // TODO: other events +} diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/index_m.html b/test/baselines/adapter_TS_OfficialESLint/admin/index_m.html new file mode 100644 index 000000000..f11dc3c14 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/admin/index_m.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ + + + +
+
+ + +
+ +
+ + +
+
+ +
+ + + + \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/style.css b/test/baselines/adapter_TS_OfficialESLint/admin/style.css new file mode 100644 index 000000000..57d4549ee --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/admin/style.css @@ -0,0 +1,32 @@ +/* You can delete those if you want. I just found them very helpful */ +* { + box-sizing: border-box +} +.m { + /* Don't cut off dropdowns! */ + overflow: initial; +} +.m.adapter-container, +.m.adapter-container > div.App { + /* Fix layout/scrolling issues with tabs */ + height: 100%; + width: 100%; + position: relative; +} +.m .select-wrapper + label { + /* The positioning for dropdown labels is messed up */ + transform: none !important; +} + +label > i[title] { + /* Display the help cursor for the tooltip icons and fix their positioning */ + cursor: help; + margin-left: 0.25em; +} + +.dropdown-content { + /* Don't wrap text in dropdowns */ + white-space: nowrap; +} + +/* Add your styles here */ diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/test-adapter.png b/test/baselines/adapter_TS_OfficialESLint/admin/test-adapter.png new file mode 100644 index 000000000..094ebd97c Binary files /dev/null and b/test/baselines/adapter_TS_OfficialESLint/admin/test-adapter.png differ diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/tsconfig.json b/test/baselines/adapter_TS_OfficialESLint/admin/tsconfig.json new file mode 100644 index 000000000..49fb013d2 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/admin/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "include": [ + "./admin.d.ts", + "./**/*.js", + // Include the adapter-config definition if it exists. + // It should be at either on of these paths: + "../lib/adapter-config.d.ts", // JS + "../src/lib/adapter-config.d.ts", // TS + ] +} diff --git a/test/baselines/adapter_TS_OfficialESLint/admin/words.js b/test/baselines/adapter_TS_OfficialESLint/admin/words.js new file mode 100644 index 000000000..4517fef89 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/admin/words.js @@ -0,0 +1,46 @@ +/* eslint no-unused-vars: off */ +/* eslint no-global-assign: off */ +/* global systemDictionary */ +"use strict"; + +systemDictionary = { + "test-adapter adapter settings": { + "en": "Adapter settings for test-adapter", + "de": "Adaptereinstellungen für test-adapter", + "ru": "Настройки адаптера для test-adapter", + "pt": "Configurações do adaptador para test-adapter", + "nl": "Adapterinstellingen voor test-adapter", + "fr": "Paramètres d'adaptateur pour test-adapter", + "it": "Impostazioni dell'adattatore per test-adapter", + "es": "Ajustes del adaptador para test-adapter", + "pl": "Ustawienia adaptera dla test-adapter", + "uk": "Налаштування адаптера для test-adapter", + "zh-cn": "test-adapter的适配器设置" + }, + "option1": { + "en": "option1", + "de": "Mock translation of 'option1' to 'de'", + "ru": "Mock translation of 'option1' to 'ru'", + "pt": "Mock translation of 'option1' to 'pt'", + "nl": "Mock translation of 'option1' to 'nl'", + "fr": "Mock translation of 'option1' to 'fr'", + "it": "Mock translation of 'option1' to 'it'", + "es": "Mock translation of 'option1' to 'es'", + "pl": "Mock translation of 'option1' to 'pl'", + "uk": "Mock translation of 'option1' to 'uk'", + "zh-cn": "Mock translation of 'option1' to 'zh-cn'" + }, + "option2": { + "en": "option2", + "de": "Mock translation of 'option2' to 'de'", + "ru": "Mock translation of 'option2' to 'ru'", + "pt": "Mock translation of 'option2' to 'pt'", + "nl": "Mock translation of 'option2' to 'nl'", + "fr": "Mock translation of 'option2' to 'fr'", + "it": "Mock translation of 'option2' to 'it'", + "es": "Mock translation of 'option2' to 'es'", + "pl": "Mock translation of 'option2' to 'pl'", + "uk": "Mock translation of 'option2' to 'uk'", + "zh-cn": "Mock translation of 'option2' to 'zh-cn'" + } +}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/eslint.config.mjs b/test/baselines/adapter_TS_OfficialESLint/eslint.config.mjs new file mode 100644 index 000000000..5224defc7 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/eslint.config.mjs @@ -0,0 +1,35 @@ +// ioBroker eslint template configuration file for js and ts files +// Please note that esm or react based modules need additional modules loaded. +import config from '@iobroker/eslint-config'; + +export default [ + ...config, + { + // specify files to exclude from linting here + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build', + 'dist', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + 'widgets/**/*.js' + ], + }, + { + // you may disable some 'jsdoc' warnings - but using jsdoc is highly recommended + // as this improves maintainability. jsdoc warnings will not block build process. + rules: { + // 'jsdoc/require-jsdoc': 'off', + // 'jsdoc/require-param': 'off', + // 'jsdoc/require-param-description': 'off', + // 'jsdoc/require-returns-description': 'off', + // 'jsdoc/require-returns-check': 'off', + }, + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/io-package.json b/test/baselines/adapter_TS_OfficialESLint/io-package.json new file mode 100644 index 000000000..53cff6aab --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/io-package.json @@ -0,0 +1,91 @@ +{ + "common": { + "name": "test-adapter", + "version": "0.0.1", + "news": { + "0.0.1": { + "en": "initial release", + "de": "Erstveröffentlichung", + "ru": "Начальная версия", + "pt": "lançamento inicial", + "nl": "Eerste uitgave", + "fr": "Première version", + "it": "Versione iniziale", + "es": "Versión inicial", + "pl": "Pierwsze wydanie", + "uk": "Початкова версія", + "zh-cn": "首次出版" + } + }, + "titleLang": { + "en": "Is used to test the creator", + "de": "Mock translation of 'Is used to test the creator' to 'de'", + "ru": "Mock translation of 'Is used to test the creator' to 'ru'", + "pt": "Mock translation of 'Is used to test the creator' to 'pt'", + "nl": "Mock translation of 'Is used to test the creator' to 'nl'", + "fr": "Mock translation of 'Is used to test the creator' to 'fr'", + "it": "Mock translation of 'Is used to test the creator' to 'it'", + "es": "Mock translation of 'Is used to test the creator' to 'es'", + "pl": "Mock translation of 'Is used to test the creator' to 'pl'", + "uk": "Mock translation of 'Is used to test the creator' to 'uk'", + "zh-cn": "Mock translation of 'Is used to test the creator' to 'zh-cn'" + }, + "desc": { + "en": "test-adapter", + "de": "Mock translation of 'test-adapter' to 'de'", + "ru": "Mock translation of 'test-adapter' to 'ru'", + "pt": "Mock translation of 'test-adapter' to 'pt'", + "nl": "Mock translation of 'test-adapter' to 'nl'", + "fr": "Mock translation of 'test-adapter' to 'fr'", + "it": "Mock translation of 'test-adapter' to 'it'", + "es": "Mock translation of 'test-adapter' to 'es'", + "pl": "Mock translation of 'test-adapter' to 'pl'", + "uk": "Mock translation of 'test-adapter' to 'uk'", + "zh-cn": "Mock translation of 'test-adapter' to 'zh-cn'" + }, + "authors": [ + "Al Calzone " + ], + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "platform": "Javascript/Node.js", + "icon": "test-adapter.png", + "enabled": true, + "extIcon": "https://raw.githubusercontent.com/AlCalzone/ioBroker.test-adapter/main/admin/test-adapter.png", + "readme": "https://github.com/AlCalzone/ioBroker.test-adapter/blob/main/README.md", + "loglevel": "info", + "tier": 3, + "mode": "daemon", + "type": "general", + "compact": true, + "connectionType": "local", + "dataSource": "push", + "adminUI": { + "config": "materialize" + }, + "dependencies": [ + { + "js-controller": ">=6.0.11" + } + ], + "globalDependencies": [ + { + "admin": ">=7.0.23" + } + ] + }, + "native": { + "option1": true, + "option2": "42" + }, + "objects": [], + "instanceObjects": [] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/package.json b/test/baselines/adapter_TS_OfficialESLint/package.json new file mode 100644 index 000000000..045167d35 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/package.json @@ -0,0 +1,67 @@ +{ + "name": "iobroker.test-adapter", + "version": "0.0.1", + "description": "test-adapter", + "author": { + "name": "Al Calzone", + "email": "al@calzo.ne" + }, + "contributors": [], + "homepage": "https://github.com/AlCalzone/ioBroker.test-adapter", + "license": "MIT", + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "repository": { + "type": "git", + "url": "https://github.com/AlCalzone/ioBroker.test-adapter.git" + }, + "engines": { + "node": ">= 20" + }, + "dependencies": { + "@iobroker/adapter-core": "^3.3.2" + }, + "devDependencies": { + "@iobroker/adapter-dev": "^1.5.0", + "@iobroker/eslint-config": "^2.2.0", + "@iobroker/testing": "^5.1.1", + "@tsconfig/node20": "^20.1.6", + "@types/node": "^20.19.21", + "rimraf": "^6.0.1", + "source-map-support": "^0.5.21", + "ts-node": "^10.9.2", + "typescript": "~5.9.3" + }, + "main": "build/main.js", + "files": [ + "admin{,/!(src)/**}/!(tsconfig|tsconfig.*|.eslintrc).{json,json5}", + "admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}", + "build/", + "www/", + "io-package.json", + "LICENSE" + ], + "scripts": { + "prebuild": "rimraf build", + "build": "build-adapter ts", + "watch": "build-adapter ts --watch", + "prebuild:ts": "rimraf build", + "build:ts": "build-adapter ts", + "watch:ts": "build-adapter ts --watch", + "test:ts": "mocha --config test/mocharc.custom.json src/**/*.test.ts", + "test:package": "mocha test/package --exit", + "test:integration": "mocha test/integration --exit", + "test": "npm run test:ts && npm run test:package", + "check": "tsc --noEmit", + "lint": "eslint -c eslint.config.mjs .", + "translate": "translate-adapter" + }, + "bugs": { + "url": "https://github.com/AlCalzone/ioBroker.test-adapter/issues" + }, + "readmeFilename": "README.md" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs b/test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs new file mode 100644 index 000000000..2aa4713b5 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/prettier.config.mjs @@ -0,0 +1,8 @@ +// iobroker prettier configuration file +import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; + +export default { + ...prettierConfig, + useTabs: true, + singleQuote: false, +}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/src/lib/adapter-config.d.ts b/test/baselines/adapter_TS_OfficialESLint/src/lib/adapter-config.d.ts new file mode 100644 index 000000000..c6c8a0e2a --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/src/lib/adapter-config.d.ts @@ -0,0 +1,14 @@ +// This file extends the AdapterConfig type from "@types/iobroker" + +// Augment the globally declared type ioBroker.AdapterConfig +declare global { + namespace ioBroker { + interface AdapterConfig { + option1: boolean; + option2: string; + } + } +} + +// this is required so the above AdapterConfig is found by TypeScript / type checking +export {}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/src/main.test.ts b/test/baselines/adapter_TS_OfficialESLint/src/main.test.ts new file mode 100644 index 000000000..0992583bc --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/src/main.test.ts @@ -0,0 +1,24 @@ +/** + * This is a dummy TypeScript test file using chai and mocha + * + * It's automatically excluded from npm and its build output is excluded from both git and npm. + * It is advised to test all your modules with accompanying *.test.ts-files + */ + +import { expect } from "chai"; +// import { functionToTest } from "./moduleToTest"; + +describe("module to test => function to test", () => { + // initializing logic + const expected = 5; + + it(`should return ${expected}`, () => { + const result = 5; + // assign result a value from functionToTest + expect(result).to.equal(expected); + // or using the should() syntax + result.should.equal(expected); + }); + // ... more tests => it +}); +// ... more test suites => describe diff --git a/test/baselines/adapter_TS_OfficialESLint/src/main.ts b/test/baselines/adapter_TS_OfficialESLint/src/main.ts new file mode 100644 index 000000000..c5c122375 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/src/main.ts @@ -0,0 +1,155 @@ +/* + * Created with @iobroker/create-adapter v2.6.5 + */ + +// The adapter-core module gives you access to the core ioBroker functions +// you need to create an adapter +import * as utils from "@iobroker/adapter-core"; + +// Load your modules here, e.g.: +// import * as fs from "fs"; + +class TestAdapter extends utils.Adapter { + public constructor(options: Partial = {}) { + super({ + ...options, + name: "test-adapter", + }); + this.on("ready", this.onReady.bind(this)); + this.on("stateChange", this.onStateChange.bind(this)); + // this.on("objectChange", this.onObjectChange.bind(this)); + // this.on("message", this.onMessage.bind(this)); + this.on("unload", this.onUnload.bind(this)); + } + + /** + * Is called when databases are connected and adapter received configuration. + */ + private async onReady(): Promise { + // Initialize your adapter here + + // The adapters config (in the instance object everything under the attribute "native") is accessible via + // this.config: + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); + + /* + For every state in the system there has to be also an object of type state + Here a simple template for a boolean variable named "testVariable" + Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables + */ + await this.setObjectNotExistsAsync("testVariable", { + type: "state", + common: { + name: "testVariable", + type: "boolean", + role: "indicator", + read: true, + write: true, + }, + native: {}, + }); + + // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. + this.subscribeStates("testVariable"); + // You can also add a subscription for multiple states. The following line watches all states starting with "lights." + // this.subscribeStates("lights.*"); + // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: + // this.subscribeStates("*"); + + /* + setState examples + you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) + */ + // the variable testVariable is set to true as command (ack=false) + await this.setState("testVariable", true); + + // same thing, but the value is flagged "ack" + // ack should be always set to true if the value is received from or acknowledged from the target system + await this.setState("testVariable", { val: true, ack: true }); + + // same thing, but the state is deleted after 30s (getState will return null afterwards) + await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + + // examples for the checkPassword/checkGroup functions + const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); + + const groupResult = await this.checkGroupAsync("admin", "admin"); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); + } + + /** + * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function + */ + private onUnload(callback: () => void): void { + try { + // Here you must clear all timeouts or intervals that may still be active + // clearTimeout(timeout1); + // clearTimeout(timeout2); + // ... + // clearInterval(interval1); + + callback(); + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); + callback(); + } + } + + // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. + // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. + // /** + // * Is called if a subscribed object changes + // */ + // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void { + // if (obj) { + // // The object was changed + // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); + // } else { + // // The object was deleted + // this.log.info(`object ${id} deleted`); + // } + // } + + /** + * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object + */ + private onStateChange(id: string, state: ioBroker.State | null | undefined): void { + if (state) { + // The state was changed + this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`); + } else { + // The state was deleted + this.log.info(`state ${id} deleted`); + } + } + // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. + // /** + // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... + // * Using this method requires "common.messagebox" property to be set to true in io-package.json + // */ + // + // private onMessage(obj: ioBroker.Message): void { + // if (typeof obj === "object" && obj.message) { + // if (obj.command === "send") { + // // e.g. send email or pushover or whatever + // this.log.info("send command"); + // // Send response in callback if required + // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // } + // } + // } +} +if (require.main !== module) { + // Export the constructor in compact mode + module.exports = (options: Partial | undefined) => new TestAdapter(options); +} else { + // otherwise start the instance directly + (() => new TestAdapter())(); +} diff --git a/test/baselines/adapter_JS_React/.eslintrc.json b/test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json similarity index 70% rename from test/baselines/adapter_JS_React/.eslintrc.json rename to test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json index 56d859b3a..ce6b3d62c 100644 --- a/test/baselines/adapter_JS_React/.eslintrc.json +++ b/test/baselines/adapter_TS_OfficialESLint/test/.eslintrc.json @@ -6,17 +6,8 @@ "mocha": true }, "extends": [ - "eslint:recommended", - "plugin:react/recommended" + "eslint:recommended" ], - "plugins": [ - "react" - ], - "settings": { - "react": { - "version": "detect" - } - }, "rules": { "indent": [ "error", @@ -48,11 +39,5 @@ "error", "always" ] - }, - "parserOptions": { - "ecmaVersion": "latest", - "ecmaFeatures": { - "jsx": true - } } } \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/test/integration.js b/test/baselines/adapter_TS_OfficialESLint/test/integration.js new file mode 100644 index 000000000..986936fac --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/test/integration.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options +tests.integration(path.join(__dirname, "..")); \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js b/test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js new file mode 100644 index 000000000..b839790ff --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/test/mocha.setup.js @@ -0,0 +1,23 @@ +"use strict"; + +// Makes ts-node ignore warnings, so mocha --watch does work +process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; +// Sets the correct tsconfig for testing +process.env.TS_NODE_PROJECT = "tsconfig.json"; +// Make ts-node respect the "include" key in tsconfig.json +process.env.TS_NODE_FILES = "TRUE"; + +// Don't silently swallow unhandled rejections +process.on("unhandledRejection", (e) => { + throw e; +}); + +// enable the should interface with sinon +// and load chai-as-promised and sinon-chai by default +const sinonChai = require("sinon-chai"); +const chaiAsPromised = require("chai-as-promised"); +const { should, use } = require("chai"); + +should(); +use(sinonChai); +use(chaiAsPromised); \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/test/mocharc.custom.json b/test/baselines/adapter_TS_OfficialESLint/test/mocharc.custom.json new file mode 100644 index 000000000..851ed9cdc --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/test/mocharc.custom.json @@ -0,0 +1,10 @@ +{ + "require": [ + "test/mocha.setup.js", + "ts-node/register", + "source-map-support/register" + ], + "watch-files": [ + "src/**/*.test.ts" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_OfficialESLint/test/package.js b/test/baselines/adapter_TS_OfficialESLint/test/package.js new file mode 100644 index 000000000..3a48e0449 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/test/package.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Validate the package files +tests.packageFiles(path.join(__dirname, "..")); diff --git a/test/baselines/adapter_TS_OfficialESLint/test/tsconfig.json b/test/baselines/adapter_TS_OfficialESLint/test/tsconfig.json new file mode 100644 index 000000000..3ebc81b65 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/test/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false + }, + "include": [ + "./**/*.js" + ] +} diff --git a/test/baselines/adapter_TS_OfficialESLint/tsconfig.build.json b/test/baselines/adapter_TS_OfficialESLint/tsconfig.build.json new file mode 100644 index 000000000..1f040ce18 --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/tsconfig.build.json @@ -0,0 +1,16 @@ +// Specialized tsconfig to only compile .ts-files in the src dir +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "allowJs": false, + "checkJs": false, + "noEmit": false, + "declaration": false + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/**/*.test.ts" + ] +} diff --git a/test/baselines/adapter_TS_OfficialESLint/tsconfig.json b/test/baselines/adapter_TS_OfficialESLint/tsconfig.json new file mode 100644 index 000000000..4c80d776d --- /dev/null +++ b/test/baselines/adapter_TS_OfficialESLint/tsconfig.json @@ -0,0 +1,46 @@ +// Root tsconfig to set the settings and power editor support for all TS files +{ + // To update the compilation target, install a different version of @tsconfig/node... and reference it here + // https://github.com/tsconfig/bases#node-20-tsconfigjson + "extends": "@tsconfig/node20/tsconfig.json", + "compilerOptions": { + // do not compile anything, this file is just to configure type checking + // the compilation is configured in tsconfig.build.json + "noEmit": true, + + // check JS files, but do not compile them => tsconfig.build.json + "allowJs": true, + "checkJs": true, + + "noEmitOnError": true, + "outDir": "./build/", + "removeComments": false, + + // This is necessary for the automatic typing of the adapter config + "resolveJsonModule": true, + + // If you want to disable the stricter type checks (not recommended), uncomment the following line + // "strict": false, + // And enable some of those features for more fine-grained control + // "strictNullChecks": true, + // "strictPropertyInitialization": true, + // "strictBindCallApply": true, + // "noImplicitAny": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // Uncomment this if you want the old behavior of catch variables being `any` + // "useUnknownInCatchVariables": false, + + "sourceMap": true, + "inlineSourceMap": false + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "build/**", + "node_modules/**", + "widgets/**" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React/.create-adapter.json b/test/baselines/adapter_TS_React/.create-adapter.json index 06eebdce3..f3b7379bd 100644 --- a/test/baselines/adapter_TS_React/.create-adapter.json +++ b/test/baselines/adapter_TS_React/.create-adapter.json @@ -19,6 +19,7 @@ "tools": [ "ESLint" ], + "eslintConfig": "custom", "indentation": "Tab", "quotes": "double", "authorName": "Al Calzone", diff --git a/test/baselines/adapter_TS_React/.eslintignore b/test/baselines/adapter_TS_React/.eslintignore deleted file mode 100644 index 0e24f5220..000000000 --- a/test/baselines/adapter_TS_React/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -admin/build/ -build/ -**/.eslintrc.js -admin/words.js \ No newline at end of file diff --git a/test/baselines/adapter_TS_React/.eslintrc.js b/test/baselines/adapter_TS_React/.eslintrc.js deleted file mode 100644 index d050da9cc..000000000 --- a/test/baselines/adapter_TS_React/.eslintrc.js +++ /dev/null @@ -1,78 +0,0 @@ -module.exports = { - root: true, // Don't look outside this project for inherited configs - parser: "@typescript-eslint/parser", // Specifies the ESLint parser - parserOptions: { - ecmaVersion: "latest", // Allows for the parsing of modern ECMAScript features - sourceType: "module", // Allows for the use of imports - project: ["./tsconfig.json", "./admin/tsconfig.json"], - ecmaFeatures: { - jsx: true, - }, - }, - extends: [ - "plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin - "plugin:react/recommended", // Supports React JSX - ], - plugins: ["react"], - settings: { - react: { - version: "detect", - }, - }, - rules: { - "indent": "off", - "@typescript-eslint/indent": [ - "error", - "tab", - { - "SwitchCase": 1 - } - ], - "quotes": [ - "error", - "double", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-use-before-define": [ - "error", - { - functions: false, - typedefs: false, - classes: false, - }, - ], - "@typescript-eslint/no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - argsIgnorePattern: "^_", - }, - ], - "@typescript-eslint/explicit-function-return-type": [ - "warn", - { - allowExpressions: true, - allowTypedFunctionExpressions: true, - }, - ], - "@typescript-eslint/no-object-literal-type-assertion": "off", - "@typescript-eslint/interface-name-prefix": "off", - "@typescript-eslint/no-non-null-assertion": "off", // This is necessary for Map.has()/get()! - "no-var": "error", - "prefer-const": "error", - "no-trailing-spaces": "error", - }, - overrides: [ - { - files: ["*.test.ts", "*.tsx"], - rules: { - "@typescript-eslint/explicit-function-return-type": "off", - }, - }, - ], -}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_React/admin/src/app.tsx b/test/baselines/adapter_TS_React/admin/src/app.tsx index b4f93806a..181208404 100644 --- a/test/baselines/adapter_TS_React/admin/src/app.tsx +++ b/test/baselines/adapter_TS_React/admin/src/app.tsx @@ -1,10 +1,10 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ import React from "react"; -import { Theme, withStyles } from "@material-ui/core/styles"; +import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; import GenericApp from "@iobroker/adapter-react/GenericApp"; import Settings from "./components/settings"; -import { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; -import { StyleRules } from "@material-ui/core/styles"; +import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; const styles = (_theme: Theme): StyleRules => ({ root: {}, @@ -16,16 +16,16 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - "en": require("./i18n/en.json"), - "de": require("./i18n/de.json"), - "ru": require("./i18n/ru.json"), - "pt": require("./i18n/pt.json"), - "nl": require("./i18n/nl.json"), - "fr": require("./i18n/fr.json"), - "it": require("./i18n/it.json"), - "es": require("./i18n/es.json"), - "pl": require("./i18n/pl.json"), - "uk": require("./i18n/uk.json"), + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), "zh-cn": require("./i18n/zh-cn.json"), }, }; @@ -36,14 +36,17 @@ class App extends GenericApp { // executed when connection is ready } - render() { + render(): Element { if (!this.state.loaded) { return super.render(); } return (
- this.updateNativeValue(attr, value)} /> + this.updateNativeValue(attr, value)} + /> {this.renderError()} {this.renderToast()} {this.renderSaveCloseButtons()} @@ -52,4 +55,4 @@ class App extends GenericApp { } } -export default withStyles(styles)(App); \ No newline at end of file +export default withStyles(styles)(App); diff --git a/test/baselines/adapter_TS_React/admin/src/components/settings.tsx b/test/baselines/adapter_TS_React/admin/src/components/settings.tsx index a504b063a..7c717b899 100644 --- a/test/baselines/adapter_TS_React/admin/src/components/settings.tsx +++ b/test/baselines/adapter_TS_React/admin/src/components/settings.tsx @@ -1,6 +1,6 @@ import React from "react"; import { withStyles } from "@material-ui/core/styles"; -import { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; +import type { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; import TextField from "@material-ui/core/TextField"; import Input from "@material-ui/core/Input"; import FormHelperText from "@material-ui/core/FormHelperText"; @@ -62,14 +62,14 @@ class Settings extends React.Component { this.state = {}; } - renderInput(title: AdminWord, attr: string, type: string) { + renderInput(title: AdminWord, attr: string, type: string): React.JSX.Element { return ( this.props.onChange(attr, e.target.value)} + onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> ); @@ -80,22 +80,30 @@ class Settings extends React.Component { attr: string, options: { value: string; title: AdminWord }[], style?: React.CSSProperties, - ) { + ): React.JSX.Element { return ( } + onChange={e => this.props.onChange(attr, e.target.value === "_" ? "" : e.target.value)} + input={ + + } > - {options.map((item) => ( - + {options.map(item => ( + {I18n.t(item.title)} ))} @@ -105,13 +113,13 @@ class Settings extends React.Component { ); } - renderCheckbox(title: AdminWord, attr: string, style?: React.CSSProperties) { + renderCheckbox(title: AdminWord, attr: string, style?: React.CSSProperties): React.JSX.Element { return ( { ); } - render() { + render(): React.JSX.Element { return (
- {this.renderCheckbox("option1", "option1")}
+ {this.renderCheckbox("option1", "option1")} +
{this.renderInput("option2", "option2", "text")}
); } } -export default withStyles(styles)(Settings); \ No newline at end of file +export default withStyles(styles)(Settings); diff --git a/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts b/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts index f4a769e59..c260647af 100644 --- a/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts +++ b/test/baselines/adapter_TS_React/admin/src/i18n/i18n.d.ts @@ -14,13 +14,15 @@ /** * Available words in `i18n/en.json`. */ +// eslint-disable-next-line @typescript-eslint/consistent-type-imports declare type AdminWord = keyof typeof import("./en.json"); declare module "@iobroker/adapter-react/i18n" { /** * Translate the given string to the selected language. + * * @param word The (key) word to look up the string. Has to be defined at least in `i18n/en.json`. * @param args Optional arguments which will replace the first (second, third, ...) occurence of %s */ function t(word: AdminWord, ...args: string[]): string; -} \ No newline at end of file +} diff --git a/test/baselines/adapter_TS_React/admin/src/index.tsx b/test/baselines/adapter_TS_React/admin/src/index.tsx index e114005c8..5857b0fa6 100644 --- a/test/baselines/adapter_TS_React/admin/src/index.tsx +++ b/test/baselines/adapter_TS_React/admin/src/index.tsx @@ -12,7 +12,7 @@ function build(): void { { + onThemeChange={_theme => { themeName = _theme; build(); }} @@ -22,4 +22,4 @@ function build(): void { ); } -build(); \ No newline at end of file +build(); diff --git a/test/baselines/adapter_TS_React/eslint.config.mjs b/test/baselines/adapter_TS_React/eslint.config.mjs new file mode 100644 index 000000000..9b6bd916f --- /dev/null +++ b/test/baselines/adapter_TS_React/eslint.config.mjs @@ -0,0 +1,94 @@ +import js from '@eslint/js'; +import tseslint from '@typescript-eslint/eslint-plugin'; +import tsparser from '@typescript-eslint/parser'; +import react from 'eslint-plugin-react'; + +export default [ + js.configs.recommended, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parser: tsparser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: ['./tsconfig.json', './admin/tsconfig.json'], + ecmaFeatures: { + jsx: true, + }, + }, + globals: { + 'process': 'readonly', + 'Buffer': 'readonly', + '__dirname': 'readonly', + '__filename': 'readonly', + 'module': 'readonly', + 'require': 'readonly', + 'exports': 'readonly', + 'global': 'readonly', + 'console': 'readonly', + 'setTimeout': 'readonly', + 'setInterval': 'readonly', + 'clearTimeout': 'readonly', + 'clearInterval': 'readonly', + 'document': 'readonly', + 'window': 'readonly', + 'describe': 'readonly', + 'it': 'readonly', + 'ioBroker': 'readonly', + 'AdminWord': 'readonly', + }, + }, + plugins: { + '@typescript-eslint': tseslint, + react, + }, + rules: { + ...tseslint.configs.recommended.rules, + ...react.configs.recommended.rules, + 'react/react-in-jsx-scope': 'off', + 'indent': [ + 'error', + 'tab', + { + 'SwitchCase': 1 + } + ], + 'quotes': [ + 'error', + 'double' + ], + // Strict rules to match official @iobroker/eslint-config + 'prefer-template': 'error', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + 'ignoreRestSiblings': true, + 'argsIgnorePattern': '^_', + 'varsIgnorePattern': '^_' + } + ], + }, + settings: { + react: { + version: 'detect', + }, + }, + }, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build/', + 'dist/', + 'admin/build/', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + ], + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_TS_React/package.json b/test/baselines/adapter_TS_React/package.json index 7f85115eb..a35013f3c 100644 --- a/test/baselines/adapter_TS_React/package.json +++ b/test/baselines/adapter_TS_React/package.json @@ -26,6 +26,7 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/adapter-react": "2.0.22", "@iobroker/testing": "^5.1.1", @@ -34,10 +35,10 @@ "@types/node": "^20.19.21", "@types/react-dom": "^17.0.26", "@types/react": "^17.0.89", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", "eslint-plugin-react": "^7.37.5", - "eslint": "^8.57.1", + "eslint": "^9.37.0", "react-dom": "^17.0.2", "react": "^17.0.2", "rimraf": "^6.0.1", @@ -70,7 +71,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit && tsc --noEmit -p admin/tsconfig.json", - "lint": "eslint --ext .ts,.tsx src/ admin/src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/adapter_TS_React/src/main.test.ts b/test/baselines/adapter_TS_React/src/main.test.ts index a8d538e95..0992583bc 100644 --- a/test/baselines/adapter_TS_React/src/main.test.ts +++ b/test/baselines/adapter_TS_React/src/main.test.ts @@ -20,7 +20,5 @@ describe("module to test => function to test", () => { result.should.equal(expected); }); // ... more tests => it - }); - // ... more test suites => describe diff --git a/test/baselines/adapter_TS_React/src/main.ts b/test/baselines/adapter_TS_React/src/main.ts index e2388f1af..c5c122375 100644 --- a/test/baselines/adapter_TS_React/src/main.ts +++ b/test/baselines/adapter_TS_React/src/main.ts @@ -10,7 +10,6 @@ import * as utils from "@iobroker/adapter-core"; // import * as fs from "fs"; class TestAdapter extends utils.Adapter { - public constructor(options: Partial = {}) { super({ ...options, @@ -31,8 +30,8 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: " + this.config.option1); - this.log.debug("config option2: " + this.config.option2); + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); /* For every state in the system there has to be also an object of type state @@ -74,14 +73,16 @@ class TestAdapter extends utils.Adapter { // examples for the checkPassword/checkGroup functions const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); - this.log.info("check user admin pw iobroker: " + pwdResult); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); const groupResult = await this.checkGroupAsync("admin", "admin"); - this.log.info("check group user admin group admin: " + groupResult); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } /** * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function */ private onUnload(callback: () => void): void { try { @@ -92,7 +93,8 @@ class TestAdapter extends utils.Adapter { // clearInterval(interval1); callback(); - } catch (_e) { + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); callback(); } } @@ -114,6 +116,9 @@ class TestAdapter extends utils.Adapter { /** * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object */ private onStateChange(id: string, state: ioBroker.State | null | undefined): void { if (state) { @@ -124,30 +129,27 @@ class TestAdapter extends utils.Adapter { this.log.info(`state ${id} deleted`); } } - // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. // /** // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... // * Using this method requires "common.messagebox" property to be set to true in io-package.json // */ + // // private onMessage(obj: ioBroker.Message): void { // if (typeof obj === "object" && obj.message) { // if (obj.command === "send") { // // e.g. send email or pushover or whatever // this.log.info("send command"); - // // Send response in callback if required // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); // } // } // } - } - if (require.main !== module) { // Export the constructor in compact mode module.exports = (options: Partial | undefined) => new TestAdapter(options); } else { // otherwise start the instance directly (() => new TestAdapter())(); -} \ No newline at end of file +} diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.create-adapter.json b/test/baselines/adapter_TS_React_OfficialESLint/.create-adapter.json new file mode 100644 index 000000000..9d32bec48 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.create-adapter.json @@ -0,0 +1,38 @@ +{ + "cli": true, + "target": "directory", + "adapterName": "test-adapter", + "title": "Is used to test the creator", + "startMode": "daemon", + "features": [ + "adapter" + ], + "connectionIndicator": "no", + "connectionType": "local", + "dataSource": "push", + "adminFeatures": [], + "type": "general", + "language": "TypeScript", + "adminUi": "react", + "tabReact": "no", + "releaseScript": "no", + "tools": [ + "ESLint" + ], + "eslintConfig": "official", + "indentation": "Tab", + "quotes": "double", + "authorName": "Al Calzone", + "authorGithub": "AlCalzone", + "authorEmail": "al@calzo.ne", + "gitRemoteProtocol": "HTTPS", + "dependabot": "yes", + "gitCommit": "no", + "defaultBranch": "main", + "license": "MIT License", + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "creatorVersion": "2.6.5" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md b/test/baselines/adapter_TS_React_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..895613958 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Something is not working as it should +title: '' +labels: '' +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '...' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots & Logfiles** +If applicable, add screenshots and logfiles to help explain your problem. + +**Versions:** + - Adapter version: + - JS-Controller version: + - Node version: + - Operating system: + +**Additional context** +Add any other context about the problem here. diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml b/test/baselines/adapter_TS_React_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..d7cfe5940 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: ioBroker Community + url: https://forum.iobroker.net/ + about: Please ask and answer questions here. \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.github/auto-merge.yml b/test/baselines/adapter_TS_React_OfficialESLint/.github/auto-merge.yml new file mode 100644 index 000000000..4f6d185f0 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.github/auto-merge.yml @@ -0,0 +1,17 @@ +# Configure here which dependency updates should be merged automatically. +# The recommended configuration is the following: +- match: + # Only merge patches for production dependencies + dependency_type: production + update_type: "semver:patch" +- match: + # Except for security fixes, here we allow minor patches + dependency_type: production + update_type: "security:minor" +- match: + # and development dependencies can have a minor update, too + dependency_type: development + update_type: "semver:minor" + +# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: +# https://dependabot.com/docs/config-file/#automerged_updates diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.github/dependabot.yml b/test/baselines/adapter_TS_React_OfficialESLint/.github/dependabot.yml new file mode 100644 index 000000000..4936f4f1c --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone + versioning-strategy: increase + + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.github/workflows/dependabot-auto-merge.yml b/test/baselines/adapter_TS_React_OfficialESLint/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 000000000..baeae23b5 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,27 @@ +# Automatically merge Dependabot PRs when version comparison is within the range +# that is configured in .github/auto-merge.yml + +name: Auto-Merge Dependabot PRs + +on: + # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action + # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ + pull_request_target: + +jobs: + auto-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check if PR should be auto-merged + uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + # In order to use this, you need to go to https://github.com/settings/tokens and + # create a Personal Access Token with the permission "public_repo". + # Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN + github-token: ${{ secrets.AUTO_MERGE_TOKEN }} + # By default, squash and merge, so Github chooses nice commit messages + command: squash and merge diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.github/workflows/test-and-release.yml b/test/baselines/adapter_TS_React_OfficialESLint/.github/workflows/test-and-release.yml new file mode 100644 index 000000000..c6cf66c79 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.github/workflows/test-and-release.yml @@ -0,0 +1,96 @@ +name: Test and Release + +# Run this job on all pushes and pull requests +# as well as tags with a semantic version +on: + push: + branches: + - "main" + tags: + # normal versions + - "v[0-9]+.[0-9]+.[0-9]+" + # pre-releases + - "v[0-9]+.[0-9]+.[0-9]+-**" + pull_request: {} + +# Cancel previous PR/branch runs when a new commit is pushed +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + # Performs quick checks before the expensive test runs + check-and-lint: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ubuntu-latest + + steps: + - uses: ioBroker/testing-action-check@v1 + with: + node-version: '20.x' + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + type-checking: true + lint: true + + # Runs adapter tests on all supported node versions and OSes + adapter-tests: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [20.x, 22.x, 24.x] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: ioBroker/testing-action-adapter@v1 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + build: true + +# TODO: To enable automatic npm releases, create a token on npmjs.org +# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options +# Then uncomment the following block: + +# # Deploys the final package to NPM +# deploy: +# needs: [check-and-lint, adapter-tests] +# +# # Trigger this step only when a commit on any branch is tagged with a version number +# if: | +# contains(github.event.head_commit.message, '[skip ci]') == false && +# github.event_name == 'push' && +# startsWith(github.ref, 'refs/tags/v') +# +# runs-on: ubuntu-latest +# +# # Write permissions are required to create Github releases +# permissions: +# contents: write +# +# steps: +# - uses: ioBroker/testing-action-deploy@v1 +# with: +# node-version: '20.x' +# # Uncomment the following line if your adapter cannot be installed using 'npm ci' +# # install-command: 'npm install' +# build: true +# npm-token: ${{ secrets.NPM_TOKEN }} +# github-token: ${{ secrets.GITHUB_TOKEN }} +# +# # When using Sentry for error reporting, Sentry can be informed about new releases +# # To enable create a API-Token in Sentry (User settings, API keys) +# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options +# # Then uncomment and customize the following block: +# sentry: true +# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }} +# sentry-project: "iobroker-test-adapter" +# sentry-version-prefix: "iobroker.test-adapter" +# sentry-sourcemap-paths: "build/ admin/build/" +# # If your sentry project is linked to a GitHub repository, you can enable the following option +# # sentry-github-integration: true diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.gitignore b/test/baselines/adapter_TS_React_OfficialESLint/.gitignore new file mode 100644 index 000000000..80c28aa9d --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.gitignore @@ -0,0 +1,18 @@ +# No dot-directories except github/vscode +.*/ +!.vscode/ +!.github/ + +*.code-workspace +node_modules +nbproject + +# npm package files +iobroker.*.tgz + +Thumbs.db +.commitinfo + +# i18n intermediate files +admin/i18n/flat.txt +admin/i18n/*/flat.txt \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.vscode/extensions.json b/test/baselines/adapter_TS_React_OfficialESLint/.vscode/extensions.json new file mode 100644 index 000000000..2c6ac5b31 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/.vscode/settings.json b/test/baselines/adapter_TS_React_OfficialESLint/.vscode/settings.json new file mode 100644 index 000000000..854736cc0 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "eslint.enable": true, + "json.schemas": [ + { + "fileMatch": [ + "io-package.json" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" + }, + { + "fileMatch": [ + "admin/jsonConfig.json", + "admin/jsonConfig.json5", + "admin/jsonCustom.json", + "admin/jsonCustom.json5", + "admin/jsonTab.json", + "admin/jsonTab.json5" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" + } + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/LICENSE b/test/baselines/adapter_TS_React_OfficialESLint/LICENSE new file mode 100644 index 000000000..27c9a624d --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/baselines/adapter_TS_React_OfficialESLint/README.md b/test/baselines/adapter_TS_React_OfficialESLint/README.md new file mode 100644 index 000000000..4d66eab99 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/README.md @@ -0,0 +1,136 @@ +![Logo](admin/test-adapter.png) +# ioBroker.test-adapter + +[![NPM version](https://img.shields.io/npm/v/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +[![Downloads](https://img.shields.io/npm/dm/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +![Number of Installations](https://iobroker.live/badges/test-adapter-installed.svg) +![Current version in stable repository](https://iobroker.live/badges/test-adapter-stable.svg) + +[![NPM](https://nodei.co/npm/iobroker.test-adapter.png?downloads=true)](https://nodei.co/npm/iobroker.test-adapter/) + +**Tests:** ![Test and Release](https://github.com/AlCalzone/ioBroker.test-adapter/workflows/Test%20and%20Release/badge.svg) + +## test-adapter adapter for ioBroker + +Describe your project here + +## Developer manual +This section is intended for the developer. It can be deleted later. + +### DISCLAIMER + +Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README. +You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you. + +### Getting started + +You are almost done, only a few steps left: +1. Create a new repository on GitHub with the name `ioBroker.test-adapter` +1. Initialize the current folder as a new git repository: + ```bash + git init -b main + git add . + git commit -m "Initial commit" + ``` +1. Link your local repository with the one on GitHub: + ```bash + git remote add origin https://github.com/AlCalzone/ioBroker.test-adapter + ``` + +1. Push all files to the GitHub repo: + ```bash + git push origin main + ``` +1. Add a new secret under https://github.com/AlCalzone/ioBroker.test-adapter/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. + +1. Head over to [src/main.ts](src/main.ts) and start programming! + +### Best Practices +We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should +check them out. If you're already experienced, you should also take a look at them - you might learn something new :) + +### Scripts in `package.json` +Several npm scripts are predefined for your convenience. You can run them using `npm run ` +| Script name | Description | +|-------------|-------------| +| `build` | Compile the TypeScript and React sources. | +| `watch` | Compile the TypeScript and React sources and watch for changes. | +| `build:ts` | Compile the TypeScript sources. | +| `watch:ts` | Compile the TypeScript sources and watch for changes. | +| `build:react` | Compile the React sources. | +| `watch:react` | Compile the React sources and watch for changes. | +| `test:ts` | Executes the tests you defined in `*.test.ts` files. | +| `test:package` | Ensures your `package.json` and `io-package.json` are valid. | +| `test:integration` | Tests the adapter startup with an actual instance of ioBroker. | +| `test` | Performs a minimal test run on package files and your tests. | +| `check` | Performs a type-check on your code (without compiling anything). | +| `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. | +| `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. | + +### Configuring the compilation +The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings +either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the +[`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files). + +### Writing tests +When done right, testing code is invaluable, because it gives you the +confidence to change your code while knowing exactly if and when +something breaks. A good read on the topic of test-driven development +is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92. +Although writing tests before the code might seem strange at first, but it has very +clear upsides. + +The template provides you with basic tests for the adapter startup and package files. +It is recommended that you add your own tests into the mix. + +### Publishing the adapter +Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form +`v..`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`. + +To get your adapter released in ioBroker, please refer to the documentation +of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). + +### Test the adapter manually on a local ioBroker installation +In order to install the adapter locally without publishing, the following steps are recommended: +1. Create a tarball from your dev directory: + ```bash + npm pack + ``` +1. Upload the resulting file to your ioBroker host +1. Install it locally (The paths are different on Windows): + ```bash + cd /opt/iobroker + npm i /path/to/tarball.tgz + ``` + +For later updates, the above procedure is not necessary. Just do the following: +1. Overwrite the changed files in the adapter directory (`/opt/iobroker/node_modules/iobroker.test-adapter`) +1. Execute `iobroker upload test-adapter` on the ioBroker host + +## Changelog + +### 0.0.1 +* (Al Calzone) initial release + +## License +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/__meta__/npm_package_files.txt b/test/baselines/adapter_TS_React_OfficialESLint/__meta__/npm_package_files.txt new file mode 100644 index 000000000..49c3dedbb --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/__meta__/npm_package_files.txt @@ -0,0 +1,7 @@ +admin/index_m.html +admin/style.css +admin/test-adapter.png +io-package.json +LICENSE +package.json +README.md \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/index_m.html b/test/baselines/adapter_TS_React_OfficialESLint/admin/index_m.html new file mode 100644 index 000000000..c1e5ff148 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/index_m.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/app.tsx b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/app.tsx new file mode 100644 index 000000000..181208404 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/app.tsx @@ -0,0 +1,58 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ +import React from "react"; +import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; + +import GenericApp from "@iobroker/adapter-react/GenericApp"; +import Settings from "./components/settings"; +import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; + +const styles = (_theme: Theme): StyleRules => ({ + root: {}, +}); + +class App extends GenericApp { + constructor(props: GenericAppProps) { + const extendedProps: GenericAppSettings = { + ...props, + encryptedFields: [], + translations: { + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), + "zh-cn": require("./i18n/zh-cn.json"), + }, + }; + super(props, extendedProps); + } + + onConnectionReady(): void { + // executed when connection is ready + } + + render(): Element { + if (!this.state.loaded) { + return super.render(); + } + + return ( +
+ this.updateNativeValue(attr, value)} + /> + {this.renderError()} + {this.renderToast()} + {this.renderSaveCloseButtons()} +
+ ); + } +} + +export default withStyles(styles)(App); diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/components/settings.tsx b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/components/settings.tsx new file mode 100644 index 000000000..7c717b899 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/components/settings.tsx @@ -0,0 +1,148 @@ +import React from "react"; +import { withStyles } from "@material-ui/core/styles"; +import type { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; +import TextField from "@material-ui/core/TextField"; +import Input from "@material-ui/core/Input"; +import FormHelperText from "@material-ui/core/FormHelperText"; +import FormControl from "@material-ui/core/FormControl"; +import Select from "@material-ui/core/Select"; +import MenuItem from "@material-ui/core/MenuItem"; +import FormControlLabel from "@material-ui/core/FormControlLabel"; +import Checkbox from "@material-ui/core/Checkbox"; +import I18n from "@iobroker/adapter-react/i18n"; + +const styles = (): Record => ({ + input: { + marginTop: 0, + minWidth: 400, + }, + button: { + marginRight: 20, + }, + card: { + maxWidth: 345, + textAlign: "center", + }, + media: { + height: 180, + }, + column: { + display: "inline-block", + verticalAlign: "top", + marginRight: 20, + }, + columnLogo: { + width: 350, + marginRight: 0, + }, + columnSettings: { + width: "calc(100% - 370px)", + }, + controlElement: { + //background: "#d2d2d2", + marginBottom: 5, + }, +}); + +interface SettingsProps { + classes: Record; + native: Record; + + onChange: (attr: string, value: any) => void; +} + +interface SettingsState { + // add your state properties here + dummy?: undefined; +} + +class Settings extends React.Component { + constructor(props: SettingsProps) { + super(props); + this.state = {}; + } + + renderInput(title: AdminWord, attr: string, type: string): React.JSX.Element { + return ( + this.props.onChange(attr, e.target.value)} + margin="normal" + /> + ); + } + + renderSelect( + title: AdminWord, + attr: string, + options: { value: string; title: AdminWord }[], + style?: React.CSSProperties, + ): React.JSX.Element { + return ( + + + } + > + {options.map(item => ( + + {I18n.t(item.title)} + + ))} + + {I18n.t(title)} + + ); + } + + renderCheckbox(title: AdminWord, attr: string, style?: React.CSSProperties): React.JSX.Element { + return ( + this.props.onChange(attr, !this.props.native[attr])} + color="primary" + /> + } + label={I18n.t(title)} + /> + ); + } + + render(): React.JSX.Element { + return ( +
+ {this.renderCheckbox("option1", "option1")} +
+ {this.renderInput("option2", "option2", "text")} +
+ ); + } +} + +export default withStyles(styles)(Settings); diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/de.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/de.json new file mode 100644 index 000000000..d5cb3c428 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/de.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Adaptereinstellungen für test-adapter", + "option1": "Mock translation of 'option1' to 'de'", + "option2": "Mock translation of 'option2' to 'de'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/en.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/en.json new file mode 100644 index 000000000..f8c9603af --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/en.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Adapter settings for test-adapter", + "option1": "option1", + "option2": "option2" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/es.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/es.json new file mode 100644 index 000000000..2b0e2d150 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/es.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Ajustes del adaptador para test-adapter", + "option1": "Mock translation of 'option1' to 'es'", + "option2": "Mock translation of 'option2' to 'es'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/fr.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/fr.json new file mode 100644 index 000000000..50f364d83 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/fr.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Paramètres d'adaptateur pour test-adapter", + "option1": "Mock translation of 'option1' to 'fr'", + "option2": "Mock translation of 'option2' to 'fr'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/i18n.d.ts b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/i18n.d.ts new file mode 100644 index 000000000..c260647af --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/i18n.d.ts @@ -0,0 +1,28 @@ +/* + * This file loads the translations keys from `i18n/en.json` file and overrides + * the declarations for the translate function `I18n.t` available in "@iobroker/adapter-react/i18n". + * Using these definitions it is ensured that all used translations in the React + * context are defined at least in the english translations file. + * This will add no overhead in the generated code since it just reexports the + * I18n class but with a more typed `t` function. + */ + +/* + * DO NOT add any imports or exports in this file or it will stop working! + */ + +/** + * Available words in `i18n/en.json`. + */ +// eslint-disable-next-line @typescript-eslint/consistent-type-imports +declare type AdminWord = keyof typeof import("./en.json"); + +declare module "@iobroker/adapter-react/i18n" { + /** + * Translate the given string to the selected language. + * + * @param word The (key) word to look up the string. Has to be defined at least in `i18n/en.json`. + * @param args Optional arguments which will replace the first (second, third, ...) occurence of %s + */ + function t(word: AdminWord, ...args: string[]): string; +} diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/it.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/it.json new file mode 100644 index 000000000..67ef9c4dc --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/it.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Impostazioni dell'adattatore per test-adapter", + "option1": "Mock translation of 'option1' to 'it'", + "option2": "Mock translation of 'option2' to 'it'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/nl.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/nl.json new file mode 100644 index 000000000..d7c9cdc17 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/nl.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Adapterinstellingen voor test-adapter", + "option1": "Mock translation of 'option1' to 'nl'", + "option2": "Mock translation of 'option2' to 'nl'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pl.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pl.json new file mode 100644 index 000000000..24e733a7d --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pl.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Ustawienia adaptera dla test-adapter", + "option1": "Mock translation of 'option1' to 'pl'", + "option2": "Mock translation of 'option2' to 'pl'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pt.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pt.json new file mode 100644 index 000000000..7ad3e244b --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/pt.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Configurações do adaptador para test-adapter", + "option1": "Mock translation of 'option1' to 'pt'", + "option2": "Mock translation of 'option2' to 'pt'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/ru.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/ru.json new file mode 100644 index 000000000..a41d670f5 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/ru.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Настройки адаптера для test-adapter", + "option1": "Mock translation of 'option1' to 'ru'", + "option2": "Mock translation of 'option2' to 'ru'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/uk.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/uk.json new file mode 100644 index 000000000..6a8dc5022 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/uk.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "Налаштування адаптера для test-adapter", + "option1": "Mock translation of 'option1' to 'uk'", + "option2": "Mock translation of 'option2' to 'uk'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/zh-cn.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/zh-cn.json new file mode 100644 index 000000000..c4ee1d90d --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/i18n/zh-cn.json @@ -0,0 +1,5 @@ +{ + "test-adapter adapter settings": "test-adapter的适配器设置", + "option1": "Mock translation of 'option1' to 'zh-cn'", + "option2": "Mock translation of 'option2' to 'zh-cn'" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx new file mode 100644 index 000000000..5857b0fa6 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/src/index.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import { MuiThemeProvider } from "@material-ui/core/styles"; +import theme from "@iobroker/adapter-react/Theme"; +import Utils from "@iobroker/adapter-react/Components/Utils"; +import App from "./app"; + +let themeName = Utils.getThemeName(); + +function build(): void { + ReactDOM.render( + + { + themeName = _theme; + build(); + }} + /> + , + document.getElementById("root"), + ); +} + +build(); diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/style.css b/test/baselines/adapter_TS_React_OfficialESLint/admin/style.css new file mode 100644 index 000000000..57d4549ee --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/style.css @@ -0,0 +1,32 @@ +/* You can delete those if you want. I just found them very helpful */ +* { + box-sizing: border-box +} +.m { + /* Don't cut off dropdowns! */ + overflow: initial; +} +.m.adapter-container, +.m.adapter-container > div.App { + /* Fix layout/scrolling issues with tabs */ + height: 100%; + width: 100%; + position: relative; +} +.m .select-wrapper + label { + /* The positioning for dropdown labels is messed up */ + transform: none !important; +} + +label > i[title] { + /* Display the help cursor for the tooltip icons and fix their positioning */ + cursor: help; + margin-left: 0.25em; +} + +.dropdown-content { + /* Don't wrap text in dropdowns */ + white-space: nowrap; +} + +/* Add your styles here */ diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/test-adapter.png b/test/baselines/adapter_TS_React_OfficialESLint/admin/test-adapter.png new file mode 100644 index 000000000..094ebd97c Binary files /dev/null and b/test/baselines/adapter_TS_React_OfficialESLint/admin/test-adapter.png differ diff --git a/test/baselines/adapter_TS_React_OfficialESLint/admin/tsconfig.json b/test/baselines/adapter_TS_React_OfficialESLint/admin/tsconfig.json new file mode 100644 index 000000000..755c6ca7c --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/admin/tsconfig.json @@ -0,0 +1,26 @@ +// Specialized tsconfig for the admin directory, +// includes DOM typings and configures the admin build +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noEmit": false, + "outDir": "./build", + "sourceMap": true, + "sourceRoot": "./src", + "noImplicitAny": false, + "lib": [ + "es2018", + "DOM" + ], + "jsx": "react" + }, + "include": [ + "./**/*.ts", + "./**/*.tsx", + "../src/lib/adapter-config.d.ts" + ], + "exclude": [ + "./**/*.test.ts", + "./**/*.test.tsx" + ] +} diff --git a/test/baselines/adapter_TS_React_OfficialESLint/eslint.config.mjs b/test/baselines/adapter_TS_React_OfficialESLint/eslint.config.mjs new file mode 100644 index 000000000..e5b668231 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/eslint.config.mjs @@ -0,0 +1,36 @@ +// ioBroker eslint template configuration file for js and ts files +// Please note that esm or react based modules need additional modules loaded. +import config from '@iobroker/eslint-config'; + +export default [ + ...config, + { + // specify files to exclude from linting here + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build', + 'dist', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + 'widgets/**/*.js', + 'admin/build' + ], + }, + { + // you may disable some 'jsdoc' warnings - but using jsdoc is highly recommended + // as this improves maintainability. jsdoc warnings will not block build process. + rules: { + // 'jsdoc/require-jsdoc': 'off', + // 'jsdoc/require-param': 'off', + // 'jsdoc/require-param-description': 'off', + // 'jsdoc/require-returns-description': 'off', + // 'jsdoc/require-returns-check': 'off', + }, + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/io-package.json b/test/baselines/adapter_TS_React_OfficialESLint/io-package.json new file mode 100644 index 000000000..98973e67d --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/io-package.json @@ -0,0 +1,92 @@ +{ + "common": { + "name": "test-adapter", + "version": "0.0.1", + "news": { + "0.0.1": { + "en": "initial release", + "de": "Erstveröffentlichung", + "ru": "Начальная версия", + "pt": "lançamento inicial", + "nl": "Eerste uitgave", + "fr": "Première version", + "it": "Versione iniziale", + "es": "Versión inicial", + "pl": "Pierwsze wydanie", + "uk": "Початкова версія", + "zh-cn": "首次出版" + } + }, + "titleLang": { + "en": "Is used to test the creator", + "de": "Mock translation of 'Is used to test the creator' to 'de'", + "ru": "Mock translation of 'Is used to test the creator' to 'ru'", + "pt": "Mock translation of 'Is used to test the creator' to 'pt'", + "nl": "Mock translation of 'Is used to test the creator' to 'nl'", + "fr": "Mock translation of 'Is used to test the creator' to 'fr'", + "it": "Mock translation of 'Is used to test the creator' to 'it'", + "es": "Mock translation of 'Is used to test the creator' to 'es'", + "pl": "Mock translation of 'Is used to test the creator' to 'pl'", + "uk": "Mock translation of 'Is used to test the creator' to 'uk'", + "zh-cn": "Mock translation of 'Is used to test the creator' to 'zh-cn'" + }, + "desc": { + "en": "test-adapter", + "de": "Mock translation of 'test-adapter' to 'de'", + "ru": "Mock translation of 'test-adapter' to 'ru'", + "pt": "Mock translation of 'test-adapter' to 'pt'", + "nl": "Mock translation of 'test-adapter' to 'nl'", + "fr": "Mock translation of 'test-adapter' to 'fr'", + "it": "Mock translation of 'test-adapter' to 'it'", + "es": "Mock translation of 'test-adapter' to 'es'", + "pl": "Mock translation of 'test-adapter' to 'pl'", + "uk": "Mock translation of 'test-adapter' to 'uk'", + "zh-cn": "Mock translation of 'test-adapter' to 'zh-cn'" + }, + "authors": [ + "Al Calzone " + ], + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "platform": "Javascript/Node.js", + "icon": "test-adapter.png", + "enabled": true, + "extIcon": "https://raw.githubusercontent.com/AlCalzone/ioBroker.test-adapter/main/admin/test-adapter.png", + "readme": "https://github.com/AlCalzone/ioBroker.test-adapter/blob/main/README.md", + "loglevel": "info", + "tier": 3, + "mode": "daemon", + "type": "general", + "compact": true, + "connectionType": "local", + "dataSource": "push", + "adminUI": { + "config": "materialize" + }, + "eraseOnUpload": true, + "dependencies": [ + { + "js-controller": ">=6.0.11" + } + ], + "globalDependencies": [ + { + "admin": ">=7.0.23" + } + ] + }, + "native": { + "option1": true, + "option2": "42" + }, + "objects": [], + "instanceObjects": [] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/package.json b/test/baselines/adapter_TS_React_OfficialESLint/package.json new file mode 100644 index 000000000..ea8d65242 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/package.json @@ -0,0 +1,77 @@ +{ + "name": "iobroker.test-adapter", + "version": "0.0.1", + "description": "test-adapter", + "author": { + "name": "Al Calzone", + "email": "al@calzo.ne" + }, + "contributors": [], + "homepage": "https://github.com/AlCalzone/ioBroker.test-adapter", + "license": "MIT", + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "repository": { + "type": "git", + "url": "https://github.com/AlCalzone/ioBroker.test-adapter.git" + }, + "engines": { + "node": ">= 20" + }, + "dependencies": { + "@iobroker/adapter-core": "^3.3.2" + }, + "devDependencies": { + "@iobroker/adapter-dev": "^1.5.0", + "@iobroker/adapter-react": "2.0.22", + "@iobroker/eslint-config": "^2.2.0", + "@iobroker/testing": "^5.1.1", + "@material-ui/core": "^4.12.4", + "@tsconfig/node20": "^20.1.6", + "@types/node": "^20.19.21", + "@types/react-dom": "^17.0.26", + "@types/react": "^17.0.89", + "react-dom": "^17.0.2", + "react": "^17.0.2", + "rimraf": "^6.0.1", + "source-map-support": "^0.5.21", + "ts-node": "^10.9.2", + "typescript": "~5.9.3" + }, + "main": "build/main.js", + "files": [ + "admin{,/!(src)/**}/!(tsconfig|tsconfig.*|.eslintrc).{json,json5}", + "admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}", + "admin/build/", + "build/", + "www/", + "io-package.json", + "LICENSE" + ], + "scripts": { + "prebuild": "rimraf build admin/build", + "build": "build-adapter all", + "watch": "build-adapter all --watch", + "prebuild:ts": "rimraf build", + "build:ts": "build-adapter ts", + "watch:ts": "build-adapter ts --watch", + "prebuild:react": "rimraf admin/build", + "build:react": "build-adapter react", + "watch:react": "build-adapter react --watch", + "test:ts": "mocha --config test/mocharc.custom.json src/**/*.test.ts", + "test:package": "mocha test/package --exit", + "test:integration": "mocha test/integration --exit", + "test": "npm run test:ts && npm run test:package", + "check": "tsc --noEmit && tsc --noEmit -p admin/tsconfig.json", + "lint": "eslint -c eslint.config.mjs .", + "translate": "translate-adapter" + }, + "bugs": { + "url": "https://github.com/AlCalzone/ioBroker.test-adapter/issues" + }, + "readmeFilename": "README.md" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs b/test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs new file mode 100644 index 000000000..2aa4713b5 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/prettier.config.mjs @@ -0,0 +1,8 @@ +// iobroker prettier configuration file +import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; + +export default { + ...prettierConfig, + useTabs: true, + singleQuote: false, +}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/src/lib/adapter-config.d.ts b/test/baselines/adapter_TS_React_OfficialESLint/src/lib/adapter-config.d.ts new file mode 100644 index 000000000..c6c8a0e2a --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/src/lib/adapter-config.d.ts @@ -0,0 +1,14 @@ +// This file extends the AdapterConfig type from "@types/iobroker" + +// Augment the globally declared type ioBroker.AdapterConfig +declare global { + namespace ioBroker { + interface AdapterConfig { + option1: boolean; + option2: string; + } + } +} + +// this is required so the above AdapterConfig is found by TypeScript / type checking +export {}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/src/main.test.ts b/test/baselines/adapter_TS_React_OfficialESLint/src/main.test.ts new file mode 100644 index 000000000..0992583bc --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/src/main.test.ts @@ -0,0 +1,24 @@ +/** + * This is a dummy TypeScript test file using chai and mocha + * + * It's automatically excluded from npm and its build output is excluded from both git and npm. + * It is advised to test all your modules with accompanying *.test.ts-files + */ + +import { expect } from "chai"; +// import { functionToTest } from "./moduleToTest"; + +describe("module to test => function to test", () => { + // initializing logic + const expected = 5; + + it(`should return ${expected}`, () => { + const result = 5; + // assign result a value from functionToTest + expect(result).to.equal(expected); + // or using the should() syntax + result.should.equal(expected); + }); + // ... more tests => it +}); +// ... more test suites => describe diff --git a/test/baselines/adapter_TS_React_OfficialESLint/src/main.ts b/test/baselines/adapter_TS_React_OfficialESLint/src/main.ts new file mode 100644 index 000000000..c5c122375 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/src/main.ts @@ -0,0 +1,155 @@ +/* + * Created with @iobroker/create-adapter v2.6.5 + */ + +// The adapter-core module gives you access to the core ioBroker functions +// you need to create an adapter +import * as utils from "@iobroker/adapter-core"; + +// Load your modules here, e.g.: +// import * as fs from "fs"; + +class TestAdapter extends utils.Adapter { + public constructor(options: Partial = {}) { + super({ + ...options, + name: "test-adapter", + }); + this.on("ready", this.onReady.bind(this)); + this.on("stateChange", this.onStateChange.bind(this)); + // this.on("objectChange", this.onObjectChange.bind(this)); + // this.on("message", this.onMessage.bind(this)); + this.on("unload", this.onUnload.bind(this)); + } + + /** + * Is called when databases are connected and adapter received configuration. + */ + private async onReady(): Promise { + // Initialize your adapter here + + // The adapters config (in the instance object everything under the attribute "native") is accessible via + // this.config: + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); + + /* + For every state in the system there has to be also an object of type state + Here a simple template for a boolean variable named "testVariable" + Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables + */ + await this.setObjectNotExistsAsync("testVariable", { + type: "state", + common: { + name: "testVariable", + type: "boolean", + role: "indicator", + read: true, + write: true, + }, + native: {}, + }); + + // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. + this.subscribeStates("testVariable"); + // You can also add a subscription for multiple states. The following line watches all states starting with "lights." + // this.subscribeStates("lights.*"); + // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: + // this.subscribeStates("*"); + + /* + setState examples + you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) + */ + // the variable testVariable is set to true as command (ack=false) + await this.setState("testVariable", true); + + // same thing, but the value is flagged "ack" + // ack should be always set to true if the value is received from or acknowledged from the target system + await this.setState("testVariable", { val: true, ack: true }); + + // same thing, but the state is deleted after 30s (getState will return null afterwards) + await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + + // examples for the checkPassword/checkGroup functions + const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); + + const groupResult = await this.checkGroupAsync("admin", "admin"); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); + } + + /** + * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function + */ + private onUnload(callback: () => void): void { + try { + // Here you must clear all timeouts or intervals that may still be active + // clearTimeout(timeout1); + // clearTimeout(timeout2); + // ... + // clearInterval(interval1); + + callback(); + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); + callback(); + } + } + + // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. + // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. + // /** + // * Is called if a subscribed object changes + // */ + // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void { + // if (obj) { + // // The object was changed + // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); + // } else { + // // The object was deleted + // this.log.info(`object ${id} deleted`); + // } + // } + + /** + * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object + */ + private onStateChange(id: string, state: ioBroker.State | null | undefined): void { + if (state) { + // The state was changed + this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`); + } else { + // The state was deleted + this.log.info(`state ${id} deleted`); + } + } + // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. + // /** + // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... + // * Using this method requires "common.messagebox" property to be set to true in io-package.json + // */ + // + // private onMessage(obj: ioBroker.Message): void { + // if (typeof obj === "object" && obj.message) { + // if (obj.command === "send") { + // // e.g. send email or pushover or whatever + // this.log.info("send command"); + // // Send response in callback if required + // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // } + // } + // } +} +if (require.main !== module) { + // Export the constructor in compact mode + module.exports = (options: Partial | undefined) => new TestAdapter(options); +} else { + // otherwise start the instance directly + (() => new TestAdapter())(); +} diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json b/test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json new file mode 100644 index 000000000..ce6b3d62c --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/.eslintrc.json @@ -0,0 +1,43 @@ +{ + "root": true, + "env": { + "es6": true, + "node": true, + "mocha": true + }, + "extends": [ + "eslint:recommended" + ], + "rules": { + "indent": [ + "error", + "tab", + { + "SwitchCase": 1 + } + ], + "no-console": "off", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true, + "argsIgnorePattern": "^_" + } + ], + "no-var": "error", + "no-trailing-spaces": "error", + "prefer-const": "error", + "quotes": [ + "error", + "double", + { + "avoidEscape": true, + "allowTemplateLiterals": true + } + ], + "semi": [ + "error", + "always" + ] + } +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/integration.js b/test/baselines/adapter_TS_React_OfficialESLint/test/integration.js new file mode 100644 index 000000000..986936fac --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/integration.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options +tests.integration(path.join(__dirname, "..")); \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js b/test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js new file mode 100644 index 000000000..b839790ff --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/mocha.setup.js @@ -0,0 +1,23 @@ +"use strict"; + +// Makes ts-node ignore warnings, so mocha --watch does work +process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; +// Sets the correct tsconfig for testing +process.env.TS_NODE_PROJECT = "tsconfig.json"; +// Make ts-node respect the "include" key in tsconfig.json +process.env.TS_NODE_FILES = "TRUE"; + +// Don't silently swallow unhandled rejections +process.on("unhandledRejection", (e) => { + throw e; +}); + +// enable the should interface with sinon +// and load chai-as-promised and sinon-chai by default +const sinonChai = require("sinon-chai"); +const chaiAsPromised = require("chai-as-promised"); +const { should, use } = require("chai"); + +should(); +use(sinonChai); +use(chaiAsPromised); \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/mocharc.custom.json b/test/baselines/adapter_TS_React_OfficialESLint/test/mocharc.custom.json new file mode 100644 index 000000000..851ed9cdc --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/mocharc.custom.json @@ -0,0 +1,10 @@ +{ + "require": [ + "test/mocha.setup.js", + "ts-node/register", + "source-map-support/register" + ], + "watch-files": [ + "src/**/*.test.ts" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/package.js b/test/baselines/adapter_TS_React_OfficialESLint/test/package.js new file mode 100644 index 000000000..3a48e0449 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/package.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Validate the package files +tests.packageFiles(path.join(__dirname, "..")); diff --git a/test/baselines/adapter_TS_React_OfficialESLint/test/tsconfig.json b/test/baselines/adapter_TS_React_OfficialESLint/test/tsconfig.json new file mode 100644 index 000000000..3ebc81b65 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/test/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false + }, + "include": [ + "./**/*.js" + ] +} diff --git a/test/baselines/adapter_TS_React_OfficialESLint/tsconfig.build.json b/test/baselines/adapter_TS_React_OfficialESLint/tsconfig.build.json new file mode 100644 index 000000000..1f040ce18 --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/tsconfig.build.json @@ -0,0 +1,16 @@ +// Specialized tsconfig to only compile .ts-files in the src dir +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "allowJs": false, + "checkJs": false, + "noEmit": false, + "declaration": false + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/**/*.test.ts" + ] +} diff --git a/test/baselines/adapter_TS_React_OfficialESLint/tsconfig.json b/test/baselines/adapter_TS_React_OfficialESLint/tsconfig.json new file mode 100644 index 000000000..4c80d776d --- /dev/null +++ b/test/baselines/adapter_TS_React_OfficialESLint/tsconfig.json @@ -0,0 +1,46 @@ +// Root tsconfig to set the settings and power editor support for all TS files +{ + // To update the compilation target, install a different version of @tsconfig/node... and reference it here + // https://github.com/tsconfig/bases#node-20-tsconfigjson + "extends": "@tsconfig/node20/tsconfig.json", + "compilerOptions": { + // do not compile anything, this file is just to configure type checking + // the compilation is configured in tsconfig.build.json + "noEmit": true, + + // check JS files, but do not compile them => tsconfig.build.json + "allowJs": true, + "checkJs": true, + + "noEmitOnError": true, + "outDir": "./build/", + "removeComments": false, + + // This is necessary for the automatic typing of the adapter config + "resolveJsonModule": true, + + // If you want to disable the stricter type checks (not recommended), uncomment the following line + // "strict": false, + // And enable some of those features for more fine-grained control + // "strictNullChecks": true, + // "strictPropertyInitialization": true, + // "strictBindCallApply": true, + // "noImplicitAny": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // Uncomment this if you want the old behavior of catch variables being `any` + // "useUnknownInCatchVariables": false, + + "sourceMap": true, + "inlineSourceMap": false + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "build/**", + "node_modules/**", + "widgets/**" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.create-adapter.json b/test/baselines/adapter_TS_VIS_CustomESLint/.create-adapter.json new file mode 100644 index 000000000..42e1f8eb7 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.create-adapter.json @@ -0,0 +1,40 @@ +{ + "cli": true, + "target": "directory", + "adapterName": "test-adapter", + "title": "Is used to test the creator", + "startMode": "daemon", + "features": [ + "adapter", + "vis" + ], + "connectionIndicator": "no", + "connectionType": "local", + "dataSource": "push", + "adminFeatures": [], + "type": "general", + "language": "TypeScript", + "adminUi": "html", + "tabReact": "no", + "releaseScript": "no", + "tools": [ + "ESLint" + ], + "eslintConfig": "custom", + "indentation": "Tab", + "quotes": "double", + "authorName": "Al Calzone", + "authorGithub": "AlCalzone", + "authorEmail": "al@calzo.ne", + "gitRemoteProtocol": "HTTPS", + "dependabot": "yes", + "gitCommit": "no", + "defaultBranch": "main", + "license": "MIT License", + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "widgetIsMainFunction": "main", + "creatorVersion": "2.6.5" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.github/ISSUE_TEMPLATE/bug_report.md b/test/baselines/adapter_TS_VIS_CustomESLint/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..895613958 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Something is not working as it should +title: '' +labels: '' +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '...' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots & Logfiles** +If applicable, add screenshots and logfiles to help explain your problem. + +**Versions:** + - Adapter version: + - JS-Controller version: + - Node version: + - Operating system: + +**Additional context** +Add any other context about the problem here. diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.github/ISSUE_TEMPLATE/config.yml b/test/baselines/adapter_TS_VIS_CustomESLint/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..d7cfe5940 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: ioBroker Community + url: https://forum.iobroker.net/ + about: Please ask and answer questions here. \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.github/auto-merge.yml b/test/baselines/adapter_TS_VIS_CustomESLint/.github/auto-merge.yml new file mode 100644 index 000000000..4f6d185f0 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.github/auto-merge.yml @@ -0,0 +1,17 @@ +# Configure here which dependency updates should be merged automatically. +# The recommended configuration is the following: +- match: + # Only merge patches for production dependencies + dependency_type: production + update_type: "semver:patch" +- match: + # Except for security fixes, here we allow minor patches + dependency_type: production + update_type: "security:minor" +- match: + # and development dependencies can have a minor update, too + dependency_type: development + update_type: "semver:minor" + +# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: +# https://dependabot.com/docs/config-file/#automerged_updates diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.github/dependabot.yml b/test/baselines/adapter_TS_VIS_CustomESLint/.github/dependabot.yml new file mode 100644 index 000000000..4936f4f1c --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone + versioning-strategy: increase + + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.github/workflows/dependabot-auto-merge.yml b/test/baselines/adapter_TS_VIS_CustomESLint/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 000000000..baeae23b5 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,27 @@ +# Automatically merge Dependabot PRs when version comparison is within the range +# that is configured in .github/auto-merge.yml + +name: Auto-Merge Dependabot PRs + +on: + # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action + # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ + pull_request_target: + +jobs: + auto-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check if PR should be auto-merged + uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + # In order to use this, you need to go to https://github.com/settings/tokens and + # create a Personal Access Token with the permission "public_repo". + # Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN + github-token: ${{ secrets.AUTO_MERGE_TOKEN }} + # By default, squash and merge, so Github chooses nice commit messages + command: squash and merge diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.github/workflows/test-and-release.yml b/test/baselines/adapter_TS_VIS_CustomESLint/.github/workflows/test-and-release.yml new file mode 100644 index 000000000..0c48ade1a --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.github/workflows/test-and-release.yml @@ -0,0 +1,96 @@ +name: Test and Release + +# Run this job on all pushes and pull requests +# as well as tags with a semantic version +on: + push: + branches: + - "main" + tags: + # normal versions + - "v[0-9]+.[0-9]+.[0-9]+" + # pre-releases + - "v[0-9]+.[0-9]+.[0-9]+-**" + pull_request: {} + +# Cancel previous PR/branch runs when a new commit is pushed +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + # Performs quick checks before the expensive test runs + check-and-lint: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ubuntu-latest + + steps: + - uses: ioBroker/testing-action-check@v1 + with: + node-version: '20.x' + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + type-checking: true + lint: true + + # Runs adapter tests on all supported node versions and OSes + adapter-tests: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [20.x, 22.x, 24.x] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: ioBroker/testing-action-adapter@v1 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + build: true + +# TODO: To enable automatic npm releases, create a token on npmjs.org +# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options +# Then uncomment the following block: + +# # Deploys the final package to NPM +# deploy: +# needs: [check-and-lint, adapter-tests] +# +# # Trigger this step only when a commit on any branch is tagged with a version number +# if: | +# contains(github.event.head_commit.message, '[skip ci]') == false && +# github.event_name == 'push' && +# startsWith(github.ref, 'refs/tags/v') +# +# runs-on: ubuntu-latest +# +# # Write permissions are required to create Github releases +# permissions: +# contents: write +# +# steps: +# - uses: ioBroker/testing-action-deploy@v1 +# with: +# node-version: '20.x' +# # Uncomment the following line if your adapter cannot be installed using 'npm ci' +# # install-command: 'npm install' +# build: true +# npm-token: ${{ secrets.NPM_TOKEN }} +# github-token: ${{ secrets.GITHUB_TOKEN }} +# +# # When using Sentry for error reporting, Sentry can be informed about new releases +# # To enable create a API-Token in Sentry (User settings, API keys) +# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options +# # Then uncomment and customize the following block: +# sentry: true +# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }} +# sentry-project: "iobroker-test-adapter" +# sentry-version-prefix: "iobroker.test-adapter" +# sentry-sourcemap-paths: "build/" +# # If your sentry project is linked to a GitHub repository, you can enable the following option +# # sentry-github-integration: true diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.gitignore b/test/baselines/adapter_TS_VIS_CustomESLint/.gitignore new file mode 100644 index 000000000..80c28aa9d --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.gitignore @@ -0,0 +1,18 @@ +# No dot-directories except github/vscode +.*/ +!.vscode/ +!.github/ + +*.code-workspace +node_modules +nbproject + +# npm package files +iobroker.*.tgz + +Thumbs.db +.commitinfo + +# i18n intermediate files +admin/i18n/flat.txt +admin/i18n/*/flat.txt \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.vscode/extensions.json b/test/baselines/adapter_TS_VIS_CustomESLint/.vscode/extensions.json new file mode 100644 index 000000000..a8d778499 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/.vscode/settings.json b/test/baselines/adapter_TS_VIS_CustomESLint/.vscode/settings.json new file mode 100644 index 000000000..854736cc0 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "eslint.enable": true, + "json.schemas": [ + { + "fileMatch": [ + "io-package.json" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" + }, + { + "fileMatch": [ + "admin/jsonConfig.json", + "admin/jsonConfig.json5", + "admin/jsonCustom.json", + "admin/jsonCustom.json5", + "admin/jsonTab.json", + "admin/jsonTab.json5" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" + } + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/LICENSE b/test/baselines/adapter_TS_VIS_CustomESLint/LICENSE new file mode 100644 index 000000000..27c9a624d --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/README.md b/test/baselines/adapter_TS_VIS_CustomESLint/README.md new file mode 100644 index 000000000..f57bba69c --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/README.md @@ -0,0 +1,132 @@ +![Logo](admin/test-adapter.png) +# ioBroker.test-adapter + +[![NPM version](https://img.shields.io/npm/v/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +[![Downloads](https://img.shields.io/npm/dm/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +![Number of Installations](https://iobroker.live/badges/test-adapter-installed.svg) +![Current version in stable repository](https://iobroker.live/badges/test-adapter-stable.svg) + +[![NPM](https://nodei.co/npm/iobroker.test-adapter.png?downloads=true)](https://nodei.co/npm/iobroker.test-adapter/) + +**Tests:** ![Test and Release](https://github.com/AlCalzone/ioBroker.test-adapter/workflows/Test%20and%20Release/badge.svg) + +## test-adapter adapter for ioBroker + +Describe your project here + +## Developer manual +This section is intended for the developer. It can be deleted later. + +### DISCLAIMER + +Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README. +You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you. + +### Getting started + +You are almost done, only a few steps left: +1. Create a new repository on GitHub with the name `ioBroker.test-adapter` +1. Initialize the current folder as a new git repository: + ```bash + git init -b main + git add . + git commit -m "Initial commit" + ``` +1. Link your local repository with the one on GitHub: + ```bash + git remote add origin https://github.com/AlCalzone/ioBroker.test-adapter + ``` + +1. Push all files to the GitHub repo: + ```bash + git push origin main + ``` +1. Add a new secret under https://github.com/AlCalzone/ioBroker.test-adapter/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. + +1. Head over to [src/main.ts](src/main.ts) and start programming! + +### Best Practices +We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should +check them out. If you're already experienced, you should also take a look at them - you might learn something new :) + +### Scripts in `package.json` +Several npm scripts are predefined for your convenience. You can run them using `npm run ` +| Script name | Description | +|-------------|-------------| +| `build` | Compile the TypeScript sources. | +| `watch` | Compile the TypeScript sources and watch for changes. | +| `test:ts` | Executes the tests you defined in `*.test.ts` files. | +| `test:package` | Ensures your `package.json` and `io-package.json` are valid. | +| `test:integration` | Tests the adapter startup with an actual instance of ioBroker. | +| `test` | Performs a minimal test run on package files and your tests. | +| `check` | Performs a type-check on your code (without compiling anything). | +| `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. | +| `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. | + +### Configuring the compilation +The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings +either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the +[`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files). + +### Writing tests +When done right, testing code is invaluable, because it gives you the +confidence to change your code while knowing exactly if and when +something breaks. A good read on the topic of test-driven development +is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92. +Although writing tests before the code might seem strange at first, but it has very +clear upsides. + +The template provides you with basic tests for the adapter startup and package files. +It is recommended that you add your own tests into the mix. + +### Publishing the adapter +Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form +`v..`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`. + +To get your adapter released in ioBroker, please refer to the documentation +of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). + +### Test the adapter manually on a local ioBroker installation +In order to install the adapter locally without publishing, the following steps are recommended: +1. Create a tarball from your dev directory: + ```bash + npm pack + ``` +1. Upload the resulting file to your ioBroker host +1. Install it locally (The paths are different on Windows): + ```bash + cd /opt/iobroker + npm i /path/to/tarball.tgz + ``` + +For later updates, the above procedure is not necessary. Just do the following: +1. Overwrite the changed files in the adapter directory (`/opt/iobroker/node_modules/iobroker.test-adapter`) +1. Execute `iobroker upload test-adapter` on the ioBroker host + +## Changelog + +### 0.0.1 +* (Al Calzone) initial release + +## License +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/__meta__/npm_package_files.txt b/test/baselines/adapter_TS_VIS_CustomESLint/__meta__/npm_package_files.txt new file mode 100644 index 000000000..98f028fe2 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/__meta__/npm_package_files.txt @@ -0,0 +1,11 @@ +admin/index_m.html +admin/style.css +admin/test-adapter.png +admin/words.js +widgets/test-adapter.html +widgets/test-adapter/css/style.css +widgets/test-adapter/js/test-adapter.js +io-package.json +LICENSE +package.json +README.md \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/admin/admin.d.ts b/test/baselines/adapter_TS_VIS_CustomESLint/admin/admin.d.ts new file mode 100644 index 000000000..7594b9e3a --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/admin/admin.d.ts @@ -0,0 +1,65 @@ +declare let systemDictionary: Record>; + +declare let load: (settings: Record, onChange: (hasChanges: boolean) => void) => void; +declare let save: (callback: (settings: Record) => void) => void; + +// make load and save exist on the window object +interface Window { + load: typeof load; + save: typeof save; +} + +declare const instance: number; +declare const adapter: string; +/** + * Translates text + * + * @param text + * @param arg1 + * @param arg2 + * @param arg3 + */ +declare function _(text: string, arg1?: string, arg2?: string, arg3?: string): string; +declare const socket: ioBrokerSocket; +declare function sendTo( + instance: any, + command: string, + message: any, + callback: (result: SendToResult) => void | Promise, +): void; + +interface SendToResult { + error?: string | Error; + result?: any; +} + +// tslint:disable-next-line:class-name +interface ioBrokerSocket { + emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + + emit( + event: "getObjectView", + view: "system", + type: "device", + options: ioBroker.GetObjectViewParams, + callback: (err: string | undefined, result?: any) => void | Promise, + ): void; + emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; + emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; + emit( + event: "setState", + id: string, + state: unknown, + callback: (err: string | undefined, result?: any) => void, + ): void; + + on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + + // TODO: other events +} diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/admin/index_m.html b/test/baselines/adapter_TS_VIS_CustomESLint/admin/index_m.html new file mode 100644 index 000000000..f11dc3c14 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/admin/index_m.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ + + + +
+
+ + +
+ +
+ + +
+
+ +
+ + + + \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/admin/style.css b/test/baselines/adapter_TS_VIS_CustomESLint/admin/style.css new file mode 100644 index 000000000..57d4549ee --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/admin/style.css @@ -0,0 +1,32 @@ +/* You can delete those if you want. I just found them very helpful */ +* { + box-sizing: border-box +} +.m { + /* Don't cut off dropdowns! */ + overflow: initial; +} +.m.adapter-container, +.m.adapter-container > div.App { + /* Fix layout/scrolling issues with tabs */ + height: 100%; + width: 100%; + position: relative; +} +.m .select-wrapper + label { + /* The positioning for dropdown labels is messed up */ + transform: none !important; +} + +label > i[title] { + /* Display the help cursor for the tooltip icons and fix their positioning */ + cursor: help; + margin-left: 0.25em; +} + +.dropdown-content { + /* Don't wrap text in dropdowns */ + white-space: nowrap; +} + +/* Add your styles here */ diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/admin/test-adapter.png b/test/baselines/adapter_TS_VIS_CustomESLint/admin/test-adapter.png new file mode 100644 index 000000000..094ebd97c Binary files /dev/null and b/test/baselines/adapter_TS_VIS_CustomESLint/admin/test-adapter.png differ diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/admin/tsconfig.json b/test/baselines/adapter_TS_VIS_CustomESLint/admin/tsconfig.json new file mode 100644 index 000000000..49fb013d2 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/admin/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "include": [ + "./admin.d.ts", + "./**/*.js", + // Include the adapter-config definition if it exists. + // It should be at either on of these paths: + "../lib/adapter-config.d.ts", // JS + "../src/lib/adapter-config.d.ts", // TS + ] +} diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/admin/words.js b/test/baselines/adapter_TS_VIS_CustomESLint/admin/words.js new file mode 100644 index 000000000..0cc646034 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/admin/words.js @@ -0,0 +1,124 @@ +/* eslint no-unused-vars: off */ +/* eslint no-global-assign: off */ +/* global systemDictionary */ +"use strict"; + +systemDictionary = { + "test-adapter adapter settings": { + "en": "Adapter settings for test-adapter", + "de": "Adaptereinstellungen für test-adapter", + "ru": "Настройки адаптера для test-adapter", + "pt": "Configurações do adaptador para test-adapter", + "nl": "Adapterinstellingen voor test-adapter", + "fr": "Paramètres d'adaptateur pour test-adapter", + "it": "Impostazioni dell'adattatore per test-adapter", + "es": "Ajustes del adaptador para test-adapter", + "pl": "Ustawienia adaptera dla test-adapter", + "uk": "Налаштування адаптера для test-adapter", + "zh-cn": "test-adapter的适配器设置" + }, + "option1": { + "en": "option1", + "de": "Mock translation of 'option1' to 'de'", + "ru": "Mock translation of 'option1' to 'ru'", + "pt": "Mock translation of 'option1' to 'pt'", + "nl": "Mock translation of 'option1' to 'nl'", + "fr": "Mock translation of 'option1' to 'fr'", + "it": "Mock translation of 'option1' to 'it'", + "es": "Mock translation of 'option1' to 'es'", + "pl": "Mock translation of 'option1' to 'pl'", + "uk": "Mock translation of 'option1' to 'uk'", + "zh-cn": "Mock translation of 'option1' to 'zh-cn'" + }, + "option2": { + "en": "option2", + "de": "Mock translation of 'option2' to 'de'", + "ru": "Mock translation of 'option2' to 'ru'", + "pt": "Mock translation of 'option2' to 'pt'", + "nl": "Mock translation of 'option2' to 'nl'", + "fr": "Mock translation of 'option2' to 'fr'", + "it": "Mock translation of 'option2' to 'it'", + "es": "Mock translation of 'option2' to 'es'", + "pl": "Mock translation of 'option2' to 'pl'", + "uk": "Mock translation of 'option2' to 'uk'", + "zh-cn": "Mock translation of 'option2' to 'zh-cn'" + }, + "myColor": { + "en": "myColor", + "de": "meineColor", + "ru": "Мой цвет", + "pt": "minhaCor", + "nl": "mijnKleur", + "fr": "maCouleur", + "it": "mioColore", + "es": "miColor", + "pl": "mójKolor", + "uk": "мійКолір", + "zh-cn": "我的颜色" + }, + "myColor_tooltip": { + "en": "Description of\nmyColor", + "de": "Beschreibung von\nmyColor", + "ru": "Описание\nmyColor", + "pt": "Descrição de\nmyColor", + "nl": "Beschrijving van\nmyColor", + "fr": "Description de\nmyColor", + "it": "Descrizione di\nmyColor", + "es": "Descripción de\nmyColor", + "pl": "Opis\nmyColor", + "uk": "Опис\nmyColor", + "zh-cn": "\nmyColor的描述" + }, + "htmlText": { + "en": "htmlText", + "de": "htmlText", + "ru": "htmlText", + "pt": "htmlText", + "nl": "htmlText", + "fr": "htmlText", + "it": "htmlText", + "es": "htmlText", + "pl": "htmlText", + "uk": "htmlText", + "zh-cn": "htmlText" + }, + "group_extraMyset": { + "en": "extraMyset", + "de": "extraMyset", + "ru": "extraMyset", + "pt": "extraMyset", + "nl": "extraMyset", + "fr": "extraMyset", + "it": "extraMyset", + "es": "extraMyset", + "pl": "extraMyset", + "uk": "extraMyset", + "zh-cn": "extraMyset" + }, + "extraAttr": { + "en": "extraAttr", + "de": "extraAttr", + "ru": "extraAttr", + "pt": "extraAttr", + "nl": "extraAttr", + "fr": "extraAttr", + "it": "extraAttr", + "es": "extraAttr", + "pl": "extraAttr", + "uk": "extraAttr", + "zh-cn": "extraAttr" + }, + "Instance": { + "en": "Instance", + "de": "Instanz", + "ru": "Инстанция", + "pt": "Instância", + "nl": "Instantie", + "fr": "Instance", + "it": "Esempio", + "es": "Instancia", + "pl": "Instancja", + "uk": "Інстанція", + "zh-cn": "例" + } +}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/eslint.config.mjs b/test/baselines/adapter_TS_VIS_CustomESLint/eslint.config.mjs new file mode 100644 index 000000000..ae15a7ffc --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/eslint.config.mjs @@ -0,0 +1,108 @@ +import js from '@eslint/js'; +import tseslint from '@typescript-eslint/eslint-plugin'; +import tsparser from '@typescript-eslint/parser'; + +export default [ + js.configs.recommended, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parser: tsparser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: './tsconfig.json', + }, + globals: { + 'process': 'readonly', + 'Buffer': 'readonly', + '__dirname': 'readonly', + '__filename': 'readonly', + 'module': 'readonly', + 'require': 'readonly', + 'exports': 'readonly', + 'global': 'readonly', + 'console': 'readonly', + 'setTimeout': 'readonly', + 'setInterval': 'readonly', + 'clearTimeout': 'readonly', + 'clearInterval': 'readonly', + 'document': 'readonly', + 'window': 'readonly', + 'describe': 'readonly', + 'it': 'readonly', + 'ioBroker': 'readonly', + 'AdminWord': 'readonly', + }, + }, + plugins: { + '@typescript-eslint': tseslint, + }, + rules: { + ...tseslint.configs.recommended.rules, + 'indent': [ + 'error', + 'tab', + { + 'SwitchCase': 1 + } + ], + 'quotes': [ + 'error', + 'double' + ], + // Strict rules to match official @iobroker/eslint-config + 'prefer-template': 'error', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + 'ignoreRestSiblings': true, + 'argsIgnorePattern': '^_', + 'varsIgnorePattern': '^_' + } + ], + }, + }, + { + files: ['widgets/**/*.js'], + languageOptions: { + ecmaVersion: 5, + sourceType: 'script', + globals: { + 'console': 'readonly', + 'setTimeout': 'readonly', + }, + }, + rules: { + // Visualizations may run in very old browsers + 'no-var': 'off', + 'prefer-const': 'off', + 'prefer-arrow-callback': 'off', + // The example code does not use some parameters + 'no-unused-vars': [ + 'warn', + { + 'ignoreRestSiblings': true, + 'argsIgnorePattern': '^_', + 'varsIgnorePattern': '^_' + } + ] + } + }, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build/', + 'dist/', + 'admin/build/', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + ], + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/io-package.json b/test/baselines/adapter_TS_VIS_CustomESLint/io-package.json new file mode 100644 index 000000000..cd2246e68 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/io-package.json @@ -0,0 +1,95 @@ +{ + "common": { + "name": "test-adapter", + "version": "0.0.1", + "news": { + "0.0.1": { + "en": "initial release", + "de": "Erstveröffentlichung", + "ru": "Начальная версия", + "pt": "lançamento inicial", + "nl": "Eerste uitgave", + "fr": "Première version", + "it": "Versione iniziale", + "es": "Versión inicial", + "pl": "Pierwsze wydanie", + "uk": "Початкова версія", + "zh-cn": "首次出版" + } + }, + "titleLang": { + "en": "Is used to test the creator", + "de": "Mock translation of 'Is used to test the creator' to 'de'", + "ru": "Mock translation of 'Is used to test the creator' to 'ru'", + "pt": "Mock translation of 'Is used to test the creator' to 'pt'", + "nl": "Mock translation of 'Is used to test the creator' to 'nl'", + "fr": "Mock translation of 'Is used to test the creator' to 'fr'", + "it": "Mock translation of 'Is used to test the creator' to 'it'", + "es": "Mock translation of 'Is used to test the creator' to 'es'", + "pl": "Mock translation of 'Is used to test the creator' to 'pl'", + "uk": "Mock translation of 'Is used to test the creator' to 'uk'", + "zh-cn": "Mock translation of 'Is used to test the creator' to 'zh-cn'" + }, + "desc": { + "en": "test-adapter", + "de": "Mock translation of 'test-adapter' to 'de'", + "ru": "Mock translation of 'test-adapter' to 'ru'", + "pt": "Mock translation of 'test-adapter' to 'pt'", + "nl": "Mock translation of 'test-adapter' to 'nl'", + "fr": "Mock translation of 'test-adapter' to 'fr'", + "it": "Mock translation of 'test-adapter' to 'it'", + "es": "Mock translation of 'test-adapter' to 'es'", + "pl": "Mock translation of 'test-adapter' to 'pl'", + "uk": "Mock translation of 'test-adapter' to 'uk'", + "zh-cn": "Mock translation of 'test-adapter' to 'zh-cn'" + }, + "authors": [ + "Al Calzone " + ], + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "platform": "Javascript/Node.js", + "icon": "test-adapter.png", + "enabled": true, + "extIcon": "https://raw.githubusercontent.com/AlCalzone/ioBroker.test-adapter/main/admin/test-adapter.png", + "readme": "https://github.com/AlCalzone/ioBroker.test-adapter/blob/main/README.md", + "loglevel": "info", + "tier": 3, + "restartAdapters": [ + "vis" + ], + "mode": "daemon", + "type": "general", + "compact": true, + "connectionType": "local", + "dataSource": "push", + "adminUI": { + "config": "materialize" + }, + "dependencies": [ + { + "js-controller": ">=6.0.11" + }, + "vis" + ], + "globalDependencies": [ + { + "admin": ">=7.0.23" + } + ] + }, + "native": { + "option1": true, + "option2": "42" + }, + "objects": [], + "instanceObjects": [] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/package.json b/test/baselines/adapter_TS_VIS_CustomESLint/package.json new file mode 100644 index 000000000..e3e52ccf3 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/package.json @@ -0,0 +1,72 @@ +{ + "name": "iobroker.test-adapter", + "version": "0.0.1", + "description": "test-adapter", + "author": { + "name": "Al Calzone", + "email": "al@calzo.ne" + }, + "contributors": [], + "homepage": "https://github.com/AlCalzone/ioBroker.test-adapter", + "license": "MIT", + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "repository": { + "type": "git", + "url": "https://github.com/AlCalzone/ioBroker.test-adapter.git" + }, + "engines": { + "node": ">= 20" + }, + "dependencies": { + "@iobroker/adapter-core": "^3.3.2" + }, + "devDependencies": { + "@eslint/js": "^9.37.0", + "@iobroker/adapter-dev": "^1.5.0", + "@iobroker/testing": "^5.1.1", + "@tsconfig/node20": "^20.1.6", + "@types/node": "^20.19.21", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", + "rimraf": "^6.0.1", + "source-map-support": "^0.5.21", + "ts-node": "^10.9.2", + "typescript": "~5.9.3" + }, + "main": "build/main.js", + "files": [ + "admin{,/!(src)/**}/!(tsconfig|tsconfig.*|.eslintrc).{json,json5}", + "admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}", + "build/", + "widgets/**/!(tsconfig|tsconfig.*|.eslintrc).json", + "widgets/**/*.{html,css,png,svg,jpg,js}", + "www/", + "io-package.json", + "LICENSE" + ], + "scripts": { + "prebuild": "rimraf build", + "build": "build-adapter ts", + "watch": "build-adapter ts --watch", + "prebuild:ts": "rimraf build", + "build:ts": "build-adapter ts", + "watch:ts": "build-adapter ts --watch", + "test:ts": "mocha --config test/mocharc.custom.json src/**/*.test.ts", + "test:package": "mocha test/package --exit", + "test:integration": "mocha test/integration --exit", + "test": "npm run test:ts && npm run test:package", + "check": "tsc --noEmit", + "lint": "eslint -c eslint.config.mjs .", + "translate": "translate-adapter" + }, + "bugs": { + "url": "https://github.com/AlCalzone/ioBroker.test-adapter/issues" + }, + "readmeFilename": "README.md" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/src/lib/adapter-config.d.ts b/test/baselines/adapter_TS_VIS_CustomESLint/src/lib/adapter-config.d.ts new file mode 100644 index 000000000..c6c8a0e2a --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/src/lib/adapter-config.d.ts @@ -0,0 +1,14 @@ +// This file extends the AdapterConfig type from "@types/iobroker" + +// Augment the globally declared type ioBroker.AdapterConfig +declare global { + namespace ioBroker { + interface AdapterConfig { + option1: boolean; + option2: string; + } + } +} + +// this is required so the above AdapterConfig is found by TypeScript / type checking +export {}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/src/main.test.ts b/test/baselines/adapter_TS_VIS_CustomESLint/src/main.test.ts new file mode 100644 index 000000000..0992583bc --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/src/main.test.ts @@ -0,0 +1,24 @@ +/** + * This is a dummy TypeScript test file using chai and mocha + * + * It's automatically excluded from npm and its build output is excluded from both git and npm. + * It is advised to test all your modules with accompanying *.test.ts-files + */ + +import { expect } from "chai"; +// import { functionToTest } from "./moduleToTest"; + +describe("module to test => function to test", () => { + // initializing logic + const expected = 5; + + it(`should return ${expected}`, () => { + const result = 5; + // assign result a value from functionToTest + expect(result).to.equal(expected); + // or using the should() syntax + result.should.equal(expected); + }); + // ... more tests => it +}); +// ... more test suites => describe diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/src/main.ts b/test/baselines/adapter_TS_VIS_CustomESLint/src/main.ts new file mode 100644 index 000000000..c5c122375 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/src/main.ts @@ -0,0 +1,155 @@ +/* + * Created with @iobroker/create-adapter v2.6.5 + */ + +// The adapter-core module gives you access to the core ioBroker functions +// you need to create an adapter +import * as utils from "@iobroker/adapter-core"; + +// Load your modules here, e.g.: +// import * as fs from "fs"; + +class TestAdapter extends utils.Adapter { + public constructor(options: Partial = {}) { + super({ + ...options, + name: "test-adapter", + }); + this.on("ready", this.onReady.bind(this)); + this.on("stateChange", this.onStateChange.bind(this)); + // this.on("objectChange", this.onObjectChange.bind(this)); + // this.on("message", this.onMessage.bind(this)); + this.on("unload", this.onUnload.bind(this)); + } + + /** + * Is called when databases are connected and adapter received configuration. + */ + private async onReady(): Promise { + // Initialize your adapter here + + // The adapters config (in the instance object everything under the attribute "native") is accessible via + // this.config: + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); + + /* + For every state in the system there has to be also an object of type state + Here a simple template for a boolean variable named "testVariable" + Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables + */ + await this.setObjectNotExistsAsync("testVariable", { + type: "state", + common: { + name: "testVariable", + type: "boolean", + role: "indicator", + read: true, + write: true, + }, + native: {}, + }); + + // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. + this.subscribeStates("testVariable"); + // You can also add a subscription for multiple states. The following line watches all states starting with "lights." + // this.subscribeStates("lights.*"); + // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: + // this.subscribeStates("*"); + + /* + setState examples + you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) + */ + // the variable testVariable is set to true as command (ack=false) + await this.setState("testVariable", true); + + // same thing, but the value is flagged "ack" + // ack should be always set to true if the value is received from or acknowledged from the target system + await this.setState("testVariable", { val: true, ack: true }); + + // same thing, but the state is deleted after 30s (getState will return null afterwards) + await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + + // examples for the checkPassword/checkGroup functions + const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); + + const groupResult = await this.checkGroupAsync("admin", "admin"); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); + } + + /** + * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function + */ + private onUnload(callback: () => void): void { + try { + // Here you must clear all timeouts or intervals that may still be active + // clearTimeout(timeout1); + // clearTimeout(timeout2); + // ... + // clearInterval(interval1); + + callback(); + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); + callback(); + } + } + + // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. + // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. + // /** + // * Is called if a subscribed object changes + // */ + // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void { + // if (obj) { + // // The object was changed + // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); + // } else { + // // The object was deleted + // this.log.info(`object ${id} deleted`); + // } + // } + + /** + * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object + */ + private onStateChange(id: string, state: ioBroker.State | null | undefined): void { + if (state) { + // The state was changed + this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`); + } else { + // The state was deleted + this.log.info(`state ${id} deleted`); + } + } + // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. + // /** + // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... + // * Using this method requires "common.messagebox" property to be set to true in io-package.json + // */ + // + // private onMessage(obj: ioBroker.Message): void { + // if (typeof obj === "object" && obj.message) { + // if (obj.command === "send") { + // // e.g. send email or pushover or whatever + // this.log.info("send command"); + // // Send response in callback if required + // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // } + // } + // } +} +if (require.main !== module) { + // Export the constructor in compact mode + module.exports = (options: Partial | undefined) => new TestAdapter(options); +} else { + // otherwise start the instance directly + (() => new TestAdapter())(); +} diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/test/.eslintrc.json b/test/baselines/adapter_TS_VIS_CustomESLint/test/.eslintrc.json new file mode 100644 index 000000000..ce6b3d62c --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/test/.eslintrc.json @@ -0,0 +1,43 @@ +{ + "root": true, + "env": { + "es6": true, + "node": true, + "mocha": true + }, + "extends": [ + "eslint:recommended" + ], + "rules": { + "indent": [ + "error", + "tab", + { + "SwitchCase": 1 + } + ], + "no-console": "off", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true, + "argsIgnorePattern": "^_" + } + ], + "no-var": "error", + "no-trailing-spaces": "error", + "prefer-const": "error", + "quotes": [ + "error", + "double", + { + "avoidEscape": true, + "allowTemplateLiterals": true + } + ], + "semi": [ + "error", + "always" + ] + } +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/test/integration.js b/test/baselines/adapter_TS_VIS_CustomESLint/test/integration.js new file mode 100644 index 000000000..986936fac --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/test/integration.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options +tests.integration(path.join(__dirname, "..")); \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/test/mocha.setup.js b/test/baselines/adapter_TS_VIS_CustomESLint/test/mocha.setup.js new file mode 100644 index 000000000..b839790ff --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/test/mocha.setup.js @@ -0,0 +1,23 @@ +"use strict"; + +// Makes ts-node ignore warnings, so mocha --watch does work +process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; +// Sets the correct tsconfig for testing +process.env.TS_NODE_PROJECT = "tsconfig.json"; +// Make ts-node respect the "include" key in tsconfig.json +process.env.TS_NODE_FILES = "TRUE"; + +// Don't silently swallow unhandled rejections +process.on("unhandledRejection", (e) => { + throw e; +}); + +// enable the should interface with sinon +// and load chai-as-promised and sinon-chai by default +const sinonChai = require("sinon-chai"); +const chaiAsPromised = require("chai-as-promised"); +const { should, use } = require("chai"); + +should(); +use(sinonChai); +use(chaiAsPromised); \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/test/mocharc.custom.json b/test/baselines/adapter_TS_VIS_CustomESLint/test/mocharc.custom.json new file mode 100644 index 000000000..851ed9cdc --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/test/mocharc.custom.json @@ -0,0 +1,10 @@ +{ + "require": [ + "test/mocha.setup.js", + "ts-node/register", + "source-map-support/register" + ], + "watch-files": [ + "src/**/*.test.ts" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/test/package.js b/test/baselines/adapter_TS_VIS_CustomESLint/test/package.js new file mode 100644 index 000000000..3a48e0449 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/test/package.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Validate the package files +tests.packageFiles(path.join(__dirname, "..")); diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/test/tsconfig.json b/test/baselines/adapter_TS_VIS_CustomESLint/test/tsconfig.json new file mode 100644 index 000000000..3ebc81b65 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/test/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false + }, + "include": [ + "./**/*.js" + ] +} diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/tsconfig.build.json b/test/baselines/adapter_TS_VIS_CustomESLint/tsconfig.build.json new file mode 100644 index 000000000..1f040ce18 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/tsconfig.build.json @@ -0,0 +1,16 @@ +// Specialized tsconfig to only compile .ts-files in the src dir +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "allowJs": false, + "checkJs": false, + "noEmit": false, + "declaration": false + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/**/*.test.ts" + ] +} diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/tsconfig.json b/test/baselines/adapter_TS_VIS_CustomESLint/tsconfig.json new file mode 100644 index 000000000..4c80d776d --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/tsconfig.json @@ -0,0 +1,46 @@ +// Root tsconfig to set the settings and power editor support for all TS files +{ + // To update the compilation target, install a different version of @tsconfig/node... and reference it here + // https://github.com/tsconfig/bases#node-20-tsconfigjson + "extends": "@tsconfig/node20/tsconfig.json", + "compilerOptions": { + // do not compile anything, this file is just to configure type checking + // the compilation is configured in tsconfig.build.json + "noEmit": true, + + // check JS files, but do not compile them => tsconfig.build.json + "allowJs": true, + "checkJs": true, + + "noEmitOnError": true, + "outDir": "./build/", + "removeComments": false, + + // This is necessary for the automatic typing of the adapter config + "resolveJsonModule": true, + + // If you want to disable the stricter type checks (not recommended), uncomment the following line + // "strict": false, + // And enable some of those features for more fine-grained control + // "strictNullChecks": true, + // "strictPropertyInitialization": true, + // "strictBindCallApply": true, + // "noImplicitAny": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // Uncomment this if you want the old behavior of catch variables being `any` + // "useUnknownInCatchVariables": false, + + "sourceMap": true, + "inlineSourceMap": false + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "build/**", + "node_modules/**", + "widgets/**" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter.html b/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter.html new file mode 100644 index 000000000..b5f9aaede --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter.html @@ -0,0 +1,135 @@ + + + + + + + + + + \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter/css/style.css b/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter/css/style.css new file mode 100644 index 000000000..5ea1abc76 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter/css/style.css @@ -0,0 +1,4 @@ +/* Style your widget here */ +.test-adapter-class { + font-style: italic; +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter/js/test-adapter.js b/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter/js/test-adapter.js new file mode 100644 index 000000000..a7f6b07d0 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_CustomESLint/widgets/test-adapter/js/test-adapter.js @@ -0,0 +1,76 @@ +/* + ioBroker.vis test-adapter Widget-Set + + version: "0.0.1" + + Copyright 2025 Al Calzone al@calzo.ne +*/ +"use strict"; + +/* global $, vis, systemDictionary */ + +// add translations for edit mode +$.extend( + true, + systemDictionary, + { + // Add your translations here, e.g.: + // "size": { + // "en": "Size", + // "de": "Größe", + // "ru": "Размер", + // "pt": "Tamanho", + // "nl": "Grootte", + // "fr": "Taille", + // "it": "Dimensione", + // "es": "Talla", + // "pl": "Rozmiar", + // "uk": "Розмір" + // "zh-cn": "尺寸" + // } + } +); + +// this code can be placed directly in test-adapter.html +vis.binds["test-adapter"] = { + version: "0.0.1", + showVersion: function () { + if (vis.binds["test-adapter"].version) { + console.log("Version test-adapter: " + vis.binds["test-adapter"].version); + vis.binds["test-adapter"].version = null; + } + }, + createWidget: function (widgetID, view, data, style) { + var $div = $("#" + widgetID); + // if nothing found => wait + if (!$div.length) { + return setTimeout(function () { + vis.binds["test-adapter"].createWidget(widgetID, view, data, style); + }, 100); + } + + var text = ""; + text += "OID: " + data.oid + "

"; + text += 'OID value: ' + vis.states[data.oid + ".val"] + "
"; + text += 'Color: ' + data.myColor + "
"; + text += "extraAttr: " + data.extraAttr + "
"; + text += "Browser instance: " + vis.instance + "
"; + text += 'htmlText:
"; + + $("#" + widgetID).html(text); + + // subscribe on updates of value + function onChange(e, newVal, _oldVal) { + $div.find(".template-value").html(newVal); + } + if (data.oid) { + vis.states.bind(data.oid + ".val", onChange); + //remember bound state that vis can release if didnt needed + $div.data("bound", [data.oid + ".val"]); + //remember onchange handler to release bound states + $div.data("bindHandler", onChange); + } + } +}; + +vis.binds["test-adapter"].showVersion(); \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.create-adapter.json b/test/baselines/adapter_TS_VIS_OfficialESLint/.create-adapter.json new file mode 100644 index 000000000..6cc3dd75b --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.create-adapter.json @@ -0,0 +1,40 @@ +{ + "cli": true, + "target": "directory", + "adapterName": "test-adapter", + "title": "Is used to test the creator", + "startMode": "daemon", + "features": [ + "adapter", + "vis" + ], + "connectionIndicator": "no", + "connectionType": "local", + "dataSource": "push", + "adminFeatures": [], + "type": "general", + "language": "TypeScript", + "adminUi": "html", + "tabReact": "no", + "releaseScript": "no", + "tools": [ + "ESLint" + ], + "eslintConfig": "official", + "indentation": "Tab", + "quotes": "double", + "authorName": "Al Calzone", + "authorGithub": "AlCalzone", + "authorEmail": "al@calzo.ne", + "gitRemoteProtocol": "HTTPS", + "dependabot": "yes", + "gitCommit": "no", + "defaultBranch": "main", + "license": "MIT License", + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "widgetIsMainFunction": "main", + "creatorVersion": "2.6.5" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..895613958 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Something is not working as it should +title: '' +labels: '' +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '...' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots & Logfiles** +If applicable, add screenshots and logfiles to help explain your problem. + +**Versions:** + - Adapter version: + - JS-Controller version: + - Node version: + - Operating system: + +**Additional context** +Add any other context about the problem here. diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..d7cfe5940 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: ioBroker Community + url: https://forum.iobroker.net/ + about: Please ask and answer questions here. \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.github/auto-merge.yml b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/auto-merge.yml new file mode 100644 index 000000000..4f6d185f0 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/auto-merge.yml @@ -0,0 +1,17 @@ +# Configure here which dependency updates should be merged automatically. +# The recommended configuration is the following: +- match: + # Only merge patches for production dependencies + dependency_type: production + update_type: "semver:patch" +- match: + # Except for security fixes, here we allow minor patches + dependency_type: production + update_type: "security:minor" +- match: + # and development dependencies can have a minor update, too + dependency_type: development + update_type: "semver:minor" + +# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: +# https://dependabot.com/docs/config-file/#automerged_updates diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.github/dependabot.yml b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/dependabot.yml new file mode 100644 index 000000000..4936f4f1c --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone + versioning-strategy: increase + + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: monthly + day: 8 + time: "00:05" + timezone: Europe/Berlin + open-pull-requests-limit: 5 + assignees: + - AlCalzone diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 000000000..baeae23b5 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,27 @@ +# Automatically merge Dependabot PRs when version comparison is within the range +# that is configured in .github/auto-merge.yml + +name: Auto-Merge Dependabot PRs + +on: + # WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action + # details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/ + pull_request_target: + +jobs: + auto-merge: + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check if PR should be auto-merged + uses: ahmadnassri/action-dependabot-auto-merge@v2 + with: + # In order to use this, you need to go to https://github.com/settings/tokens and + # create a Personal Access Token with the permission "public_repo". + # Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN + github-token: ${{ secrets.AUTO_MERGE_TOKEN }} + # By default, squash and merge, so Github chooses nice commit messages + command: squash and merge diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.github/workflows/test-and-release.yml b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/workflows/test-and-release.yml new file mode 100644 index 000000000..0c48ade1a --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.github/workflows/test-and-release.yml @@ -0,0 +1,96 @@ +name: Test and Release + +# Run this job on all pushes and pull requests +# as well as tags with a semantic version +on: + push: + branches: + - "main" + tags: + # normal versions + - "v[0-9]+.[0-9]+.[0-9]+" + # pre-releases + - "v[0-9]+.[0-9]+.[0-9]+-**" + pull_request: {} + +# Cancel previous PR/branch runs when a new commit is pushed +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + # Performs quick checks before the expensive test runs + check-and-lint: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ubuntu-latest + + steps: + - uses: ioBroker/testing-action-check@v1 + with: + node-version: '20.x' + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + type-checking: true + lint: true + + # Runs adapter tests on all supported node versions and OSes + adapter-tests: + if: contains(github.event.head_commit.message, '[skip ci]') == false + + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [20.x, 22.x, 24.x] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: ioBroker/testing-action-adapter@v1 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + # Uncomment the following line if your adapter cannot be installed using 'npm ci' + # install-command: 'npm install' + build: true + +# TODO: To enable automatic npm releases, create a token on npmjs.org +# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options +# Then uncomment the following block: + +# # Deploys the final package to NPM +# deploy: +# needs: [check-and-lint, adapter-tests] +# +# # Trigger this step only when a commit on any branch is tagged with a version number +# if: | +# contains(github.event.head_commit.message, '[skip ci]') == false && +# github.event_name == 'push' && +# startsWith(github.ref, 'refs/tags/v') +# +# runs-on: ubuntu-latest +# +# # Write permissions are required to create Github releases +# permissions: +# contents: write +# +# steps: +# - uses: ioBroker/testing-action-deploy@v1 +# with: +# node-version: '20.x' +# # Uncomment the following line if your adapter cannot be installed using 'npm ci' +# # install-command: 'npm install' +# build: true +# npm-token: ${{ secrets.NPM_TOKEN }} +# github-token: ${{ secrets.GITHUB_TOKEN }} +# +# # When using Sentry for error reporting, Sentry can be informed about new releases +# # To enable create a API-Token in Sentry (User settings, API keys) +# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options +# # Then uncomment and customize the following block: +# sentry: true +# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }} +# sentry-project: "iobroker-test-adapter" +# sentry-version-prefix: "iobroker.test-adapter" +# sentry-sourcemap-paths: "build/" +# # If your sentry project is linked to a GitHub repository, you can enable the following option +# # sentry-github-integration: true diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.gitignore b/test/baselines/adapter_TS_VIS_OfficialESLint/.gitignore new file mode 100644 index 000000000..80c28aa9d --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.gitignore @@ -0,0 +1,18 @@ +# No dot-directories except github/vscode +.*/ +!.vscode/ +!.github/ + +*.code-workspace +node_modules +nbproject + +# npm package files +iobroker.*.tgz + +Thumbs.db +.commitinfo + +# i18n intermediate files +admin/i18n/flat.txt +admin/i18n/*/flat.txt \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/extensions.json b/test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/extensions.json new file mode 100644 index 000000000..2c6ac5b31 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/settings.json b/test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/settings.json new file mode 100644 index 000000000..854736cc0 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib", + "eslint.enable": true, + "json.schemas": [ + { + "fileMatch": [ + "io-package.json" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json" + }, + { + "fileMatch": [ + "admin/jsonConfig.json", + "admin/jsonConfig.json5", + "admin/jsonCustom.json", + "admin/jsonCustom.json5", + "admin/jsonTab.json", + "admin/jsonTab.json5" + ], + "url": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/packages/jsonConfig/schemas/jsonConfig.json" + } + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/LICENSE b/test/baselines/adapter_TS_VIS_OfficialESLint/LICENSE new file mode 100644 index 000000000..27c9a624d --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/README.md b/test/baselines/adapter_TS_VIS_OfficialESLint/README.md new file mode 100644 index 000000000..f57bba69c --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/README.md @@ -0,0 +1,132 @@ +![Logo](admin/test-adapter.png) +# ioBroker.test-adapter + +[![NPM version](https://img.shields.io/npm/v/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +[![Downloads](https://img.shields.io/npm/dm/iobroker.test-adapter.svg)](https://www.npmjs.com/package/iobroker.test-adapter) +![Number of Installations](https://iobroker.live/badges/test-adapter-installed.svg) +![Current version in stable repository](https://iobroker.live/badges/test-adapter-stable.svg) + +[![NPM](https://nodei.co/npm/iobroker.test-adapter.png?downloads=true)](https://nodei.co/npm/iobroker.test-adapter/) + +**Tests:** ![Test and Release](https://github.com/AlCalzone/ioBroker.test-adapter/workflows/Test%20and%20Release/badge.svg) + +## test-adapter adapter for ioBroker + +Describe your project here + +## Developer manual +This section is intended for the developer. It can be deleted later. + +### DISCLAIMER + +Please make sure that you consider copyrights and trademarks when you use names or logos of a company and add a disclaimer to your README. +You can check other adapters for examples or ask in the developer community. Using a name or logo of a company without permission may cause legal problems for you. + +### Getting started + +You are almost done, only a few steps left: +1. Create a new repository on GitHub with the name `ioBroker.test-adapter` +1. Initialize the current folder as a new git repository: + ```bash + git init -b main + git add . + git commit -m "Initial commit" + ``` +1. Link your local repository with the one on GitHub: + ```bash + git remote add origin https://github.com/AlCalzone/ioBroker.test-adapter + ``` + +1. Push all files to the GitHub repo: + ```bash + git push origin main + ``` +1. Add a new secret under https://github.com/AlCalzone/ioBroker.test-adapter/settings/secrets. It must be named `AUTO_MERGE_TOKEN` and contain a personal access token with push access to the repository, e.g. yours. You can create a new token under https://github.com/settings/tokens. + +1. Head over to [src/main.ts](src/main.ts) and start programming! + +### Best Practices +We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should +check them out. If you're already experienced, you should also take a look at them - you might learn something new :) + +### Scripts in `package.json` +Several npm scripts are predefined for your convenience. You can run them using `npm run ` +| Script name | Description | +|-------------|-------------| +| `build` | Compile the TypeScript sources. | +| `watch` | Compile the TypeScript sources and watch for changes. | +| `test:ts` | Executes the tests you defined in `*.test.ts` files. | +| `test:package` | Ensures your `package.json` and `io-package.json` are valid. | +| `test:integration` | Tests the adapter startup with an actual instance of ioBroker. | +| `test` | Performs a minimal test run on package files and your tests. | +| `check` | Performs a type-check on your code (without compiling anything). | +| `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. | +| `translate` | Translates texts in your adapter to all required languages, see [`@iobroker/adapter-dev`](https://github.com/ioBroker/adapter-dev#manage-translations) for more details. | + +### Configuring the compilation +The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings +either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the +[`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files). + +### Writing tests +When done right, testing code is invaluable, because it gives you the +confidence to change your code while knowing exactly if and when +something breaks. A good read on the topic of test-driven development +is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92. +Although writing tests before the code might seem strange at first, but it has very +clear upsides. + +The template provides you with basic tests for the adapter startup and package files. +It is recommended that you add your own tests into the mix. + +### Publishing the adapter +Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form +`v..`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`. + +To get your adapter released in ioBroker, please refer to the documentation +of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). + +### Test the adapter manually on a local ioBroker installation +In order to install the adapter locally without publishing, the following steps are recommended: +1. Create a tarball from your dev directory: + ```bash + npm pack + ``` +1. Upload the resulting file to your ioBroker host +1. Install it locally (The paths are different on Windows): + ```bash + cd /opt/iobroker + npm i /path/to/tarball.tgz + ``` + +For later updates, the above procedure is not necessary. Just do the following: +1. Overwrite the changed files in the adapter directory (`/opt/iobroker/node_modules/iobroker.test-adapter`) +1. Execute `iobroker upload test-adapter` on the ioBroker host + +## Changelog + +### 0.0.1 +* (Al Calzone) initial release + +## License +MIT License + +Copyright (c) 2025 Al Calzone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/__meta__/npm_package_files.txt b/test/baselines/adapter_TS_VIS_OfficialESLint/__meta__/npm_package_files.txt new file mode 100644 index 000000000..98f028fe2 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/__meta__/npm_package_files.txt @@ -0,0 +1,11 @@ +admin/index_m.html +admin/style.css +admin/test-adapter.png +admin/words.js +widgets/test-adapter.html +widgets/test-adapter/css/style.css +widgets/test-adapter/js/test-adapter.js +io-package.json +LICENSE +package.json +README.md \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/admin/admin.d.ts b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/admin.d.ts new file mode 100644 index 000000000..7594b9e3a --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/admin.d.ts @@ -0,0 +1,65 @@ +declare let systemDictionary: Record>; + +declare let load: (settings: Record, onChange: (hasChanges: boolean) => void) => void; +declare let save: (callback: (settings: Record) => void) => void; + +// make load and save exist on the window object +interface Window { + load: typeof load; + save: typeof save; +} + +declare const instance: number; +declare const adapter: string; +/** + * Translates text + * + * @param text + * @param arg1 + * @param arg2 + * @param arg3 + */ +declare function _(text: string, arg1?: string, arg2?: string, arg3?: string): string; +declare const socket: ioBrokerSocket; +declare function sendTo( + instance: any, + command: string, + message: any, + callback: (result: SendToResult) => void | Promise, +): void; + +interface SendToResult { + error?: string | Error; + result?: any; +} + +// tslint:disable-next-line:class-name +interface ioBrokerSocket { + emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + + emit( + event: "getObjectView", + view: "system", + type: "device", + options: ioBroker.GetObjectViewParams, + callback: (err: string | undefined, result?: any) => void | Promise, + ): void; + emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; + emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; + emit( + event: "setState", + id: string, + state: unknown, + callback: (err: string | undefined, result?: any) => void, + ): void; + + on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; + + // TODO: other events +} diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/admin/index_m.html b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/index_m.html new file mode 100644 index 000000000..f11dc3c14 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/index_m.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ + + + +
+
+ + +
+ +
+ + +
+
+ +
+ + + + \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/admin/style.css b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/style.css new file mode 100644 index 000000000..57d4549ee --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/style.css @@ -0,0 +1,32 @@ +/* You can delete those if you want. I just found them very helpful */ +* { + box-sizing: border-box +} +.m { + /* Don't cut off dropdowns! */ + overflow: initial; +} +.m.adapter-container, +.m.adapter-container > div.App { + /* Fix layout/scrolling issues with tabs */ + height: 100%; + width: 100%; + position: relative; +} +.m .select-wrapper + label { + /* The positioning for dropdown labels is messed up */ + transform: none !important; +} + +label > i[title] { + /* Display the help cursor for the tooltip icons and fix their positioning */ + cursor: help; + margin-left: 0.25em; +} + +.dropdown-content { + /* Don't wrap text in dropdowns */ + white-space: nowrap; +} + +/* Add your styles here */ diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/admin/test-adapter.png b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/test-adapter.png new file mode 100644 index 000000000..094ebd97c Binary files /dev/null and b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/test-adapter.png differ diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/admin/tsconfig.json b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/tsconfig.json new file mode 100644 index 000000000..49fb013d2 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "include": [ + "./admin.d.ts", + "./**/*.js", + // Include the adapter-config definition if it exists. + // It should be at either on of these paths: + "../lib/adapter-config.d.ts", // JS + "../src/lib/adapter-config.d.ts", // TS + ] +} diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/admin/words.js b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/words.js new file mode 100644 index 000000000..0cc646034 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/admin/words.js @@ -0,0 +1,124 @@ +/* eslint no-unused-vars: off */ +/* eslint no-global-assign: off */ +/* global systemDictionary */ +"use strict"; + +systemDictionary = { + "test-adapter adapter settings": { + "en": "Adapter settings for test-adapter", + "de": "Adaptereinstellungen für test-adapter", + "ru": "Настройки адаптера для test-adapter", + "pt": "Configurações do adaptador para test-adapter", + "nl": "Adapterinstellingen voor test-adapter", + "fr": "Paramètres d'adaptateur pour test-adapter", + "it": "Impostazioni dell'adattatore per test-adapter", + "es": "Ajustes del adaptador para test-adapter", + "pl": "Ustawienia adaptera dla test-adapter", + "uk": "Налаштування адаптера для test-adapter", + "zh-cn": "test-adapter的适配器设置" + }, + "option1": { + "en": "option1", + "de": "Mock translation of 'option1' to 'de'", + "ru": "Mock translation of 'option1' to 'ru'", + "pt": "Mock translation of 'option1' to 'pt'", + "nl": "Mock translation of 'option1' to 'nl'", + "fr": "Mock translation of 'option1' to 'fr'", + "it": "Mock translation of 'option1' to 'it'", + "es": "Mock translation of 'option1' to 'es'", + "pl": "Mock translation of 'option1' to 'pl'", + "uk": "Mock translation of 'option1' to 'uk'", + "zh-cn": "Mock translation of 'option1' to 'zh-cn'" + }, + "option2": { + "en": "option2", + "de": "Mock translation of 'option2' to 'de'", + "ru": "Mock translation of 'option2' to 'ru'", + "pt": "Mock translation of 'option2' to 'pt'", + "nl": "Mock translation of 'option2' to 'nl'", + "fr": "Mock translation of 'option2' to 'fr'", + "it": "Mock translation of 'option2' to 'it'", + "es": "Mock translation of 'option2' to 'es'", + "pl": "Mock translation of 'option2' to 'pl'", + "uk": "Mock translation of 'option2' to 'uk'", + "zh-cn": "Mock translation of 'option2' to 'zh-cn'" + }, + "myColor": { + "en": "myColor", + "de": "meineColor", + "ru": "Мой цвет", + "pt": "minhaCor", + "nl": "mijnKleur", + "fr": "maCouleur", + "it": "mioColore", + "es": "miColor", + "pl": "mójKolor", + "uk": "мійКолір", + "zh-cn": "我的颜色" + }, + "myColor_tooltip": { + "en": "Description of\nmyColor", + "de": "Beschreibung von\nmyColor", + "ru": "Описание\nmyColor", + "pt": "Descrição de\nmyColor", + "nl": "Beschrijving van\nmyColor", + "fr": "Description de\nmyColor", + "it": "Descrizione di\nmyColor", + "es": "Descripción de\nmyColor", + "pl": "Opis\nmyColor", + "uk": "Опис\nmyColor", + "zh-cn": "\nmyColor的描述" + }, + "htmlText": { + "en": "htmlText", + "de": "htmlText", + "ru": "htmlText", + "pt": "htmlText", + "nl": "htmlText", + "fr": "htmlText", + "it": "htmlText", + "es": "htmlText", + "pl": "htmlText", + "uk": "htmlText", + "zh-cn": "htmlText" + }, + "group_extraMyset": { + "en": "extraMyset", + "de": "extraMyset", + "ru": "extraMyset", + "pt": "extraMyset", + "nl": "extraMyset", + "fr": "extraMyset", + "it": "extraMyset", + "es": "extraMyset", + "pl": "extraMyset", + "uk": "extraMyset", + "zh-cn": "extraMyset" + }, + "extraAttr": { + "en": "extraAttr", + "de": "extraAttr", + "ru": "extraAttr", + "pt": "extraAttr", + "nl": "extraAttr", + "fr": "extraAttr", + "it": "extraAttr", + "es": "extraAttr", + "pl": "extraAttr", + "uk": "extraAttr", + "zh-cn": "extraAttr" + }, + "Instance": { + "en": "Instance", + "de": "Instanz", + "ru": "Инстанция", + "pt": "Instância", + "nl": "Instantie", + "fr": "Instance", + "it": "Esempio", + "es": "Instancia", + "pl": "Instancja", + "uk": "Інстанція", + "zh-cn": "例" + } +}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/eslint.config.mjs b/test/baselines/adapter_TS_VIS_OfficialESLint/eslint.config.mjs new file mode 100644 index 000000000..5224defc7 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/eslint.config.mjs @@ -0,0 +1,35 @@ +// ioBroker eslint template configuration file for js and ts files +// Please note that esm or react based modules need additional modules loaded. +import config from '@iobroker/eslint-config'; + +export default [ + ...config, + { + // specify files to exclude from linting here + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build', + 'dist', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + 'widgets/**/*.js' + ], + }, + { + // you may disable some 'jsdoc' warnings - but using jsdoc is highly recommended + // as this improves maintainability. jsdoc warnings will not block build process. + rules: { + // 'jsdoc/require-jsdoc': 'off', + // 'jsdoc/require-param': 'off', + // 'jsdoc/require-param-description': 'off', + // 'jsdoc/require-returns-description': 'off', + // 'jsdoc/require-returns-check': 'off', + }, + }, +]; \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/io-package.json b/test/baselines/adapter_TS_VIS_OfficialESLint/io-package.json new file mode 100644 index 000000000..cd2246e68 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/io-package.json @@ -0,0 +1,95 @@ +{ + "common": { + "name": "test-adapter", + "version": "0.0.1", + "news": { + "0.0.1": { + "en": "initial release", + "de": "Erstveröffentlichung", + "ru": "Начальная версия", + "pt": "lançamento inicial", + "nl": "Eerste uitgave", + "fr": "Première version", + "it": "Versione iniziale", + "es": "Versión inicial", + "pl": "Pierwsze wydanie", + "uk": "Початкова версія", + "zh-cn": "首次出版" + } + }, + "titleLang": { + "en": "Is used to test the creator", + "de": "Mock translation of 'Is used to test the creator' to 'de'", + "ru": "Mock translation of 'Is used to test the creator' to 'ru'", + "pt": "Mock translation of 'Is used to test the creator' to 'pt'", + "nl": "Mock translation of 'Is used to test the creator' to 'nl'", + "fr": "Mock translation of 'Is used to test the creator' to 'fr'", + "it": "Mock translation of 'Is used to test the creator' to 'it'", + "es": "Mock translation of 'Is used to test the creator' to 'es'", + "pl": "Mock translation of 'Is used to test the creator' to 'pl'", + "uk": "Mock translation of 'Is used to test the creator' to 'uk'", + "zh-cn": "Mock translation of 'Is used to test the creator' to 'zh-cn'" + }, + "desc": { + "en": "test-adapter", + "de": "Mock translation of 'test-adapter' to 'de'", + "ru": "Mock translation of 'test-adapter' to 'ru'", + "pt": "Mock translation of 'test-adapter' to 'pt'", + "nl": "Mock translation of 'test-adapter' to 'nl'", + "fr": "Mock translation of 'test-adapter' to 'fr'", + "it": "Mock translation of 'test-adapter' to 'it'", + "es": "Mock translation of 'test-adapter' to 'es'", + "pl": "Mock translation of 'test-adapter' to 'pl'", + "uk": "Mock translation of 'test-adapter' to 'uk'", + "zh-cn": "Mock translation of 'test-adapter' to 'zh-cn'" + }, + "authors": [ + "Al Calzone " + ], + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "platform": "Javascript/Node.js", + "icon": "test-adapter.png", + "enabled": true, + "extIcon": "https://raw.githubusercontent.com/AlCalzone/ioBroker.test-adapter/main/admin/test-adapter.png", + "readme": "https://github.com/AlCalzone/ioBroker.test-adapter/blob/main/README.md", + "loglevel": "info", + "tier": 3, + "restartAdapters": [ + "vis" + ], + "mode": "daemon", + "type": "general", + "compact": true, + "connectionType": "local", + "dataSource": "push", + "adminUI": { + "config": "materialize" + }, + "dependencies": [ + { + "js-controller": ">=6.0.11" + }, + "vis" + ], + "globalDependencies": [ + { + "admin": ">=7.0.23" + } + ] + }, + "native": { + "option1": true, + "option2": "42" + }, + "objects": [], + "instanceObjects": [] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/package.json b/test/baselines/adapter_TS_VIS_OfficialESLint/package.json new file mode 100644 index 000000000..c7b91cf9e --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/package.json @@ -0,0 +1,69 @@ +{ + "name": "iobroker.test-adapter", + "version": "0.0.1", + "description": "test-adapter", + "author": { + "name": "Al Calzone", + "email": "al@calzo.ne" + }, + "contributors": [], + "homepage": "https://github.com/AlCalzone/ioBroker.test-adapter", + "license": "MIT", + "keywords": [ + "template", + "automation", + "IoT", + "integration" + ], + "repository": { + "type": "git", + "url": "https://github.com/AlCalzone/ioBroker.test-adapter.git" + }, + "engines": { + "node": ">= 20" + }, + "dependencies": { + "@iobroker/adapter-core": "^3.3.2" + }, + "devDependencies": { + "@iobroker/adapter-dev": "^1.5.0", + "@iobroker/eslint-config": "^2.2.0", + "@iobroker/testing": "^5.1.1", + "@tsconfig/node20": "^20.1.6", + "@types/node": "^20.19.21", + "rimraf": "^6.0.1", + "source-map-support": "^0.5.21", + "ts-node": "^10.9.2", + "typescript": "~5.9.3" + }, + "main": "build/main.js", + "files": [ + "admin{,/!(src)/**}/!(tsconfig|tsconfig.*|.eslintrc).{json,json5}", + "admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}", + "build/", + "widgets/**/!(tsconfig|tsconfig.*|.eslintrc).json", + "widgets/**/*.{html,css,png,svg,jpg,js}", + "www/", + "io-package.json", + "LICENSE" + ], + "scripts": { + "prebuild": "rimraf build", + "build": "build-adapter ts", + "watch": "build-adapter ts --watch", + "prebuild:ts": "rimraf build", + "build:ts": "build-adapter ts", + "watch:ts": "build-adapter ts --watch", + "test:ts": "mocha --config test/mocharc.custom.json src/**/*.test.ts", + "test:package": "mocha test/package --exit", + "test:integration": "mocha test/integration --exit", + "test": "npm run test:ts && npm run test:package", + "check": "tsc --noEmit", + "lint": "eslint -c eslint.config.mjs .", + "translate": "translate-adapter" + }, + "bugs": { + "url": "https://github.com/AlCalzone/ioBroker.test-adapter/issues" + }, + "readmeFilename": "README.md" +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/prettier.config.mjs b/test/baselines/adapter_TS_VIS_OfficialESLint/prettier.config.mjs new file mode 100644 index 000000000..2aa4713b5 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/prettier.config.mjs @@ -0,0 +1,8 @@ +// iobroker prettier configuration file +import prettierConfig from '@iobroker/eslint-config/prettier.config.mjs'; + +export default { + ...prettierConfig, + useTabs: true, + singleQuote: false, +}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/src/lib/adapter-config.d.ts b/test/baselines/adapter_TS_VIS_OfficialESLint/src/lib/adapter-config.d.ts new file mode 100644 index 000000000..c6c8a0e2a --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/src/lib/adapter-config.d.ts @@ -0,0 +1,14 @@ +// This file extends the AdapterConfig type from "@types/iobroker" + +// Augment the globally declared type ioBroker.AdapterConfig +declare global { + namespace ioBroker { + interface AdapterConfig { + option1: boolean; + option2: string; + } + } +} + +// this is required so the above AdapterConfig is found by TypeScript / type checking +export {}; \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/src/main.test.ts b/test/baselines/adapter_TS_VIS_OfficialESLint/src/main.test.ts new file mode 100644 index 000000000..0992583bc --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/src/main.test.ts @@ -0,0 +1,24 @@ +/** + * This is a dummy TypeScript test file using chai and mocha + * + * It's automatically excluded from npm and its build output is excluded from both git and npm. + * It is advised to test all your modules with accompanying *.test.ts-files + */ + +import { expect } from "chai"; +// import { functionToTest } from "./moduleToTest"; + +describe("module to test => function to test", () => { + // initializing logic + const expected = 5; + + it(`should return ${expected}`, () => { + const result = 5; + // assign result a value from functionToTest + expect(result).to.equal(expected); + // or using the should() syntax + result.should.equal(expected); + }); + // ... more tests => it +}); +// ... more test suites => describe diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/src/main.ts b/test/baselines/adapter_TS_VIS_OfficialESLint/src/main.ts new file mode 100644 index 000000000..c5c122375 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/src/main.ts @@ -0,0 +1,155 @@ +/* + * Created with @iobroker/create-adapter v2.6.5 + */ + +// The adapter-core module gives you access to the core ioBroker functions +// you need to create an adapter +import * as utils from "@iobroker/adapter-core"; + +// Load your modules here, e.g.: +// import * as fs from "fs"; + +class TestAdapter extends utils.Adapter { + public constructor(options: Partial = {}) { + super({ + ...options, + name: "test-adapter", + }); + this.on("ready", this.onReady.bind(this)); + this.on("stateChange", this.onStateChange.bind(this)); + // this.on("objectChange", this.onObjectChange.bind(this)); + // this.on("message", this.onMessage.bind(this)); + this.on("unload", this.onUnload.bind(this)); + } + + /** + * Is called when databases are connected and adapter received configuration. + */ + private async onReady(): Promise { + // Initialize your adapter here + + // The adapters config (in the instance object everything under the attribute "native") is accessible via + // this.config: + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); + + /* + For every state in the system there has to be also an object of type state + Here a simple template for a boolean variable named "testVariable" + Because every adapter instance uses its own unique namespace variable names can't collide with other adapters variables + */ + await this.setObjectNotExistsAsync("testVariable", { + type: "state", + common: { + name: "testVariable", + type: "boolean", + role: "indicator", + read: true, + write: true, + }, + native: {}, + }); + + // In order to get state updates, you need to subscribe to them. The following line adds a subscription for our variable we have created above. + this.subscribeStates("testVariable"); + // You can also add a subscription for multiple states. The following line watches all states starting with "lights." + // this.subscribeStates("lights.*"); + // Or, if you really must, you can also watch all states. Don't do this if you don't need to. Otherwise this will cause a lot of unnecessary load on the system: + // this.subscribeStates("*"); + + /* + setState examples + you will notice that each setState will cause the stateChange event to fire (because of above subscribeStates cmd) + */ + // the variable testVariable is set to true as command (ack=false) + await this.setState("testVariable", true); + + // same thing, but the value is flagged "ack" + // ack should be always set to true if the value is received from or acknowledged from the target system + await this.setState("testVariable", { val: true, ack: true }); + + // same thing, but the state is deleted after 30s (getState will return null afterwards) + await this.setState("testVariable", { val: true, ack: true, expire: 30 }); + + // examples for the checkPassword/checkGroup functions + const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); + + const groupResult = await this.checkGroupAsync("admin", "admin"); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); + } + + /** + * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function + */ + private onUnload(callback: () => void): void { + try { + // Here you must clear all timeouts or intervals that may still be active + // clearTimeout(timeout1); + // clearTimeout(timeout2); + // ... + // clearInterval(interval1); + + callback(); + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); + callback(); + } + } + + // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. + // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. + // /** + // * Is called if a subscribed object changes + // */ + // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void { + // if (obj) { + // // The object was changed + // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); + // } else { + // // The object was deleted + // this.log.info(`object ${id} deleted`); + // } + // } + + /** + * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object + */ + private onStateChange(id: string, state: ioBroker.State | null | undefined): void { + if (state) { + // The state was changed + this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`); + } else { + // The state was deleted + this.log.info(`state ${id} deleted`); + } + } + // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. + // /** + // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... + // * Using this method requires "common.messagebox" property to be set to true in io-package.json + // */ + // + // private onMessage(obj: ioBroker.Message): void { + // if (typeof obj === "object" && obj.message) { + // if (obj.command === "send") { + // // e.g. send email or pushover or whatever + // this.log.info("send command"); + // // Send response in callback if required + // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); + // } + // } + // } +} +if (require.main !== module) { + // Export the constructor in compact mode + module.exports = (options: Partial | undefined) => new TestAdapter(options); +} else { + // otherwise start the instance directly + (() => new TestAdapter())(); +} diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/test/.eslintrc.json b/test/baselines/adapter_TS_VIS_OfficialESLint/test/.eslintrc.json new file mode 100644 index 000000000..ce6b3d62c --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/test/.eslintrc.json @@ -0,0 +1,43 @@ +{ + "root": true, + "env": { + "es6": true, + "node": true, + "mocha": true + }, + "extends": [ + "eslint:recommended" + ], + "rules": { + "indent": [ + "error", + "tab", + { + "SwitchCase": 1 + } + ], + "no-console": "off", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true, + "argsIgnorePattern": "^_" + } + ], + "no-var": "error", + "no-trailing-spaces": "error", + "prefer-const": "error", + "quotes": [ + "error", + "double", + { + "avoidEscape": true, + "allowTemplateLiterals": true + } + ], + "semi": [ + "error", + "always" + ] + } +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/test/integration.js b/test/baselines/adapter_TS_VIS_OfficialESLint/test/integration.js new file mode 100644 index 000000000..986936fac --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/test/integration.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Run integration tests - See https://github.com/ioBroker/testing for a detailed explanation and further options +tests.integration(path.join(__dirname, "..")); \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/test/mocha.setup.js b/test/baselines/adapter_TS_VIS_OfficialESLint/test/mocha.setup.js new file mode 100644 index 000000000..b839790ff --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/test/mocha.setup.js @@ -0,0 +1,23 @@ +"use strict"; + +// Makes ts-node ignore warnings, so mocha --watch does work +process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; +// Sets the correct tsconfig for testing +process.env.TS_NODE_PROJECT = "tsconfig.json"; +// Make ts-node respect the "include" key in tsconfig.json +process.env.TS_NODE_FILES = "TRUE"; + +// Don't silently swallow unhandled rejections +process.on("unhandledRejection", (e) => { + throw e; +}); + +// enable the should interface with sinon +// and load chai-as-promised and sinon-chai by default +const sinonChai = require("sinon-chai"); +const chaiAsPromised = require("chai-as-promised"); +const { should, use } = require("chai"); + +should(); +use(sinonChai); +use(chaiAsPromised); \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/test/mocharc.custom.json b/test/baselines/adapter_TS_VIS_OfficialESLint/test/mocharc.custom.json new file mode 100644 index 000000000..851ed9cdc --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/test/mocharc.custom.json @@ -0,0 +1,10 @@ +{ + "require": [ + "test/mocha.setup.js", + "ts-node/register", + "source-map-support/register" + ], + "watch-files": [ + "src/**/*.test.ts" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/test/package.js b/test/baselines/adapter_TS_VIS_OfficialESLint/test/package.js new file mode 100644 index 000000000..3a48e0449 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/test/package.js @@ -0,0 +1,5 @@ +const path = require("path"); +const { tests } = require("@iobroker/testing"); + +// Validate the package files +tests.packageFiles(path.join(__dirname, "..")); diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/test/tsconfig.json b/test/baselines/adapter_TS_VIS_OfficialESLint/test/tsconfig.json new file mode 100644 index 000000000..3ebc81b65 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/test/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false + }, + "include": [ + "./**/*.js" + ] +} diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/tsconfig.build.json b/test/baselines/adapter_TS_VIS_OfficialESLint/tsconfig.build.json new file mode 100644 index 000000000..1f040ce18 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/tsconfig.build.json @@ -0,0 +1,16 @@ +// Specialized tsconfig to only compile .ts-files in the src dir +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "allowJs": false, + "checkJs": false, + "noEmit": false, + "declaration": false + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/**/*.test.ts" + ] +} diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/tsconfig.json b/test/baselines/adapter_TS_VIS_OfficialESLint/tsconfig.json new file mode 100644 index 000000000..4c80d776d --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/tsconfig.json @@ -0,0 +1,46 @@ +// Root tsconfig to set the settings and power editor support for all TS files +{ + // To update the compilation target, install a different version of @tsconfig/node... and reference it here + // https://github.com/tsconfig/bases#node-20-tsconfigjson + "extends": "@tsconfig/node20/tsconfig.json", + "compilerOptions": { + // do not compile anything, this file is just to configure type checking + // the compilation is configured in tsconfig.build.json + "noEmit": true, + + // check JS files, but do not compile them => tsconfig.build.json + "allowJs": true, + "checkJs": true, + + "noEmitOnError": true, + "outDir": "./build/", + "removeComments": false, + + // This is necessary for the automatic typing of the adapter config + "resolveJsonModule": true, + + // If you want to disable the stricter type checks (not recommended), uncomment the following line + // "strict": false, + // And enable some of those features for more fine-grained control + // "strictNullChecks": true, + // "strictPropertyInitialization": true, + // "strictBindCallApply": true, + // "noImplicitAny": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // Uncomment this if you want the old behavior of catch variables being `any` + // "useUnknownInCatchVariables": false, + + "sourceMap": true, + "inlineSourceMap": false + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "build/**", + "node_modules/**", + "widgets/**" + ] +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter.html b/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter.html new file mode 100644 index 000000000..b5f9aaede --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter.html @@ -0,0 +1,135 @@ + + + + + + + + + + \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter/css/style.css b/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter/css/style.css new file mode 100644 index 000000000..5ea1abc76 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter/css/style.css @@ -0,0 +1,4 @@ +/* Style your widget here */ +.test-adapter-class { + font-style: italic; +} \ No newline at end of file diff --git a/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter/js/test-adapter.js b/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter/js/test-adapter.js new file mode 100644 index 000000000..a7f6b07d0 --- /dev/null +++ b/test/baselines/adapter_TS_VIS_OfficialESLint/widgets/test-adapter/js/test-adapter.js @@ -0,0 +1,76 @@ +/* + ioBroker.vis test-adapter Widget-Set + + version: "0.0.1" + + Copyright 2025 Al Calzone al@calzo.ne +*/ +"use strict"; + +/* global $, vis, systemDictionary */ + +// add translations for edit mode +$.extend( + true, + systemDictionary, + { + // Add your translations here, e.g.: + // "size": { + // "en": "Size", + // "de": "Größe", + // "ru": "Размер", + // "pt": "Tamanho", + // "nl": "Grootte", + // "fr": "Taille", + // "it": "Dimensione", + // "es": "Talla", + // "pl": "Rozmiar", + // "uk": "Розмір" + // "zh-cn": "尺寸" + // } + } +); + +// this code can be placed directly in test-adapter.html +vis.binds["test-adapter"] = { + version: "0.0.1", + showVersion: function () { + if (vis.binds["test-adapter"].version) { + console.log("Version test-adapter: " + vis.binds["test-adapter"].version); + vis.binds["test-adapter"].version = null; + } + }, + createWidget: function (widgetID, view, data, style) { + var $div = $("#" + widgetID); + // if nothing found => wait + if (!$div.length) { + return setTimeout(function () { + vis.binds["test-adapter"].createWidget(widgetID, view, data, style); + }, 100); + } + + var text = ""; + text += "OID: " + data.oid + "

"; + text += 'OID value: ' + vis.states[data.oid + ".val"] + "
"; + text += 'Color: ' + data.myColor + "
"; + text += "extraAttr: " + data.extraAttr + "
"; + text += "Browser instance: " + vis.instance + "
"; + text += 'htmlText:
"; + + $("#" + widgetID).html(text); + + // subscribe on updates of value + function onChange(e, newVal, _oldVal) { + $div.find(".template-value").html(newVal); + } + if (data.oid) { + vis.states.bind(data.oid + ".val", onChange); + //remember bound state that vis can release if didnt needed + $div.data("bound", [data.oid + ".val"]); + //remember onchange handler to release bound states + $div.data("bindHandler", onChange); + } + } +}; + +vis.binds["test-adapter"].showVersion(); \ No newline at end of file diff --git a/test/baselines/connectionIndicator_yes/src/main.ts b/test/baselines/connectionIndicator_yes/src/main.ts index c5b30f40c..4fbd7de83 100644 --- a/test/baselines/connectionIndicator_yes/src/main.ts +++ b/test/baselines/connectionIndicator_yes/src/main.ts @@ -10,7 +10,6 @@ import * as utils from "@iobroker/adapter-core"; // import * as fs from "fs"; class TestAdapter extends utils.Adapter { - public constructor(options: Partial = {}) { super({ ...options, @@ -34,8 +33,8 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config option1: " + this.config.option1); - this.log.debug("config option2: " + this.config.option2); + this.log.debug("config option1: ${this.config.option1}"); + this.log.debug("config option2: ${this.config.option2}"); /* For every state in the system there has to be also an object of type state @@ -77,14 +76,16 @@ class TestAdapter extends utils.Adapter { // examples for the checkPassword/checkGroup functions const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); - this.log.info("check user admin pw iobroker: " + pwdResult); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); const groupResult = await this.checkGroupAsync("admin", "admin"); - this.log.info("check group user admin group admin: " + groupResult); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } /** * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function */ private onUnload(callback: () => void): void { try { @@ -95,7 +96,8 @@ class TestAdapter extends utils.Adapter { // clearInterval(interval1); callback(); - } catch (_e) { + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); callback(); } } @@ -117,6 +119,9 @@ class TestAdapter extends utils.Adapter { /** * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object */ private onStateChange(id: string, state: ioBroker.State | null | undefined): void { if (state) { @@ -127,30 +132,27 @@ class TestAdapter extends utils.Adapter { this.log.info(`state ${id} deleted`); } } - // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. // /** // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... // * Using this method requires "common.messagebox" property to be set to true in io-package.json // */ + // // private onMessage(obj: ioBroker.Message): void { // if (typeof obj === "object" && obj.message) { // if (obj.command === "send") { // // e.g. send email or pushover or whatever // this.log.info("send command"); - // // Send response in callback if required // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); // } // } // } - } - if (require.main !== module) { // Export the constructor in compact mode module.exports = (options: Partial | undefined) => new TestAdapter(options); } else { // otherwise start the instance directly (() => new TestAdapter())(); -} \ No newline at end of file +} diff --git a/test/baselines/contributors/package.json b/test/baselines/contributors/package.json index 82b124b66..684100ff2 100644 --- a/test/baselines/contributors/package.json +++ b/test/baselines/contributors/package.json @@ -33,13 +33,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node20": "^20.1.6", "@types/node": "^20.19.21", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -66,7 +67,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/contributors_with_author_duplication/package.json b/test/baselines/contributors_with_author_duplication/package.json index c2da6b589..d7fe4e8bc 100644 --- a/test/baselines/contributors_with_author_duplication/package.json +++ b/test/baselines/contributors_with_author_duplication/package.json @@ -33,13 +33,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node20": "^20.1.6", "@types/node": "^20.19.21", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -66,7 +67,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/customAdapterSettings/src/main.ts b/test/baselines/customAdapterSettings/src/main.ts index 1421f1f9e..3b2295a3d 100644 --- a/test/baselines/customAdapterSettings/src/main.ts +++ b/test/baselines/customAdapterSettings/src/main.ts @@ -10,7 +10,6 @@ import * as utils from "@iobroker/adapter-core"; // import * as fs from "fs"; class TestAdapter extends utils.Adapter { - public constructor(options: Partial = {}) { super({ ...options, @@ -31,8 +30,8 @@ class TestAdapter extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug("config prop1: " + this.config.prop1); - this.log.debug("config prop2: " + this.config.prop2); + this.log.debug("config prop1: ${this.config.prop1}"); + this.log.debug("config prop2: ${this.config.prop2}"); /* For every state in the system there has to be also an object of type state @@ -74,14 +73,16 @@ class TestAdapter extends utils.Adapter { // examples for the checkPassword/checkGroup functions const pwdResult = await this.checkPasswordAsync("admin", "iobroker"); - this.log.info("check user admin pw iobroker: " + pwdResult); + this.log.info(`check user admin pw iobroker: ${JSON.stringify(pwdResult)}`); const groupResult = await this.checkGroupAsync("admin", "admin"); - this.log.info("check group user admin group admin: " + groupResult); + this.log.info(`check group user admin group admin: ${JSON.stringify(groupResult)}`); } /** * Is called when adapter shuts down - callback has to be called under any circumstances! + * + * @param callback - Callback function */ private onUnload(callback: () => void): void { try { @@ -92,7 +93,8 @@ class TestAdapter extends utils.Adapter { // clearInterval(interval1); callback(); - } catch (_e) { + } catch (error) { + this.log.error(`Error during unloading: ${(error as Error).message}`); callback(); } } @@ -114,6 +116,9 @@ class TestAdapter extends utils.Adapter { /** * Is called if a subscribed state changes + * + * @param id - State ID + * @param state - State object */ private onStateChange(id: string, state: ioBroker.State | null | undefined): void { if (state) { @@ -124,30 +129,27 @@ class TestAdapter extends utils.Adapter { this.log.info(`state ${id} deleted`); } } - // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. // /** // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... // * Using this method requires "common.messagebox" property to be set to true in io-package.json // */ + // // private onMessage(obj: ioBroker.Message): void { // if (typeof obj === "object" && obj.message) { // if (obj.command === "send") { // // e.g. send email or pushover or whatever // this.log.info("send command"); - // // Send response in callback if required // if (obj.callback) this.sendTo(obj.from, obj.command, "Message received", obj.callback); // } // } // } - } - if (require.main !== module) { // Export the constructor in compact mode module.exports = (options: Partial | undefined) => new TestAdapter(options); } else { // otherwise start the instance directly (() => new TestAdapter())(); -} \ No newline at end of file +} diff --git a/test/baselines/git_SSH/package.json b/test/baselines/git_SSH/package.json index 17284a560..d9d594f37 100644 --- a/test/baselines/git_SSH/package.json +++ b/test/baselines/git_SSH/package.json @@ -26,13 +26,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node20": "^20.1.6", "@types/node": "^20.19.21", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -59,7 +60,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/i18n_json/admin/admin.d.ts b/test/baselines/i18n_json/admin/admin.d.ts index 41f934f4c..7594b9e3a 100644 --- a/test/baselines/i18n_json/admin/admin.d.ts +++ b/test/baselines/i18n_json/admin/admin.d.ts @@ -11,11 +11,18 @@ interface Window { declare const instance: number; declare const adapter: string; -/** Translates text */ +/** + * Translates text + * + * @param text + * @param arg1 + * @param arg2 + * @param arg3 + */ declare function _(text: string, arg1?: string, arg2?: string, arg3?: string): string; declare const socket: ioBrokerSocket; declare function sendTo( - instance: any | null, + instance: any, command: string, message: any, callback: (result: SendToResult) => void | Promise, @@ -28,49 +35,20 @@ interface SendToResult { // tslint:disable-next-line:class-name interface ioBrokerSocket { - emit( - command: "subscribeObjects", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "subscribeStates", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "unsubscribeObjects", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; - emit( - command: "unsubscribeStates", - pattern: string, - callback?: (err?: string) => void | Promise, - ): void; + emit(command: "subscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "subscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeObjects", pattern: string, callback?: (err?: string) => void | Promise): void; + emit(command: "unsubscribeStates", pattern: string, callback?: (err?: string) => void | Promise): void; emit( event: "getObjectView", view: "system", type: "device", options: ioBroker.GetObjectViewParams, - callback: ( - err: string | undefined, - result?: any, - ) => void | Promise, - ): void; - emit( - event: "getStates", - callback: ( - err: string | undefined, - result?: Record, - ) => void, - ): void; - emit( - event: "getState", - id: string, - callback: (err: string | undefined, result?: ioBroker.State) => void, + callback: (err: string | undefined, result?: any) => void | Promise, ): void; + emit(event: "getStates", callback: (err: string | undefined, result?: Record) => void): void; + emit(event: "getState", id: string, callback: (err: string | undefined, result?: ioBroker.State) => void): void; emit( event: "setState", id: string, @@ -80,14 +58,8 @@ interface ioBrokerSocket { on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; on(event: "stateChange", handler: ioBroker.StateChangeHandler): void; - removeEventHandler( - event: "objectChange", - handler: ioBroker.ObjectChangeHandler, - ): void; - removeEventHandler( - event: "stateChange", - handler: ioBroker.StateChangeHandler, - ): void; + removeEventHandler(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void; + removeEventHandler(event: "stateChange", handler: ioBroker.StateChangeHandler): void; // TODO: other events } diff --git a/test/baselines/ioBroker.hello-devcontainer/.create-adapter.json b/test/baselines/ioBroker.hello-devcontainer/.create-adapter.json index 60c913990..d819d9ae8 100644 --- a/test/baselines/ioBroker.hello-devcontainer/.create-adapter.json +++ b/test/baselines/ioBroker.hello-devcontainer/.create-adapter.json @@ -21,6 +21,7 @@ "type checking", "devcontainer" ], + "eslintConfig": "custom", "indentation": "Space (4)", "quotes": "single", "authorName": "Al Calzone", diff --git a/test/baselines/ioBroker.hello-devcontainer/.eslintignore b/test/baselines/ioBroker.hello-devcontainer/.eslintignore deleted file mode 100644 index 396d8e174..000000000 --- a/test/baselines/ioBroker.hello-devcontainer/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -**/.eslintrc.js -admin/words.js \ No newline at end of file diff --git a/test/baselines/ioBroker.hello-devcontainer/.eslintrc.json b/test/baselines/ioBroker.hello-devcontainer/.eslintrc.json deleted file mode 100644 index 6e461e9da..000000000 --- a/test/baselines/ioBroker.hello-devcontainer/.eslintrc.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "root": true, - "env": { - "es6": true, - "node": true, - "mocha": true - }, - "extends": [ - "eslint:recommended" - ], - "plugins": [], - "rules": { - "indent": [ - "error", - 4, - { - "SwitchCase": 1 - } - ], - "no-console": "off", - "no-unused-vars": [ - "error", - { - "ignoreRestSiblings": true, - "argsIgnorePattern": "^_" - } - ], - "no-var": "error", - "no-trailing-spaces": "error", - "prefer-const": "error", - "quotes": [ - "error", - "single", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "semi": [ - "error", - "always" - ] - }, - "parserOptions": { - "ecmaVersion": "latest" - } -} \ No newline at end of file diff --git a/test/baselines/ioBroker.hello-devcontainer/eslint.config.mjs b/test/baselines/ioBroker.hello-devcontainer/eslint.config.mjs new file mode 100644 index 000000000..e859b444d --- /dev/null +++ b/test/baselines/ioBroker.hello-devcontainer/eslint.config.mjs @@ -0,0 +1,74 @@ +import js from '@eslint/js'; + +export default [ + js.configs.recommended, + { + files: ['**/*.js', '**/*.jsx'], + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + globals: { + 'process': 'readonly', + 'Buffer': 'readonly', + '__dirname': 'readonly', + '__filename': 'readonly', + 'module': 'readonly', + 'require': 'readonly', + 'exports': 'readonly', + 'global': 'readonly', + 'console': 'readonly', + 'setTimeout': 'readonly', + 'setInterval': 'readonly', + 'clearTimeout': 'readonly', + 'clearInterval': 'readonly', + 'document': 'readonly', + 'window': 'readonly', + 'describe': 'readonly', + 'it': 'readonly', + 'ioBroker': 'readonly', + }, + }, + plugins: { + }, + rules: { + ...js.configs.recommended.rules, + 'indent': [ + 'error', + 4, + { + 'SwitchCase': 1 + } + ], + 'quotes': [ + 'error', + 'single' + ], + // Strict rules to match official @iobroker/eslint-config + 'prefer-template': 'error', + 'no-unused-vars': [ + 'warn', + { + 'ignoreRestSiblings': true, + 'argsIgnorePattern': '^_', + 'varsIgnorePattern': '^_' + } + ], + }, + }, + { + ignores: [ + '.dev-server/', + '.vscode/', + '*.test.js', + 'test/**/*.js', + '*.config.mjs', + 'build/', + 'dist/', + 'admin/build/', + 'admin/words.js', + 'admin/admin.d.ts', + 'admin/blockly.js', + '**/adapter-config.d.ts', + ], + }, +]; \ No newline at end of file diff --git a/test/baselines/ioBroker.hello-devcontainer/main.js b/test/baselines/ioBroker.hello-devcontainer/main.js index f958c9ce0..be1c33084 100644 --- a/test/baselines/ioBroker.hello-devcontainer/main.js +++ b/test/baselines/ioBroker.hello-devcontainer/main.js @@ -12,9 +12,8 @@ const utils = require('@iobroker/adapter-core'); // const fs = require('fs'); class HelloDevcontainer extends utils.Adapter { - /** - * @param {Partial} [options={}] + * @param {Partial} [options] - Adapter options */ constructor(options) { super({ @@ -36,8 +35,8 @@ class HelloDevcontainer extends utils.Adapter { // The adapters config (in the instance object everything under the attribute "native") is accessible via // this.config: - this.log.debug('config option1: ' + this.config.option1); - this.log.debug('config option2: ' + this.config.option2); + this.log.debug('config option1: ${this.config.option1}'); + this.log.debug('config option2: ${this.config.option2}'); /* For every state in the system there has to be also an object of type state @@ -79,15 +78,16 @@ class HelloDevcontainer extends utils.Adapter { // examples for the checkPassword/checkGroup functions const pwdResult = await this.checkPasswordAsync('admin', 'iobroker'); - this.log.info('check user admin pw iobroker: ' + pwdResult); + this.log.info(`check user admin pw iobroker: ${pwdResult}`); const groupResult = await this.checkGroupAsync('admin', 'admin'); - this.log.info('check group user admin group admin: ' + groupResult); + this.log.info(`check group user admin group admin: ${groupResult}`); } /** * Is called when adapter shuts down - callback has to be called under any circumstances! - * @param {() => void} callback + * + * @param {() => void} callback - Callback function */ onUnload(callback) { try { @@ -98,7 +98,8 @@ class HelloDevcontainer extends utils.Adapter { // clearInterval(interval1); callback(); - } catch (_e) { + } catch (error) { + this.log.error(`Error during unloading: ${error.message}`); callback(); } } @@ -122,8 +123,9 @@ class HelloDevcontainer extends utils.Adapter { /** * Is called if a subscribed state changes - * @param {string} id - * @param {ioBroker.State | null | undefined} state + * + * @param {string} id - State ID + * @param {ioBroker.State | null | undefined} state - State object */ onStateChange(id, state) { if (state) { @@ -134,7 +136,6 @@ class HelloDevcontainer extends utils.Adapter { this.log.info(`state ${id} deleted`); } } - // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. // /** // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... @@ -152,16 +153,15 @@ class HelloDevcontainer extends utils.Adapter { // } // } // } - } if (require.main !== module) { // Export the constructor in compact mode /** - * @param {Partial} [options={}] + * @param {Partial} [options] - Adapter options */ - module.exports = (options) => new HelloDevcontainer(options); + module.exports = options => new HelloDevcontainer(options); } else { // otherwise start the instance directly new HelloDevcontainer(); -} \ No newline at end of file +} diff --git a/test/baselines/ioBroker.hello-devcontainer/main.test.js b/test/baselines/ioBroker.hello-devcontainer/main.test.js index 5dc6ee4a6..85f2fc17f 100644 --- a/test/baselines/ioBroker.hello-devcontainer/main.test.js +++ b/test/baselines/ioBroker.hello-devcontainer/main.test.js @@ -24,7 +24,6 @@ describe('module to test => function to test', () => { result.should.equal(expected); }); // ... more tests => it - }); // ... more test suites => describe diff --git a/test/baselines/ioBroker.hello-devcontainer/package.json b/test/baselines/ioBroker.hello-devcontainer/package.json index e821748e3..31bda8ffa 100644 --- a/test/baselines/ioBroker.hello-devcontainer/package.json +++ b/test/baselines/ioBroker.hello-devcontainer/package.json @@ -26,11 +26,12 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node20": "^20.1.6", "@types/node": "^20.19.21", - "eslint": "^8.57.1", + "eslint": "^9.37.0", "typescript": "~5.9.3" }, "main": "main.js", @@ -49,7 +50,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:js && npm run test:package", "check": "tsc --noEmit -p tsconfig.check.json", - "lint": "eslint .", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/keywords/package.json b/test/baselines/keywords/package.json index cd871c75a..1992042a6 100644 --- a/test/baselines/keywords/package.json +++ b/test/baselines/keywords/package.json @@ -27,13 +27,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node20": "^20.1.6", "@types/node": "^20.19.21", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -60,7 +61,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/minNodeVersion_20/package.json b/test/baselines/minNodeVersion_20/package.json index 8b8418535..b29530070 100644 --- a/test/baselines/minNodeVersion_20/package.json +++ b/test/baselines/minNodeVersion_20/package.json @@ -26,13 +26,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node20": "^20.1.6", "@types/node": "^20.19.21", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -59,7 +60,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/minNodeVersion_22/package.json b/test/baselines/minNodeVersion_22/package.json index 98110b7a1..2302071b6 100644 --- a/test/baselines/minNodeVersion_22/package.json +++ b/test/baselines/minNodeVersion_22/package.json @@ -26,13 +26,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node22": "^22.0.2", "@types/node": "^22.18.10", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -59,7 +60,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/minNodeVersion_24/package.json b/test/baselines/minNodeVersion_24/package.json index cb65bdbbe..88311dad8 100644 --- a/test/baselines/minNodeVersion_24/package.json +++ b/test/baselines/minNodeVersion_24/package.json @@ -26,13 +26,14 @@ "@iobroker/adapter-core": "^3.3.2" }, "devDependencies": { + "@eslint/js": "^9.37.0", "@iobroker/adapter-dev": "^1.5.0", "@iobroker/testing": "^5.1.1", "@tsconfig/node24": "^24.0.1", "@types/node": "^24.7.2", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", - "eslint": "^8.57.1", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.37.0", "rimraf": "^6.0.1", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", @@ -59,7 +60,7 @@ "test:integration": "mocha test/integration --exit", "test": "npm run test:ts && npm run test:package", "check": "tsc --noEmit", - "lint": "eslint --ext .ts src/", + "lint": "eslint -c eslint.config.mjs .", "translate": "translate-adapter" }, "bugs": { diff --git a/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx b/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx index 9e0ae262d..cae5228c1 100644 --- a/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx +++ b/test/baselines/tabReact_adminHtml_JS/admin/src/tab-app.jsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ import React from "react"; import { withStyles } from "@material-ui/core/styles"; @@ -17,16 +18,16 @@ class TabApp extends GenericApp { bottomButtons: false, encryptedFields: [], translations: { - "en": require("./i18n/en.json"), - "de": require("./i18n/de.json"), - "ru": require("./i18n/ru.json"), - "pt": require("./i18n/pt.json"), - "nl": require("./i18n/nl.json"), - "fr": require("./i18n/fr.json"), - "it": require("./i18n/it.json"), - "es": require("./i18n/es.json"), - "pl": require("./i18n/pl.json"), - "uk": require("./i18n/uk.json"), + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), "zh-cn": require("./i18n/zh-cn.json"), }, }; @@ -52,4 +53,4 @@ class TabApp extends GenericApp { } } -export default withStyles(styles)(TabApp); \ No newline at end of file +export default withStyles(styles)(TabApp); diff --git a/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx b/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx index e70544ba0..641fe9775 100644 --- a/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx +++ b/test/baselines/tabReact_adminHtml_JS/admin/src/tab.jsx @@ -12,7 +12,7 @@ function build() { { + onThemeChange={_theme => { themeName = _theme; build(); }} @@ -22,4 +22,4 @@ function build() { ); } -build(); \ No newline at end of file +build(); diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx index b4f93806a..181208404 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/app.tsx @@ -1,10 +1,10 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ import React from "react"; -import { Theme, withStyles } from "@material-ui/core/styles"; +import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; import GenericApp from "@iobroker/adapter-react/GenericApp"; import Settings from "./components/settings"; -import { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; -import { StyleRules } from "@material-ui/core/styles"; +import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; const styles = (_theme: Theme): StyleRules => ({ root: {}, @@ -16,16 +16,16 @@ class App extends GenericApp { ...props, encryptedFields: [], translations: { - "en": require("./i18n/en.json"), - "de": require("./i18n/de.json"), - "ru": require("./i18n/ru.json"), - "pt": require("./i18n/pt.json"), - "nl": require("./i18n/nl.json"), - "fr": require("./i18n/fr.json"), - "it": require("./i18n/it.json"), - "es": require("./i18n/es.json"), - "pl": require("./i18n/pl.json"), - "uk": require("./i18n/uk.json"), + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), "zh-cn": require("./i18n/zh-cn.json"), }, }; @@ -36,14 +36,17 @@ class App extends GenericApp { // executed when connection is ready } - render() { + render(): Element { if (!this.state.loaded) { return super.render(); } return (
- this.updateNativeValue(attr, value)} /> + this.updateNativeValue(attr, value)} + /> {this.renderError()} {this.renderToast()} {this.renderSaveCloseButtons()} @@ -52,4 +55,4 @@ class App extends GenericApp { } } -export default withStyles(styles)(App); \ No newline at end of file +export default withStyles(styles)(App); diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx index a504b063a..7c717b899 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/components/settings.tsx @@ -1,6 +1,6 @@ import React from "react"; import { withStyles } from "@material-ui/core/styles"; -import { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; +import type { CreateCSSProperties } from "@material-ui/core/styles/withStyles"; import TextField from "@material-ui/core/TextField"; import Input from "@material-ui/core/Input"; import FormHelperText from "@material-ui/core/FormHelperText"; @@ -62,14 +62,14 @@ class Settings extends React.Component { this.state = {}; } - renderInput(title: AdminWord, attr: string, type: string) { + renderInput(title: AdminWord, attr: string, type: string): React.JSX.Element { return ( this.props.onChange(attr, e.target.value)} + onChange={e => this.props.onChange(attr, e.target.value)} margin="normal" /> ); @@ -80,22 +80,30 @@ class Settings extends React.Component { attr: string, options: { value: string; title: AdminWord }[], style?: React.CSSProperties, - ) { + ): React.JSX.Element { return ( } + onChange={e => this.props.onChange(attr, e.target.value === "_" ? "" : e.target.value)} + input={ + + } > - {options.map((item) => ( - + {options.map(item => ( + {I18n.t(item.title)} ))} @@ -105,13 +113,13 @@ class Settings extends React.Component { ); } - renderCheckbox(title: AdminWord, attr: string, style?: React.CSSProperties) { + renderCheckbox(title: AdminWord, attr: string, style?: React.CSSProperties): React.JSX.Element { return ( { ); } - render() { + render(): React.JSX.Element { return (
- {this.renderCheckbox("option1", "option1")}
+ {this.renderCheckbox("option1", "option1")} +
{this.renderInput("option2", "option2", "text")}
); } } -export default withStyles(styles)(Settings); \ No newline at end of file +export default withStyles(styles)(Settings); diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts b/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts index f4a769e59..c260647af 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts +++ b/test/baselines/tabReact_adminReact_TS/admin/src/i18n/i18n.d.ts @@ -14,13 +14,15 @@ /** * Available words in `i18n/en.json`. */ +// eslint-disable-next-line @typescript-eslint/consistent-type-imports declare type AdminWord = keyof typeof import("./en.json"); declare module "@iobroker/adapter-react/i18n" { /** * Translate the given string to the selected language. + * * @param word The (key) word to look up the string. Has to be defined at least in `i18n/en.json`. * @param args Optional arguments which will replace the first (second, third, ...) occurence of %s */ function t(word: AdminWord, ...args: string[]): string; -} \ No newline at end of file +} diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx index e114005c8..5857b0fa6 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/index.tsx @@ -12,7 +12,7 @@ function build(): void { { + onThemeChange={_theme => { themeName = _theme; build(); }} @@ -22,4 +22,4 @@ function build(): void { ); } -build(); \ No newline at end of file +build(); diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx index c84a968cb..4fa1fc994 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/tab-app.tsx @@ -1,9 +1,9 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ import React from "react"; -import { Theme, withStyles } from "@material-ui/core/styles"; +import { type Theme, type StyleRules, withStyles } from "@material-ui/core/styles"; import GenericApp from "@iobroker/adapter-react/GenericApp"; -import { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; -import { StyleRules } from "@material-ui/core/styles"; +import type { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types"; const styles = (_theme: Theme): StyleRules => ({ root: {}, @@ -16,16 +16,16 @@ class TabApp extends GenericApp { bottomButtons: false, encryptedFields: [], translations: { - "en": require("./i18n/en.json"), - "de": require("./i18n/de.json"), - "ru": require("./i18n/ru.json"), - "pt": require("./i18n/pt.json"), - "nl": require("./i18n/nl.json"), - "fr": require("./i18n/fr.json"), - "it": require("./i18n/it.json"), - "es": require("./i18n/es.json"), - "pl": require("./i18n/pl.json"), - "uk": require("./i18n/uk.json"), + en: require("./i18n/en.json"), + de: require("./i18n/de.json"), + ru: require("./i18n/ru.json"), + pt: require("./i18n/pt.json"), + nl: require("./i18n/nl.json"), + fr: require("./i18n/fr.json"), + it: require("./i18n/it.json"), + es: require("./i18n/es.json"), + pl: require("./i18n/pl.json"), + uk: require("./i18n/uk.json"), "zh-cn": require("./i18n/zh-cn.json"), }, }; @@ -36,7 +36,7 @@ class TabApp extends GenericApp { // executed when connection is ready } - render() { + render(): React.JSX.Element { if (!this.state.loaded) { return super.render(); } @@ -51,4 +51,4 @@ class TabApp extends GenericApp { } } -export default withStyles(styles)(TabApp); \ No newline at end of file +export default withStyles(styles)(TabApp); diff --git a/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx b/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx index a10100bcd..98abfd37b 100644 --- a/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx +++ b/test/baselines/tabReact_adminReact_TS/admin/src/tab.tsx @@ -12,7 +12,7 @@ function build(): void { { + onThemeChange={_theme => { themeName = _theme; build(); }} @@ -22,4 +22,4 @@ function build(): void { ); } -build(); \ No newline at end of file +build(); diff --git a/test/baselines/vis_Widget/widgets/.eslintrc.json b/test/baselines/vis_Widget/widgets/.eslintrc.json deleted file mode 100644 index b7ca3620a..000000000 --- a/test/baselines/vis_Widget/widgets/.eslintrc.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "env": { - "browser": true, - "es6": false - }, - "rules": { - // Visualizations may run in very old browsers without `let` and `const` - "no-var": "off", - // The example code does not use some parameters. If unused variables should be - // an error, delete the following rule - "no-unused-vars": [ - "warn", - { - "ignoreRestSiblings": true, - "argsIgnorePattern": "^_" - } - ] - } -} \ No newline at end of file diff --git a/test/create-adapter.test.ts b/test/create-adapter.test.ts index 47ff74fb3..659fc8a49 100644 --- a/test/create-adapter.test.ts +++ b/test/create-adapter.test.ts @@ -13,14 +13,10 @@ import { writeFiles } from "../src/lib/createAdapter"; const baselineDir = path.join(__dirname, "../test/baselines"); let ioPackageSchema: unknown; -async function generateBaselines( - testName: string, - answers: Answers, - filterFilesPredicate?: (file: File) => boolean, -) { +async function generateBaselines(testName: string, answers: Answers, filterFilesPredicate?: (file: File) => boolean) { const files = await createAdapter(answers); - const ioPackage = files.find((f) => f.name.endsWith("io-package.json")); + const ioPackage = files.find(f => f.name.endsWith("io-package.json")); if (ioPackage) { // Download JSON schema for validation if (!ioPackageSchema) { @@ -31,30 +27,18 @@ async function generateBaselines( ).data; } // Validate io-package.json - const result = validateJSON( - JSON.parse(ioPackage.content as string), - ioPackageSchema, - ); + const result = validateJSON(JSON.parse(ioPackage.content as string), ioPackageSchema); if (result.errors.length) { - throw new Error( - `io-package.json had errors:\n${result.errors - .map((e) => e.message) - .join("\n")}`, - ); + throw new Error(`io-package.json had errors:\n${result.errors.map(e => e.message).join("\n")}`); } } const testDir = path.join(baselineDir, testName); await fs.emptyDir(testDir); - await writeFiles( - testDir, - typeof filterFilesPredicate === "function" - ? files.filter(filterFilesPredicate) - : files, - ); + await writeFiles(testDir, typeof filterFilesPredicate === "function" ? files.filter(filterFilesPredicate) : files); // Include the npm package content in the baselines (only for full adapter tests) - if (!filterFilesPredicate && files.some((f) => f.name === "package.json")) { + if (!filterFilesPredicate && files.some(f => f.name === "package.json")) { const { execaSync } = await import("execa"); const packageContent = JSON.parse( execaSync("npm", ["pack", "--dry-run", "--json"], { @@ -68,37 +52,27 @@ async function generateBaselines( // Put directories on top const isDirA = a.includes("/"); const isDirB = b.includes("/"); - if (isDirA && !isDirB) return -1; - if (isDirB && !isDirA) return 1; + if (isDirA && !isDirB) { + return -1; + } + if (isDirB && !isDirA) { + return 1; + } return a.localeCompare(b); }); await fs.ensureDir(path.join(testDir, "__meta__")); - await fs.writeFile( - path.join(testDir, "__meta__/npm_package_files.txt"), - packageFiles.join("\n"), - ); + await fs.writeFile(path.join(testDir, "__meta__/npm_package_files.txt"), packageFiles.join("\n")); } } // TODO: Mock network requests -async function expectSuccess( - testName: string, - answers: Answers, - filterFilesPredicate?: (file: File) => boolean, -) { +async function expectSuccess(testName: string, answers: Answers, filterFilesPredicate?: (file: File) => boolean) { await generateBaselines(testName, answers, filterFilesPredicate); } -async function expectFail( - testName: string, - answers: Partial, - message: string, -) { - await generateBaselines( - testName, - answers as Answers, - ).should.be.rejectedWith(message); +async function expectFail(testName: string, answers: Partial, message: string) { + await generateBaselines(testName, answers as Answers).should.be.rejectedWith(message); const testDir = path.join(baselineDir, testName); await fs.pathExists(testDir).should.become(false); } @@ -120,6 +94,7 @@ const baseAnswers: Answers = { tabReact: "no", releaseScript: "no", tools: ["ESLint"], + eslintConfig: "custom", indentation: "Tab", quotes: "double", authorName: "Al Calzone", @@ -135,67 +110,51 @@ const baseAnswers: Answers = { describe("adapter creation =>", () => { describe("incomplete answer sets should fail =>", () => { - it("only name", () => { + it("only name", async () => { const answers = { adapterName: "foobar" }; - expectFail("incompleteAnswersOnlyName", answers, "Missing answer"); + await expectFail("incompleteAnswersOnlyName", answers, "Missing answer"); }); - it("no title", () => { + it("no title", async () => { const { title, ...noTitle } = baseAnswers; - expectFail("incompleteAnswersNoTitle", noTitle, "Missing answer"); + await expectFail("incompleteAnswersNoTitle", noTitle, "Missing answer"); }); - it("no type", () => { + it("no type", async () => { const { type, ...noType } = baseAnswers; - expectFail("incompleteAnswersNoType", noType, "Missing answer"); + await expectFail("incompleteAnswersNoType", noType, "Missing answer"); }); - it("empty title 1", () => { + it("empty title 1", async () => { const answers: Answers = { ...baseAnswers, title: "", }; - expectFail( - "incompleteAnswersEmptyTitle", - answers, - "Please enter a title", - ); + await expectFail("incompleteAnswersEmptyTitle", answers, "Please enter a title"); }); - it("empty title 2", () => { + it("empty title 2", async () => { const answers: Answers = { ...baseAnswers, title: " ", }; - expectFail( - "incompleteAnswersEmptyTitle", - answers, - "Please enter a title", - ); + await expectFail("incompleteAnswersEmptyTitle", answers, "Please enter a title"); }); - it("invalid title 1", () => { + it("invalid title 1", async () => { const answers: Answers = { ...baseAnswers, title: "Adapter for ioBroker", }; - expectFail( - "incompleteAnswersEmptyTitle", - answers, - "must not contain the words", - ); + await expectFail("incompleteAnswersEmptyTitle", answers, "must not contain the words"); }); - it("selecting Prettier without ESLint", () => { + it("selecting Prettier without ESLint", async () => { const answers: Answers = { ...baseAnswers, tools: ["Prettier"], }; - expectFail( - "invalidAnswersPrettierWithoutESLint", - answers, - "ESLint must be selected", - ); + await expectFail("invalidAnswersPrettierWithoutESLint", answers, "ESLint must be selected"); }); }); @@ -207,9 +166,7 @@ describe("adapter creation =>", () => { await fs.mkdirp(baselineDir); const files = await fs.readdir(baselineDir); await Promise.all( - files - .filter((file) => file !== "README.md") - .map((file) => fs.remove(path.join(baselineDir, file))), + files.filter(file => file !== "README.md").map(file => fs.remove(path.join(baselineDir, file))), ); }); @@ -219,10 +176,7 @@ describe("adapter creation =>", () => { ...baseAnswers, adminFeatures: ["custom", "tab"], }; - await expectSuccess( - "adapter_TS_ESLint_Tabs_DoubleQuotes_MIT", - answers, - ); + await expectSuccess("adapter_TS_ESLint_Tabs_DoubleQuotes_MIT", answers); }); it("Adapter, TypeScript React", async () => { @@ -252,10 +206,7 @@ describe("adapter creation =>", () => { quotes: "single", license: "Apache License 2.0", }; - await expectSuccess( - "adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0", - answers, - ); + await expectSuccess("adapter_JS_JsonUI_ESLint_TypeChecking_Spaces_SingleQuotes_Apache-2.0", answers); }); it("Adapter, JavaScript, JSON UI, ESLint, Spaces, Single quotes, Dev Container", async () => { @@ -271,6 +222,58 @@ describe("adapter creation =>", () => { await expectSuccess("ioBroker.hello-devcontainer", answers); }); + it("Adapter, TypeScript, Official ESLint Config", async () => { + const answers: Answers = { + ...baseAnswers, + eslintConfig: "official", + }; + await expectSuccess("adapter_TS_OfficialESLint", answers); + }); + + it("Adapter, JavaScript, Official ESLint Config", async () => { + const answers: Answers = { + ...baseAnswers, + language: "JavaScript", + eslintConfig: "official", + indentation: "Space (4)", + quotes: "single", + }; + await expectSuccess("adapter_JS_OfficialESLint", answers); + }); + + it("Adapter, TypeScript React, Official ESLint Config", async () => { + const answers: Answers = { + ...baseAnswers, + adminUi: "react", + eslintConfig: "official", + }; + await expectSuccess("adapter_TS_React_OfficialESLint", answers); + }); + + it("Adapter, TypeScript VIS, Official ESLint Config", async () => { + const answers: Answers = { + ...baseAnswers, + features: ["adapter", "vis"], + eslintConfig: "official", + indentation: "Tab", + quotes: "double", + widgetIsMainFunction: "main", + }; + await expectSuccess("adapter_TS_VIS_OfficialESLint", answers); + }); + + it("Adapter, TypeScript VIS, Custom ESLint Config", async () => { + const answers: Answers = { + ...baseAnswers, + features: ["adapter", "vis"], + eslintConfig: "custom", + indentation: "Tab", + quotes: "double", + widgetIsMainFunction: "main", + }; + await expectSuccess("adapter_TS_VIS_CustomESLint", answers); + }); + it("Widget", async () => { const answers: Answers = { cli: true, @@ -302,11 +305,7 @@ describe("adapter creation =>", () => { ...baseAnswers, description: "This is a short description", }; - await expectSuccess( - "description_valid", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("description_valid", answers, file => file.name === "io-package.json"); }); it("Empty description 1", async () => { @@ -314,11 +313,7 @@ describe("adapter creation =>", () => { ...baseAnswers, description: "", }; - await expectSuccess( - "description_empty_1", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("description_empty_1", answers, file => file.name === "io-package.json"); }); it("Empty description 2", async () => { @@ -326,11 +321,7 @@ describe("adapter creation =>", () => { ...baseAnswers, description: " ", }; - await expectSuccess( - "description_empty_2", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("description_empty_2", answers, file => file.name === "io-package.json"); }); it(`Start mode "schedule"`, async () => { @@ -339,11 +330,7 @@ describe("adapter creation =>", () => { startMode: "schedule", scheduleStartOnChange: "yes", }; - await expectSuccess( - "startMode_schedule", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("startMode_schedule", answers, file => file.name === "io-package.json"); }); it(`Adapter with type "storage"`, async () => { @@ -352,11 +339,7 @@ describe("adapter creation =>", () => { features: ["adapter"], type: "storage", }; - await expectSuccess( - "type_storage", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("type_storage", answers, file => file.name === "io-package.json"); }); it(`VIS with type "visualization-icons"`, async () => { @@ -366,11 +349,7 @@ describe("adapter creation =>", () => { type: "visualization-icons", widgetIsMainFunction: "additional", // Icons are additional, so no VIS dependency }; - await expectSuccess( - "type_visualization-icons", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("type_visualization-icons", answers, file => file.name === "io-package.json"); }); it(`VIS widget with main functionality`, async () => { @@ -380,11 +359,7 @@ describe("adapter creation =>", () => { type: "visualization-widgets", widgetIsMainFunction: "main", // Widget is main functionality, includes VIS dependency }; - await expectSuccess( - "vis_widget_main_function", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("vis_widget_main_function", answers, file => file.name === "io-package.json"); }); it(`VIS widget with additional functionality`, async () => { @@ -394,11 +369,7 @@ describe("adapter creation =>", () => { type: "visualization-widgets", widgetIsMainFunction: "additional", // Widget is additional, no VIS dependency }; - await expectSuccess( - "vis_widget_additional_function", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("vis_widget_additional_function", answers, file => file.name === "io-package.json"); }); it(`Node.js 20 as minimum`, async () => { @@ -409,9 +380,7 @@ describe("adapter creation =>", () => { await expectSuccess( "minNodeVersion_20", answers, - (file) => - file.name === "package.json" || - file.name === "tsconfig.json", + file => file.name === "package.json" || file.name === "tsconfig.json", ); }); @@ -423,9 +392,7 @@ describe("adapter creation =>", () => { await expectSuccess( "minNodeVersion_22", answers, - (file) => - file.name === "package.json" || - file.name === "tsconfig.json", + file => file.name === "package.json" || file.name === "tsconfig.json", ); }); @@ -437,9 +404,7 @@ describe("adapter creation =>", () => { await expectSuccess( "minNodeVersion_24", answers, - (file) => - file.name === "package.json" || - file.name === "tsconfig.json", + file => file.name === "package.json" || file.name === "tsconfig.json", ); }); @@ -449,10 +414,9 @@ describe("adapter creation =>", () => { quotes: "single", adminUi: "react", }; - await expectSuccess("TS_SingleQuotes", answers, (file) => { + await expectSuccess("TS_SingleQuotes", answers, file => { return ( - (file.name.endsWith(".ts") && - !file.name.endsWith(".d.ts")) || + (file.name.endsWith(".ts") && !file.name.endsWith(".d.ts")) || file.name.endsWith(".tsx") || file.name.startsWith(".eslint") ); @@ -465,10 +429,9 @@ describe("adapter creation =>", () => { quotes: "double", adminUi: "react", }; - await expectSuccess("TS_DoubleQuotes", answers, (file) => { + await expectSuccess("TS_DoubleQuotes", answers, file => { return ( - (file.name.endsWith(".ts") && - !file.name.endsWith(".d.ts")) || + (file.name.endsWith(".ts") && !file.name.endsWith(".d.ts")) || file.name.endsWith(".tsx") || file.name.startsWith(".eslint") ); @@ -480,7 +443,7 @@ describe("adapter creation =>", () => { ...baseAnswers, tools: ["ESLint", "Prettier"], }; - await expectSuccess("TS_Prettier", answers, (file) => { + await expectSuccess("TS_Prettier", answers, file => { return ( file.name.startsWith(".vscode/") || file.name.startsWith(".eslint") || @@ -498,7 +461,7 @@ describe("adapter creation =>", () => { await expectSuccess( "connectionIndicator_yes", answers, - (file) => + file => file.name.endsWith("main.ts") || file.name.endsWith("main.js") || file.name === "io-package.json", @@ -526,7 +489,7 @@ describe("adapter creation =>", () => { await expectSuccess( "customAdapterSettings", answers, - (file) => + file => file.name.endsWith("main.ts") || file.name.endsWith("main.js") || file.name === "io-package.json" || @@ -537,12 +500,9 @@ describe("adapter creation =>", () => { it(`Different keywords`, async () => { const answers: Answers = { ...baseAnswers, - keywords: - "this, adapter,uses, different , keywords" as any, + keywords: "this, adapter,uses, different , keywords" as any, }; - await expectSuccess("keywords", answers, (file) => - file.name.endsWith("package.json"), - ); + await expectSuccess("keywords", answers, file => file.name.endsWith("package.json")); }); it(`Contributors`, async () => { @@ -550,11 +510,7 @@ describe("adapter creation =>", () => { ...baseAnswers, contributors: `Bill Gates, "Malformed JSON, ,,` as any, }; - await expectSuccess( - "contributors", - answers, - (file) => file.name === "package.json", - ); + await expectSuccess("contributors", answers, file => file.name === "package.json"); }); it(`Contributors with author duplication`, async () => { @@ -565,7 +521,7 @@ describe("adapter creation =>", () => { await expectSuccess( "contributors_with_author_duplication", answers, - (file) => file.name === "package.json", + file => file.name === "package.json", ); }); @@ -574,11 +530,7 @@ describe("adapter creation =>", () => { ...baseAnswers, gitRemoteProtocol: "SSH", }; - await expectSuccess( - "git_SSH", - answers, - (file) => file.name === "package.json", - ); + await expectSuccess("git_SSH", answers, file => file.name === "package.json"); }); it(`Data Source and Connection Type`, async () => { @@ -587,11 +539,7 @@ describe("adapter creation =>", () => { connectionType: "cloud", dataSource: "assumption", }; - await expectSuccess( - "connectionType", - answers, - (file) => file.name === "io-package.json", - ); + await expectSuccess("connectionType", answers, file => file.name === "io-package.json"); }); it(`VSCode devcontainer`, async () => { @@ -602,7 +550,7 @@ describe("adapter creation =>", () => { await expectSuccess( "devcontainer", answers, - (file) => + file => file.name.startsWith(".devcontainer/") || file.name === ".gitignore" || file.name === ".vscode/launch.json", @@ -616,9 +564,7 @@ describe("adapter creation =>", () => { adminUi: "react", tabReact: "yes", }; - await expectSuccess("tabReact_adminReact_TS", answers, (file) => - file.name.startsWith("admin/"), - ); + await expectSuccess("tabReact_adminReact_TS", answers, file => file.name.startsWith("admin/")); }); it("TabReact AdminHtml JS", async () => { @@ -628,9 +574,7 @@ describe("adapter creation =>", () => { tabReact: "yes", language: "JavaScript", }; - await expectSuccess("tabReact_adminHtml_JS", answers, (file) => - file.name.startsWith("admin/"), - ); + await expectSuccess("tabReact_adminHtml_JS", answers, file => file.name.startsWith("admin/")); }); it("I18n with JSON", async () => { @@ -638,9 +582,7 @@ describe("adapter creation =>", () => { ...baseAnswers, i18n: "JSON", }; - await expectSuccess("i18n_json", answers, (file) => - file.name.startsWith("admin/"), - ); + await expectSuccess("i18n_json", answers, file => file.name.startsWith("admin/")); }); it("Release Script (JS)", async () => { @@ -652,7 +594,7 @@ describe("adapter creation =>", () => { await expectSuccess( "ReleaseScript_JS", answers, - (file) => + file => file.name === "package.json" || file.name === "README.md" || file.name === ".releaseconfig.json", @@ -668,7 +610,7 @@ describe("adapter creation =>", () => { await expectSuccess( "ReleaseScript_TS", answers, - (file) => + file => file.name === "package.json" || file.name === "README.md" || file.name === ".releaseconfig.json", @@ -681,11 +623,7 @@ describe("adapter creation =>", () => { devServer: "yes", devServerPort: 9003, }; - await expectSuccess( - "dev-server", - answers, - (file) => file.name === "README.md", - ); + await expectSuccess("dev-server", answers, file => file.name === "README.md"); }); it("Start mode: schedule", async () => { @@ -694,11 +632,7 @@ describe("adapter creation =>", () => { startMode: "schedule", scheduleStartOnChange: "yes", }; - await expectSuccess( - "schedule", - answers, - (file) => file.name === "test/integration.js", - ); + await expectSuccess("schedule", answers, file => file.name === "test/integration.js"); }); it("Portal w/ GitHub", async () => { @@ -711,9 +645,7 @@ describe("adapter creation =>", () => { await expectSuccess( "portal-github", answers, - (file) => - file.name === "README.md" || - file.name.endsWith("test-and-release.yml"), + file => file.name === "README.md" || file.name.endsWith("test-and-release.yml"), ); }); @@ -725,9 +657,7 @@ describe("adapter creation =>", () => { await expectSuccess( "no_config", answers, - (file) => - file.name.startsWith("admin/") || - file.name === "io-package.json", + file => file.name.startsWith("admin/") || file.name === "io-package.json", ); }); }); @@ -761,49 +691,36 @@ describe("adapter creation =>", () => { }; const files = await createAdapter(answers); - const workflowFile = files.find((f) => - f.name.endsWith("test-and-release.yml"), - ); + const workflowFile = files.find(f => f.name.endsWith("test-and-release.yml")); if (!workflowFile) { - throw new Error( - `Workflow file not found for Node.js ${testCase.nodeVersion}`, - ); + throw new Error(`Workflow file not found for Node.js ${testCase.nodeVersion}`); } - const content = workflowFile.content; + const content = workflowFile.content.toString(); // Check that the matrix includes only the expected versions - const matrixMatch = content.match( - /node-version: \[(.*?)\]/, - ); + const matrixMatch = content.match(/node-version: \[(.*?)\]/); if (!matrixMatch) { - throw new Error( - `Matrix node versions not found for Node.js ${testCase.nodeVersion}`, - ); + throw new Error(`Matrix node versions not found for Node.js ${testCase.nodeVersion}`); } - const actualVersions = matrixMatch[1] - .split(", ") - .map((v) => v.trim()); + const actualVersions = matrixMatch[1].split(", ").map(v => v.trim()); actualVersions.should.deep.equal( testCase.expectedVersions, `For Node.js ${testCase.nodeVersion}, expected versions ${testCase.expectedVersions.join(", ")} but got ${actualVersions.join(", ")}`, ); // Check that the LTS version is correct - const ltsMatches = - content.match(/node-version: '(\d+\.x)'/g) || []; + const ltsMatches = content.match(/node-version: '(\d+\.x)'/g) || []; if (ltsMatches.length === 0) { - throw new Error( - `LTS node version not found for Node.js ${testCase.nodeVersion}`, - ); + throw new Error(`LTS node version not found for Node.js ${testCase.nodeVersion}`); } // All LTS references should use the expected version for (const ltsMatch of ltsMatches) { const ltsVersion = ltsMatch.match(/'(\d+\.x)'/)?.[1]; - ltsVersion.should.equal( + ltsVersion!.should.equal( testCase.expectedLts, `For Node.js ${testCase.nodeVersion}, expected LTS ${testCase.expectedLts} but got ${ltsVersion}`, ); diff --git a/test/mocha.setup.js b/test/mocha.setup.js index be86e73c2..d923b1ea9 100644 --- a/test/mocha.setup.js +++ b/test/mocha.setup.js @@ -4,9 +4,9 @@ process.env.TS_NODE_IGNORE_WARNINGS = "TRUE"; process.env.TS_NODE_PROJECT = "tsconfig.json"; // Don't silently swallow unhandled rejections -process.on("unhandledRejection", (e) => { +process.on("unhandledRejection", e => { throw e; -}) +}); // enable the should interface with sinon // and load chai-as-promised and sinon-chai by default diff --git a/tsconfig.json b/tsconfig.json index bae68a24c..cf8b3ea8d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { // To update the compilation target, install a different version of @tsconfig/node... and reference it here // https://github.com/tsconfig/bases#node-12-tsconfigjson - "extends": "@tsconfig/node18/tsconfig.json", + "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { // do not compile anything, this file is just to configure type checking // the compilation is configured in tsconfig.build.json