tailwindcss-patch 2.0.5 → 2.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/dist/cli.cjs +46 -0
- package/dist/cli.mjs +20 -13
- package/dist/{chunk-PZNRLYGX.mjs → index.cjs} +180 -253
- package/dist/index.mjs +522 -63
- package/package.json +4 -20
- package/dist/cli.d.mts +0 -2
- package/dist/cli.js +0 -643
- package/dist/index.d.mts +0 -149
- package/dist/index.js +0 -661
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const cac = require('cac');
|
|
4
|
+
const index = require('./index.cjs');
|
|
5
|
+
require('node:path');
|
|
6
|
+
require('node:fs');
|
|
7
|
+
require('node:fs/promises');
|
|
8
|
+
require('resolve');
|
|
9
|
+
require('@babel/types');
|
|
10
|
+
require('@babel/generator');
|
|
11
|
+
require('@babel/traverse');
|
|
12
|
+
require('@babel/parser');
|
|
13
|
+
const config = require('@tailwindcss-mangle/config');
|
|
14
|
+
require('semver');
|
|
15
|
+
require('postcss');
|
|
16
|
+
require('lilconfig');
|
|
17
|
+
require('jiti');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
20
|
+
|
|
21
|
+
const cac__default = /*#__PURE__*/_interopDefaultCompat(cac);
|
|
22
|
+
|
|
23
|
+
function init() {
|
|
24
|
+
const cwd = process.cwd();
|
|
25
|
+
return config.initConfig(cwd);
|
|
26
|
+
}
|
|
27
|
+
const cli = cac__default();
|
|
28
|
+
cli.command("install", "patch install").action(() => {
|
|
29
|
+
const opt = index.getPatchOptions();
|
|
30
|
+
const patch = index.createPatch(opt);
|
|
31
|
+
patch();
|
|
32
|
+
});
|
|
33
|
+
cli.command("init").action(async () => {
|
|
34
|
+
await init();
|
|
35
|
+
console.log(`\u2728 ${config.configName}.config.ts initialized!`);
|
|
36
|
+
});
|
|
37
|
+
cli.command("extract").action(async () => {
|
|
38
|
+
const { config: config$1 } = await config.getConfig();
|
|
39
|
+
if (config$1) {
|
|
40
|
+
const twPatcher = new index.TailwindcssPatcher();
|
|
41
|
+
const p = await twPatcher.extract(config$1.patch);
|
|
42
|
+
console.log("\u2728 tailwindcss-patch extract success! file path: " + p);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
cli.help();
|
|
46
|
+
cli.parse();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import cac from 'cac';
|
|
2
|
+
import { getPatchOptions, TailwindcssPatcher, createPatch } from './index.mjs';
|
|
3
|
+
import 'node:path';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import 'node:fs/promises';
|
|
6
|
+
import 'resolve';
|
|
7
|
+
import '@babel/types';
|
|
8
|
+
import '@babel/generator';
|
|
9
|
+
import '@babel/traverse';
|
|
10
|
+
import '@babel/parser';
|
|
11
|
+
import { configName, getConfig, initConfig } from '@tailwindcss-mangle/config';
|
|
12
|
+
import 'semver';
|
|
13
|
+
import 'postcss';
|
|
14
|
+
import 'lilconfig';
|
|
15
|
+
import 'jiti';
|
|
7
16
|
|
|
8
|
-
// src/cli.ts
|
|
9
|
-
import cac from "cac";
|
|
10
17
|
function init() {
|
|
11
18
|
const cwd = process.cwd();
|
|
12
|
-
return
|
|
19
|
+
return initConfig(cwd);
|
|
13
20
|
}
|
|
14
|
-
|
|
21
|
+
const cli = cac();
|
|
15
22
|
cli.command("install", "patch install").action(() => {
|
|
16
23
|
const opt = getPatchOptions();
|
|
17
24
|
const patch = createPatch(opt);
|
|
@@ -19,14 +26,14 @@ cli.command("install", "patch install").action(() => {
|
|
|
19
26
|
});
|
|
20
27
|
cli.command("init").action(async () => {
|
|
21
28
|
await init();
|
|
22
|
-
console.log(`\u2728 ${
|
|
29
|
+
console.log(`\u2728 ${configName}.config.ts initialized!`);
|
|
23
30
|
});
|
|
24
31
|
cli.command("extract").action(async () => {
|
|
25
|
-
const { config } = await
|
|
32
|
+
const { config } = await getConfig();
|
|
26
33
|
if (config) {
|
|
27
34
|
const twPatcher = new TailwindcssPatcher();
|
|
28
35
|
const p = await twPatcher.extract(config.patch);
|
|
29
|
-
console.log("\u2728 tailwindcss-patch extract success! file path
|
|
36
|
+
console.log("\u2728 tailwindcss-patch extract success! file path: " + p);
|
|
30
37
|
}
|
|
31
38
|
});
|
|
32
39
|
cli.help();
|