From c275855cd090159f819737d93e8b60d79d0ec302 Mon Sep 17 00:00:00 2001 From: Pamplemousse Date: Sat, 7 Jan 2023 08:43:12 +0100 Subject: [PATCH] removing `bower`: migrate `json.sortify` Signed-off-by: Pamplemousse --- bower.json | 1 - package-lock.json | 16 ++++++++++++++++ package.json | 1 + scripts/copy-components.js | 1 + www/common/outer/roster.js | 4 ++-- www/common/requireconfig.js | 2 +- www/worker/worker.js | 2 +- 7 files changed, 22 insertions(+), 5 deletions(-) diff --git a/bower.json b/bower.json index ce5e9b9da..4ed20a3fe 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,6 @@ "tests" ], "dependencies": { - "json.sortify": "~2.1.0", "hyperjson": "~1.4.0", "chainpad-crypto": "^0.2.0", "chainpad-listmap": "^1.0.0", diff --git a/package-lock.json b/package-lock.json index d89586369..62c7f4129 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "components-font-awesome": "^4.6.3", "jquery": "3.6.0", "jshint": "^2.13.4", + "json.sortify": "~2.1.0", "less": "3.7.1", "lesshint": "6.3.7", "marked": "^1.1.0", @@ -2466,6 +2467,15 @@ "dev": true, "optional": true }, + "node_modules/json.sortify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json.sortify/-/json.sortify-2.1.0.tgz", + "integrity": "sha512-otSldRQcu9PaQJJDeB1qGZUIoL7C4nxZunUVHieWPUMJvvVxIUhsMQUhR+r4OUZBwA1McnbS7sqDf5dYHzJsbw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -6696,6 +6706,12 @@ "dev": true, "optional": true }, + "json.sortify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json.sortify/-/json.sortify-2.1.0.tgz", + "integrity": "sha512-otSldRQcu9PaQJJDeB1qGZUIoL7C4nxZunUVHieWPUMJvvVxIUhsMQUhR+r4OUZBwA1McnbS7sqDf5dYHzJsbw==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", diff --git a/package.json b/package.json index a20b44263..700ad304e 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "components-font-awesome": "^4.6.3", "jquery": "3.6.0", "jshint": "^2.13.4", + "json.sortify": "~2.1.0", "less": "3.7.1", "lesshint": "6.3.7", "marked": "^1.1.0", diff --git a/scripts/copy-components.js b/scripts/copy-components.js index 6d910e054..bf8b1a894 100644 --- a/scripts/copy-components.js +++ b/scripts/copy-components.js @@ -15,6 +15,7 @@ Fse.mkdirpSync(componentsPath); "components-font-awesome", "requirejs", "requirejs-plugins", + "json.sortify", ].forEach(l => { const source = Path.join("node_modules", l); const destination = Path.join(componentsPath, l); diff --git a/www/common/outer/roster.js b/www/common/outer/roster.js index 9b6e4120d..033e6cd42 100644 --- a/www/common/outer/roster.js +++ b/www/common/outer/roster.js @@ -921,13 +921,13 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto, Feedback) require("../common-util"), require("../common-hash"), require("../../bower_components/chainpad-netflux/chainpad-netflux.js"), - require("../../bower_components/json.sortify"), + require("../../components/json.sortify"), require("nthen"), require("../../bower_components/chainpad-crypto/crypto"), null // no feedback here ); } else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) { - require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); + require.config({ paths: { 'json.sortify': '/components/json.sortify/dist/JSON.sortify' } }); define([ '/common/common-util.js', '/common/common-hash.js', diff --git a/www/common/requireconfig.js b/www/common/requireconfig.js index 1a8aab594..075391492 100644 --- a/www/common/requireconfig.js +++ b/www/common/requireconfig.js @@ -13,7 +13,7 @@ define([ "jquery": "/components/jquery/dist/jquery.min", "mermaid": "/lib/mermaid/mermaid.min", // json.sortify same - "json.sortify": "/bower_components/json.sortify/dist/JSON.sortify", + "json.sortify": "/components/json.sortify/dist/JSON.sortify", cm: '/components/codemirror', 'tui-code-snippet': '/lib/calendar/tui-code-snippet.min', 'tui-date-picker': '/lib/calendar/date-picker', diff --git a/www/worker/worker.js b/www/worker/worker.js index c42abb092..74e8e4197 100644 --- a/www/worker/worker.js +++ b/www/worker/worker.js @@ -15,7 +15,7 @@ require.config({ // jquery declares itself as literally "jquery" so it cannot be pulled by path :( "jquery": "/components/jquery/dist/jquery.min", // json.sortify same - "json.sortify": "/bower_components/json.sortify/dist/JSON.sortify", + "json.sortify": "/components/json.sortify/dist/JSON.sortify", cm: '/components/codemirror' }, map: {