ek-starter 1.0.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.
Files changed (3) hide show
  1. package/README.md +18 -0
  2. package/bin/cli.js +37 -0
  3. package/package.json +24 -0
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # ek-starter
2
+
3
+ A CLI to instantly start a new Expo project with a feature-rich template.
4
+
5
+ ## Features
6
+ - **Expo** (Router, Image, etc.)
7
+ - **Keycloak** Authentication
8
+ - **React Native Reusable** Components
9
+ - **Uniwind** / NativeWind (Tailwind CSS)
10
+ - **i18n** (Internationalization)
11
+
12
+ ## Usage
13
+ ```bash
14
+ npx ek-starter@latest my-app
15
+ ```
16
+
17
+ ## Template
18
+ This CLI uses the template from: [github.com/ofirrubin/expo-keycloak-i18n](https://github.com/ofirrubin/expo-keycloak-i18n)
package/bin/cli.js ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ const spawn = require('cross-spawn');
4
+ const path = require('path');
5
+
6
+ const args = process.argv.slice(2);
7
+ const template = 'https://github.com/ofirrubin/expo-keycloak-i18n';
8
+
9
+ // Construct the arguments for create-expo-app
10
+ // If the user provided an app name, it will be in args[0]
11
+ // We append the template argument
12
+ const createExpoAppArgs = [...args, '--template', template];
13
+
14
+ console.log(`Creating a new Expo app using template: ${template}`);
15
+
16
+ const result = spawn.sync('npx', ['create-expo-app', ...createExpoAppArgs], {
17
+ stdio: 'inherit',
18
+ });
19
+
20
+ if (result.signal) {
21
+ if (result.signal === 'SIGKILL') {
22
+ console.log(
23
+ 'The build failed because the process exited too early. ' +
24
+ 'This probably means the system ran out of memory or someone called ' +
25
+ '`kill -9` on the process.'
26
+ );
27
+ } else if (result.signal === 'SIGTERM') {
28
+ console.log(
29
+ 'The build failed because the process exited too early. ' +
30
+ 'Someone might have called `kill` or `killall`, or the system could ' +
31
+ 'be shutting down.'
32
+ );
33
+ }
34
+ process.exit(1);
35
+ }
36
+
37
+ process.exit(result.status);
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "ek-starter",
3
+ "version": "1.0.0",
4
+ "description": "CLI to create a new Expo app with Keycloak and i18n support",
5
+ "main": "bin/cli.js",
6
+ "bin": {
7
+ "ek-starter": "./bin/cli.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "keywords": [
13
+ "expo",
14
+ "keycloak",
15
+ "i18n",
16
+ "create-expo-app",
17
+ "template"
18
+ ],
19
+ "author": "Ofir Rubin",
20
+ "license": "MIT",
21
+ "dependencies": {
22
+ "cross-spawn": "^7.0.3"
23
+ }
24
+ }