@caweb/cli 1.3.10 → 1.3.12

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/commands/sync.js CHANGED
@@ -133,14 +133,15 @@ export default async function sync({
133
133
  * Sync Process
134
134
  * If taxonomy is undefined then we don't sync that section.
135
135
  *
136
- * 1) Site Settings are always synced.
137
- * 2) We always collect all the media.
136
+ * 1) We collect media if the taxonomy is undefined or includes media, pages, posts.
137
+ * 2) We only collect settings if the taxonomy is undefined or it's set to settings.
138
138
  * 3) We only collect pages if the taxonomy is undefined or it's set to pages.
139
139
  * 4) We only collect posts if the taxonomy is undefined or it's set to posts.
140
140
  * 5) We only collect menus if the taxonomy is undefined or it's set to menus.
141
141
  * - We also collect menu items if menus are collected.
142
142
  */
143
143
  let settings = [];
144
+ let mediaLibrary = [];
144
145
  let media = [];
145
146
  let pages = [];
146
147
  let posts = [];
@@ -148,24 +149,26 @@ export default async function sync({
148
149
  let menuNavItems = [];
149
150
 
150
151
  // Media Library.
151
- spinner.text = `Collecting Media Library ${from.url}`;
152
- let mediaLibrary = await getTaxonomies({
153
- ...fromOptions,
154
- fields: [
155
- 'id',
156
- 'source_url',
157
- 'title',
158
- 'caption',
159
- 'alt_text',
160
- 'date',
161
- 'mime_type',
162
- 'post',
163
- 'media_details'
164
- ],
165
- include: tax && tax.includes('media') && include ? include.join(',') : null
166
- },
167
- 'media'
168
- );
152
+ if( undefined === tax || tax.includes('media', 'pages', 'posts') ){
153
+ spinner.text = `Collecting Media Library ${from.url}`;
154
+ mediaLibrary = await getTaxonomies({
155
+ ...fromOptions,
156
+ fields: [
157
+ 'id',
158
+ 'source_url',
159
+ 'title',
160
+ 'caption',
161
+ 'alt_text',
162
+ 'date',
163
+ 'mime_type',
164
+ 'post',
165
+ 'media_details'
166
+ ],
167
+ include: tax && tax.includes('media') && include ? include.join(',') : null
168
+ },
169
+ 'media'
170
+ );
171
+ }
169
172
 
170
173
  // Site Settings.
171
174
  if( undefined === tax || tax.includes('settings') ){
@@ -339,7 +342,6 @@ export default async function sync({
339
342
  'meta',
340
343
  'menus'
341
344
  ],
342
- include: tax && include ? include.join(',') : null,
343
345
  menus: menus.map((menu) => { return menu.id; })
344
346
  },
345
347
  'menu-items'
@@ -81,7 +81,7 @@ baseConfig.module.rules.forEach((rule, i) => {
81
81
  // Our Webpack Configuration.
82
82
  let webpackConfig = {
83
83
  ...baseConfig,
84
- target: 'browserslist',
84
+ //target: 'browserslist',
85
85
  devtool: false,
86
86
  output: {
87
87
  ...baseConfig.output,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/cli",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
4
4
  "description": "CAWebPublishing Command Line Interface.",
5
5
  "exports": "./lib/env.js",
6
6
  "type": "module",