@swell/cli 2.0.1-alpha.0 → 2.0.1-alpha.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.
package/README.md CHANGED
@@ -1,141 +1,3 @@
1
- # @swell/cli
1
+ # @swell/cli 2 alpha
2
2
 
3
- #We're in beta: commands and arguments can still change.#
4
-
5
- Install with:
6
-
7
- ```sh
8
- npm install -g @swell/cli
9
- ```
10
-
11
- If you are using tools for version managing like [asdf](https://asdf-vm.com/), make sure you [reshim](https://asdf-vm.com/manage/core.html#reshim) after install:
12
-
13
- ```sh
14
- asdf reshim
15
- ```
16
-
17
- # Commands
18
-
19
- ## General options
20
-
21
- Commands tend to support the following helper options:
22
-
23
- - --quiet (-q): Boolean, quiets the progress indicator and output of intermediary commands
24
- - --verbose (-v): Boolean, outputs all commands
25
- - --dry-run: Boolean, dry runs requests that delete data, but doesn't run them
26
- - --yes (-y): Boolean, answers all confirmation questions with **yes**.
27
-
28
- ## Login
29
-
30
- The `admin login` command authenticates and stores a user's session locally. Saved sessions can/will be used by other commands, unless a secret key is specified.
31
-
32
- ```sh
33
- swell login [--username (-u) String] [--password (-p) String] [--set-default Boolean]
34
- ```
35
-
36
- ### Examples
37
-
38
- ```sh
39
- swell login
40
- swell login --set-default
41
- ```
42
-
43
- ## Storefronts
44
-
45
- List all storefronts associated to logged in user:
46
-
47
- ```sh
48
- swell storefronts list
49
- ```
50
-
51
- Retrieves storefront configuration data from the server and writes it to a file if specified or stdout by default. It requires a type to run. Configuration types allowed are "editor", "menus" and "settings":
52
- ```sh
53
- swell storefronts pull --id String --type (-t) String [--file (-f) String]
54
- ```
55
-
56
- Send storefront configuration data to the server. Configuration types allowed are "editor", "menus" and "settings":
57
- ```sh
58
- swell storefronts push --id String --type (-t) String [--file (-f) String] [--strategy (-i) String]
59
- ```
60
-
61
- ### Examples
62
-
63
- ```sh
64
- swell storefronts pull --id P5OzfzLD -t editor
65
- swell storefronts pull --id P5OzfzLD -t menus -f menus.json
66
- swell storefronts push --id P5OzfzLD -t editor -s set -f ../origin-storefront/config/editor.json
67
- ```
68
-
69
- ### Without logging in
70
-
71
- ```sh
72
- swell storefronts pull --id P5OzfzLD -t editor --store my-test-store --secret-key my-dev-secret-key
73
- swell storefronts pull --id P5OzfzLD -t menus -f menus.json --store my-test-store --secret-key my-dev-secret-key
74
- swell storefronts push --id P5OzfzLD -t editor -s set -f ../origin-storefront/config/editor.json --store my-test-store --secret-key my-dev-secret-key
75
- ```
76
-
77
- ## Model
78
-
79
- Push or pull model definitions, including namespaced models (e.g. content models), abstract content models and content fields.
80
-
81
- ```sh
82
- # pull => retrieves a model from the server and tries to merge and/or write to a specified JSON file or stdout (by default)
83
- # --content flag toggles between base models and abstract content models or content fields
84
- swell model pull -m MODEL_ID [--file (-f) String] [--strategy (-s) String] [--content Boolean]
85
-
86
- # push => send a model definition from a JSON file or stdin to the server
87
- swell model push [--file (-f) String] [--input (-i) stdin] [--content Boolean]
88
- ```
89
-
90
- It is important that the model definition includes some fields depending on the type/source of the model.
91
-
92
- #### Basic model
93
-
94
- ```json
95
- {
96
- "name": "Test", // slug will be assumed from this field
97
- "slug": "test_model", // or you can define one explicitly
98
- "fields": { ... }
99
- }
100
- ```
101
-
102
- #### Namespaced model
103
-
104
- ```json
105
- {
106
- "name": "Page", // slug will be assumed from this field
107
- "namespace": "content",
108
- "fields": { ... }
109
- }
110
- ```
111
-
112
- #### Theme content (abstract) model/fields (use with --content flag)
113
-
114
- ```json
115
- {
116
- "name": "Test", // slug will be assumed from this field
117
- "fields": { ... },
118
- "source_type": "theme",
119
- "source_id": "origin"
120
- }
121
- ```
122
-
123
- ### Examples
124
-
125
- ```sh
126
- swell model pull -m products # pull products model and display in stdout
127
- swell model pull -m theme.origin.page --content -f models/page.json # pull a content model and save it to a file
128
-
129
- swell model push -f models/orders.json
130
- swell model push -c -f models/page.json # push a content model
131
- ```
132
-
133
- ### Without logging in
134
-
135
- ```sh
136
- swell model pull -m products --store my-test-store --secret-key my-dev-secret-key
137
- swell model pull -m theme.origin.page --content -f models/page.json --store my-test-store --secret-key my-dev-secret-key
138
-
139
- swell model push -f models/orders.json --store my-test-store --secret-key my-dev-secret-key
140
- swell model push -c -f models/page.json --store my-test-store --secret-key my-dev-secret-key
141
- ```
3
+ Find the alpha docs at https://www.notion.so/swellcorp/CLI-reference-c3553ebb3de24d94becbedf95a5a25d8?pvs=4
@@ -1081,5 +1081,5 @@
1081
1081
  ]
1082
1082
  }
1083
1083
  },
1084
- "version": "2.0.1-alpha.0"
1084
+ "version": "2.0.1-alpha.2"
1085
1085
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swell/cli",
3
- "version": "2.0.1-alpha.0",
3
+ "version": "2.0.1-alpha.2",
4
4
  "type": "module",
5
5
  "description": "Swell's command line interface/utility",
6
6
  "keywords": [
@@ -26,27 +26,28 @@
26
26
  "/oclif.manifest.json"
27
27
  ],
28
28
  "dependencies": {
29
+ "@inquirer/prompts": "3.2.0",
29
30
  "@npmcli/git": "5.0.3",
30
31
  "@oclif/core": "3.7.1",
31
32
  "@oclif/plugin-help": "6.0.4",
32
33
  "@oclif/plugin-plugins": "3.9.4",
34
+ "chalk": "5.3.0",
33
35
  "conf": "11.0.2",
34
36
  "configstore": "6.0.0",
37
+ "esbuild": "0.19.5",
35
38
  "inflection": "3.0.0",
39
+ "lodash": "4.17.21",
36
40
  "node-fetch": "3.3.2",
37
41
  "oclif": "4.0.3",
38
42
  "open": "9.1.0",
43
+ "ora": "7.0.1",
39
44
  "semver": "7.5.4",
40
45
  "table": "6.8.1"
41
46
  },
42
47
  "devDependencies": {
43
- "@inquirer/prompts": "3.2.0",
44
48
  "@inquirer/testing": "2.1.8",
45
49
  "@oclif/errors": "1.3.6",
46
50
  "@oclif/test": "3.0.3",
47
- "@rollup/plugin-commonjs": "25.0.7",
48
- "@rollup/plugin-json": "6.0.1",
49
- "@rollup/plugin-node-resolve": "15.2.3",
50
51
  "@types/chai": "4.3.9",
51
52
  "@types/configstore": "6.0.1",
52
53
  "@types/inquirer": "9.0.6",
@@ -54,30 +55,20 @@
54
55
  "@types/node": "20.8.8",
55
56
  "@typescript-eslint/eslint-plugin": "6.9.0",
56
57
  "chai": "4.3.10",
57
- "chalk": "5.3.0",
58
- "configstore": "6.0.0",
59
58
  "dotenv": "16.3.1",
60
- "esbuild": "0.19.5",
61
59
  "eslint": "8.52.0",
62
60
  "eslint-config-oclif": "5.0.0",
63
61
  "eslint-config-oclif-typescript": "3.0.8",
64
62
  "eslint-config-prettier": "9.0.0",
65
63
  "eslint-plugin-prettier": "5.0.1",
66
64
  "eslint-plugin-unicorn": "48.0.1",
67
- "list-it": "1.3.12",
68
- "lodash": "4.17.21",
69
65
  "mocha": "10.2.0",
70
66
  "nock": "13.3.6",
71
- "npm-decode": "1.4.2",
72
67
  "oclif": "4.0.3",
73
- "ora": "7.0.1",
74
- "rollup": "4.1.4",
75
68
  "shx": "0.3.4",
76
69
  "testdouble": "3.20.0",
77
70
  "ts-node": "10.9.1",
78
- "tslib": "2.6.2",
79
- "typescript": "5.2.2",
80
- "uvu": "0.5.6"
71
+ "typescript": "5.2.2"
81
72
  },
82
73
  "oclif": {
83
74
  "bin": "swell",
@@ -103,7 +94,7 @@
103
94
  "posttest": "npm run lint",
104
95
  "prepack": "npm run build && oclif manifest && oclif readme",
105
96
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
106
- "version": "oclif readme && git add README.md"
97
+ "publish-alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha"
107
98
  },
108
99
  "engines": {
109
100
  "node": ">= 18.16.1"