@clerc/plugin-strict-flags 1.0.2 → 1.1.0

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/README.md CHANGED
@@ -2,23 +2,9 @@
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@clerc/plugin-strict-flags?color=a1b858&label=)](https://www.npmjs.com/package/@clerc/plugin-strict-flags)
4
4
 
5
- Clerc plugin to throw error when unknown flags are passed.
5
+ ## Documenation
6
6
 
7
- ## 📦 Installation
8
-
9
- ```bash
10
- $ npm install @clerc/plugin-strict-flags
11
- $ yarn add @clerc/plugin-strict-flags
12
- $ pnpm add @clerc/plugin-strict-flags
13
- ```
14
-
15
- ## 🚀 Usage
16
-
17
- ```ts
18
- import { strictFlagsPlugin } from "@clerc/plugin-strict-flags";
19
-
20
- cli.use(strictFlagsPlugin());
21
- ```
7
+ Read the [documentation](https://clerc.so1ve.dev/official-plugins/plugin-strict-flags.html) for more details.
22
8
 
23
9
  ## 📝 License
24
10
 
@@ -1,14 +1,6 @@
1
1
  import { definePlugin } from "@clerc/core";
2
+ import { joinWithAnd } from "@clerc/utils";
2
3
 
3
- //#region ../utils/src/index.ts
4
- function joinWithAnd(values) {
5
- if (values.length === 0) return "";
6
- if (values.length === 1) return values[0];
7
- const last = values.pop();
8
- return `${values.join(", ")} and ${last}`;
9
- }
10
-
11
- //#endregion
12
4
  //#region src/index.ts
13
5
  const strictFlagsPlugin = () => definePlugin({ setup: (cli) => {
14
6
  cli.interceptor(async (ctx, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-strict-flags",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve)",
5
5
  "type": "module",
6
6
  "description": "Clerc plugin strict flags",
@@ -25,28 +25,23 @@
25
25
  "license": "MIT",
26
26
  "sideEffects": false,
27
27
  "exports": {
28
- ".": "./dist/index.js"
29
- },
30
- "main": "./dist/index.js",
31
- "module": "./dist/index.js",
32
- "types": "dist/index.d.ts",
33
- "typesVersions": {
34
- "*": {
35
- "*": [
36
- "./dist/*",
37
- "./dist/index.d.ts"
38
- ]
39
- }
28
+ ".": "./dist/index.mjs",
29
+ "./package.json": "./package.json"
40
30
  },
31
+ "main": "./dist/index.mjs",
32
+ "module": "./dist/index.mjs",
33
+ "types": "./dist/index.d.mts",
41
34
  "files": [
42
35
  "dist"
43
36
  ],
44
37
  "publishConfig": {
45
38
  "access": "public"
46
39
  },
40
+ "dependencies": {
41
+ "@clerc/utils": "1.1.0"
42
+ },
47
43
  "devDependencies": {
48
- "@clerc/core": "1.0.2",
49
- "@clerc/utils": "1.0.2"
44
+ "@clerc/core": "1.1.0"
50
45
  },
51
46
  "peerDependencies": {
52
47
  "@clerc/core": "*"
File without changes