@arcote.tech/arc-cli 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/README.md +67 -0
- package/dist/fsevents-hj42pnne.node +0 -0
- package/dist/index.js +180038 -0
- package/package.json +29 -0
- package/src/commands/build.ts +68 -0
- package/src/commands/dev.ts +112 -0
- package/src/index.ts +30 -0
- package/src/utils/build.ts +146 -0
- package/src/utils/config.ts +141 -0
- package/tsconfig.json +9 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @arcote.tech/cli
|
|
2
|
+
|
|
3
|
+
CLI tool for Arc framework.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun install -g @arcote.tech/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or use it directly with npx:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @arcote.tech/cli dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Development Mode
|
|
20
|
+
|
|
21
|
+
Run the development mode to watch and build your Arc packages:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
arc dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This will:
|
|
28
|
+
|
|
29
|
+
1. Find all `arc.config.ts` files in your workspace
|
|
30
|
+
2. Generate client-specific TypeScript definitions based on the clients specified in the config
|
|
31
|
+
3. Build each client using Bun with the appropriate define constants
|
|
32
|
+
4. Watch for changes and rebuild automatically
|
|
33
|
+
5. Generate TypeScript declaration files
|
|
34
|
+
|
|
35
|
+
## Configuration
|
|
36
|
+
|
|
37
|
+
Create an `arc.config.json` file in your package:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"file": "index.ts",
|
|
42
|
+
"outDir": "dist",
|
|
43
|
+
"clients": ["browser", "mobile app", "server", "api"]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The CLI will generate the following constants for each client:
|
|
48
|
+
|
|
49
|
+
- `BROWSER` (true/false)
|
|
50
|
+
- `NOT_ON_BROWSER` (true/false)
|
|
51
|
+
- `ONLY_BROWSER` (true/false)
|
|
52
|
+
|
|
53
|
+
And similarly for other clients, with spaces converted to underscores:
|
|
54
|
+
|
|
55
|
+
- `MOBILE_APP`
|
|
56
|
+
- `NOT_ON_MOBILE_APP`
|
|
57
|
+
- `ONLY_MOBILE_APP`
|
|
58
|
+
- etc.
|
|
59
|
+
|
|
60
|
+
These constants can be used in your code to conditionally include or exclude code for specific clients:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
export const myFeature = context().pipe([
|
|
64
|
+
NOT_ON_BROWSER && myBrowserSpecificFeature,
|
|
65
|
+
API_ONLY && myApiOnlyFeature,
|
|
66
|
+
]);
|
|
67
|
+
```
|
|
Binary file
|