Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dist/zaf_sdk.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/zaf_sdk.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*! Native Promise Only
v0.8.1 (c) Kyle Simpson
MIT License: http://getify.mit-license.org
*/
1 change: 1 addition & 0 deletions dist/zaf_sdk.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/zaf_sdk.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/zaf_sdk.min.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/*! Native Promise Only
v0.8.1 (c) Kyle Simpson
MIT License: http://getify.mit-license.org
*/
1 change: 1 addition & 0 deletions dist/zaf_sdk.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global URL */
import version from 'version'
import pkgJson from '../package.json'
import { when, isObject, isString } from './utils'
import IdleState from './utils/idleState'
import Tracker from './tracker'
Expand Down Expand Up @@ -380,7 +380,7 @@ export default class Client {
const tracker = new Tracker(this)
tracker.setup()
window.addEventListener('message', messageHandler.bind(null, this))
this.postMessage('iframe.handshake', { version: version })
this.postMessage('iframe.handshake', { version: pkgJson.version })
}

/**
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zendesk_app_framework_sdk",
"version": "2.0.33",
"main": "lib/zendesk-app-framework-sdk.js",
"main": "dist/zaf_sdk.min.js",
"description": "The Zendesk App Framework (ZAF) SDK is a JavaScript library that simplifies cross-frame communication between iframed apps and ZAF.",
"homepage": "http://developer.zendesk.com",
"bugs": "[email protected]",
Expand All @@ -11,9 +11,7 @@
"url": "http://developer.zendesk.com"
},
"engines": {
"node": ">=12.10.0",
"npm": ">=5.6.0",
"yarn": "Yarn is disabled for this project, use npm instead"
"node": ">=12.10.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -82,5 +80,10 @@
"snyk-protect": "snyk protect",
"prepare": "npm run snyk-protect"
},
"standard": {
"ignore": [
"/dist/"
]
},
"snyk": true
}
4 changes: 2 additions & 2 deletions spec/client_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global expect Promise */
import Client, * as clientUtils from '../lib/client'
import Tracker from '../lib/tracker'
import version from 'version'
import pkgJson from '../package.json'
import sinon from 'sinon'

describe('#collateActions', () => {
Expand Down Expand Up @@ -200,7 +200,7 @@ describe('Client', () => {
it('posts an "iframe.handshake" message when initialised', () => {
const data = {
key: 'iframe.handshake',
message: { version: version },
message: { version: pkgJson.version },
appGuid: appGuid,
instanceGuid: appGuid
}
Expand Down
18 changes: 8 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const path = require('path')
const packageJson = require('./package.json')
const webpackMerge = require('webpack-merge')
const TerserPlugin = require('terser-webpack-plugin')
const Visualizer = require('webpack-visualizer-plugin')
Expand Down Expand Up @@ -40,21 +39,20 @@ const commonConfig = {
},

output: {
library: 'ZAFClient',
libraryExport: 'default',
library: {
name: 'ZAFClient',
type: 'umd',
export: 'default'
},
filename: '[name].js',
sourceMapFilename: '[name].js.map',
path: path.resolve(__dirname, 'build')
path: path.resolve(__dirname, 'dist')
},

externals: {
version: `"${packageJson.version}"`
},

// Note: devServer does not serve from build/, but from cache. It also doesn't respect mode
// Note: devServer does not serve from dist/, but from cache. It also doesn't respect mode
// so outputed files are very different from server/build/build:dev
devServer: {
contentBase: path.join(__dirname, 'build'),
contentBase: path.join(__dirname, 'dist'),
hot: false,
inline: false,
compress: true,
Expand Down