@timus-networks/theme 1.0.143 → 1.0.144
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.
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
18
18
|
<p class="text-xs">
|
|
19
|
-
<code><el-
|
|
19
|
+
<code><el-tag type="gray" size="medium">content</el-tag></code>
|
|
20
20
|
</p>
|
|
21
21
|
</div>
|
|
22
22
|
</section>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
35
35
|
<p class="text-xs">
|
|
36
|
-
<code><el-
|
|
36
|
+
<code><el-tag>content</el-tag></code>
|
|
37
37
|
</p>
|
|
38
38
|
</div>
|
|
39
39
|
</section>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
</div>
|
|
51
51
|
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
52
52
|
<p class="text-xs">
|
|
53
|
-
<code><el-
|
|
53
|
+
<code><el-tag size="medium">content</el-tag></code>
|
|
54
54
|
</p>
|
|
55
55
|
</div>
|
|
56
56
|
</section>
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
</div>
|
|
76
76
|
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
77
77
|
<p class="text-xs">
|
|
78
|
-
<code><el-
|
|
78
|
+
<code><el-tag>content</el-tag></code>
|
|
79
79
|
</p>
|
|
80
80
|
</div>
|
|
81
81
|
</section>
|
package/convert-js.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const execSync = require('child_process')
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
4
|
const glob = require('glob');
|
|
5
5
|
|
|
6
6
|
// Eğer 'components-js' klasörü varsa sil
|
|
@@ -16,8 +16,9 @@ const copyRecursiveSync = function (src, dest) {
|
|
|
16
16
|
const exists = fs.existsSync(src);
|
|
17
17
|
const stats = exists && fs.statSync(src);
|
|
18
18
|
const isDirectory = exists && stats.isDirectory();
|
|
19
|
+
|
|
19
20
|
if (exists && isDirectory) {
|
|
20
|
-
if (!fs.existsSync(dest)) fs.mkdirSync(dest);
|
|
21
|
+
if (!fs.existsSync(dest)) { fs.mkdirSync(dest); }
|
|
21
22
|
fs.readdirSync(src).forEach((childItemName) => {
|
|
22
23
|
copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
|
|
23
24
|
});
|
|
@@ -39,9 +40,10 @@ vueFiles.forEach((file) => {
|
|
|
39
40
|
if (content) {
|
|
40
41
|
if (scriptMatch) {
|
|
41
42
|
let tsCode = scriptMatch[1];
|
|
43
|
+
|
|
42
44
|
tsCode = tsCode.replace(/import .*?from '.*?.vue';/g, (match) => `// ${match}`);
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
tsFilePath = file.replace('.vue', '.temp.ts');
|
|
45
47
|
fs.writeFileSync(tsFilePath, tsCode, 'utf-8');
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -58,37 +60,40 @@ vueFiles.forEach((file) => {
|
|
|
58
60
|
hasError = true;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
if (tsFilePath && hasError
|
|
63
|
+
if (tsFilePath && hasError) {
|
|
62
64
|
// temp.d.ts dosyasını yeniden oluştur ve adını
|
|
63
65
|
const tsOutputFilePath = tsFilePath.replace('.temp.ts', '.temp.d.ts');
|
|
64
66
|
const desiredOutputFilePath = tsFilePath.replace('.temp.ts', '.d.ts');
|
|
67
|
+
|
|
65
68
|
if (fs.existsSync(tsOutputFilePath)) {
|
|
66
69
|
fs.renameSync(tsOutputFilePath, desiredOutputFilePath);
|
|
67
70
|
}
|
|
68
71
|
const jsCode = fs.readFileSync(tsFilePath.replace('.ts', '.js'), 'utf-8');
|
|
69
72
|
const finalJsCode = jsCode.replace(/\/\/ import/g, 'import');
|
|
70
73
|
const newContent = content.replace(/<script lang="ts">(.*?)<\/script>/s, `<script>${finalJsCode}</script>`);
|
|
74
|
+
|
|
71
75
|
fs.writeFileSync(file, newContent, 'utf-8');
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
if (scriptMatch) {
|
|
75
79
|
// Dosyaları sil
|
|
76
|
-
if (fs.existsSync(tsFilePath)) fs.unlinkSync(tsFilePath);
|
|
77
|
-
if (fs.existsSync(tsFilePath.replace('.ts', '.js'))) fs.unlinkSync(tsFilePath.replace('.ts', '.js'));
|
|
80
|
+
if (fs.existsSync(tsFilePath)) { fs.unlinkSync(tsFilePath); }
|
|
81
|
+
if (fs.existsSync(tsFilePath.replace('.ts', '.js'))) { fs.unlinkSync(tsFilePath.replace('.ts', '.js')); }
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
});
|
|
81
85
|
|
|
82
86
|
// vueFiles.forEach döngüsünden sonra
|
|
83
87
|
const declarationFiles = glob.sync('./components-js/**/*.d.ts');
|
|
84
|
-
|
|
85
88
|
// Bu dosyaları import eden bir index.d.ts oluştur
|
|
86
|
-
|
|
89
|
+
const imports = declarationFiles
|
|
87
90
|
.map((file) => {
|
|
88
91
|
// Dosya yolundan modül adını elde etmek için gereken işlemler
|
|
89
92
|
let modulePath = path.relative('.', file);
|
|
93
|
+
|
|
90
94
|
modulePath = modulePath.replace('.d.ts', '');
|
|
91
95
|
modulePath = modulePath.replace(/\\/g, '/'); // Windows için ters eğik çizgileri düzelt
|
|
96
|
+
|
|
92
97
|
return `export * from './${modulePath}';`;
|
|
93
98
|
})
|
|
94
99
|
.join('\n');
|
|
@@ -96,6 +101,7 @@ let imports = declarationFiles
|
|
|
96
101
|
fs.writeFileSync('./index.d.ts', imports);
|
|
97
102
|
|
|
98
103
|
const tsFiles = glob.sync('./components-js/**/*.ts');
|
|
104
|
+
|
|
99
105
|
tsFiles.forEach((file) => {
|
|
100
106
|
if (!file.endsWith('.d.ts') && fs.existsSync(file)) {
|
|
101
107
|
fs.unlinkSync(file);
|