@jpp-toolkit/plugin-clean 0.0.93 → 0.0.95
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/dist/index.mjs.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/clean-command.ts","../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { Command } from '@jpp-toolkit/core';\nimport { findProjectRoot } from '@jpp-toolkit/utils';\nimport { Flags } from '@oclif/core';\nimport { execa } from 'execa';\nimport { rimraf } from 'rimraf';\n\nconst RESET_PATTERNS = ['!old', '!tmp'];\nconst CLEAN_PATTERNS = [\n ...RESET_PATTERNS,\n '!node_modules',\n '!node_modules/**',\n '**/node_modules/.cache',\n '!**/hooks/_',\n '!**/hooks/_/**',\n '!.env',\n];\n\nexport class CleanCommand extends Command {\n static override summary = 'Remove build artifacts and temporary files from the project.';\n\n static override flags = {\n 'dry-run': Flags.boolean({\n char: 'd',\n description: 'Perform a dry run without deleting files.',\n default: false,\n }),\n 'reset': Flags.boolean({\n char: 'r',\n description: 'Reset the project to a clean state.',\n default: false,\n }),\n 'root': Flags.boolean({\n char: 'R',\n description: 'Clean from the project root directory.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Perform a dry run of the clean command.',\n command: '<%= config.bin %> <%= command.id %> --dry-run',\n },\n {\n description: 'Reset the project to a clean state.',\n command: '<%= config.bin %> <%= command.id %> --reset',\n },\n {\n description: 'Clean 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(CleanCommand);\n\n const cwd = flags.root ? findProjectRoot() : process.cwd();\n const patterns = flags.reset ? RESET_PATTERNS : CLEAN_PATTERNS;\n\n const { stdout } = await execa(\n 'git',\n [\n 'ls-files',\n '--others',\n '--ignored',\n '--exclude-standard',\n '--directory',\n ...patterns.map((pattern) => `--exclude=${pattern}`),\n ],\n { cwd, lines: true },\n );\n\n const paths = stdout\n .filter((line) => line.trim().length > 0)\n .map((filePath) => path.resolve(cwd, filePath));\n\n if (paths.length === 0) {\n this.logger.info('No files to clean');\n return;\n }\n\n if (flags['dry-run']) {\n this.logger.info('The following files would be removed:');\n this.logger.paths(paths);\n return;\n }\n\n await rimraf(paths);\n\n this.logger.success('Cleaned the following files:');\n this.logger.paths(paths);\n }\n}\n","import { CleanCommand } from './clean-command';\n\nexport const commands = {\n clean: CleanCommand,\n};\n"],"mappings":";;;;;;;AAQA,MAAM,iBAAiB,CAAC,QAAQ,OAAO;AACvC,MAAM,iBAAiB;CACnB,GAAG;CACH;CACA;CACA;CACA;CACA;CACA;CACH;;;ACfD,MAAa,WAAW,EACpB,OAAO,MDgBE,qBAAqB,QAAQ;CACtC,OAAgB,UAAU;CAE1B,OAAgB,QAAQ;EACpB,WAAW,MAAM,QAAQ;GACrB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,SAAS,MAAM,QAAQ;GACnB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,QAAQ,MAAM,QAAQ;GAClB,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,aAAa;EAEhD,MAAM,MAAM,MAAM,OAAO,iBAAiB,GAAG,QAAQ,KAAK;EAG1D,MAAM,EAAE,WAAW,MAAM,MACrB,OACA;GACI;GACA;GACA;GACA;GACA;GACA,IAVS,MAAM,QAAQ,iBAAiB,gBAU5B,KAAK,YAAY,aAAa,UAAU;GACvD,EACD;GAAE;GAAK,OAAO;GAAM,CACvB;EAED,MAAM,QAAQ,OACT,QAAQ,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE,CACxC,KAAK,aAAa,KAAK,QAAQ,KAAK,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/clean-command.ts","../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport { Command } from '@jpp-toolkit/core';\nimport { findProjectRoot } from '@jpp-toolkit/utils';\nimport { Flags } from '@oclif/core';\nimport { execa } from 'execa';\nimport { rimraf } from 'rimraf';\n\nconst RESET_PATTERNS = ['!old', '!tmp'];\nconst CLEAN_PATTERNS = [\n ...RESET_PATTERNS,\n '!node_modules',\n '!node_modules/**',\n '**/node_modules/.cache',\n '!**/hooks/_',\n '!**/hooks/_/**',\n '!.env',\n];\n\nexport class CleanCommand extends Command {\n static override summary = 'Remove build artifacts and temporary files from the project.';\n\n static override flags = {\n 'dry-run': Flags.boolean({\n char: 'd',\n description: 'Perform a dry run without deleting files.',\n default: false,\n }),\n 'reset': Flags.boolean({\n char: 'r',\n description: 'Reset the project to a clean state.',\n default: false,\n }),\n 'root': Flags.boolean({\n char: 'R',\n description: 'Clean from the project root directory.',\n default: false,\n }),\n };\n\n static override examples = [\n {\n description: 'Perform a dry run of the clean command.',\n command: '<%= config.bin %> <%= command.id %> --dry-run',\n },\n {\n description: 'Reset the project to a clean state.',\n command: '<%= config.bin %> <%= command.id %> --reset',\n },\n {\n description: 'Clean 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(CleanCommand);\n\n const cwd = flags.root ? findProjectRoot() : process.cwd();\n const patterns = flags.reset ? RESET_PATTERNS : CLEAN_PATTERNS;\n\n const { stdout } = await execa(\n 'git',\n [\n 'ls-files',\n '--others',\n '--ignored',\n '--exclude-standard',\n '--directory',\n ...patterns.map((pattern) => `--exclude=${pattern}`),\n ],\n { cwd, lines: true },\n );\n\n const paths = stdout\n .filter((line) => line.trim().length > 0)\n .map((filePath) => path.resolve(cwd, filePath));\n\n if (paths.length === 0) {\n this.logger.info('No files to clean');\n return;\n }\n\n if (flags['dry-run']) {\n this.logger.info('The following files would be removed:');\n this.logger.paths(paths);\n return;\n }\n\n await rimraf(paths);\n\n this.logger.success('Cleaned the following files:');\n this.logger.paths(paths);\n }\n}\n","import { CleanCommand } from './clean-command';\n\nexport const commands = {\n clean: CleanCommand,\n};\n"],"mappings":";;;;;;;AAQA,MAAM,iBAAiB,CAAC,QAAQ,OAAO;AACvC,MAAM,iBAAiB;CACnB,GAAG;CACH;CACA;CACA;CACA;CACA;CACA;CACH;;;ACfD,MAAa,WAAW,EACpB,OAAO,MDgBE,qBAAqB,QAAQ;CACtC,OAAgB,UAAU;CAE1B,OAAgB,QAAQ;EACpB,WAAW,MAAM,QAAQ;GACrB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,SAAS,MAAM,QAAQ;GACnB,MAAM;GACN,aAAa;GACb,SAAS;GACZ,CAAC;EACF,QAAQ,MAAM,QAAQ;GAClB,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,aAAa;EAEhD,MAAM,MAAM,MAAM,OAAO,iBAAiB,GAAG,QAAQ,KAAK;EAG1D,MAAM,EAAE,WAAW,MAAM,MACrB,OACA;GACI;GACA;GACA;GACA;GACA;GACA,IAVS,MAAM,QAAQ,iBAAiB,gBAU5B,KAAK,YAAY,aAAa,UAAU;GACvD,EACD;GAAE;GAAK,OAAO;GAAM,CACvB;EAED,MAAM,QAAQ,OACT,QAAQ,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE,CACxC,KAAK,aAAa,KAAK,QAAQ,KAAK,SAAS,CAAC;EAEnD,IAAI,MAAM,WAAW,GAAG;GACpB,KAAK,OAAO,KAAK,oBAAoB;GACrC;;EAGJ,IAAI,MAAM,YAAY;GAClB,KAAK,OAAO,KAAK,wCAAwC;GACzD,KAAK,OAAO,MAAM,MAAM;GACxB;;EAGJ,MAAM,OAAO,MAAM;EAEnB,KAAK,OAAO,QAAQ,+BAA+B;EACnD,KAAK,OAAO,MAAM,MAAM;;GCxF/B"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jpp-toolkit/plugin-clean",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.95",
|
|
4
4
|
"description": "Plugin that add the clean command to the jpp cli.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jpp",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"oclif.manifest.json"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@oclif/core": "4.11.
|
|
36
|
+
"@oclif/core": "4.11.2",
|
|
37
37
|
"execa": "9.6.1",
|
|
38
38
|
"rimraf": "6.1.3",
|
|
39
|
-
"@jpp-toolkit/core": "0.0.
|
|
39
|
+
"@jpp-toolkit/core": "0.0.53",
|
|
40
40
|
"@jpp-toolkit/utils": "0.0.37"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"oclif": "4.23.
|
|
43
|
+
"oclif": "4.23.1"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": "24",
|