partweave 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/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/chunk-2IGBGILB.js +1230 -0
- package/dist/chunk-2IGBGILB.js.map +1 -0
- package/dist/create-bin.js +17 -0
- package/dist/create-bin.js.map +1 -0
- package/dist/index.js +164 -0
- package/dist/index.js.map +1 -0
- package/modules/_core/api-client/package.json +22 -0
- package/modules/_core/api-client/src/index.ts +32 -0
- package/modules/_core/api-client/src/schema.d.ts +12 -0
- package/modules/_core/api-client/tsconfig.json +7 -0
- package/modules/_core/mobile/app/_layout.tsx +10 -0
- package/modules/_core/mobile/app/index.tsx +24 -0
- package/modules/_core/mobile/app.json +18 -0
- package/modules/_core/mobile/babel.config.js +6 -0
- package/modules/_core/mobile/expo-env.d.ts +3 -0
- package/modules/_core/mobile/jest.config.js +10 -0
- package/modules/_core/mobile/metro.config.js +18 -0
- package/modules/_core/mobile/package.json +36 -0
- package/modules/_core/mobile/src/nav.ts +9 -0
- package/modules/_core/mobile/src/providers.tsx +17 -0
- package/modules/_core/mobile/tsconfig.json +10 -0
- package/modules/_core/root/.editorconfig +15 -0
- package/modules/_core/root/_gitignore +29 -0
- package/modules/_core/server/.python-version +1 -0
- package/modules/_core/server/config/__init__.py +0 -0
- package/modules/_core/server/config/asgi.py +7 -0
- package/modules/_core/server/config/settings.py +127 -0
- package/modules/_core/server/config/urls.py +17 -0
- package/modules/_core/server/config/wsgi.py +7 -0
- package/modules/_core/server/manage.py +21 -0
- package/modules/_core/server/pyproject.toml +38 -0
- package/modules/_core/server/tests/test_health.py +4 -0
- package/modules/_core/shared/package.json +17 -0
- package/modules/_core/shared/src/index.ts +11 -0
- package/modules/_core/shared/tsconfig.json +7 -0
- package/modules/_core/web/app/globals.css +3 -0
- package/modules/_core/web/app/layout.tsx +19 -0
- package/modules/_core/web/app/page.tsx +21 -0
- package/modules/_core/web/app/providers.tsx +19 -0
- package/modules/_core/web/next-env.d.ts +5 -0
- package/modules/_core/web/next.config.mjs +9 -0
- package/modules/_core/web/package.json +31 -0
- package/modules/_core/web/postcss.config.mjs +6 -0
- package/modules/_core/web/src/nav.ts +9 -0
- package/modules/_core/web/tailwind.config.ts +9 -0
- package/modules/_core/web/tsconfig.json +18 -0
- package/modules/_core/web/vitest.config.mts +19 -0
- package/modules/auth/mobile/app/login.tsx +63 -0
- package/modules/auth/mobile/src/auth/auth-context.tsx +61 -0
- package/modules/auth/mobile/src/auth/client.test.ts +69 -0
- package/modules/auth/mobile/src/auth/client.ts +59 -0
- package/modules/auth/mobile/src/lib/config.ts +22 -0
- package/modules/auth/mobile/src/lib/token-store.ts +20 -0
- package/modules/auth/module.json +47 -0
- package/modules/auth/server/accounts/__init__.py +0 -0
- package/modules/auth/server/accounts/admin.py +4 -0
- package/modules/auth/server/accounts/apps.py +6 -0
- package/modules/auth/server/accounts/migrations/0001_initial.py +38 -0
- package/modules/auth/server/accounts/migrations/__init__.py +0 -0
- package/modules/auth/server/accounts/models.py +39 -0
- package/modules/auth/server/accounts/serializers.py +21 -0
- package/modules/auth/server/accounts/urls.py +11 -0
- package/modules/auth/server/accounts/views.py +26 -0
- package/modules/auth/server/tests/test_auth.py +44 -0
- package/modules/auth/shared/src/auth.ts +27 -0
- package/modules/auth/web/app/login/page.tsx +61 -0
- package/modules/auth/web/src/auth/auth-context.test.tsx +66 -0
- package/modules/auth/web/src/auth/auth-context.tsx +63 -0
- package/modules/auth/web/src/auth/client.test.ts +73 -0
- package/modules/auth/web/src/auth/client.ts +59 -0
- package/modules/auth/web/src/lib/config.ts +2 -0
- package/modules/auth/web/src/lib/token-store.ts +23 -0
- package/modules/ci/module.json +11 -0
- package/modules/db-postgres/module.json +22 -0
- package/modules/docker/module.json +19 -0
- package/modules/docker/root/infra/docker-compose.yml +20 -0
- package/modules/docker/server/.dockerignore +7 -0
- package/modules/example/mobile/app/profile.test.tsx +44 -0
- package/modules/example/mobile/app/profile.tsx +39 -0
- package/modules/example/module.json +21 -0
- package/modules/example/web/app/profile/page.test.tsx +41 -0
- package/modules/example/web/app/profile/page.tsx +34 -0
- package/modules/storage/module.json +34 -0
- package/modules/storage/server/storage/__init__.py +0 -0
- package/modules/storage/server/storage/base.py +24 -0
- package/modules/storage/server/storage/factory.py +20 -0
- package/modules/storage/server/storage/local.py +28 -0
- package/modules/storage/server/storage/s3.py +30 -0
- package/modules/storage/server/tests/test_storage.py +20 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agrim Sigdel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# partweave — a modular full-stack scaffolder
|
|
2
|
+
|
|
3
|
+
Generate new projects that contain **only the parts you pick** — a Django server, a
|
|
4
|
+
Next.js web app, an Expo mobile app, and cross-cutting components (auth, storage, docker,
|
|
5
|
+
CI) — all wired together.
|
|
6
|
+
|
|
7
|
+
It's `create-t3-app` (choose your stack) meets `shadcn/ui` (you own the code that's added,
|
|
8
|
+
built on clean, swappable interfaces).
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
**Run it directly — no install** (always the latest published version):
|
|
13
|
+
```sh
|
|
14
|
+
npx partweave create # interactive picker
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Or install the command globally:**
|
|
18
|
+
```sh
|
|
19
|
+
npm install -g partweave
|
|
20
|
+
partweave create # or use the short alias: weave create
|
|
21
|
+
```
|
|
22
|
+
> Requires Node ≥ 20. Updates are automatic with `npx`; for the global install run
|
|
23
|
+
> `npm update -g partweave`.
|
|
24
|
+
|
|
25
|
+
<details>
|
|
26
|
+
<summary>Install from source (contributors)</summary>
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
git clone git@github.com:Agrim-Sigdel/partweave.git ~/.partweave && cd ~/.partweave
|
|
30
|
+
./bin/partweave create # the launcher builds itself on first run
|
|
31
|
+
```
|
|
32
|
+
Or the one-line installer (clones to `~/.partweave`, builds, drops a `partweave` /
|
|
33
|
+
`weave` command into `~/.local/bin`):
|
|
34
|
+
```sh
|
|
35
|
+
curl -fsSL https://raw.githubusercontent.com/Agrim-Sigdel/partweave/main/scripts/install.sh | bash
|
|
36
|
+
```
|
|
37
|
+
</details>
|
|
38
|
+
|
|
39
|
+
### Use it
|
|
40
|
+
```sh
|
|
41
|
+
partweave create # interactive picker
|
|
42
|
+
partweave create my-app --dir ~/apps/my-app --server --mobile --with auth,docker # scriptable
|
|
43
|
+
partweave create my-app --server --web --js-pm npm --py-pm pip # use npm + pip instead of pnpm + uv
|
|
44
|
+
cd ~/apps/my-app && partweave add storage # add a component later
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **No pnpm or uv?** The generator defaults to whichever managers are installed and falls back to
|
|
48
|
+
> `npm` + `pip` (both bundled with Node / Python). Pick them with `--js-pm pnpm|npm` and
|
|
49
|
+
> `--py-pm uv|pip`, or in the interactive prompt.
|
|
50
|
+
|
|
51
|
+
## What you can generate
|
|
52
|
+
|
|
53
|
+
**Apps** (pick any subset):
|
|
54
|
+
|
|
55
|
+
| App | Stack |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `server` | Django 5 + DRF, managed by `uv` or `pip` (Python 3.12), SQLite by default |
|
|
58
|
+
| `web` | Next.js 14 (App Router) + TypeScript + Tailwind |
|
|
59
|
+
| `mobile` | Expo (React Native) + Expo Router + TypeScript |
|
|
60
|
+
|
|
61
|
+
Selecting a client app also brings `packages/shared` (TS interfaces) and, when a server is
|
|
62
|
+
present, `packages/api-client` (a typed client generated from the server's OpenAPI schema).
|
|
63
|
+
|
|
64
|
+
**Components** (`modules/`):
|
|
65
|
+
|
|
66
|
+
| id | What it adds |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `db-postgres` | Switch the server from SQLite to PostgreSQL |
|
|
69
|
+
| `auth` | JWT auth — register/login/refresh/me, with a swappable `TokenStore` on the clients |
|
|
70
|
+
| `example` | A demo profile screen proving the client↔server wiring |
|
|
71
|
+
| `docker` | Postgres `docker-compose.yml` + a production `Dockerfile` |
|
|
72
|
+
| `ci` | Per-app GitHub Actions with path filters (independent builds) |
|
|
73
|
+
| `storage` | Reference *swappable provider*: `StorageProvider` ABC + Local/S3 backends |
|
|
74
|
+
|
|
75
|
+
Dependencies resolve automatically (e.g. `example → auth → db-postgres`), and incompatible
|
|
76
|
+
picks (a component that needs an app you didn't select) are rejected up front.
|
|
77
|
+
|
|
78
|
+
## How it works
|
|
79
|
+
|
|
80
|
+
Two pieces:
|
|
81
|
+
|
|
82
|
+
- **`modules/`** — the catalog. `_core/` holds the bare, feature-less scaffolds (with wiring
|
|
83
|
+
anchors); every other folder is a component described by a `module.json` manifest.
|
|
84
|
+
- **`packages/cli/`** — the composer. It resolves your selection, copies only the needed files,
|
|
85
|
+
and injects wiring at deterministic `# <partweave:...>` anchors (idempotent, so `add` works too).
|
|
86
|
+
|
|
87
|
+
The output is a self-contained monorepo where each app can be developed and deployed on its own.
|
|
88
|
+
|
|
89
|
+
## Documentation
|
|
90
|
+
|
|
91
|
+
| Doc | Read it for |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| [creating-projects.md](docs/creating-projects.md) | **What you can create** — every app, component, flag, and common project shapes |
|
|
94
|
+
| [independent-workflows.md](docs/independent-workflows.md) | **Developing & deploying each part separately** — run/build/ship server, web, mobile on their own; split a part into its own repo |
|
|
95
|
+
| [feature-catalog.md](docs/feature-catalog.md) | **The menu of reusable features** — what's available now + a roadmap so you never rewrite the same boilerplate |
|
|
96
|
+
| [authoring-a-module.md](docs/authoring-a-module.md) | **How to add a feature** — recipes for server, client, ops, and swappable-provider components |
|
|
97
|
+
| [module-contract.md](docs/module-contract.md) | The `module.json` manifest spec (anchors, targets, wiring) |
|
|
98
|
+
|
|
99
|
+
## Extending the catalog
|
|
100
|
+
|
|
101
|
+
Adding a new component is **just a new folder under `modules/`** with a `module.json` — no
|
|
102
|
+
changes to the engine. Build the boilerplate once here and it appears in the picker for every
|
|
103
|
+
future project. See [feature-catalog.md](docs/feature-catalog.md) for a prioritized list of
|
|
104
|
+
components worth adding, and [authoring-a-module.md](docs/authoring-a-module.md) to build one.
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
pnpm --filter partweave build # build the CLI
|
|
110
|
+
pnpm --filter partweave typecheck # typecheck the engine
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The generator locates the catalog by walking up from the CLI to find `modules/`.
|
|
114
|
+
Override with `PARTWEAVE_MODULES_DIR=/path/to/modules`.
|
|
115
|
+
|
|
116
|
+
## Releasing
|
|
117
|
+
|
|
118
|
+
The CLI is published to npm as [`partweave`](https://www.npmjs.com/package/partweave).
|
|
119
|
+
Publishing is automated by [`.github/workflows/publish.yml`](.github/workflows/publish.yml):
|
|
120
|
+
push a version tag and CI builds, bundles `modules/`, and publishes.
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
npm version patch --workspace partweave # bump version + create a matching git tag (v0.1.1)
|
|
124
|
+
git push --follow-tags # push the tag → CI publishes to npm
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
> One-time setup: add an `NPM_TOKEN` (an npm "Automation" access token) to the repo's
|
|
128
|
+
> **Settings → Secrets and variables → Actions**. The `prepack` script copies `modules/` +
|
|
129
|
+
> README + LICENSE into the package, so `npm publish` ships a self-contained CLI.
|