@plumeria/compiler 8.0.2 → 8.0.3
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 +36 -2
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
@@ -7,15 +40,17 @@ exports.compileCSS = compileCSS;
|
|
|
7
40
|
const core_1 = require("@swc/core");
|
|
8
41
|
const zss_engine_1 = require("zss-engine");
|
|
9
42
|
const fs_1 = __importDefault(require("fs"));
|
|
43
|
+
const rs = __importStar(require("@rust-gear/glob"));
|
|
10
44
|
const utils_1 = require("@plumeria/utils");
|
|
11
45
|
const utils_2 = require("@plumeria/utils");
|
|
12
46
|
function compileCSS(options) {
|
|
13
47
|
const { include, exclude, cwd = process.cwd() } = options;
|
|
14
48
|
const allSheets = new Set();
|
|
15
|
-
const files =
|
|
49
|
+
const files = rs.globSync(include, {
|
|
16
50
|
cwd,
|
|
17
51
|
exclude: exclude,
|
|
18
52
|
});
|
|
53
|
+
const scannedTables = (0, utils_1.scanAll)();
|
|
19
54
|
const processFile = (filePath) => {
|
|
20
55
|
const source = fs_1.default.readFileSync(filePath, 'utf-8');
|
|
21
56
|
const extractedSheets = [];
|
|
@@ -28,7 +63,6 @@ function compileCSS(options) {
|
|
|
28
63
|
const sourceBuffer = Buffer.from(source, 'utf-8');
|
|
29
64
|
const leadingBytes = Buffer.byteLength(source.slice(0, leadingLen), 'utf-8');
|
|
30
65
|
const baseByteOffset = ast.span.start - leadingBytes;
|
|
31
|
-
const scannedTables = (0, utils_1.scanAll)();
|
|
32
66
|
const localConsts = (0, utils_1.collectLocalConsts)(ast);
|
|
33
67
|
const resourcePath = filePath;
|
|
34
68
|
const importMap = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/compiler",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3",
|
|
4
4
|
"description": "Plumeria swc based compiler for statically extracting css",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"dist/"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@plumeria/utils": "^8.0.
|
|
24
|
+
"@plumeria/utils": "^8.0.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@
|
|
27
|
+
"@rust-gear/glob": "0.2.8",
|
|
28
|
+
"@swc/core": "1.15.18",
|
|
28
29
|
"zss-engine": "2.2.4"
|
|
29
30
|
},
|
|
30
31
|
"publishConfig": {
|