@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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare class Utils {
2
+ private timeout;
3
+ debounce(func: Function, delay: number): (...args: any[]) => void;
4
+ generateRandomId(): string;
5
+ }
6
+ export declare const utils: Utils;
@@ -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.');
@@ -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.ts', options.typescript ? 'plugins/ts-components-installer.js' : 'plugins/js-components-installer.js'];
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`);