fitbit-sdk-types
Advanced tools
Comparing version 8.0.0 to 8.0.1
{ | ||
"name": "fitbit-sdk-types", | ||
"version": "8.0.0", | ||
"version": "8.0.1", | ||
"author": "Sergio Morchón Poveda <sergio.morchon@outlook.com>", | ||
@@ -32,3 +32,4 @@ "description": "Types for Fitbit SDK.", | ||
"test:settings": "tsc -p test-code-samples/settings", | ||
"test": "npm run test:app && npm run test:companion && npm run test:settings", | ||
"test:scripts": "tsc -p scripts", | ||
"test": "npm run test:app && npm run test:companion && npm run test:settings && npm run test:scripts", | ||
"prettier": "prettier -l \"**/*.ts\" \"**/*.tsx\" \"**/*.json\" \"**/*.yml\" \"**/*.md\"", | ||
@@ -35,0 +36,0 @@ "lint": "eslint types/**/*.ts", |
@@ -1,2 +0,8 @@ | ||
export const help = () => { | ||
export const help = ( | ||
/** @type {{install: string, migrate: String, vscode: string}} */ { | ||
install, | ||
migrate, | ||
vscode, | ||
}, | ||
) => { | ||
console.info(` | ||
@@ -6,8 +12,8 @@ Add types to your Fitbit SDK project. | ||
Positional arguments: | ||
install: Installs this package types in your project. | ||
${install}: Installs this package types in your project. | ||
Optional arguments: | ||
--migrate: Move from JavaScript files to TypeScript files. | ||
--vscode: Adds extra configuration for Visual Studio Code IDE. | ||
${migrate}: Move from JavaScript files to TypeScript files. | ||
${vscode}: Adds extra configuration for Visual Studio Code IDE. | ||
`); | ||
}; |
#!/usr/bin/env node | ||
import { parseArgs } from 'node:util'; | ||
import { install } from './install.js'; | ||
import { help } from './help.js'; | ||
const { | ||
values: { migrate = false, vscode = false }, | ||
positionals: [command], | ||
} = parseArgs({ | ||
strict: true, | ||
options: { | ||
migrate: { type: 'boolean' }, | ||
vscode: { type: 'boolean' }, | ||
}, | ||
allowPositionals: true, | ||
}); | ||
const [, , command, ...args] = process.argv; | ||
const INSTALL_COMMAND = 'install'; | ||
const MIGRATE_ARG = '--migrate'; | ||
const VSCODE_ARG = '--vscode'; | ||
switch (command) { | ||
case 'install': | ||
install({ migrate, vscode }); | ||
case INSTALL_COMMAND: | ||
install({ | ||
migrate: args.includes(MIGRATE_ARG), | ||
vscode: args.includes(VSCODE_ARG), | ||
}); | ||
break; | ||
default: | ||
help(); | ||
help({ | ||
install: INSTALL_COMMAND, | ||
migrate: MIGRATE_ARG, | ||
vscode: VSCODE_ARG, | ||
}); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64114
2098