heroui-native-pro 0.0.1-alpha.0 → 1.0.0-alpha.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/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,29 @@
1
1
  {
2
- "name": "heroui-native-pro",
3
- "version": "0.0.1-alpha.0",
4
- "description": "HeroUI Native Pro components",
5
- "license": "SEE LICENSE IN LICENSE",
6
- "author": "HeroUI <support@heroui.com>",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
- "type": "commonjs",
11
- "main": "index.js",
12
- "scripts": {
13
- "test": "echo \"Error: no test specified\" && exit 1"
14
- }
2
+ "name": "heroui-native-pro",
3
+ "version": "1.0.0-alpha.0",
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",
16
+ "scripts": {
17
+ "postinstall": "node ./pre/postinstall/index.js"
18
+ },
19
+ "dependencies": {
20
+ "chalk": "5.6.2",
21
+ "heroui-cli-pro": "workspace:*"
22
+ },
23
+ "bundledDependencies": [
24
+ "heroui-cli-pro"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ }
15
29
  }
package/pre/bin.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import 'heroui-cli-pro/cli';
@@ -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-cli-pro/consts';
5
+ import { downloadFromCI, downloadFromCLI } from 'heroui-cli-pro/cdn';
6
+ import { getCredentials } from 'heroui-cli-pro/auth/keyring';
7
+ import { getCIToken } from 'heroui-cli-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
+ });