juisy 2.3.0 → 3.0.0-beta.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/dist/index.js CHANGED
@@ -1,267 +1,24 @@
1
1
  /*!
2
- * juisy v2.3.0
2
+ * juisy v3.0.0-beta.0
3
3
  * Copyright © 2022-Present Hervé Perchec
4
4
  */
5
5
 
6
- import path$1, { dirname } from 'node:path';
7
- import { pathToFileURL, fileURLToPath } from 'node:url';
8
- import fs from 'fs-extra';
9
- import { CLIFactory } from 'juisy/cli';
10
- import { readdir } from 'node:fs/promises';
11
- import { readdirSync, readFileSync } from 'node:fs';
12
- import { glob } from 'glob';
13
- import { packageDirectorySync } from 'pkg-dir';
14
6
  import yaml from 'yaml';
15
7
  import { json2csv } from 'json-2-csv';
16
8
  import jstoxml from 'jstoxml';
9
+ import fs from 'fs-extra';
10
+ import path from 'node:path';
11
+ import { packageDirectorySync } from 'pkg-dir';
17
12
  import log from 'loglevel';
18
13
  import { Templater } from 'juisy/templater';
14
+ import getFileUrls from '@juisy/utils/fs/get-file-urls';
15
+ import isFile from '@juisy/utils/fs/is-file';
16
+ import isDirectory from '@juisy/utils/fs/is-directory';
17
+ import { readFileSync } from 'node:fs';
18
+ import { pathToFileURL } from 'node:url';
19
19
  import dotenv from '@dotenvx/dotenvx';
20
20
  import deepmerge from 'deepmerge';
21
21
 
22
- // export const DEFAULT_EXT_CACHE_PATH = './node_modules/.cache/juisy/extensions.json'
23
- const DEFAULT_EXT_CACHE_PATH = './package.json';
24
-
25
- /**
26
- * Get the extensions locally added to juisy
27
- * @param {string} extCachePath - The path to extensions cache file
28
- * @returns {string[]} The extension names
29
- */
30
- function getExtensions (extCachePath = DEFAULT_EXT_CACHE_PATH) {
31
- const absolutePath = path$1.isAbsolute(extCachePath)
32
- ? extCachePath
33
- : path$1.resolve(extCachePath);
34
-
35
- // // If default, ensure file exists
36
- // if (extCachePath === DEFAULT_EXT_CACHE_PATH
37
- // && fs.existsSync(path.resolve('./node_modules'))
38
- // && !fs.existsSync(absolutePath)
39
- // ) {
40
- // fs.outputFileSync(absolutePath, '[]')
41
- // }
42
-
43
- const content = fs.readFileSync(absolutePath, 'utf-8');
44
- const extensionIds = JSON.parse(content).juisy?.extensions || [];
45
- return extensionIds
46
- }
47
-
48
- /**
49
- * Load an extension
50
- * @param {string} id - The module name or relative/absolute path
51
- */
52
- async function loadExtension (id) {
53
- // Module name or full path
54
- const modPath = id.startsWith('.') // is relative?
55
- ? path$1.resolve(id) // relative to process.cwd()
56
- : id; // can be module name or absolute path
57
-
58
- const mod = await import(path$1.isAbsolute(modPath)
59
- ? pathToFileURL(modPath).toString()
60
- : id);
61
-
62
- return mod.extension || mod.default
63
- }
64
-
65
- /**
66
- * Load the extensions
67
- * @param {?string} extCachePath - The path to extensions cache file
68
- */
69
- async function loadExtensions (extCachePath) {
70
- // Get extension identifiers
71
- const extensionIds = getExtensions(extCachePath);
72
-
73
- const extensions = [];
74
-
75
- for (const id of extensionIds) {
76
- const loaded = {
77
- id,
78
- extension: await loadExtension(id)
79
- };
80
- extensions.push(loaded);
81
- //
82
- if (loaded.extension.juisyBin) {
83
- loaded.extension.juisyBin(CLIFactory);
84
- }
85
- }
86
-
87
- return extensions
88
- }
89
-
90
- let isAlreadyBootstraped = false;
91
- async function bootstrap(importMeta) {
92
- await loadExtensions();
93
- console.log("importMeta.url:", importMeta.url);
94
- console.log("isAlreadyBootstraped ? ", isAlreadyBootstraped);
95
- isAlreadyBootstraped = true;
96
- }
97
-
98
- function getFileUrls(pattern, options) {
99
- const files = glob.sync(pattern, options || {});
100
- return files;
101
- }
102
- async function* getFiles(dir) {
103
- const dirents = await readdir(dir, { withFileTypes: true });
104
- for (const dirent of dirents) {
105
- const res = path$1.resolve(dir, dirent.name);
106
- if (dirent.isDirectory()) {
107
- yield* getFiles(res);
108
- } else {
109
- yield res;
110
- }
111
- }
112
- }
113
- function getFilesSync(dir) {
114
- const files = [];
115
- const dirents = readdirSync(dir, { withFileTypes: true });
116
- for (const dirent of dirents) {
117
- const res = path$1.resolve(dir, dirent.name);
118
- if (dirent.isDirectory()) {
119
- files.push(...getFilesSync(res));
120
- } else {
121
- files.push(res);
122
- }
123
- }
124
- return files;
125
- }
126
- function getRootDir() {
127
- return packageDirectorySync();
128
- }
129
- const path = {
130
- /**
131
- * Convert a path to win32 format (with `\\` separator)
132
- * @param val - The path to convert
133
- * @example
134
- * utils.path.toWin32('a/posix/path') // => 'a\posix\path'
135
- * utils.path.toWin32('C:\\a\\win32\\absolute\\path') // => 'C:\a\win32\absolute\path'
136
- * utils.path.toWin32('a/mixed\\path') // => 'a\mixed\path'
137
- */
138
- toWin32(val) {
139
- return val.split(path$1.posix.sep).join(path$1.win32.sep);
140
- },
141
- /**
142
- * Convert a path to posix format (with `/` separator)
143
- * @param val - The path to convert
144
- * @example
145
- * utils.path.toPosix('a/posix/path') // => 'a/posix/path'
146
- * utils.path.toPosix('C:\\a\\win32\\absolute\\path') // => 'C:/a/win32/absolute/path'
147
- * utils.path.toPosix('a/mixed\\path') // => 'a/mixed/path'
148
- */
149
- toPosix(val) {
150
- return val.split(path$1.win32.sep).join(path$1.posix.sep);
151
- },
152
- /**
153
- * Automatically convert a path to OS specific format
154
- * @param val - The path to convert
155
- */
156
- toOsFormat(val) {
157
- const platform = process.platform;
158
- return platform === "win32" ? path.toWin32(val) : path.toPosix(val);
159
- },
160
- /**
161
- * Check if the given path is win32 format
162
- * @param val - The path to check
163
- * @example
164
- * utils.path.isWin32('a/posix/path') // => false
165
- * utils.path.isWin32('C:\\a\\win32\\absolute\\path') // => true
166
- * utils.path.isWin32('a/mixed\\path') // => true
167
- */
168
- isWin32(val) {
169
- return /^[a-zA-Z]:/.test(val) || val.includes("\\");
170
- },
171
- /**
172
- * Check if the given path is posix format
173
- * @param val - The path to check
174
- * @example
175
- * utils.path.isPosix('a/posix/path') // => true
176
- * utils.path.isPosix('C:\\a\\win32\\absolute\\path') // => false
177
- * utils.path.isPosix('a/mixed\\path') // => false
178
- */
179
- isPosix(val) {
180
- return !path.isWin32(val);
181
- },
182
- /**
183
- * Normalize a path depending on base format
184
- * @param val - The path to normalize
185
- * @example
186
- * utils.path.normalize('a/Posix/path') // => 'a/Posix/path'
187
- * utils.path.normalize('C:\\a\\Win32\\Absolute\\path\\') // => 'c:\a\win32\absolute\path'
188
- * utils.path.normalize('a/Mixed\\Path') // => 'a\mixed\path'
189
- */
190
- normalize(val) {
191
- let normalized;
192
- if (path.isWin32(val)) {
193
- normalized = path$1.win32.normalize(val).toLowerCase();
194
- } else {
195
- normalized = path$1.posix.normalize(val);
196
- }
197
- if ((normalized.endsWith("/") || normalized.endsWith("\\")) && normalized.length > 1) {
198
- normalized = normalized.slice(0, -1);
199
- }
200
- return normalized;
201
- },
202
- /**
203
- * Util to resolve a relative file path
204
- * @param from - The "from" absolute file path
205
- * @param to - The "to" absolute file path
206
- * @param separator - (Optional) The separator type: can be `"posix"` or `"win32"`
207
- * @returns The resolved relative path
208
- * @example
209
- * const base = 'C:\\Users\\JohnDoe\\Documents\\Projects\\MyProject'
210
- *
211
- * utils.path.resolveRel(base, 'C:\\Users\\JohnDoe\\Documents\\Projects\\MyProject\\src\\index.ts') // 'src\\index.ts'
212
- * utils.path.resolveRel('C:\\Users\\JohnDoe\\Documents\\Projects\\MyProject\\src\\index.ts', base) // '..\\..'
213
- * utils.path.resolveRel(base, 'C:\\Users\\JohnDoe\\Documents\\Projects\\MyProject\\src\\index.ts', 'posix') // 'src/index.ts'
214
- */
215
- resolveRel(from, to, separator) {
216
- const relativePath = path$1.relative(from, to);
217
- return separator ? separator === "posix" ? path.toPosix(relativePath) : path.toWin32(relativePath) : path.toOsFormat(relativePath);
218
- },
219
- /**
220
- * Util to resolve relative file path from root directory
221
- * @param to - The absolute file path
222
- * @param separator - (Optional) The separator type: can be `"posix"` or `"win32"`
223
- * @returns The resolved relative path from root directory
224
- */
225
- resolveRelFromRoot(to, separator) {
226
- return path.resolveRel(getRootDir(), to, separator);
227
- },
228
- /**
229
- * Util to resolve absolute file path from root directory
230
- * @param to - The relative file path
231
- * @param separator - (Optional) The separator type: can be `"posix"` or `"win32"`
232
- * @returns The resolved absolute path from root directory
233
- */
234
- resolveAbsFromRoot(to, separator) {
235
- const absolutePath = path$1.join(getRootDir(), to);
236
- return separator ? separator === "posix" ? path.toPosix(absolutePath) : path.toWin32(absolutePath) : path.toOsFormat(absolutePath);
237
- },
238
- /**
239
- * Util function to compare two file paths
240
- * @param a - The first file path to compare
241
- * @param b - The second file path to compare
242
- * @returns True if the two paths are the same
243
- * @example
244
- * utils.path.isSameAs('src/index.ts', 'src\\index.ts') // true
245
- * utils.path.isSameAs('../src/index.ts', '..\\src\\index.ts') // true
246
- * utils.path.isSameAs('C:\\a\\Win32\\Absolute\\path\\', 'c:/a/Win32/Absolute/path') // true
247
- * utils.path.isSameAs('C:\\a\\Win32\\Absolute\\path\\', '/a/Win32/Absolute/path')// false
248
- * utils.path.isSameAs('/a/posix/absolute/path', '/a/posix/absolute/path/../../absolute/path') // true
249
- * utils.path.isSameAs('/a/posix/absolute/path', '/a/Posix/Absolute/path') // false
250
- */
251
- isSameAs(a, b) {
252
- return path.normalize(path.toPosix(a)) === path.normalize(path.toPosix(b));
253
- }
254
- };
255
-
256
- const misc = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
257
- __proto__: null,
258
- getFileUrls,
259
- getFiles,
260
- getFilesSync,
261
- getRootDir,
262
- path
263
- }, Symbol.toStringTag, { value: 'Module' }));
264
-
265
22
  const xml = jstoxml.toXML;
266
23
  const SUPPORTED_FORMATS = [
267
24
  "json",
@@ -301,6 +58,7 @@ class DataExporter {
301
58
  throw new Error(`DataConverter: Unsupported "${format}" format`);
302
59
  }
303
60
  }
61
+ // eslint-disable-line @typescript-eslint/no-explicit-any
304
62
  exportSync(data, options) {
305
63
  switch (this.format) {
306
64
  case "json":
@@ -320,31 +78,13 @@ class DataExporter {
320
78
  }
321
79
  }
322
80
 
323
- const __filename = fileURLToPath(import.meta.url);
324
- dirname(__filename);
325
81
  const templater = new Templater("ejs", {
326
82
  engineOptions: {
327
83
  // ...
328
84
  }
329
85
  });
330
- async function isDirectory(filePath) {
331
- try {
332
- const stats = await fs.stat(filePath);
333
- return stats.isDirectory();
334
- } catch (err) {
335
- return false;
336
- }
337
- }
338
- async function isFile(filePath) {
339
- try {
340
- const stats = await fs.stat(filePath);
341
- return stats.isFile();
342
- } catch (err) {
343
- return false;
344
- }
345
- }
346
86
  async function ejectFile(from, to, identifier = null, options) {
347
- identifier = identifier || path$1.basename(from);
87
+ identifier = identifier || path.basename(from);
348
88
  const force = options?.force || false;
349
89
  const templateData = options?.templateData;
350
90
  const processor = options?.processor || (async (str, _identifier) => str);
@@ -383,10 +123,10 @@ async function eject(templateDir, identifier, options) {
383
123
  throw new Error("eject: identifier is required");
384
124
  } else {
385
125
  try {
386
- const fullPath = path$1.resolve(templateDir, identifier);
126
+ const fullPath = path.resolve(templateDir, identifier);
387
127
  if (await isFile(fullPath)) {
388
128
  if (!ignoreFiles.includes(identifier)) {
389
- await ejectFile(fullPath, path$1.resolve(targetDir, identifier), identifier, {
129
+ await ejectFile(fullPath, path.resolve(targetDir, identifier), identifier, {
390
130
  force: options?.force,
391
131
  templateData: options?.templateData,
392
132
  processor: options?.processor,
@@ -397,9 +137,9 @@ async function eject(templateDir, identifier, options) {
397
137
  } else {
398
138
  const globPattern = await isDirectory(fullPath) ? identifier + "/**/*" : identifier;
399
139
  for (const fileRelativePath of getFileUrls(globPattern, { cwd: templateDir, nodir: true, posix: true, dot: true })) {
400
- const fullTemplateFilePath = path$1.resolve(templateDir, fileRelativePath);
140
+ const fullTemplateFilePath = path.resolve(templateDir, fileRelativePath);
401
141
  if (!ignoreFiles.includes(fileRelativePath)) {
402
- await ejectFile(fullTemplateFilePath, path$1.resolve(targetDir, fileRelativePath), fileRelativePath, {
142
+ await ejectFile(fullTemplateFilePath, path.resolve(targetDir, fileRelativePath), fileRelativePath, {
403
143
  force: options?.force,
404
144
  templateData: options?.templateData,
405
145
  processor: options?.processor,
@@ -417,7 +157,7 @@ async function eject(templateDir, identifier, options) {
417
157
  }
418
158
 
419
159
  function getPackageInfo() {
420
- const pkgPath = path$1.resolve(packageDirectorySync(), "./package.json");
160
+ const pkgPath = path.resolve(packageDirectorySync(), "./package.json");
421
161
  return JSON.parse(readFileSync(pkgPath, "utf8"));
422
162
  }
423
163
 
@@ -473,10 +213,9 @@ function defineGlobals(config, builder) {
473
213
  return deepmerge(GLOBALS, JSON.parse(JSON.stringify(builder(ctx))));
474
214
  }
475
215
  async function getProjectGlobals(filePath = "./project.globals.js") {
476
- return (await import(pathToFileURL(path$1.resolve(filePath)))).default;
216
+ return (await import(pathToFileURL(path.resolve(filePath)))).default;
477
217
  }
478
218
 
479
- bootstrap(import.meta);
480
219
  const index = {};
481
220
 
482
- export { DataExporter, index as default, defineGlobals, eject, getPackageInfo, getProjectGlobals, misc as utils };
221
+ export { DataExporter, index as default, defineGlobals, eject, getPackageInfo, getProjectGlobals };
@@ -29,7 +29,8 @@ export type DotenvOptions = Omit<DotenvConfigOptions, 'processEnv'>;
29
29
  /**
30
30
  * @group Types
31
31
  */
32
- export type DefineGlobalsBuilder<T extends Record<string, any>> = (ctx: {
32
+ export type DefineGlobalsBuilder<T extends Record<string, any>> = (// eslint-disable-line @typescript-eslint/no-explicit-any
33
+ ctx: {
33
34
  env: NodeJS.ProcessEnv;
34
35
  pkg: PackageJson;
35
36
  }) => T;
@@ -40,7 +41,8 @@ export type DefineGlobalsBuilder<T extends Record<string, any>> = (ctx: {
40
41
  * @returns The computed globals object
41
42
  * @group None
42
43
  */
43
- export declare function defineGlobals<CustomGlobals extends Record<string, any>>(config: {
44
+ export declare function defineGlobals<CustomGlobals extends Record<string, any>>(// eslint-disable-line @typescript-eslint/no-explicit-any
45
+ config: {
44
46
  env?: {
45
47
  map?: string[];
46
48
  dotenvOptions?: DotenvOptions;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * juisy v2.3.0
2
+ * juisy v3.0.0-beta.0
3
3
  * Copyright © 2022-Present Hervé Perchec
4
4
  */
5
5
 
@@ -61,6 +61,7 @@ class Templater {
61
61
  engine;
62
62
  defaultData;
63
63
  methodsMap = {};
64
+ // eslint-disable-line @typescript-eslint/no-unsafe-function-type
64
65
  /**
65
66
  * @returns Get the engine
66
67
  */
@@ -188,7 +189,6 @@ class ReadmeTemplater {
188
189
  /**
189
190
  * Render README markdown
190
191
  * @param options - Options object
191
- * @param options.data - Additionnal data object to merge with default EJS data
192
192
  * @returns Returns the rendered markdown as string. Promise is immediately resolved except if a module is async.
193
193
  * @example
194
194
  * await templater.render()
@@ -23,7 +23,7 @@ export type Configuration = {
23
23
  */
24
24
  ejsDataPath: string;
25
25
  /**
26
- * EJS options: see also {@link https://www.npmjs.com/package/ejs#options EJS documentation}.
26
+ * EJS options: see also {@link https://www.npmjs.com/package/ejs#options "EJS documentation"}.
27
27
  * @property {string[]} [ejsOptions.root] - The path of template folder is automatically included.
28
28
  * @property {string[]} [ejsOptions.views] - The path of template folder and the path of internal partials are automatically included.
29
29
  */
@@ -81,13 +81,15 @@ export declare class ReadmeTemplater {
81
81
  /**
82
82
  * Render README markdown
83
83
  * @param options - Options object
84
- * @param options.data - Additionnal data object to merge with default EJS data
85
84
  * @returns Returns the rendered markdown as string. Promise is immediately resolved except if a module is async.
86
85
  * @example
87
86
  * await templater.render()
88
87
  * await templater.render({ data: { foo: 'bar' } })
89
88
  */
90
89
  render(options?: {
90
+ /**
91
+ * Additionnal data object to merge with default EJS data
92
+ */
91
93
  data?: Record<any, any>;
92
94
  }): Promise<string>;
93
95
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juisy",
3
- "version": "2.3.0",
3
+ "version": "3.0.0-beta.0",
4
4
  "description": "Make your JavaScript (and/or TypeScript) project juicy!",
5
5
  "type": "module",
6
6
  "files": [
@@ -90,6 +90,7 @@
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@github/markdownlint-github": "^0.6.3",
93
+ "@juisy/utils": "3.0.0-beta.0",
93
94
  "@types/yargs": "^17.0.33",
94
95
  "@types/yargs-parser": "^21.0.3",
95
96
  "conventional-changelog-cli": "^5.0.0",
@@ -113,7 +114,6 @@
113
114
  }
114
115
  },
115
116
  "devDependencies": {
116
- "@babel/eslint-parser": "^7.25.9",
117
117
  "@conventional-changelog/git-client": "^1.0.1",
118
118
  "@types/conventional-changelog": "^3.1.5",
119
119
  "@types/conventional-changelog-config-spec": "^2.1.5",
@@ -129,9 +129,7 @@
129
129
  "@types/semver": "^7.5.8",
130
130
  "@types/yargs": "^17.0.33",
131
131
  "@types/yargs-parser": "^21.0.3",
132
- "@typescript-eslint/eslint-plugin": "^8.18.1",
133
132
  "cpy-cli": "^5.0.0",
134
- "eslint": "^9.17.0",
135
133
  "json-schema-to-ts": "^3.1.1",
136
134
  "lint-staged": "^14.0.1",
137
135
  "npm-check-updates": "^17.1.12",
@@ -144,15 +142,16 @@
144
142
  "@commitlint/cli": "^19.6.1",
145
143
  "@commitlint/config-conventional": "^19.6.0",
146
144
  "@commitlint/types": "^19.8.0",
147
- "@dotenvx/dotenvx": "^1.31.0",
145
+ "@dotenvx/dotenvx": "1.32.0",
146
+ "@juisy/utils": "3.0.0-beta.0",
148
147
  "@release-it/bumper": "6.0.1",
149
148
  "@release-it/conventional-changelog": "^9.0.4",
150
- "@stylistic/eslint-plugin": "^5",
151
149
  "ascii-tree": "^0.3.0",
152
150
  "chalk": "^5.4.1",
153
151
  "conventional-recommended-bump": "^10.0.0",
154
152
  "deepmerge": "^4.3.1",
155
153
  "ejs": "^3.1.10",
154
+ "eslint": "^9.17.0",
156
155
  "execa": "^9.5.2",
157
156
  "find-up": "^7.0.0",
158
157
  "fs-extra": "^11.2.0",
@@ -172,7 +171,6 @@
172
171
  "markdown-table": "^3.0.4",
173
172
  "markdown-toc": "^1.2.0",
174
173
  "markdown-utils": "^1.0.0",
175
- "mri": "^1.2.0",
176
174
  "package-json-type": "^1.0.3",
177
175
  "pkg-dir": "^8.0.0",
178
176
  "prompts": "^2.4.2",
@@ -183,21 +181,23 @@
183
181
  "semver": "^7.7.1",
184
182
  "strip-ansi": "^7.1.0",
185
183
  "strip-indent": "^4.1.1",
186
- "to-vfile": "^8.0.0",
187
184
  "typescript-eslint": "^8",
188
- "unist-util-is": "^6.0.1",
189
- "unist-util-source": "^5.0.0",
190
- "unist-util-visit": "^5.0.0",
191
185
  "yaml": "^2.6.1",
192
186
  "yargs": "^17.7.2",
193
187
  "yargs-parser": "^21.1.1"
194
188
  },
195
189
  "release-it": {
196
- "git": false
197
- },
198
- "juisy": {
199
- "extensions": [
200
- "../cli-plugin-build-entries/dist/index.js"
201
- ]
190
+ "git": false,
191
+ "plugins": {
192
+ "@release-it/bumper": {
193
+ "out": {
194
+ "file": "package.json",
195
+ "path": [
196
+ "dependencies.@juisy/utils",
197
+ "peerDependencies.@juisy/utils"
198
+ ]
199
+ }
200
+ }
201
+ }
202
202
  }
203
203
  }
@@ -1,49 +0,0 @@
1
- /**
2
- * @import { Command } from '#juisy/cli'
3
- */
4
-
5
- /**
6
- * @extends {Command}
7
- */
8
- export default class AddExtCommand extends CLI.Command {
9
- /**
10
- * The command signature
11
- */
12
- command = 'ext:add <ext>'
13
-
14
- /**
15
- * The command description
16
- */
17
- describe = 'Add a Juisy extension'
18
-
19
- /**
20
- * The command meta
21
- */
22
- meta = {}
23
-
24
- /**
25
- * Command builder
26
- */
27
- builder (cli) {
28
- return cli
29
- }
30
-
31
- /**
32
- * Command handler
33
- */
34
- async handler (args) {
35
- // Utils
36
- const { $style, step, substep } = CLI.OutputUtils
37
- // const { run } = CLI.InterfaceUtils
38
-
39
- /**
40
- * Add extension
41
- */
42
- step('Adding extension')
43
-
44
- this.log('Wants to add: ', args.ext)
45
-
46
- substep($style.green('✔ Successfuly generated'), { last: true })
47
- this.log() // blank line
48
- }
49
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * @import { Command } from '#juisy/cli'
3
- */
4
-
5
- /**
6
- * @extends {Command}
7
- */
8
- export default class RemoveExtCommand extends CLI.Command {
9
- /**
10
- * The command signature
11
- */
12
- command = 'ext:remove <ext>'
13
-
14
- /**
15
- * The command description
16
- */
17
- describe = 'Remove a Juisy extension'
18
-
19
- /**
20
- * The command meta
21
- */
22
- meta = {}
23
-
24
- /**
25
- * Command builder
26
- */
27
- builder (cli) {
28
- return cli
29
- }
30
-
31
- /**
32
- * Command handler
33
- */
34
- async handler (args) {
35
- // Utils
36
- const { $style, step, substep } = CLI.OutputUtils
37
- // const { run } = CLI.InterfaceUtils
38
-
39
- /**
40
- * Remove extension
41
- */
42
- step('Removing extension')
43
-
44
- this.log('Wants to remove: ', args.ext)
45
-
46
- substep($style.green('✔ Successfuly generated'), { last: true })
47
- this.log() // blank line
48
- }
49
- }
package/bin/cli/init.js DELETED
@@ -1 +0,0 @@
1
- process.env.JUISY_ENABLE_EXTENSIONS = 'true'