heroui-native-pro 0.0.1-alpha.0 → 1.0.0-alpha.1
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/LICENSE +1 -0
- package/README.md +1 -0
- package/package.json +18 -7
- package/pre/bin.js +2 -0
- package/pre/postinstall/index.js +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TODO
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## HeroUI React Native
|
package/package.json
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heroui-native-pro",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "HeroUI Native
|
|
5
|
-
"license": "
|
|
6
|
-
"author": "HeroUI
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "HeroUI React Native",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"author": "HeroUI",
|
|
7
|
+
"bin": {
|
|
8
|
+
"heroui-pro": "./pre/bin.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"pre",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
7
16
|
"publishConfig": {
|
|
8
17
|
"access": "public"
|
|
9
18
|
},
|
|
10
|
-
"type": "commonjs",
|
|
11
|
-
"main": "index.js",
|
|
12
19
|
"scripts": {
|
|
13
|
-
"
|
|
20
|
+
"postinstall": "node ./pre/postinstall/index.js"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"chalk": "5.6.2",
|
|
24
|
+
"heroui-pro": "^1.0.0-alpha.1"
|
|
14
25
|
}
|
|
15
26
|
}
|
package/pre/bin.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Chalk } from 'chalk';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { HEROUI_AUTH_TOKEN, PRODUCTS, HEROUI_WEB_URL, HELP_EMAIL } from 'heroui-pro/consts';
|
|
5
|
+
import { downloadFromCI, downloadFromCLI } from 'heroui-pro/cdn';
|
|
6
|
+
import { getCredentials } from 'heroui-pro/auth/keyring';
|
|
7
|
+
import { getCIToken } from 'heroui-pro/auth/ci';
|
|
8
|
+
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const PKG_ROOT = join(__dirname, '../../');
|
|
11
|
+
|
|
12
|
+
// Skip postinstall in development workspace
|
|
13
|
+
if (!PKG_ROOT.includes('node_modules')) {
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const product = PRODUCTS['react-native'];
|
|
18
|
+
const chalk = new Chalk({ level: 3 });
|
|
19
|
+
|
|
20
|
+
const main = async () => {
|
|
21
|
+
const ciToken = getCIToken();
|
|
22
|
+
|
|
23
|
+
if (ciToken) {
|
|
24
|
+
return await downloadFromCI(product, PKG_ROOT);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const creds = await getCredentials();
|
|
28
|
+
|
|
29
|
+
if (creds) {
|
|
30
|
+
return await downloadFromCLI(product, PKG_ROOT);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
throw new Error('No credentials found');
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
main().catch(error => {
|
|
37
|
+
console.log(
|
|
38
|
+
chalk.red.bold(`Access denied: You don't have permission to install ${product.name}.\n`),
|
|
39
|
+
);
|
|
40
|
+
console.log(
|
|
41
|
+
chalk.red(
|
|
42
|
+
`To get a license, visit ${chalk.bold.underline(HEROUI_WEB_URL)}.\n` +
|
|
43
|
+
`If you already have one, run:\n\n` +
|
|
44
|
+
`${chalk.bold('heroui-pro login')}\n\n` +
|
|
45
|
+
`For CI/CD environments, ensure the ${chalk.bold.underline(HEROUI_AUTH_TOKEN)} environment variable is set.\n\n` +
|
|
46
|
+
`Need help? Contact ${chalk.bold.underline(HELP_EMAIL)} for assistance.\n`,
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
console.log(chalk.gray(error.message));
|
|
51
|
+
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|