@timus-networks/theme 1.0.143 → 1.0.145
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/components-js/ThemeTag.vue +4 -4
- package/components-ts/ThemeTag.vue +4 -4
- package/convert-js.js +14 -8
- package/module.js +3 -3
- package/output/main.css +1 -1
- package/package.json +5 -5
- package/plugins/html-to-string.js +5 -2
- package/plugins/js-components-installer.js +3 -2
- package/plugins/theme-provider.js +44 -40
- package/plugins/ts-components-installer.js +3 -2
|
@@ -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>
|
|
@@ -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);
|
package/module.js
CHANGED
|
@@ -33,7 +33,7 @@ export default function (moduleOptions) {
|
|
|
33
33
|
{ source: 'logo', target: 'assets/logo' },
|
|
34
34
|
];
|
|
35
35
|
|
|
36
|
-
// Kopyalama işlemlerini Promise.all ile
|
|
36
|
+
// Kopyalama işlemlerini Promise.all ile sarmalıyorum
|
|
37
37
|
await Promise.all(directories.map(async (directory) => {
|
|
38
38
|
const sourceDir = resolve(__dirname, `./${directory.source}/`);
|
|
39
39
|
const destDir = resolve(this.options.srcDir, `./${directory.target}/`);
|
|
@@ -41,7 +41,7 @@ export default function (moduleOptions) {
|
|
|
41
41
|
await copyDirectory(sourceDir, destDir);
|
|
42
42
|
}));
|
|
43
43
|
|
|
44
|
-
// Tüm kopyalama işlemleri tamamlandığında CSS dosyalarını
|
|
44
|
+
// Tüm kopyalama işlemleri tamamlandığında CSS dosyalarını ekleyorum
|
|
45
45
|
this.options.css.push(
|
|
46
46
|
'@/static/fonts/poppins/100.css',
|
|
47
47
|
'@/static/fonts/poppins/200.css',
|
|
@@ -75,7 +75,7 @@ export default function (moduleOptions) {
|
|
|
75
75
|
LoadPlugins.bind(this)(options, this.options);
|
|
76
76
|
LoadComponent.bind(this)(options);
|
|
77
77
|
|
|
78
|
-
// Componenti global olarak
|
|
78
|
+
// Componenti global olarak ekleyeliyorum
|
|
79
79
|
// this.addTemplate({
|
|
80
80
|
// src: path.resolve(__dirname, 'components/TableCreate.vue'),
|
|
81
81
|
// fileName: 'components/TableCreate.vue'
|