@granite-js/cli 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @granite-js/cli
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - @granite-js/mpack@0.1.2
8
+ - @granite-js/plugin-core@0.1.2
9
+ - @granite-js/utils@0.1.2
10
+
11
+ ## 0.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - d675415: Improve scaffolding to provide a better showcase UI
16
+ - 10a5f3f: empty
17
+ - Updated dependencies [d675415]
18
+ - Updated dependencies [10a5f3f]
19
+ - @granite-js/plugin-core@0.1.1
20
+ - @granite-js/mpack@0.1.1
21
+ - @granite-js/utils@0.1.1
22
+
3
23
  ## 0.1.0
4
24
 
5
25
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -510,12 +510,20 @@ function commonResolver({ optimization = DEFAULT_OPTIMIZATION_OPTIONS }) {
510
510
  ...[
511
511
  "@react-navigation/native-stack",
512
512
  "@react-navigation/native",
513
+ "@react-native-async-storage/async-storage",
514
+ "@shopify/flash-list",
515
+ "lottie-react-native",
513
516
  "react-native-safe-area-context",
514
517
  "react-native-screens",
518
+ "react-native-fast-image",
515
519
  "react-native-svg",
516
- "react-native-gesture-handler",
520
+ "react-native-webview",
521
+ "react-native-video",
517
522
  "react-native",
518
- "react"
523
+ "react",
524
+ "react-native-gesture-handler",
525
+ "react-native-pager-view",
526
+ "@react-native-community/blur"
519
527
  ].map((module2) => ({ from: module2, to: `granite-require:${module2}`, exact: true })),
520
528
  optimization["tslib-esm"] ? optimizations.resolveTslibEsm() : null
521
529
  ].filter(import_es_toolkit3.isNotNil),
package/dist/index.d.cts CHANGED
@@ -110,6 +110,55 @@ interface GraniteConfigResponse extends z.infer<typeof graniteConfigSchema> {
110
110
  };
111
111
  };
112
112
  }
113
+ /**
114
+ * @public
115
+ * @category Configuration
116
+ * @name defineConfig
117
+ * @description
118
+ * Configures your Granite application by defining key settings in `granite.config.ts`.
119
+ *
120
+ * The configuration lets you specify:
121
+ * - How users will access your app through a URL scheme (e.g. `granite://`)
122
+ * - Your app's unique name that appears in the URL (e.g. `granite://my-service`)
123
+ * - Build settings for bundlers like ESBuild and Metro
124
+ * - Code transformation settings through Babel
125
+ * - Additional functionality through Granite plugins
126
+ *
127
+ * @param config - Configuration options
128
+ * @param config.appName - Your app's unique identifier
129
+ * @param config.scheme - URL scheme for launching your app (e.g. 'granite')
130
+ * @param config.plugins - Granite plugins to enhance functionality
131
+ * @param config.outdir - Where to output build files (defaults to 'dist')
132
+ * @param config.entryFile - Your app's entry point (defaults to './src/_app.tsx')
133
+ * @param config.cwd - Working directory for build process (defaults to process.cwd())
134
+ * @param config.mpack - Fine-tune mpack bundler behavior
135
+ * @param config.babel - Customize Babel transpilation
136
+ * @param config.esbuild - Adjust ESBuild bundling
137
+ * @param config.metro - Configure Metro bundler settings
138
+ * @returns The processed configuration
139
+ *
140
+ * @example
141
+ * Here's a basic configuration that:
142
+ * - Makes your app accessible via the `granite://` scheme
143
+ * - Names your service "my-app" so it's reachable at `granite://my-app`
144
+ * - Uses the Hermes plugin to optimize JavaScript bundles into bytecode
145
+ *
146
+ * ```ts
147
+ * import { defineConfig } from '@granite-js/react-native/config';
148
+ * import { hermes } from '@granite-js/plugin-hermes';
149
+ *
150
+ * export default defineConfig({
151
+ * // The name of your microservice
152
+ * appName: 'my-app',
153
+ * // The URL scheme for deep linking
154
+ * scheme: 'granite',
155
+ * // Entry file path
156
+ * entryFile: 'index.ts',
157
+ * // Array of plugins to use
158
+ * plugins: [hermes()],
159
+ * });
160
+ * ```
161
+ */
113
162
  declare const defineConfig: (config: GraniteConfigInput) => Promise<GraniteConfigResponse>;
114
163
 
115
164
  declare const loadConfig: () => Promise<GraniteConfigResponse>;
package/dist/index.d.ts CHANGED
@@ -110,6 +110,55 @@ interface GraniteConfigResponse extends z.infer<typeof graniteConfigSchema> {
110
110
  };
111
111
  };
112
112
  }
113
+ /**
114
+ * @public
115
+ * @category Configuration
116
+ * @name defineConfig
117
+ * @description
118
+ * Configures your Granite application by defining key settings in `granite.config.ts`.
119
+ *
120
+ * The configuration lets you specify:
121
+ * - How users will access your app through a URL scheme (e.g. `granite://`)
122
+ * - Your app's unique name that appears in the URL (e.g. `granite://my-service`)
123
+ * - Build settings for bundlers like ESBuild and Metro
124
+ * - Code transformation settings through Babel
125
+ * - Additional functionality through Granite plugins
126
+ *
127
+ * @param config - Configuration options
128
+ * @param config.appName - Your app's unique identifier
129
+ * @param config.scheme - URL scheme for launching your app (e.g. 'granite')
130
+ * @param config.plugins - Granite plugins to enhance functionality
131
+ * @param config.outdir - Where to output build files (defaults to 'dist')
132
+ * @param config.entryFile - Your app's entry point (defaults to './src/_app.tsx')
133
+ * @param config.cwd - Working directory for build process (defaults to process.cwd())
134
+ * @param config.mpack - Fine-tune mpack bundler behavior
135
+ * @param config.babel - Customize Babel transpilation
136
+ * @param config.esbuild - Adjust ESBuild bundling
137
+ * @param config.metro - Configure Metro bundler settings
138
+ * @returns The processed configuration
139
+ *
140
+ * @example
141
+ * Here's a basic configuration that:
142
+ * - Makes your app accessible via the `granite://` scheme
143
+ * - Names your service "my-app" so it's reachable at `granite://my-app`
144
+ * - Uses the Hermes plugin to optimize JavaScript bundles into bytecode
145
+ *
146
+ * ```ts
147
+ * import { defineConfig } from '@granite-js/react-native/config';
148
+ * import { hermes } from '@granite-js/plugin-hermes';
149
+ *
150
+ * export default defineConfig({
151
+ * // The name of your microservice
152
+ * appName: 'my-app',
153
+ * // The URL scheme for deep linking
154
+ * scheme: 'granite',
155
+ * // Entry file path
156
+ * entryFile: 'index.ts',
157
+ * // Array of plugins to use
158
+ * plugins: [hermes()],
159
+ * });
160
+ * ```
161
+ */
113
162
  declare const defineConfig: (config: GraniteConfigInput) => Promise<GraniteConfigResponse>;
114
163
 
115
164
  declare const loadConfig: () => Promise<GraniteConfigResponse>;
package/dist/index.js CHANGED
@@ -482,12 +482,20 @@ function commonResolver({ optimization = DEFAULT_OPTIMIZATION_OPTIONS }) {
482
482
  ...[
483
483
  "@react-navigation/native-stack",
484
484
  "@react-navigation/native",
485
+ "@react-native-async-storage/async-storage",
486
+ "@shopify/flash-list",
487
+ "lottie-react-native",
485
488
  "react-native-safe-area-context",
486
489
  "react-native-screens",
490
+ "react-native-fast-image",
487
491
  "react-native-svg",
488
- "react-native-gesture-handler",
492
+ "react-native-webview",
493
+ "react-native-video",
489
494
  "react-native",
490
- "react"
495
+ "react",
496
+ "react-native-gesture-handler",
497
+ "react-native-pager-view",
498
+ "@react-native-community/blur"
491
499
  ].map((module) => ({ from: module, to: `granite-require:${module}`, exact: true })),
492
500
  optimization["tslib-esm"] ? optimizations.resolveTslibEsm() : null
493
501
  ].filter(isNotNil2),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@granite-js/cli",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "The Granite CLI",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -44,9 +44,9 @@
44
44
  "vitest": "^3.0.7"
45
45
  },
46
46
  "dependencies": {
47
- "@granite-js/mpack": "0.1.0",
48
- "@granite-js/plugin-core": "0.1.0",
49
- "@granite-js/utils": "0.1.0",
47
+ "@granite-js/mpack": "0.1.2",
48
+ "@granite-js/plugin-core": "0.1.2",
49
+ "@granite-js/utils": "0.1.2",
50
50
  "@inquirer/prompts": "^7.2.3",
51
51
  "@shopify/semaphore": "^3.1.0",
52
52
  "chalk": "^4",