@appweaver/create-weaver-app 1.0.23 → 1.0.25

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.
@@ -158,24 +158,34 @@ program
158
158
  agentsDir = '.agents';
159
159
  }
160
160
  const guidelinesFileName = agent === 'claude' ? 'CLAUDE.md' : 'AGENTS.md';
161
- // Copy skill and referenced files
161
+ // Copy skill and referenced files. The framework guidelines
162
+ // (GUIDELINES.md) are preserved inside the skills directory so that
163
+ // `weaver update` can keep them in sync without touching the project's
164
+ // own root guidelines file.
162
165
  const skillDir = node_path_1.default.join(__dirname, 'skill');
163
166
  const projectSkillPath = node_path_1.default.join(agentsDir, 'skills', 'appweaver');
164
167
  const projectSkillDir = node_path_1.default.join(destDir, projectSkillPath);
165
168
  await promises_1.default.cp(skillDir, projectSkillDir, {
166
169
  recursive: true
167
170
  });
168
- // Move the project guidelines file to the project root
169
- const guidelinesSkillPath = node_path_1.default.join(projectSkillDir, 'GUIDELINES.md');
170
- const guidelinesFilePath = node_path_1.default.join(destDir, guidelinesFileName);
171
- await promises_1.default.rename(guidelinesSkillPath, guidelinesFilePath);
172
- // Update project guidelines reference paths to point in skills directory
173
- const guidelinesContents = await promises_1.default.readFile(guidelinesFilePath, 'utf8');
174
- const referencesPath = node_path_1.default
175
- .join(projectSkillPath, 'references')
171
+ // Create a thin root guidelines file that references the framework
172
+ // guidelines from the skills directory. This file is never overwritten
173
+ // by `weaver update`, so it can be freely extended in the project.
174
+ const guidelinesPath = node_path_1.default
175
+ .join(projectSkillPath, 'GUIDELINES.md')
176
176
  .replace(/\\/g, '/');
177
- const updatedGuidelinesContent = guidelinesContents.replace(/(\[.+]\()references\/(.+\))/g, `$1${referencesPath}/$2`);
178
- await promises_1.default.writeFile(guidelinesFilePath, updatedGuidelinesContent, {
177
+ const guidelinesFilePath = node_path_1.default.join(destDir, guidelinesFileName);
178
+ const guidelinesReference = agent === 'claude'
179
+ ? `@${guidelinesPath}`
180
+ : `[Appweaver framework guidelines](${guidelinesPath})`;
181
+ const guidelinesContent = `# ${variables.NAME}\n\n` +
182
+ `${description}\n\n` +
183
+ `This is an [Appweaver](https://github.com/lmatosevic/appweaver) project. ` +
184
+ `Follow the framework conventions, architecture, and usage documented in the guidelines:\n\n` +
185
+ `${guidelinesReference}\n\n` +
186
+ `<!-- Add your own project-specific instructions below this line. ` +
187
+ `This file is not modified by \`weaver update\`. -->\n`;
188
+ await promises_1.default.writeFile(guidelinesFilePath, guidelinesContent, {
179
189
  encoding: 'utf8'
180
190
  });
181
191
  }
@@ -285,11 +295,11 @@ function getDatabaseDockerConfig(command, name) {
285
295
  },
286
296
  mysql: {
287
297
  service: ` mysql:
288
- image: mysql:8.4
298
+ image: mariadb:11.4
289
299
  container_name: ${name}-mysql
290
300
  restart: unless-stopped
291
301
  healthcheck:
292
- test: [ "CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD" ]
302
+ test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
293
303
  interval: 30s
294
304
  timeout: 10s
295
305
  retries: 10
@@ -298,10 +308,10 @@ function getDatabaseDockerConfig(command, name) {
298
308
  ports:
299
309
  - "127.0.0.1:3307:3306"
300
310
  environment:
301
- MYSQL_DATABASE: "\${DB_NAME}"
302
- MYSQL_USER: "\${DB_USER}"
303
- MYSQL_PASSWORD: "\${DB_PASSWORD}"
304
- MYSQL_ROOT_PASSWORD: "\${DB_PASSWORD}"
311
+ MARIADB_DATABASE: "\${DB_NAME}"
312
+ MARIADB_USER: "\${DB_USER}"
313
+ MARIADB_PASSWORD: "\${DB_PASSWORD}"
314
+ MARIADB_ROOT_PASSWORD: "\${DB_PASSWORD}"
305
315
  volumes:
306
316
  - mysql-data:/var/lib/mysql
307
317
  networks:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appweaver/create-weaver-app",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "Appweaver - the backend framework for AI-first development (@create-weaver-app)",
5
5
  "author": "Luka Matosevic",
6
6
  "license": "MIT",
@@ -241,7 +241,7 @@ export async function createAdminUser(): Promise<void> {
241
241
  data: {
242
242
  firstName: 'Admin',
243
243
  lastName: 'Admin',
244
- email: 'admin@appweaver.com',
244
+ email: 'admin@appweaver.co',
245
245
  roles: {
246
246
  connectOrCreate: [
247
247
  {
package/skill/SKILL.md CHANGED
@@ -472,7 +472,7 @@ export async function createAdminUser(): Promise<void> {
472
472
  data: {
473
473
  firstName: 'Admin',
474
474
  lastName: 'Admin',
475
- email: 'admin@appweaver.com',
475
+ email: 'admin@appweaver.co',
476
476
  phone: '01234435',
477
477
  roles: {
478
478
  connectOrCreate: [
@@ -553,7 +553,7 @@ weaver openapi --format yaml # generate schema in yaml
553
553
  weaver update # update all @appweaver/* packages to latest
554
554
  weaver update @appweaver/core @appweaver/cli # update specific packages
555
555
  weaver update --targetVersion 1.2.3 # update to a specific version
556
- weaver update --noSkill # skip updating AI agent skill files
556
+ weaver update --noSkill # skip updating AI agent skill files (.claude, .agents, …)
557
557
  weaver update --force # force update despite peerDependency mismatches
558
558
  ```
559
559
 
@@ -205,9 +205,9 @@ Update the Appweaver packages.
205
205
 
206
206
  **Options:**
207
207
 
208
- | Option | Description | Default |
209
- |-----------------------------------|------------------------------------------------------------|------------|
210
- | `--targetVersion [targetVersion]` | The version to update the packages to | `"latest"` |
211
- | `--noSkill` | Skip updating AI agents skill files in the current project | `false` |
212
- | `-f, --force` | Force update despite peerDependency version mismatches | `false` |
213
- | `--verbose` | Print verbose output | `false` |
208
+ | Option | Description | Default |
209
+ |-----------------------------------|-----------------------------------------------------------------------------|------------|
210
+ | `--targetVersion [targetVersion]` | The version to update the packages to | `"latest"` |
211
+ | `--noSkill` | Skip updating AI agents skill files in agent dirs (`.claude`, `.agents`, …) | `false` |
212
+ | `-f, --force` | Force update despite peerDependency version mismatches | `false` |
213
+ | `--verbose` | Print verbose output | `false` |
@@ -8,6 +8,23 @@ distinct parts:
8
8
 
9
9
  ---
10
10
 
11
+ ## Module formats (ESM & CommonJS)
12
+
13
+ The package ships **both** an ESM and a CommonJS build, selected automatically via the `exports` map — no configuration
14
+ needed. Both import styles work for the main entry and the `/angular` subpath:
15
+
16
+ ```ts
17
+ // ESM (tree-shakable — preferred for bundlers like Angular/Vite/webpack prod builds)
18
+ import { FetchClient, ClientError } from '@appweaver/client';
19
+ import { AngularClient } from '@appweaver/client/angular';
20
+
21
+ // CommonJS (e.g. plain Node scripts without a build step)
22
+ const { FetchClient, ClientError } = require('@appweaver/client');
23
+ const { AngularClient } = require('@appweaver/client/angular');
24
+ ```
25
+
26
+ ---
27
+
11
28
  ## `weaver-client` CLI
12
29
 
13
30
  ```
@@ -52,8 +69,8 @@ Reads an OpenAPI v3 schema and generates TypeScript types and a typed client cla
52
69
  **Generation process:**
53
70
 
54
71
  1. Reads and parses the schema (JSON or YAML, local or remote).
55
- 2. Generates TypeScript interfaces via `openapi-typescript`, enriching them with JSDoc validation tags
56
- (`@minLength`, `@maxLength`, `@minimum`, `@maximum`, `@pattern`, `@format`).
72
+ 2. Generates TypeScript interfaces via `openapi-typescript`, enriching them with JSDoc validation tags (`@minLength`,
73
+ `@maxLength`, `@minimum`, `@maximum`, `@pattern`, `@format`).
57
74
  3. Deduplicates union types and extracts inline schemas to named exported types.
58
75
  4. Classifies all API paths into route groups: resources, auth, account, health, files, and custom.
59
76
  5. Emits a typed client class extending `FetchClient<Paths>` with a getter for each route group. Resources with
@@ -161,8 +178,8 @@ operations not exposed by the API.
161
178
 
162
179
  ### Angular client (`--framework angular`)
163
180
 
164
- Passing `--framework angular` generates a client class extending `AngularClient` instead of `FetchClient`. The
165
- generated class is constructed with Angular's `HttpClient` and all its methods return RxJS `Observable`s instead of
181
+ Passing `--framework angular` generates a client class extending `AngularClient` instead of `FetchClient`. The generated
182
+ class is constructed with Angular's `HttpClient` and all its methods return RxJS `Observable`s instead of
166
183
  `Promise`s:
167
184
 
168
185
  ```ts
@@ -172,7 +189,8 @@ import { HttpClient } from '@angular/common/http';
172
189
 
173
190
  // In an Angular service or provider:
174
191
  const client = new CMSAPIClient(httpClient, { baseUrl: 'http://localhost:3000' });
175
- client.user.query({ filter: { enabled: true } }).subscribe((users) => {});
192
+ client.user.query({ filter: { enabled: true } }).subscribe((users) => {
193
+ });
176
194
  ```
177
195
 
178
196
  **Important:** `AngularClient` is only available from the `@appweaver/client/angular` subpath — it is not exported from
@@ -460,8 +478,8 @@ const data = await client.sendRequest('get', '/api/custom-endpoint');
460
478
 
461
479
  ### `sendRequestRaw`
462
480
 
463
- Returns the raw `{ data, error, response }` tuple from `openapi-fetch` without throwing. Useful when the caller
464
- needs to inspect error details or branch on status codes.
481
+ Returns the raw `{ data, error, response }` tuple from `openapi-fetch` without throwing. Useful when the caller needs to
482
+ inspect error details or branch on status codes.
465
483
 
466
484
  ```ts
467
485
  const { data, error, response } = await client.sendRequestRaw('post', '/api/custom-endpoint', {