@adukiorg/create-anza 0.2.4 → 0.2.6
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 +37 -0
- package/index.js +14 -2
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @adukiorg/create-anza
|
|
2
|
+
|
|
3
|
+
Scaffold a new anza app with one command.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm create @adukiorg/anza myapp
|
|
9
|
+
cd myapp
|
|
10
|
+
npm install
|
|
11
|
+
npm run dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This generates a complete project with:
|
|
15
|
+
|
|
16
|
+
- `src/app.js` — entry point with UI init, theme, and Service Worker
|
|
17
|
+
- `src/index.html` — HTML shell with importmap, tokens, and styles
|
|
18
|
+
- `src/sw.js` — Service Worker with caching strategies
|
|
19
|
+
- `src/pages/index/` — welcome page (JS, HTML, CSS)
|
|
20
|
+
- `src/tokens/` — design tokens copied from the library
|
|
21
|
+
- `src/styles/` — global styles copied from the library
|
|
22
|
+
|
|
23
|
+
## What it does
|
|
24
|
+
|
|
25
|
+
`npm create @adukiorg/anza` installs this package, which resolves the installed `@adukiorg/anza` library and delegates to its scaffold logic. The library handles the actual file generation — this package is just the entry point.
|
|
26
|
+
|
|
27
|
+
## Programmatic use
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
import { run } from '@adukiorg/anza/bin/create';
|
|
31
|
+
|
|
32
|
+
run('/path/to/myapp', 'myapp', '/path/to/@adukiorg/anza');
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
MIT © Aduki
|
package/index.js
CHANGED
|
@@ -12,8 +12,20 @@ import { dirname, join, resolve, basename } from 'path';
|
|
|
12
12
|
import { existsSync } from 'fs';
|
|
13
13
|
|
|
14
14
|
const require = createRequire(import.meta.url);
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
|
|
16
|
+
let library;
|
|
17
|
+
try {
|
|
18
|
+
const anzaPkg = require.resolve('@adukiorg/anza/package.json');
|
|
19
|
+
library = dirname(anzaPkg);
|
|
20
|
+
} catch (_) {
|
|
21
|
+
// Fallback for local development — resolve relative to this script in the repo
|
|
22
|
+
library = dirname(dirname(new URL(import.meta.url).pathname));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!library || !existsSync(join(library, 'package.json'))) {
|
|
26
|
+
console.error('@adukiorg/anza not found. Is it installed?');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
17
29
|
|
|
18
30
|
const { run } = await import(join(library, 'bin', 'create', 'index.js'));
|
|
19
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adukiorg/create-anza",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Create a new anza app — `npm create @adukiorg/anza`",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"index.js"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@adukiorg/anza": "0.2.
|
|
13
|
+
"@adukiorg/anza": "0.2.6"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"anza",
|