@moontra/moonui-pro 3.4.44 → 3.5.0
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/cdn/index.global.js +134 -134
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.d.ts +76 -13
- package/dist/index.mjs +29 -257
- package/dist/next-config-plugin.cjs +228 -0
- package/dist/next-config-plugin.d.cts +30 -0
- package/dist/next-config-plugin.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/styles/nprogress.mjs +1 -1
- package/dist/vite-plugin.cjs +246 -0
- package/dist/vite-plugin.d.cts +38 -0
- package/dist/vite-plugin.mjs +1 -1
- package/package.json +30 -14
- package/plugin/{index.js → index.cjs} +8 -8
- package/scripts/postbuild.js +16 -2
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Provides build-time license validation and code transformation
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const crypto = require('crypto');
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
11
|
|
|
12
12
|
// License validation modes
|
|
13
13
|
const LICENSE_MODES = {
|
|
@@ -131,7 +131,7 @@ const validateLicense = async (licenseKey, options = {}) => {
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
// Webpack plugin for Next.js
|
|
134
|
-
|
|
134
|
+
function withMoonUI(nextConfig = {}) {
|
|
135
135
|
const licenseKey = process.env.MOONUI_LICENSE_KEY ||
|
|
136
136
|
process.env.MOONUI_TEAM_TOKEN ||
|
|
137
137
|
process.env.MOONUI_CI_TOKEN ||
|
|
@@ -192,7 +192,7 @@ export function withMoonUI(nextConfig = {}) {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
// Vite plugin
|
|
195
|
-
|
|
195
|
+
function moonUIVitePlugin(options = {}) {
|
|
196
196
|
const licenseKey = process.env.MOONUI_LICENSE_KEY ||
|
|
197
197
|
process.env.MOONUI_TEAM_TOKEN ||
|
|
198
198
|
process.env.MOONUI_CI_TOKEN ||
|
|
@@ -264,7 +264,7 @@ function injectLicenseCheck(code, licenseKey) {
|
|
|
264
264
|
}
|
|
265
265
|
|
|
266
266
|
// ESBuild plugin
|
|
267
|
-
|
|
267
|
+
function moonUIESBuildPlugin(options = {}) {
|
|
268
268
|
const licenseKey = process.env.MOONUI_LICENSE_KEY ||
|
|
269
269
|
process.env.MOONUI_TEAM_TOKEN ||
|
|
270
270
|
process.env.MOONUI_CI_TOKEN ||
|
|
@@ -300,8 +300,8 @@ export function moonUIESBuildPlugin(options = {}) {
|
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
// Export all plugins
|
|
304
|
-
|
|
303
|
+
// Export all plugins — hem named (require().withMoonUI) hem default (require())
|
|
304
|
+
module.exports = {
|
|
305
305
|
withMoonUI,
|
|
306
306
|
moonUIVitePlugin,
|
|
307
307
|
moonUIESBuildPlugin,
|
package/scripts/postbuild.js
CHANGED
|
@@ -12,10 +12,10 @@ const files = ['dist/index.mjs', 'dist/index.js'];
|
|
|
12
12
|
|
|
13
13
|
files.forEach(file => {
|
|
14
14
|
const filePath = path.join(__dirname, '..', file);
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
if (fs.existsSync(filePath)) {
|
|
17
17
|
let content = fs.readFileSync(filePath, 'utf8');
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
if (!content.startsWith('"use client"') && !content.startsWith("'use client'")) {
|
|
20
20
|
content = '"use client";\n' + content;
|
|
21
21
|
fs.writeFileSync(filePath, content);
|
|
@@ -24,4 +24,18 @@ files.forEach(file => {
|
|
|
24
24
|
console.log(`✔️ 'use client' already exists in ${file}`);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// require koşulu için .d.cts üret — .d.ts ile birebir aynı (tip bildirimleri modül
|
|
30
|
+
// sisteminden bağımsız). tsup CJS format'ta ayrı .d.cts üretmiyor; katı nodenext/bundler
|
|
31
|
+
// moduleResolution kullanan `require` tüketicileri "masquerading CJS" uyarısı almasın diye
|
|
32
|
+
// build-tool girişlerinin .d.ts'ini .d.cts'e kopyalıyoruz.
|
|
33
|
+
const dtsBases = ['dist/next-config-plugin', 'dist/vite-plugin'];
|
|
34
|
+
dtsBases.forEach(base => {
|
|
35
|
+
const src = path.join(__dirname, '..', `${base}.d.ts`);
|
|
36
|
+
const dst = path.join(__dirname, '..', `${base}.d.cts`);
|
|
37
|
+
if (fs.existsSync(src)) {
|
|
38
|
+
fs.copyFileSync(src, dst);
|
|
39
|
+
console.log(`✅ Copied ${base}.d.ts → .d.cts`);
|
|
40
|
+
}
|
|
27
41
|
});
|