@timus-networks/theme 1.0.3 → 1.0.5
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/interfaces.js +1 -0
- package/components-js/utils.d.ts +6 -0
- package/components-js/utils.js +17 -0
- package/{convert.js → convert-js.js} +9 -0
- package/convert-sass.js +15 -0
- package/index.d.ts +1 -0
- package/loader.js +1 -1
- package/main.css +69555 -0
- package/main.css.map +1 -0
- package/module.js +5 -5
- package/package.json +4 -3
- package/plugins/theme-provider.js +68 -0
- package/components-js/interfaces.ts +0 -11
- package/components-js/utils.ts +0 -20
- package/js-converter.js +0 -90
- package/plugins/theme-provider.ts +0 -75
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class Utils {
|
|
2
|
+
timeout = null;
|
|
3
|
+
debounce(func, delay) {
|
|
4
|
+
return (...args) => {
|
|
5
|
+
if (this.timeout !== null) {
|
|
6
|
+
clearTimeout(this.timeout);
|
|
7
|
+
}
|
|
8
|
+
this.timeout = setTimeout(() => {
|
|
9
|
+
func(...args);
|
|
10
|
+
}, delay);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
generateRandomId() {
|
|
14
|
+
return Date.now().toString(36) + Math.random().toString(36).slice(2, 9);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export const utils = new Utils();
|
|
@@ -95,4 +95,13 @@ let imports = declarationFiles
|
|
|
95
95
|
.join('\n');
|
|
96
96
|
|
|
97
97
|
fs.writeFileSync('./index.d.ts', imports);
|
|
98
|
+
|
|
99
|
+
const tsFiles = glob.sync('./components-js/**/*.ts');
|
|
100
|
+
tsFiles.forEach((file) => {
|
|
101
|
+
if (!file.endsWith('.d.ts') && fs.existsSync(file)) {
|
|
102
|
+
fs.unlinkSync(file);
|
|
103
|
+
console.log(`### Ts dosyası silindi: ${file}`);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
98
107
|
console.log('### index.d.ts dosyası oluşturuldu.');
|
package/convert-sass.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// convert-sass.js
|
|
2
|
+
const exec = require('child_process').exec;
|
|
3
|
+
const sass = require('sass');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const scssPath = path.resolve(__dirname, 'scss/main.scss');
|
|
7
|
+
const cssPath = path.resolve(__dirname, 'main.css');
|
|
8
|
+
|
|
9
|
+
exec(`sass ${scssPath} ${cssPath}`, (err, stdout, stderr) => {
|
|
10
|
+
if (err) {
|
|
11
|
+
console.error('SCSS compile error:', err);
|
|
12
|
+
} else {
|
|
13
|
+
console.log('SCSS compiled successfully:', stdout);
|
|
14
|
+
}
|
|
15
|
+
});
|
package/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components-js/utils';
|
package/loader.js
CHANGED
|
@@ -26,7 +26,7 @@ export function LoadComponent(options) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function LoadPlugins(options, all) {
|
|
29
|
-
const pluginsToSync = ['plugins/theme-provider.
|
|
29
|
+
const pluginsToSync = ['plugins/theme-provider.js', options.typescript ? 'plugins/ts-components-installer.js' : 'plugins/js-components-installer.js'];
|
|
30
30
|
|
|
31
31
|
for (const pathString of pluginsToSync) {
|
|
32
32
|
const str = pathString.replace(/(\.[^\.]+)$/, `.${options.server}$1`);
|