@cobinar/dalus 0.1.8 → 0.1.11

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.
Files changed (41) hide show
  1. package/README.md +10 -36
  2. package/bin/{dalus.js → dalus.mjs} +5 -14
  3. package/convert_to_mjs.py +59 -0
  4. package/fix_requires.py +57 -0
  5. package/package.json +4 -4
  6. package/publish-dalus.bat +1 -1
  7. package/src/{api-client.js → api-client.mjs} +67 -67
  8. package/src/commands/{forge.js → forge.mjs} +104 -104
  9. package/src/commands/{init.js → init.mjs} +53 -53
  10. package/src/{forgers/login.js → commands/login.mjs} +288 -288
  11. package/src/{config.js → config.mjs} +147 -147
  12. package/src/cors.mjs +19 -0
  13. package/src/forgers/{database.js → database.mjs} +34 -34
  14. package/src/forgers/{pages.js → pages.mjs} +35 -35
  15. package/src/forgers/storage.mjs +39 -0
  16. package/src/forgers/{vault.js → vault.mjs} +27 -27
  17. package/src/forgers/{workers.js → workers.mjs} +85 -85
  18. package/src/{fs-utils.js → fs-utils.mjs} +36 -36
  19. package/src/handlers/login-callback.mjs +143 -0
  20. package/src/handlers/services.mjs +45 -0
  21. package/src/index.mjs +36 -0
  22. package/src/auth.js +0 -78
  23. package/src/commands/auth.js +0 -78
  24. package/src/commands/cors.js +0 -34
  25. package/src/commands/index.js +0 -115
  26. package/src/commands/login.js +0 -288
  27. package/src/commands/storage.js +0 -72
  28. package/src/commands/utils.js +0 -7
  29. package/src/commands/validators.js +0 -101
  30. package/src/cors.js +0 -34
  31. package/src/forgers/auth.js +0 -78
  32. package/src/forgers/cors.js +0 -34
  33. package/src/forgers/index.js +0 -115
  34. package/src/forgers/storage.js +0 -72
  35. package/src/forgers/utils.js +0 -7
  36. package/src/forgers/validators.js +0 -101
  37. package/src/index.js +0 -115
  38. package/src/login.js +0 -288
  39. package/src/storage.js +0 -72
  40. package/src/utils.js +0 -7
  41. package/src/validators.js +0 -101
@@ -1,53 +1,53 @@
1
- 'use strict';
2
- const fs = require('fs');
3
- const path = require('path');
4
-
5
- const TEMPLATE = `{
6
- // dalus config — see https://github.com/ (your Cobinar docs link here)
7
- // for the full field reference. Paths below are relative to this file.
8
-
9
- // Optional — if omitted, dalus uses whatever worker URL you logged in
10
- // with ("dalus login"). Set this when a project should always deploy
11
- // to a specific worker regardless of who's running "dalus forge".
12
- // "apiBase": "https://worker.lobby.cobinar.com",
13
-
14
- "workers": [
15
- // { "name": "my-api", "main": "./worker.js",
16
- // "bindings": [
17
- // { "name": "MY_BUCKET", "type": "storage", "resource": "my-bucket" }
18
- // ],
19
- // "secrets": ["SOME_API_KEY"] }
20
- ],
21
- "pages": [
22
- // { "name": "my-site", "dir": "./public" }
23
- ],
24
- "storage": [
25
- // { "name": "my-bucket", "dir": "./assets", "public": true }
26
- ],
27
- "database": [
28
- // { "name": "my_collection", "seed": "./seed.json" }
29
- ],
30
- "vault": [
31
- // { "name": "my-vault", "rules": "./rules.txt" }
32
- ]
33
-
34
- // Named environments (optional) — "dalus forge --env staging" uses
35
- // these instead of the top-level lists above, per resource kind:
36
- // "env": {
37
- // "staging": { "workers": [ { "name": "my-api-staging", "main": "./worker.js" } ] }
38
- // }
39
- }
40
- `;
41
-
42
- function initCommand(args) {
43
- const target = path.join(process.cwd(), 'dalus.jsonc');
44
- if (fs.existsSync(target) && !args.includes('--force')) {
45
- console.error(`${target} already exists — pass --force to overwrite.`);
46
- process.exitCode = 1;
47
- return;
48
- }
49
- fs.writeFileSync(target, TEMPLATE);
50
- console.log(`Created ${target}. Fill in the resources you want, then run "dalus forge".`);
51
- }
52
-
53
- module.exports = { initCommand };
1
+ 'use strict';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+
5
+ const TEMPLATE = `{
6
+ // dalus config — see https://github.com/ (your Cobinar docs link here)
7
+ // for the full field reference. Paths below are relative to this file.
8
+
9
+ // Optional — if omitted, dalus uses whatever worker URL you logged in
10
+ // with ("dalus login"). Set this when a project should always deploy
11
+ // to a specific worker regardless of who's running "dalus forge".
12
+ // "apiBase": "https://worker.lobby.cobinar.com",
13
+
14
+ "workers": [
15
+ // { "name": "my-api", "main": "./worker.js",
16
+ // "bindings": [
17
+ // { "name": "MY_BUCKET", "type": "storage", "resource": "my-bucket" }
18
+ // ],
19
+ // "secrets": ["SOME_API_KEY"] }
20
+ ],
21
+ "pages": [
22
+ // { "name": "my-site", "dir": "./public" }
23
+ ],
24
+ "storage": [
25
+ // { "name": "my-bucket", "dir": "./assets", "public": true }
26
+ ],
27
+ "database": [
28
+ // { "name": "my_collection", "seed": "./seed.json" }
29
+ ],
30
+ "vault": [
31
+ // { "name": "my-vault", "rules": "./rules.txt" }
32
+ ]
33
+
34
+ // Named environments (optional) — "dalus forge --env staging" uses
35
+ // these instead of the top-level lists above, per resource kind:
36
+ // "env": {
37
+ // "staging": { "workers": [ { "name": "my-api-staging", "main": "./worker.js" } ] }
38
+ // }
39
+ }
40
+ `;
41
+
42
+ function initCommand(args) {
43
+ const target = path.join(process.cwd(), 'dalus.jsonc');
44
+ if (fs.existsSync(target) && !args.includes('--force')) {
45
+ console.error(`${target} already exists — pass --force to overwrite.`);
46
+ process.exitCode = 1;
47
+ return;
48
+ }
49
+ fs.writeFileSync(target, TEMPLATE);
50
+ console.log(`Created ${target}. Fill in the resources you want, then run "dalus forge".`);
51
+ }
52
+
53
+ export { initCommand };