@granite-js/cli 0.1.0 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @granite-js/cli
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - d675415: Improve scaffolding to provide a better showcase UI
8
+ - 10a5f3f: empty
9
+ - Updated dependencies [d675415]
10
+ - Updated dependencies [10a5f3f]
11
+ - @granite-js/plugin-core@0.1.1
12
+ - @granite-js/mpack@0.1.1
13
+ - @granite-js/utils@0.1.1
14
+
3
15
  ## 0.1.0
4
16
 
5
17
  ### Minor Changes
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/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.1",
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.1",
48
+ "@granite-js/plugin-core": "0.1.1",
49
+ "@granite-js/utils": "0.1.1",
50
50
  "@inquirer/prompts": "^7.2.3",
51
51
  "@shopify/semaphore": "^3.1.0",
52
52
  "chalk": "^4",