@swell/cli 2.0.1-alpha.9 → 2.0.2

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 (102) hide show
  1. package/dist/app-command.d.ts +1 -1
  2. package/dist/app-command.js +9 -9
  3. package/dist/commands/app/dev.d.ts +16 -0
  4. package/dist/commands/app/dev.js +28 -0
  5. package/dist/commands/app/frontend/deploy.d.ts +15 -0
  6. package/dist/commands/app/frontend/deploy.js +41 -0
  7. package/dist/commands/app/frontend/dev.d.ts +19 -0
  8. package/dist/commands/app/frontend/dev.js +108 -0
  9. package/dist/commands/app/info.js +14 -9
  10. package/dist/commands/app/init.d.ts +12 -0
  11. package/dist/commands/app/init.js +34 -0
  12. package/dist/commands/app/install.d.ts +4 -4
  13. package/dist/commands/app/install.js +36 -42
  14. package/dist/commands/app/pull.d.ts +15 -0
  15. package/dist/commands/app/pull.js +50 -0
  16. package/dist/commands/app/push.d.ts +11 -14
  17. package/dist/commands/app/push.js +64 -138
  18. package/dist/commands/app/release.d.ts +13 -0
  19. package/dist/commands/app/release.js +148 -0
  20. package/dist/commands/app/version.d.ts +5 -4
  21. package/dist/commands/app/version.js +63 -42
  22. package/dist/commands/app/watch.d.ts +2 -4
  23. package/dist/commands/app/watch.js +3 -83
  24. package/dist/commands/create/app.d.ts +35 -11
  25. package/dist/commands/create/app.js +143 -137
  26. package/dist/commands/create/content.d.ts +2 -2
  27. package/dist/commands/create/content.js +10 -10
  28. package/dist/commands/create/frontend.d.ts +12 -0
  29. package/dist/commands/create/frontend.js +38 -0
  30. package/dist/commands/create/function.d.ts +3 -3
  31. package/dist/commands/create/function.js +22 -22
  32. package/dist/commands/create/model.d.ts +2 -2
  33. package/dist/commands/create/model.js +11 -11
  34. package/dist/commands/create/notification.d.ts +4 -4
  35. package/dist/commands/create/notification.js +38 -40
  36. package/dist/commands/env.d.ts +12 -0
  37. package/dist/commands/env.js +31 -0
  38. package/dist/commands/login.d.ts +1 -1
  39. package/dist/commands/login.js +18 -24
  40. package/dist/commands/logs.js +0 -1
  41. package/dist/commands/theme/dev.d.ts +21 -0
  42. package/dist/commands/theme/dev.js +164 -0
  43. package/dist/commands/theme/init.d.ts +9 -0
  44. package/dist/commands/theme/init.js +15 -0
  45. package/dist/commands/theme/pull.d.ts +20 -0
  46. package/dist/commands/theme/pull.js +65 -0
  47. package/dist/commands/theme/push.d.ts +19 -0
  48. package/dist/commands/theme/push.js +89 -0
  49. package/dist/create-app-command.d.ts +20 -0
  50. package/dist/create-app-command.js +253 -0
  51. package/dist/create-collection-command.d.ts +9 -9
  52. package/dist/create-collection-command.js +23 -23
  53. package/dist/{create-command.d.ts → create-config-command.d.ts} +1 -1
  54. package/dist/{create-command.js → create-config-command.js} +7 -7
  55. package/dist/env/local.d.ts +8 -0
  56. package/dist/env/local.js +7 -0
  57. package/dist/env/production.d.ts +8 -0
  58. package/dist/env/production.js +7 -0
  59. package/dist/env/review.d.ts +8 -0
  60. package/dist/env/review.js +7 -0
  61. package/dist/env/staging.d.ts +8 -0
  62. package/dist/env/staging.js +7 -0
  63. package/dist/lib/api.d.ts +4 -2
  64. package/dist/lib/api.js +50 -21
  65. package/dist/lib/app-config.d.ts +13 -5
  66. package/dist/lib/app-config.js +62 -24
  67. package/dist/lib/apps/app-config.d.ts +17 -3
  68. package/dist/lib/apps/app-config.js +194 -66
  69. package/dist/lib/apps/index.d.ts +93 -12
  70. package/dist/lib/apps/index.js +155 -50
  71. package/dist/lib/apps/paths.d.ts +14 -7
  72. package/dist/lib/apps/paths.js +73 -28
  73. package/dist/lib/bundle.js +15 -3
  74. package/dist/lib/config.d.ts +9 -2
  75. package/dist/lib/config.js +49 -1
  76. package/dist/lib/constants.d.ts +5 -0
  77. package/dist/lib/constants.js +24 -6
  78. package/dist/lib/create/content.d.ts +2 -2
  79. package/dist/lib/create/content.js +1 -1
  80. package/dist/lib/create/function.d.ts +2 -2
  81. package/dist/lib/create/function.js +2 -2
  82. package/dist/lib/create/index.d.ts +1 -1
  83. package/dist/lib/create/index.js +11 -7
  84. package/dist/lib/create/model.d.ts +2 -2
  85. package/dist/lib/create/notification.d.ts +2 -2
  86. package/dist/lib/info.js +2 -2
  87. package/dist/lib/logs/index.js +1 -1
  88. package/dist/lib/sessions.js +2 -2
  89. package/dist/lib/stores.d.ts +9 -4
  90. package/dist/lib/stores.js +13 -8
  91. package/dist/lib/style.d.ts +2 -0
  92. package/dist/lib/style.js +2 -0
  93. package/dist/lib/swell-function-wrapper.d.ts +40 -1
  94. package/dist/lib/swell-function-wrapper.js +107 -22
  95. package/dist/push-app-command.d.ts +73 -0
  96. package/dist/push-app-command.js +743 -0
  97. package/dist/remote-app-command.d.ts +37 -11
  98. package/dist/remote-app-command.js +432 -169
  99. package/oclif.manifest.json +872 -123
  100. package/package.json +14 -1
  101. package/dist/commands/app/_pull.d.ts +0 -8
  102. package/dist/commands/app/_pull.js +0 -45
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swell/cli",
3
- "version": "2.0.1-alpha.9",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "description": "Swell's command line interface/utility",
6
6
  "keywords": [
@@ -32,16 +32,27 @@
32
32
  "@oclif/errors": "1.3.6",
33
33
  "@oclif/plugin-help": "6.0.4",
34
34
  "@oclif/plugin-plugins": "3.9.4",
35
+ "@types/browser-sync": "2.29.0",
36
+ "blake3-wasm": "2.1.5",
37
+ "browser-sync": "3.0.2",
35
38
  "chalk": "5.3.0",
36
39
  "conf": "11.0.2",
37
40
  "configstore": "6.0.0",
38
41
  "esbuild": "0.19.5",
42
+ "execa": "8.0.1",
43
+ "find-up": "7.0.0",
44
+ "get-port": "7.0.0",
45
+ "globby": "14.0.1",
39
46
  "inflection": "3.0.0",
47
+ "istextorbinary": "9.5.0",
40
48
  "lodash": "4.17.21",
49
+ "mime-detect": "1.2.0",
50
+ "ngrok": "5.0.0-beta.2",
41
51
  "node-fetch": "3.3.2",
42
52
  "oclif": "4.0.3",
43
53
  "open": "9.1.0",
44
54
  "ora": "7.0.1",
55
+ "qs": "6.12.3",
45
56
  "semver": "7.5.4",
46
57
  "table": "6.8.1"
47
58
  },
@@ -53,6 +64,7 @@
53
64
  "@types/inquirer": "9.0.6",
54
65
  "@types/mocha": "10.0.3",
55
66
  "@types/node": "20.8.8",
67
+ "@types/qs": "6.9.15",
56
68
  "@typescript-eslint/eslint-plugin": "6.9.0",
57
69
  "chai": "4.3.10",
58
70
  "dotenv": "16.3.1",
@@ -88,6 +100,7 @@
88
100
  }
89
101
  },
90
102
  "scripts": {
103
+ "preinstall": "npm i -g ts-node",
91
104
  "build": "shx rm -rf dist && shx rm -f tsconfig.tsbuildinfo && tsc -b",
92
105
  "lint": "eslint . --ext .ts --config .eslintrc",
93
106
  "postpack": "shx rm -f oclif.manifest.json",
@@ -1,8 +0,0 @@
1
- import { RemoteAppCommand } from '../../remote-app-command.js';
2
- export default class AppPull extends RemoteAppCommand {
3
- static args: {
4
- appId: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
5
- };
6
- static summary: string;
7
- run(): Promise<void>;
8
- }
@@ -1,45 +0,0 @@
1
- import { Args } from '@oclif/core';
2
- import { dasherize, pluralize, underscore } from 'inflection';
3
- import * as path from 'node:path';
4
- import { newConfig } from '../../lib/app-config.js';
5
- import { ConfigPaths, writeJsonFile, } from '../../lib/apps/index.js';
6
- import { toAppId } from '../../lib/create/index.js';
7
- import style from '../../lib/style.js';
8
- import { RemoteAppCommand } from '../../remote-app-command.js';
9
- export default class AppPull extends RemoteAppCommand {
10
- static args = {
11
- appId: Args.string({ description: 'app id to pull' }),
12
- };
13
- static summary = 'Pull app configuration from remote.';
14
- async run() {
15
- const { args } = await this.parse(AppPull);
16
- const { appId } = args;
17
- this.appPath = process.cwd();
18
- if (!appId) {
19
- this.error('You must provide an app id to pull');
20
- }
21
- this.log(`Will pull app configuration for ${style.appConfigValue(appId)} in ${this.appPath}`);
22
- this.app = await this.getApp(appId);
23
- this.debug('run: app', this.app);
24
- // save app definition
25
- const config = newConfig();
26
- const appConfigJson = {
27
- description: this.app.description || '',
28
- id: toAppId(this.app.name),
29
- name: this.app.name,
30
- version: this.app.version,
31
- };
32
- config.clear();
33
- config.set(appConfigJson);
34
- // save app configs
35
- for (const config of this.app?.configs || []) {
36
- if (!config)
37
- continue;
38
- const configType = config.type;
39
- const typeDirName = ConfigPaths[configType];
40
- const fileName = pluralize(dasherize(underscore(config.name)).toLowerCase());
41
- const filePath = path.join(this.appPath, typeDirName, `${fileName}.json`);
42
- writeJsonFile(filePath, config.values);
43
- }
44
- }
45
- }