Update main converse.js package to use @converse/headless

* Update moved dependencies references to @converse/headless
* Remove unused webpack resolve aliases
This commit is contained in:
cmrd Senya 2018-10-08 02:14:32 +03:00 committed by JC Brand
parent ae1424aa5b
commit 8ba8eb02fa
27 changed files with 55 additions and 67 deletions

View File

@ -8,7 +8,7 @@
// https://leaverou.github.io/awesomplete/
(function (root, factory) {
define(["converse-core"], factory);
define(["@converse/headless/converse-core"], factory);
}(this, function (converse) {
const { _, Backbone } = converse.env,

View File

@ -10,8 +10,8 @@
* in XEP-0048.
*/
(function (root, factory) {
define(["converse-core",
"converse-muc",
define(["@converse/headless/converse-core",
"@converse/headless/converse-muc",
"templates/chatroom_bookmark_form.html",
"templates/chatroom_bookmark_toggle.html",
"templates/bookmark.html",
@ -42,7 +42,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
dependencies: ["converse-chatboxes", "converse-muc", "converse-muc-views"],
dependencies: ["converse-chatboxes", "@converse/headless/converse-muc", "converse-muc-views"],
overrides: {
// Overrides mentioned here will be picked up by converse.js's

View File

@ -5,7 +5,7 @@
// Licensed under the Mozilla Public License (MPLv2)
(function (root, factory) {
define(["converse-core"], factory);
define(["@converse/headless/converse-core"], factory);
}(this, function (converse) {
const { Strophe, $build, _, b64_sha1 } = converse.env;

View File

@ -6,9 +6,9 @@
(function (root, factory) {
define([
"converse-core",
"@converse/headless/converse-core",
"templates/chatboxes.html",
"converse-chatboxes",
"@converse/headless/converse-chatboxes",
"backbone.overview"
], factory);
}(this, function (converse, tpl_chatboxes) {

View File

@ -7,7 +7,7 @@
(function (root, factory) {
define([
"utils/emoji",
"converse-core",
"@converse/headless/converse-core",
"bootstrap",
"twemoji",
"xss",
@ -914,7 +914,7 @@
} else if (ev.keyCode === _converse.keycodes.DOWN_ARROW && ev.target.selectionEnd === ev.target.value.length) {
return this.editLaterMessage();
}
}
}
if (_.includes([
_converse.keycodes.SHIFT,
_converse.keycodes.META,
@ -1314,11 +1314,11 @@
* @method _converse.api.chatviews.get
* @returns {ChatBoxView} A [Backbone.View](http://backbonejs.org/#View) instance.
* The chat should already be open, otherwise `undefined` will be returned.
*
*
* @example
* // To return a single view, provide the JID of the contact:
* _converse.api.chatviews.get('buddy@example.com')
*
*
* @example
* // To return an array of views, provide an array of JIDs:
* _converse.api.chatviews.get(['buddy1@example.com', 'buddy2@example.com'])

View File

@ -7,10 +7,10 @@
/*global define */
(function (root, factory) {
define(["converse-core",
define(["@converse/headless/converse-core",
"bootstrap",
"formdata-polyfill",
"lodash.fp",
"@converse/headless/lodash.fp",
"templates/converse_brand_heading.html",
"templates/controlbox.html",
"templates/controlbox_toggle.html",

View File

@ -7,7 +7,7 @@
/*global define, window, document */
(function (root, factory) {
define(["converse-core",
define(["@converse/headless/converse-core",
"templates/dragresize.html",
"converse-chatview",
"converse-controlbox"

View File

@ -5,7 +5,7 @@
// Licensed under the Mozilla Public License (MPLv2)
(function (root, factory) {
define(["converse-core", "converse-muc"], factory);
define(["@converse/headless/converse-core", "@converse/headless/converse-muc"], factory);
}(this, function (converse) {
"use strict";
const { Backbone, _ } = converse.env;

View File

@ -7,11 +7,11 @@
/*global define */
(function (root, factory) {
define(["converse-core",
define(["@converse/headless/converse-core",
"templates/inverse_brand_heading.html",
"converse-chatview",
"converse-controlbox",
"converse-muc",
"@converse/headless/converse-muc",
"converse-singleton"
], factory);
}(this, function (converse, tpl_brand_heading) {

View File

@ -8,7 +8,7 @@
(function (root, factory) {
define([
"converse-core",
"@converse/headless/converse-core",
"templates/chatbox.html",
"converse-chatview",
], factory);

View File

@ -7,7 +7,7 @@
(function (root, factory) {
define([
"utils/emoji",
"converse-core",
"@converse/headless/converse-core",
"xss",
"filesize",
"templates/csn.html",

View File

@ -7,7 +7,7 @@
/*global define, window, document */
(function (root, factory) {
define(["converse-core",
define(["@converse/headless/converse-core",
"templates/chatbox_minimize.html",
"templates/toggle_chats.html",
"templates/trimmed_chat.html",
@ -39,7 +39,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
dependencies: ["converse-chatview", "converse-controlbox", "converse-muc", "converse-muc-views", "converse-headline"],
dependencies: ["converse-chatview", "converse-controlbox", "@converse/headless/converse-muc", "converse-muc-views", "converse-headline"],
enabled (_converse) {
return _converse.view_mode == 'overlayed';

View File

@ -7,7 +7,7 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([
"converse-core",
"@converse/headless/converse-core",
"templates/alert_modal.html",
"bootstrap",
"backbone.vdomview"

View File

@ -6,7 +6,7 @@
(function (root, factory) {
define([
"converse-core",
"@converse/headless/converse-core",
"formdata-polyfill",
"utils/muc",
"xss",

View File

@ -7,7 +7,7 @@
/*global define */
(function (root, factory) {
define(["converse-core"], factory);
define(["@converse/headless/converse-core"], factory);
}(this, function (converse) {
"use strict";
const { Strophe, _, sizzle } = converse.env,

View File

@ -7,7 +7,7 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module called "myplugin"
define(["converse-core", "templates/oauth_providers.html", "hellojs"], factory);
define(["@converse/headless/converse-core", "templates/oauth_providers.html", "hellojs"], factory);
} else {
// Browser globals. If you're not using a module loader such as require.js,
// then this line below executes. Make sure that your plugin's <script> tag

View File

@ -8,7 +8,7 @@
(function (root, factory) {
define([
"converse-core",
"@converse/headless/converse-core",
"templates/toolbar_omemo.html"
], factory);
}(this, function (converse, tpl_toolbar_omemo) {

View File

@ -7,7 +7,7 @@
/*global define */
(function (root, factory) {
define(["converse-core",
define(["@converse/headless/converse-core",
"bootstrap",
"formdata-polyfill",
"templates/alert.html",
@ -15,7 +15,7 @@
"templates/profile_modal.html",
"templates/profile_view.html",
"templates/status_option.html",
"converse-vcard",
"@converse/headless/converse-vcard",
"converse-modal"
], factory);
}(this, function (

View File

@ -8,7 +8,7 @@
* an "App Server" as defined in XEP-0357
*/
(function (root, factory) {
define(["converse-core"], factory);
define(["@converse/headless/converse-core"], factory);
}(this, function (converse) {
"use strict";
const { Strophe, $iq, _ } = converse.env;

View File

@ -11,13 +11,13 @@
*/
(function (root, factory) {
define(["utils/form",
"converse-core",
"templates/form_username.html",
"@converse/headless/converse-core",
"@converse/headless/templates/form_username.html",
"templates/register_link.html",
"templates/register_panel.html",
"templates/registration_form.html",
"templates/registration_request.html",
"templates/form_input.html",
"@converse/headless/templates/form_input.html",
"templates/spinner.html",
"converse-controlbox"
], factory);

View File

@ -10,8 +10,8 @@
* rooms in the "Rooms Panel" of the ControlBox.
*/
(function (root, factory) {
define(["converse-core",
"converse-muc",
define(["@converse/headless/converse-core",
"@converse/headless/converse-muc",
"templates/rooms_list.html",
"templates/rooms_list_item.html"
], factory);
@ -33,7 +33,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
dependencies: ["converse-singleton", "converse-controlbox", "converse-muc", "converse-bookmarks"],
dependencies: ["converse-singleton", "converse-controlbox", "@converse/headless/converse-muc", "converse-bookmarks"],
initialize () {
/* The initialize function gets called as soon as the plugin is

View File

@ -5,7 +5,7 @@
// Licensed under the Mozilla Public License (MPLv2)
(function (root, factory) {
define(["converse-core"], factory);
define(["@converse/headless/converse-core"], factory);
}(this, function (converse) {
"use strict";
const { Backbone, Promise, Strophe, $iq, $pres, b64_sha1, moment, sizzle, _ } = converse.env;

View File

@ -5,7 +5,7 @@
// Licensed under the Mozilla Public License (MPLv2)
(function (root, factory) {
define(["converse-core",
define(["@converse/headless/converse-core",
"formdata-polyfill",
"templates/add_contact_modal.html",
"templates/group_header.html",
@ -16,11 +16,11 @@
"templates/roster_item.html",
"templates/search_contact.html",
"awesomplete",
"converse-chatboxes",
"@converse/headless/converse-chatboxes",
"converse-modal"
], factory);
}(this, function (
converse,
converse,
_FormData,
tpl_add_contact_modal,
tpl_group_header,
@ -679,7 +679,7 @@
filter (q, type) {
/* Filter the group's contacts based on the query "q".
*
*
* If all contacts are filtered out (i.e. hidden), then the
* group must be filtered out as well.
*/
@ -985,7 +985,7 @@
function initRoster () {
/* Create an instance of RosterView once the RosterGroups
* collection has been created (in converse-core.js)
* collection has been created (in @converse/headless/converse-core.js)
*/
if (_converse.authentication === _converse.ANONYMOUS) {
return;

View File

@ -17,7 +17,7 @@
*/
(function (root, factory) {
define(
["converse-core", "converse-chatview"],
["@converse/headless/converse-core", "converse-chatview"],
factory);
}(this, function (converse) {
"use strict";

View File

@ -2,7 +2,7 @@
if (typeof define !== 'undefined') {
// The section below determines which plugins will be included in a build
define([
"converse-core",
"@converse/headless/converse-core",
/* START: Removable components
* --------------------
* Any of the following components may be removed if they're not needed.
@ -17,17 +17,17 @@ if (typeof define !== 'undefined') {
"converse-fullscreen",
"converse-push", // XEP-0357 Push Notifications
"converse-headline", // Support for headline messages
"converse-mam", // XEP-0313 Message Archive Management
"@converse/headless/converse-mam", // XEP-0313 Message Archive Management
"converse-minimize", // Allows chat boxes to be minimized
"converse-muc", // XEP-0045 Multi-user chat
"@converse/headless/converse-muc", // XEP-0045 Multi-user chat
"converse-muc-views", // Views related to MUC
"converse-notification", // HTML5 Notifications
"converse-omemo",
"converse-ping", // XEP-0199 XMPP Ping
"@converse/headless/converse-ping", // XEP-0199 XMPP Ping
"converse-register", // XEP-0077 In-band registration
"converse-roomslist", // Show currently open chat rooms
"converse-roster",
"converse-vcard", // XEP-0054 VCard-temp
"@converse/headless/converse-vcard", // XEP-0054 VCard-temp
/* END: Removable components */
], function (converse) {
return converse;

View File

@ -1,4 +1,4 @@
define('awesomplete', [], function () { return Awesomplete; });
define('lodash', [], function () { return _; });
define('underscore', [], function () { return _; });
@ -23,7 +23,7 @@
define('moment/locale/uk', [], function () { return moment; });
define('moment/moment', [], function () { return moment; });
define('i18n', [], function () { return; });
define('es6-promise', [], function () { return Promise; });
define('es6-promise/dist/es6-promise.auto', [], function () { return Promise; });
define('strophe', [], function () {
return {

View File

@ -80,25 +80,13 @@ const config = {
"IPv6": path.resolve(__dirname, "node_modules/urijs/src/IPv6"),
"SecondLevelDomains": path.resolve(__dirname, "node_modules/urijs/src/SecondLevelDomains"),
"awesomplete": path.resolve(__dirname, "node_modules/awesomplete-avoid-xss/awesomplete"),
"backbone": path.resolve(__dirname, "node_modules/backbone/backbone"),
"backbone.browserStorage": path.resolve(__dirname, "node_modules/backbone.browserStorage/backbone.browserStorage"),
"backbone.nativeview": path.resolve(__dirname, "node_modules/backbone.nativeview/backbone.nativeview"),
"backbone.orderedlistview": path.resolve(__dirname, "node_modules/backbone.overview/backbone.orderedlistview"),
"backbone.overview": path.resolve(__dirname, "node_modules/backbone.overview/backbone.overview"),
"backbone.vdomview": path.resolve(__dirname, "node_modules/backbone.vdomview/backbone.vdomview"),
"bootstrap": path.resolve(__dirname, "node_modules/bootstrap.native/dist/bootstrap-native-v4"),
"crypto": path.resolve(__dirname, "node_modules/otr/build/dep/crypto"),
"es6-promise": path.resolve(__dirname, "node_modules/es6-promise/dist/es6-promise.auto"),
"filesize": path.resolve(__dirname, "node_modules/filesize/lib/filesize"),
"fast-text-encoding": path.resolve(__dirname, "node_modules/fast-text-encoding/text"),
"formdata-polyfill": path.resolve(__dirname, "node_modules/formdata-polyfill/FormData"),
"jed": path.resolve(__dirname, "node_modules/jed/jed"),
"jquery": path.resolve(__dirname, "src/jquery-stub"),
"lodash": path.resolve(__dirname, "node_modules/lodash/lodash"),
"lodash.converter": path.resolve(__dirname, "3rdparty/lodash.fp"),
"lodash.converter": "@converse/core/3rdparty/lodash.fp",
"pluggable": path.resolve(__dirname, "node_modules/pluggable.js/dist/pluggable"),
"punycode": path.resolve(__dirname, "node_modules/urijs/src/punycode"),
"sizzle": path.resolve(__dirname, "node_modules/sizzle/dist/sizzle"),
"snabbdom": path.resolve(__dirname, "node_modules/snabbdom/dist/snabbdom"),
"snabbdom-attributes": path.resolve(__dirname, "node_modules/snabbdom/dist/snabbdom-attributes"),
"snabbdom-class": path.resolve(__dirname, "node_modules/snabbdom/dist/snabbdom-class"),
@ -109,10 +97,10 @@ const config = {
"tovnode": path.resolve(__dirname, "node_modules/snabbdom/dist/tovnode"),
"underscore": path.resolve(__dirname, "src/underscore-shim"),
"uri": path.resolve(__dirname, "node_modules/urijs/src/URI"),
"utils/core": path.resolve(__dirname, "src/utils/core"),
"utils/emoji": path.resolve(__dirname, "src/utils/emoji"),
"utils/form": path.resolve(__dirname, "src/utils/form"),
"utils/muc": path.resolve(__dirname, "src/utils/muc"),
"utils/core": "@converse/headless/utils/core",
"utils/emoji": "@converse/headless/utils/emoji",
"utils/form": "@converse/headless/utils/form",
"utils/muc": "@converse/headless/utils/muc",
"vdom-parser": path.resolve(__dirname, "node_modules/vdom-parser/dist"),
"xss": path.resolve(__dirname, "node_modules/xss/dist/xss")
}
@ -135,7 +123,7 @@ function parameterize () {
if (type === 'headless') {
console.log("Making a headless build");
extend(config, {
entry: path.resolve(__dirname, 'src/headless.js'),
entry: "@converse/headless",
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'converse-headless.js'