@jpp-toolkit/plugin-check-updates 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Julien Papini
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,24 @@
1
+ import { Command } from "@jpp-toolkit/core";
2
+ import * as _oclif_core_interfaces0 from "@oclif/core/interfaces";
3
+
4
+ //#region src/check-updates-command.d.ts
5
+ declare class CheckUpdatesCommand extends Command {
6
+ static summary: string;
7
+ static flags: {
8
+ workspace: _oclif_core_interfaces0.BooleanFlag<boolean>;
9
+ root: _oclif_core_interfaces0.BooleanFlag<boolean>;
10
+ };
11
+ static examples: {
12
+ description: string;
13
+ command: string;
14
+ }[];
15
+ run(): Promise<void>;
16
+ }
17
+ //#endregion
18
+ //#region src/index.d.ts
19
+ declare const commands: {
20
+ 'check-updates': typeof CheckUpdatesCommand;
21
+ };
22
+ //#endregion
23
+ export { commands };
24
+ //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs ADDED
@@ -0,0 +1,64 @@
1
+ import { Command } from "@jpp-toolkit/core";
2
+ import { findProjectRoot } from "@jpp-toolkit/utils";
3
+ import { Flags } from "@oclif/core";
4
+ import { run } from "npm-check-updates";
5
+
6
+ //#region src/check-updates-command.ts
7
+ var CheckUpdatesCommand = class CheckUpdatesCommand extends Command {
8
+ static summary = "Check updates for project dependencies.";
9
+ static flags = {
10
+ workspace: Flags.boolean({
11
+ char: "w",
12
+ description: "Check updates for all workspaces in a monorepo.",
13
+ default: false
14
+ }),
15
+ root: Flags.boolean({
16
+ char: "R",
17
+ description: "Check updates from the project root directory.",
18
+ default: false
19
+ })
20
+ };
21
+ static examples = [
22
+ {
23
+ description: "Run the check-updates command.",
24
+ command: "<%= config.bin %> <%= command.id %>"
25
+ },
26
+ {
27
+ description: "Run the check-updates command for all workspaces in a monorepo.",
28
+ command: "<%= config.bin %> <%= command.id %> --workspace"
29
+ },
30
+ {
31
+ description: "Run the check-updates command from the project root directory.",
32
+ command: "<%= config.bin %> <%= command.id %> --root"
33
+ }
34
+ ];
35
+ async run() {
36
+ const { flags } = await this.parse(CheckUpdatesCommand);
37
+ await run({
38
+ cwd: flags.root ? findProjectRoot() : process.cwd(),
39
+ color: true,
40
+ interactive: true,
41
+ upgrade: true,
42
+ format: ["group"],
43
+ install: "never",
44
+ dep: [
45
+ "prod",
46
+ "dev",
47
+ "optional",
48
+ "packageManager"
49
+ ],
50
+ ...flags.workspace ? {
51
+ root: true,
52
+ workspaces: true
53
+ } : {}
54
+ }, { cli: true });
55
+ }
56
+ };
57
+
58
+ //#endregion
59
+ //#region src/index.ts
60
+ const commands = { "check-updates": CheckUpdatesCommand };
61
+
62
+ //#endregion
63
+ export { commands };
64
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["ncu"],"sources":["../src/check-updates-command.ts","../src/index.ts"],"sourcesContent":["import { Command } from '@jpp-toolkit/core';\nimport { findProjectRoot } from '@jpp-toolkit/utils';\nimport { Flags } from '@oclif/core';\nimport { run as ncu } from 'npm-check-updates';\n\nexport class CheckUpdatesCommand extends Command {\n static override summary = 'Check updates for project dependencies.';\n\n static override flags = {\n workspace: Flags.boolean({\n char: 'w',\n description: 'Check updates for all workspaces in a monorepo.',\n default: false,\n }),\n root: Flags.boolean({\n char: 'R',\n description: 'Check updates from the project root directory.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Run the check-updates command.',\n command: '<%= config.bin %> <%= command.id %>',\n },\n {\n description: 'Run the check-updates command for all workspaces in a monorepo.',\n command: '<%= config.bin %> <%= command.id %> --workspace',\n },\n {\n description: 'Run the check-updates command from the project root directory.',\n command: '<%= config.bin %> <%= command.id %> --root',\n },\n ];\n\n public async run(): Promise<void> {\n const { flags } = await this.parse(CheckUpdatesCommand);\n\n const cwd = flags.root ? findProjectRoot() : process.cwd();\n\n await ncu(\n {\n cwd,\n color: true,\n interactive: true,\n upgrade: true,\n format: ['group'],\n install: 'never',\n dep: ['prod', 'dev', 'optional', 'packageManager'],\n\n ...(flags.workspace ?\n {\n root: true,\n workspaces: true,\n }\n : {}),\n },\n { cli: true },\n );\n }\n}\n","import { CheckUpdatesCommand } from './check-updates-command';\n\nexport const commands = {\n 'check-updates': CheckUpdatesCommand,\n};\n"],"mappings":";;;;;;AAKA,IAAa,sBAAb,MAAa,4BAA4B,QAAQ;CAC7C,OAAgB,UAAU;CAE1B,OAAgB,QAAQ;EACpB,WAAW,MAAM,QAAQ;GACrB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,MAAM,MAAM,QAAQ;GAChB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACL;CAED,OAAgB,WAAW;EACvB;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACD;GACI,aAAa;GACb,SAAS;GACZ;EACJ;CAED,MAAa,MAAqB;EAC9B,MAAM,EAAE,UAAU,MAAM,KAAK,MAAM,oBAAoB;AAIvD,QAAMA,IACF;GACI,KAJI,MAAM,OAAO,iBAAiB,GAAG,QAAQ,KAAK;GAKlD,OAAO;GACP,aAAa;GACb,SAAS;GACT,QAAQ,CAAC,QAAQ;GACjB,SAAS;GACT,KAAK;IAAC;IAAQ;IAAO;IAAY;IAAiB;GAElD,GAAI,MAAM,YACN;IACI,MAAM;IACN,YAAY;IACf,GACD,EAAE;GACT,EACD,EAAE,KAAK,MAAM,CAChB;;;;;;ACzDT,MAAa,WAAW,EACpB,iBAAiB,qBACpB"}
@@ -0,0 +1,8 @@
1
+ export default {
2
+ description: 'Plugin that add the check-updates command to the jpp cli.',
3
+ commands: {
4
+ strategy: 'explicit',
5
+ target: './dist/index.mjs',
6
+ identifier: 'commands',
7
+ },
8
+ };
@@ -0,0 +1,47 @@
1
+ {
2
+ "commands": {
3
+ "check-updates": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "examples": [
7
+ {
8
+ "description": "Run the check-updates command.",
9
+ "command": "<%= config.bin %> <%= command.id %>"
10
+ },
11
+ {
12
+ "description": "Run the check-updates command for all workspaces in a monorepo.",
13
+ "command": "<%= config.bin %> <%= command.id %> --workspace"
14
+ },
15
+ {
16
+ "description": "Run the check-updates command from the project root directory.",
17
+ "command": "<%= config.bin %> <%= command.id %> --root"
18
+ }
19
+ ],
20
+ "flags": {
21
+ "workspace": {
22
+ "char": "w",
23
+ "description": "Check updates for all workspaces in a monorepo.",
24
+ "name": "workspace",
25
+ "allowNo": false,
26
+ "type": "boolean"
27
+ },
28
+ "root": {
29
+ "char": "R",
30
+ "description": "Check updates from the project root directory.",
31
+ "name": "root",
32
+ "allowNo": false,
33
+ "type": "boolean"
34
+ }
35
+ },
36
+ "hasDynamicHelp": false,
37
+ "hiddenAliases": [],
38
+ "id": "check-updates",
39
+ "pluginAlias": "@jpp-toolkit/plugin-check-updates",
40
+ "pluginName": "@jpp-toolkit/plugin-check-updates",
41
+ "pluginType": "core",
42
+ "strict": true,
43
+ "summary": "Check updates for project dependencies."
44
+ }
45
+ },
46
+ "version": "0.0.11"
47
+ }
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@jpp-toolkit/plugin-check-updates",
3
+ "version": "0.0.11",
4
+ "description": "Plugin that add the check-updates command to the jpp cli.",
5
+ "keywords": [
6
+ "jpp",
7
+ "plugin",
8
+ "check-updates"
9
+ ],
10
+ "homepage": "https://github.com/jpapini/jpp-toolkit/tree/main/packages/plugin-check-updates#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/jpapini/jpp-toolkit/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/jpapini/jpp-toolkit.git",
17
+ "directory": "packages/plugin-check-updates"
18
+ },
19
+ "license": "MIT",
20
+ "author": "Julien Papini <julien.papini@gmail.com> (https://github.com/jpapini)",
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.mts",
25
+ "default": "./dist/index.mjs"
26
+ },
27
+ "./package.json": "./package.json"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "src",
32
+ "oclif.config.js",
33
+ "oclif.manifest.json"
34
+ ],
35
+ "dependencies": {
36
+ "@oclif/core": "4.8.0",
37
+ "npm-check-updates": "19.1.2",
38
+ "@jpp-toolkit/core": "0.0.11",
39
+ "@jpp-toolkit/utils": "0.0.11"
40
+ },
41
+ "devDependencies": {
42
+ "oclif": "4.22.52"
43
+ },
44
+ "engines": {
45
+ "node": "24",
46
+ "pnpm": "10"
47
+ },
48
+ "volta": {
49
+ "extends": "../../package.json"
50
+ },
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "scripts": {
55
+ "typecheck": "tsc --noEmit --pretty",
56
+ "dev": "build-lib --watch",
57
+ "build": "build-lib"
58
+ }
59
+ }
@@ -0,0 +1,62 @@
1
+ import { Command } from '@jpp-toolkit/core';
2
+ import { findProjectRoot } from '@jpp-toolkit/utils';
3
+ import { Flags } from '@oclif/core';
4
+ import { run as ncu } from 'npm-check-updates';
5
+
6
+ export class CheckUpdatesCommand extends Command {
7
+ static override summary = 'Check updates for project dependencies.';
8
+
9
+ static override flags = {
10
+ workspace: Flags.boolean({
11
+ char: 'w',
12
+ description: 'Check updates for all workspaces in a monorepo.',
13
+ default: false,
14
+ }),
15
+ root: Flags.boolean({
16
+ char: 'R',
17
+ description: 'Check updates from the project root directory.',
18
+ default: false,
19
+ }),
20
+ };
21
+
22
+ static override examples = [
23
+ {
24
+ description: 'Run the check-updates command.',
25
+ command: '<%= config.bin %> <%= command.id %>',
26
+ },
27
+ {
28
+ description: 'Run the check-updates command for all workspaces in a monorepo.',
29
+ command: '<%= config.bin %> <%= command.id %> --workspace',
30
+ },
31
+ {
32
+ description: 'Run the check-updates command from the project root directory.',
33
+ command: '<%= config.bin %> <%= command.id %> --root',
34
+ },
35
+ ];
36
+
37
+ public async run(): Promise<void> {
38
+ const { flags } = await this.parse(CheckUpdatesCommand);
39
+
40
+ const cwd = flags.root ? findProjectRoot() : process.cwd();
41
+
42
+ await ncu(
43
+ {
44
+ cwd,
45
+ color: true,
46
+ interactive: true,
47
+ upgrade: true,
48
+ format: ['group'],
49
+ install: 'never',
50
+ dep: ['prod', 'dev', 'optional', 'packageManager'],
51
+
52
+ ...(flags.workspace ?
53
+ {
54
+ root: true,
55
+ workspaces: true,
56
+ }
57
+ : {}),
58
+ },
59
+ { cli: true },
60
+ );
61
+ }
62
+ }
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { CheckUpdatesCommand } from './check-updates-command';
2
+
3
+ export const commands = {
4
+ 'check-updates': CheckUpdatesCommand,
5
+ };