@agility/content-sync 1.2.0-beta.3 → 1.2.0-beta.4

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/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@agility/content-sync",
3
- "version": "1.2.0-beta.3",
3
+ "version": "1.2.0-beta.4",
4
4
  "description": "JavaScript SDK for synchronizing content from Agility CMS",
5
5
  "main": "dist/agility-sync-sdk.node.js",
6
+
6
7
  "scripts": {
8
+ "preinstall": "node -e \"const major = process.version.match(/^v(\\d+)/)[1]; if (major != 16) { console.error('Node 16 required, found Node ' + major); process.exit(1); }\"",
7
9
  "test": "nyc --reporter=html --reporter=text mocha --require @babel/register --recursive ./test/",
8
10
  "generate-docs": "node_modules/.bin/jsdoc --configure .jsdoc.json --verbose",
9
11
  "build": "webpack --config webpack.config -p"
@@ -1,11 +1,11 @@
1
- const fs = require('fs')
2
- const os = require('os')
3
- const path = require('path')
4
- const {sleep} = require("./util")
5
- const { lockSync, unlockSync, checkSync, check } = require("proper-lockfile")
6
-
7
-
8
- require("dotenv").config({
1
+ import fs from 'fs'
2
+ import os from 'os'
3
+ import path from 'path'
4
+ import { sleep } from "./util.js"
5
+ import { lockSync, unlockSync, checkSync, check } from "proper-lockfile"
6
+ import dotenv from "dotenv"
7
+
8
+ dotenv.config({
9
9
  path: `.env.${process.env.NODE_ENV}`,
10
10
  })
11
11
 
@@ -192,7 +192,7 @@ const getFilePath = ({ options, itemType, languageCode, itemID }) => {
192
192
  }
193
193
 
194
194
 
195
- module.exports = {
195
+ export default {
196
196
  saveItem,
197
197
  deleteItem,
198
198
  mergeItemToList,
@@ -82,4 +82,4 @@ function createSyncClient(userConfig) {
82
82
  }
83
83
  }
84
84
 
85
- export default { getSyncClient }
85
+ export { getSyncClient }
package/src/util.js CHANGED
@@ -70,7 +70,7 @@ const sleep = (ms) => {
70
70
  return new Promise(resolve => setTimeout(resolve, ms));
71
71
  }
72
72
 
73
- module.exports = {
73
+ export {
74
74
  logDebug,
75
75
  logInfo,
76
76
  logError,
package/webpack.config.js CHANGED
@@ -7,11 +7,7 @@ const nodeConfig = {
7
7
  output: {
8
8
  filename: 'agility-sync-sdk.node.js',
9
9
  path: path.resolve(__dirname, 'dist'),
10
- library: 'agilitySync',
11
- libraryTarget: 'umd',
12
- libraryExport: 'default',
13
- umdNamedDefine: true,
14
- globalObject: 'typeof self !== \'undefined\' ? self : this'
10
+ libraryTarget: 'commonjs2'
15
11
  },
16
12
  optimization: {
17
13
  minimize: false