mirror of
https://github.com/bonfire-networks/bonfire-app.git
synced 2024-05-15 15:42:39 +00:00
Clean JS assets
This commit is contained in:
parent
2c78a362bd
commit
535522ae9a
|
@ -89,7 +89,7 @@ COPY assets assets
|
|||
RUN mix do deps.get --only prod
|
||||
|
||||
# prepare static assets
|
||||
COPY data/current_flavour/config/hooks.js data/current_flavour/config/hooks.js
|
||||
COPY data/current_flavour/config/deps_hooks.js data/current_flavour/config/deps_hooks.js
|
||||
RUN mix assets.release
|
||||
RUN MIX_ENV=prod CI=1 mix phx.digest
|
||||
|
||||
|
@ -125,7 +125,7 @@ RUN apk add --update --no-cache \
|
|||
bash \
|
||||
curl
|
||||
#^ misc
|
||||
|
||||
|
||||
WORKDIR /opt/app
|
||||
|
||||
# install app
|
||||
|
|
1
Makefile
1
Makefile
|
@ -57,6 +57,7 @@ pre-init:
|
|||
@echo "Setting flavour to $(FLAVOUR_PATH)"
|
||||
@ln -sfn $(FLAVOUR_PATH)/config ./config
|
||||
@mkdir -p data/
|
||||
@rm -rf ./data/current_flavour
|
||||
@ln -sf ../$(FLAVOUR_PATH) ./data/current_flavour
|
||||
@mkdir -p $(CONFIG_PATH)/prod
|
||||
@mkdir -p $(CONFIG_PATH)/dev
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// JS shared with non_live pages
|
||||
import "./common"
|
||||
import {ThemeHooks} from './theme'
|
||||
|
||||
// for JS features & extensions to hook into LiveView
|
||||
let Hooks = {};
|
||||
|
@ -37,6 +36,6 @@ liveSocket.connect()
|
|||
|
||||
window.liveSocket = liveSocket
|
||||
|
||||
import { ExtensionHooks } from "../../data/current_flavour/config/hooks.js"
|
||||
import { ExtensionHooks } from "../../data/current_flavour/config/deps_hooks.js"
|
||||
// Add Extensions' Hooks...
|
||||
Object.assign(liveSocket.hooks, ExtensionHooks, ThemeHooks);
|
||||
Object.assign(liveSocket.hooks, ExtensionHooks);
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
let InputSelectHooks = {};
|
||||
|
||||
import Tagify from '@yaireo/tagify'
|
||||
|
||||
InputSelectHooks.InputOrSelectOne = {
|
||||
|
||||
initInputOrSelectOne() {
|
||||
let hook = this,
|
||||
$input = hook.el.querySelector("input"),
|
||||
$select = hook.el.querySelector("select");
|
||||
|
||||
var suggestions = []
|
||||
|
||||
Array.from($select.options).forEach(opt => {
|
||||
var entry = {};
|
||||
entry.value = opt.value;
|
||||
entry.text = opt.text;
|
||||
suggestions.push(entry);
|
||||
});
|
||||
console.log(suggestions)
|
||||
|
||||
suggestionItemTemplate = function(tagData){
|
||||
return `
|
||||
<div ${this.getAttributes(tagData)}
|
||||
class='tagify__dropdown__item ${tagData.class ? tagData.class : ""}'
|
||||
tabindex="0"
|
||||
role="option">
|
||||
<span>${tagData.text}</span>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
new Tagify($input, {
|
||||
tagTextProp: 'text',
|
||||
enforceWhitelist: false,
|
||||
mode: "select",
|
||||
whitelist: suggestions,
|
||||
// blacklist: ['foo', 'bar'],
|
||||
templates: {
|
||||
dropdownItem: suggestionItemTemplate
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.initInputOrSelectOne();
|
||||
},
|
||||
|
||||
// selected(hook, event) {
|
||||
// let id = event.params.data.id;
|
||||
// hook.pushEvent("country_selected", { country: id })
|
||||
// }
|
||||
}
|
||||
|
||||
export { InputSelectHooks }
|
|
@ -1,28 +0,0 @@
|
|||
let NotificationsHooks = {};
|
||||
|
||||
NotificationsHooks.Notification = {
|
||||
mounted() {
|
||||
if (Notification.permission === "default") {
|
||||
this.pushEvent("Bonfire.Notifications:request")
|
||||
console.debug("notification permission needs to be requested ")
|
||||
} else {
|
||||
console.debug("notification permission was granted ")
|
||||
}
|
||||
|
||||
this.handleEvent("notify", ({ title, message }) => sendNotification(title, message));
|
||||
}
|
||||
}
|
||||
|
||||
function sendNotification(title, message) {
|
||||
if (Notification.permission === "granted") {
|
||||
try {
|
||||
new Notification(title, { body: message, requireInteraction: false });
|
||||
} catch (e) {
|
||||
console.debug("notification error: " + e)
|
||||
}
|
||||
} else {
|
||||
Notification.requestPermission();
|
||||
}
|
||||
}
|
||||
|
||||
export { NotificationsHooks }
|
|
@ -1,17 +0,0 @@
|
|||
let ThemeHooks = {};
|
||||
|
||||
import { themeChange } from "theme-change"
|
||||
|
||||
// run to load previously chosen theme when first loading any page
|
||||
themeChange()
|
||||
|
||||
ThemeHooks.Themeable = {
|
||||
|
||||
mounted() {
|
||||
// run on a view/component with theme-changing controls (wrapper should have phx-hook="Themeable")
|
||||
themeChange(false)
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export { ThemeHooks }
|
|
@ -24,9 +24,7 @@
|
|||
"nprogress": "^0.2.0",
|
||||
"phoenix": "link:../deps/phoenix",
|
||||
"phoenix_html": "link:../deps/phoenix_html",
|
||||
"phoenix_live_view": "link:../deps/phoenix_live_view",
|
||||
"sortablejs": "^1.14.0",
|
||||
"theme-change": "^2.0.2"
|
||||
"phoenix_live_view": "link:../deps/phoenix_live_view"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^10.4.0",
|
||||
|
|
|
@ -23,10 +23,8 @@ specifiers:
|
|||
postcss-cli: ^8.3.1
|
||||
postcss-import: ^14.0.2
|
||||
prop-types: ^15.8.0
|
||||
sortablejs: ^1.14.0
|
||||
tailwindcss: ~3.0.7
|
||||
tailwindcss-debug-screens: ^2.2.1
|
||||
theme-change: ^2.0.2
|
||||
|
||||
dependencies:
|
||||
'@alpinejs/intersect': 3.9.1
|
||||
|
@ -35,15 +33,13 @@ dependencies:
|
|||
'@tailwindcss/forms': 0.4.0_tailwindcss@3.0.7
|
||||
'@tailwindcss/line-clamp': 0.3.0_tailwindcss@3.0.7
|
||||
'@tailwindcss/typography': 0.5.0_tailwindcss@3.0.7
|
||||
'@yaireo/tagify': 4.9.4_prop-types@15.8.0
|
||||
'@yaireo/tagify': 4.9.8_prop-types@15.8.1
|
||||
alpinejs: 3.7.1
|
||||
daisyui: 2.8.0_16a290f6d0e3717bf6d2667234aebd30
|
||||
nprogress: 0.2.0
|
||||
phoenix: link:../deps/phoenix
|
||||
phoenix_html: link:../deps/phoenix_html
|
||||
phoenix_live_view: link:../deps/phoenix_live_view
|
||||
sortablejs: 1.14.0
|
||||
theme-change: 2.0.2
|
||||
|
||||
devDependencies:
|
||||
autoprefixer: 10.4.0_postcss@8.4.5
|
||||
|
@ -54,7 +50,7 @@ devDependencies:
|
|||
postcss: 8.4.5
|
||||
postcss-cli: 8.3.1_postcss@8.4.5
|
||||
postcss-import: 14.0.2_postcss@8.4.5
|
||||
prop-types: 15.8.0
|
||||
prop-types: 15.8.1
|
||||
tailwindcss: 3.0.7_16a290f6d0e3717bf6d2667234aebd30
|
||||
tailwindcss-debug-screens: 2.2.1_tailwindcss@3.0.7
|
||||
|
||||
|
@ -150,12 +146,12 @@ packages:
|
|||
resolution: {integrity: sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==}
|
||||
dev: false
|
||||
|
||||
/@yaireo/tagify/4.9.4_prop-types@15.8.0:
|
||||
resolution: {integrity: sha512-ZV8GLKw3yD1Hvh1xNqO1z0Sl+kykL2mQWIwSwQJhAtEVt62TyXRB2kPw5J3iGm4ewK9SM/LPT9WfjuJc7FBKVA==}
|
||||
/@yaireo/tagify/4.9.8_prop-types@15.8.1:
|
||||
resolution: {integrity: sha512-JqRTN4vb5tx06PJIRIOAlriO/B6u+a3jD/VBb5x6E1MOlC4wrMfaLHmNnrMpiZCHMXox7pVmrtNuyBe4YReJ4w==}
|
||||
peerDependencies:
|
||||
prop-types: ^15.7.2
|
||||
dependencies:
|
||||
prop-types: 15.8.0
|
||||
prop-types: 15.8.1
|
||||
dev: false
|
||||
|
||||
/acorn-node/1.8.2:
|
||||
|
@ -1793,8 +1789,8 @@ packages:
|
|||
resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}
|
||||
dev: true
|
||||
|
||||
/prop-types/15.8.0:
|
||||
resolution: {integrity: sha512-fDGekdaHh65eI3lMi5OnErU6a8Ighg2KjcjQxO7m8VHyWjcPyj5kiOgV1LQDOOOgVy3+5FgjXvdSSX7B8/5/4g==}
|
||||
/prop-types/15.8.1:
|
||||
resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==}
|
||||
dependencies:
|
||||
loose-envify: 1.4.0
|
||||
object-assign: 4.1.1
|
||||
|
@ -2007,10 +2003,6 @@ packages:
|
|||
use: 3.1.1
|
||||
dev: true
|
||||
|
||||
/sortablejs/1.14.0:
|
||||
resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==}
|
||||
dev: false
|
||||
|
||||
/source-map-js/1.0.1:
|
||||
resolution: {integrity: sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
@ -2152,10 +2144,6 @@ packages:
|
|||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/theme-change/2.0.2:
|
||||
resolution: {integrity: sha512-YvQqavf8nlGB3J7PdO0zLLhSLlgYhrqZL6By3FuzFIlWBsPTSPG/V98cHJllK3mmU97Jecei8XYiHalhy2umUw==}
|
||||
dev: false
|
||||
|
||||
/tmp/0.2.1:
|
||||
resolution: {integrity: sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==}
|
||||
engines: {node: '>=8.17.0'}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# any extensions/deps with a package.json in their /assets directory
|
||||
# space seperated
|
||||
DEPS='bonfire_editor_ck'
|
||||
DEPS='bonfire_common bonfire_ui_social bonfire_editor_ck'
|
||||
|
||||
chmod +x ./priv/deps.js.sh
|
||||
./priv/deps.js.sh "$DEPS"
|
16
flavours/classic/config/deps_hooks.js
Normal file
16
flavours/classic/config/deps_hooks.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// NOTE: any extensions included here need to also be added to ./deps.js.sh
|
||||
// NOTE: during development you may want to change 'deps' in the path to 'forks', but remember to change it back before committing!
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
import { ChangeLocaleHooks } from "./../../../forks/bonfire_common/assets/js/change_locale"
|
||||
import { InputSelectHooks } from "./../../../forks/bonfire_common/assets/js/input_select"
|
||||
import { NotificationsHooks } from "./../../../forks/bonfire_common/assets/js/notifications"
|
||||
import { ThemeHooks } from "./../../../forks/bonfire_ui_social/assets/js/theme"
|
||||
import { EditorCkHooks } from "./../../../forks/bonfire_editor_ck/assets/js/extension"
|
||||
// import { GeolocateHooks } from "./../../../forks/bonfire_geolocate/assets/js/extension"
|
||||
|
||||
Object.assign(ExtensionHooks, ChangeLocaleHooks, InputSelectHooks, NotificationsHooks, ThemeHooks, EditorCkHooks)
|
||||
|
||||
export { ExtensionHooks }
|
|
@ -1,10 +0,0 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
// import { MyHooks } from "../../../deps/some_extension/assets/js/extension"
|
||||
import { EditorCkHooks } from "./../../../deps/bonfire_editor_ck/assets/js/extension"
|
||||
import { NotificationsHooks } from "./../../../assets/js/notifications"
|
||||
|
||||
Object.assign(ExtensionHooks, EditorCkHooks, NotificationsHooks)
|
||||
export { ExtensionHooks }
|
|
@ -3,27 +3,73 @@ import Config
|
|||
config :bonfire_social,
|
||||
disabled: false
|
||||
|
||||
alias Bonfire.Social.{Activities, ActivityPub, Feeds, LivePush, Posts}
|
||||
alias Bonfire.Epics.Acts.Repo
|
||||
alias Bonfire.Data.Social.Post
|
||||
alias Bonfire.Ecto.Acts, as: Ecto
|
||||
alias Bonfire.Social.Acts.{
|
||||
Activity,
|
||||
ActivityPub,
|
||||
Boundaries,
|
||||
Caretaker,
|
||||
Creator,
|
||||
Feeds,
|
||||
LivePush,
|
||||
MeiliSearch,
|
||||
Posts,
|
||||
PostContents,
|
||||
Tags,
|
||||
Threaded,
|
||||
}
|
||||
|
||||
config :bonfire_social, Posts,
|
||||
config :bonfire_social, Bonfire.Social.Posts,
|
||||
epics: [
|
||||
publish: [
|
||||
# Create a changeset for insertion
|
||||
Posts.PublishChangeset, # puts the changeset at the key Posts.PublishChangeset by default
|
||||
# Figure out which feeds we need to publish to
|
||||
{Feeds.TargetFeeds, changeset: Posts.PublishChangeset}, # based on the changeset above
|
||||
# Prep: a little bit of querying and a lot of preparing changesets
|
||||
Posts.Publish, # Create a changeset for insertion
|
||||
PostContents, # with a sanitised body and tags extracted,
|
||||
{Caretaker, on: :post}, # a caretaker,
|
||||
{Creator, on: :post}, # and a creator,
|
||||
{Threaded, on: :post}, # either in reply to something or else starting a new thread,
|
||||
{Tags, on: :post}, # with extracted tags fully hooked up,
|
||||
{Boundaries, on: :post}, # and the appropriate boundaries established
|
||||
{Activity, on: :post}, # summarised by an activity,
|
||||
{Feeds, on: :post}, # appearing in feeds.
|
||||
|
||||
# *transaction klaxon*
|
||||
Repo.Begin,
|
||||
{Repo.Insert, changesets: [post: Posts.PublishChangeset]},
|
||||
Repo.Commit,
|
||||
MeiliSearch.Prepare, # Prepare for search indexing or undexing
|
||||
|
||||
# # We want to return an activity, so we must rearrange it so we get a post under an activity.
|
||||
{Activity.UnderObject, objects: [activity: :post], debug: true},
|
||||
# Now we have a short critical section
|
||||
Ecto.Begin,
|
||||
Ecto.Work, # Run our inserts
|
||||
Ecto.Commit,
|
||||
|
||||
# These things are free to happen casually in the background.
|
||||
{LivePush, on: :post}, # Publish live feed updates via (in-memory) pubsub.
|
||||
|
||||
{MeiliSearch.Queue, on: :post}, # Enqueue for indexing by meilisearch
|
||||
|
||||
# Oban would rather we put these here than in the transaction
|
||||
# above because it knows better than us, obviously.
|
||||
{ActivityPub, on: :post}, # Prepare for federation and do the queue insert (oban).
|
||||
],
|
||||
delete: [
|
||||
{Delete, on: :post}, # create a deletion changeset
|
||||
{Boundaries, on: :post}, # clean up any boundaries specific to this post
|
||||
{Feeds, on: :post}, # remove any activities related to us from feeds.
|
||||
|
||||
MeiliSearch.Prepare, # Prepare request to unindex
|
||||
|
||||
# Now we have a short critical section
|
||||
Ecto.Begin,
|
||||
Ecto.Work, # Run our deletes
|
||||
Ecto.Commit,
|
||||
|
||||
# These things are free to happen casually in the background.
|
||||
{LivePush, on: :post}, # Publish live feed updates via (in-memory) pubsub.
|
||||
|
||||
{MeiliSearch.Queue, on: :post}, # Enqueue meilisearch unindex (really an insert, because oban)
|
||||
|
||||
# Oban would rather we put these here than in the transaction
|
||||
# above because it knows better than us, obviously.
|
||||
{ActivityPub, on: :post}, # Prepare for federation
|
||||
|
||||
{LivePush.Activity, activity: :activity, debug: true}, # Publish live feed updates via pubsub.
|
||||
{ActivityPub.Push, activity: :activity}, # Publish to activitypub via a message queue
|
||||
Posts.MeiliIndex, # Attempt to index via meilisearch
|
||||
],
|
||||
]
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
# any extensions/deps with a package.json in their /assets directory
|
||||
DEPS='bonfire_geolocate bonfire_ui_kanban'
|
||||
# Add any extensions/deps with a package.json in their /assets directory here
|
||||
# NOTE: any LV Hooks should also be added to ./deps_hooks.js
|
||||
// TODO: make this more configurable? ie. autogenerate from active extensions with JS assets
|
||||
|
||||
DEPS='bonfire_common bonfire_ui_social bonfire_editor_ck bonfire_geolocate bonfire_ui_kanban'
|
||||
|
||||
chmod +x ./priv/deps.js.sh
|
||||
./priv/deps.js.sh "$DEPS"
|
17
flavours/cooperation/config/deps_hooks.js
Normal file
17
flavours/cooperation/config/deps_hooks.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// NOTE: any extensions included here need to also be added to ./deps.js.sh
|
||||
// NOTE: during development you may want to change 'deps' in the path to 'forks', but remember to change it back before committing!
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
import { ChangeLocaleHooks } from "./../../../forks/bonfire_common/assets/js/change_locale"
|
||||
import { InputSelectHooks } from "./../../../forks/bonfire_common/assets/js/input_select"
|
||||
import { NotificationsHooks } from "./../../../forks/bonfire_common/assets/js/notifications"
|
||||
import { ThemeHooks } from "./../../../forks/bonfire_ui_social/assets/js/theme"
|
||||
import { EditorCkHooks } from "./../../../forks/bonfire_editor_ck/assets/js/extension"
|
||||
import { GeolocateHooks } from "./../../../forks/bonfire_geolocate/assets/js/extension"
|
||||
import { KanbanHooks } from "./../../../forks/bonfire_ui_kanban/assets/js/extension"
|
||||
|
||||
Object.assign(ExtensionHooks, ChangeLocaleHooks, InputSelectHooks, NotificationsHooks, ThemeHooks, EditorCkHooks, GeolocateHooks, KanbanHooks)
|
||||
|
||||
export { ExtensionHooks }
|
|
@ -1,15 +0,0 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
import { ThemeHooks } from "./../../../assets/js/theme"
|
||||
import { CommonHooks } from "./../../../deps/bonfire_common/assets/js/extension"
|
||||
import { InputSelectHooks } from "./../../../assets/js/input_select"
|
||||
import { GeolocateHooks } from "./../../../deps/bonfire_geolocate/assets/js/extension"
|
||||
import { KanbanHooks } from "./../../../deps/bonfire_ui_kanban/assets/js/extension"
|
||||
import { EditorCkHooks } from "./../../../deps/bonfire_editor_ck/assets/js/extension"
|
||||
import { NotificationsHooks } from "./../../../assets/js/notifications"
|
||||
|
||||
Object.assign(ExtensionHooks, ThemeHooks, InputSelectHooks, CommonHooks, GeolocateHooks, KanbanHooks, EditorCkHooks, NotificationsHooks)
|
||||
|
||||
export { ExtensionHooks }
|
|
@ -3,27 +3,73 @@ import Config
|
|||
config :bonfire_social,
|
||||
disabled: false
|
||||
|
||||
alias Bonfire.Social.{Activities, ActivityPub, Feeds, LivePush, Posts}
|
||||
alias Bonfire.Epics.Acts.Repo
|
||||
alias Bonfire.Data.Social.Post
|
||||
alias Bonfire.Ecto.Acts, as: Ecto
|
||||
alias Bonfire.Social.Acts.{
|
||||
Activity,
|
||||
ActivityPub,
|
||||
Boundaries,
|
||||
Caretaker,
|
||||
Creator,
|
||||
Feeds,
|
||||
LivePush,
|
||||
MeiliSearch,
|
||||
Posts,
|
||||
PostContents,
|
||||
Tags,
|
||||
Threaded,
|
||||
}
|
||||
|
||||
config :bonfire_social, Posts,
|
||||
config :bonfire_social, Bonfire.Social.Posts,
|
||||
epics: [
|
||||
publish: [
|
||||
# Create a changeset for insertion
|
||||
Posts.PublishChangeset, # puts the changeset at the key Posts.PublishChangeset by default
|
||||
# Figure out which feeds we need to publish to
|
||||
{Feeds.TargetFeeds, changeset: Posts.PublishChangeset}, # based on the changeset above
|
||||
# Prep: a little bit of querying and a lot of preparing changesets
|
||||
Posts.Publish, # Create a changeset for insertion
|
||||
PostContents, # with a sanitised body and tags extracted,
|
||||
{Caretaker, on: :post}, # a caretaker,
|
||||
{Creator, on: :post}, # and a creator,
|
||||
{Threaded, on: :post}, # either in reply to something or else starting a new thread,
|
||||
{Tags, on: :post}, # with extracted tags fully hooked up,
|
||||
{Boundaries, on: :post}, # and the appropriate boundaries established
|
||||
{Activity, on: :post}, # summarised by an activity,
|
||||
{Feeds, on: :post}, # appearing in feeds.
|
||||
|
||||
# *transaction klaxon*
|
||||
Repo.Begin,
|
||||
{Repo.Insert, changesets: [post: Posts.PublishChangeset]},
|
||||
Repo.Commit,
|
||||
MeiliSearch.Prepare, # Prepare for search indexing or undexing
|
||||
|
||||
# # We want to return an activity, so we must rearrange it so we get a post under an activity.
|
||||
{Activity.UnderObject, objects: [activity: :post], debug: true},
|
||||
# Now we have a short critical section
|
||||
Ecto.Begin,
|
||||
Ecto.Work, # Run our inserts
|
||||
Ecto.Commit,
|
||||
|
||||
# These things are free to happen casually in the background.
|
||||
{LivePush, on: :post}, # Publish live feed updates via (in-memory) pubsub.
|
||||
|
||||
{MeiliSearch.Queue, on: :post}, # Enqueue for indexing by meilisearch
|
||||
|
||||
# Oban would rather we put these here than in the transaction
|
||||
# above because it knows better than us, obviously.
|
||||
{ActivityPub, on: :post}, # Prepare for federation and do the queue insert (oban).
|
||||
],
|
||||
delete: [
|
||||
{Delete, on: :post}, # create a deletion changeset
|
||||
{Boundaries, on: :post}, # clean up any boundaries specific to this post
|
||||
{Feeds, on: :post}, # remove any activities related to us from feeds.
|
||||
|
||||
MeiliSearch.Prepare, # Prepare request to unindex
|
||||
|
||||
# Now we have a short critical section
|
||||
Ecto.Begin,
|
||||
Ecto.Work, # Run our deletes
|
||||
Ecto.Commit,
|
||||
|
||||
# These things are free to happen casually in the background.
|
||||
{LivePush, on: :post}, # Publish live feed updates via (in-memory) pubsub.
|
||||
|
||||
{MeiliSearch.Queue, on: :post}, # Enqueue meilisearch unindex (really an insert, because oban)
|
||||
|
||||
# Oban would rather we put these here than in the transaction
|
||||
# above because it knows better than us, obviously.
|
||||
{ActivityPub, on: :post}, # Prepare for federation
|
||||
|
||||
{LivePush.Activity, activity: :activity, debug: true}, # Publish live feed updates via pubsub.
|
||||
{ActivityPub.Push, activity: :activity}, # Publish to activitypub via a message queue
|
||||
Posts.MeiliIndex, # Attempt to index via meilisearch
|
||||
],
|
||||
]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# add more modules separated by $IFS
|
||||
DEPS='bonfire_geolocate'
|
||||
DEPS='bonfire_common bonfire_ui_social bonfire_editor_ck bonfire_geolocate'
|
||||
|
||||
chmod +x ./priv/deps.js.sh
|
||||
./priv/deps.js.sh "$DEPS"
|
17
flavours/reflow/config/deps_hooks.js
Normal file
17
flavours/reflow/config/deps_hooks.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// NOTE: any extensions included here need to also be added to ./deps.js.sh
|
||||
// NOTE: during development you may want to change 'deps' in the path to 'forks', but remember to change it back before committing!
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
import { ChangeLocaleHooks } from "./../../../forks/bonfire_common/assets/js/change_locale"
|
||||
import { InputSelectHooks } from "./../../../forks/bonfire_common/assets/js/input_select"
|
||||
import { NotificationsHooks } from "./../../../forks/bonfire_common/assets/js/notifications"
|
||||
import { ThemeHooks } from "./../../../forks/bonfire_ui_social/assets/js/theme"
|
||||
import { EditorCkHooks } from "./../../../forks/bonfire_editor_ck/assets/js/extension"
|
||||
import { GeolocateHooks } from "./../../../forks/bonfire_geolocate/assets/js/extension"
|
||||
// import { KanbanHooks } from "./../../../forks/bonfire_ui_kanban/assets/js/extension"
|
||||
|
||||
Object.assign(ExtensionHooks, ChangeLocaleHooks, InputSelectHooks, NotificationsHooks, ThemeHooks, EditorCkHooks, GeolocateHooks)
|
||||
|
||||
export { ExtensionHooks }
|
|
@ -1,15 +0,0 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
import { ThemeHooks } from "./../../../assets/js/theme"
|
||||
import { CommonHooks } from "./../../../deps/bonfire_common/assets/js/extension"
|
||||
import { InputSelectHooks } from "./../../../assets/js/input_select"
|
||||
import { GeolocateHooks } from "./../../../deps/bonfire_geolocate/assets/js/extension"
|
||||
// import { KanbanHooks } from "./../../../deps/bonfire_ui_kanban/assets/js/extension"
|
||||
import { EditorCkHooks } from "./../../../deps/bonfire_editor_ck/assets/js/extension"
|
||||
import { NotificationsHooks } from "./../../../assets/js/notifications"
|
||||
|
||||
Object.assign(ExtensionHooks, ThemeHooks, InputSelectHooks, CommonHooks, GeolocateHooks, EditorCkHooks, NotificationsHooks)
|
||||
|
||||
export { ExtensionHooks }
|
|
@ -1,12 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# any extensions/deps with a package.json in their /assets directory
|
||||
DEPS="bonfire_geolocate bonfire_ui_kanban"
|
||||
DEPS='bonfire_common bonfire_ui_social bonfire_editor_ck bonfire_geolocate'
|
||||
|
||||
for dep in $DEPS
|
||||
do
|
||||
echo "Install JS deps from $dep"
|
||||
cd "deps/$dep/assets" && pnpm install || echo "Extension $dep not available in deps"
|
||||
cd "forks/$dep/assets" && pnpm install || echo "Extension $dep not available in forks"
|
||||
cd ../../../
|
||||
done
|
||||
chmod +x ./priv/deps.js.sh
|
||||
./priv/deps.js.sh "$DEPS"
|
17
flavours/upcycle/config/deps_hooks.js
Normal file
17
flavours/upcycle/config/deps_hooks.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// NOTE: any extensions included here need to also be added to ./deps.js.sh
|
||||
// NOTE: during development you may want to change 'deps' in the path to 'forks', but remember to change it back before committing!
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
import { ChangeLocaleHooks } from "./../../../forks/bonfire_common/assets/js/change_locale"
|
||||
import { InputSelectHooks } from "./../../../forks/bonfire_common/assets/js/input_select"
|
||||
import { NotificationsHooks } from "./../../../forks/bonfire_common/assets/js/notifications"
|
||||
import { ThemeHooks } from "./../../../forks/bonfire_ui_social/assets/js/theme"
|
||||
import { EditorCkHooks } from "./../../../forks/bonfire_editor_ck/assets/js/extension"
|
||||
import { GeolocateHooks } from "./../../../forks/bonfire_geolocate/assets/js/extension"
|
||||
// import { KanbanHooks } from "./../../../forks/bonfire_ui_kanban/assets/js/extension"
|
||||
|
||||
Object.assign(ExtensionHooks, ChangeLocaleHooks, InputSelectHooks, NotificationsHooks, ThemeHooks, EditorCkHooks, GeolocateHooks)
|
||||
|
||||
export { ExtensionHooks }
|
|
@ -1,15 +0,0 @@
|
|||
let ExtensionHooks = {};
|
||||
|
||||
// TODO: make this more configurable? ie. don't import disabled extensions
|
||||
|
||||
import { ThemeHooks } from "./../../../assets/js/theme"
|
||||
import { CommonHooks } from "./../../../deps/bonfire_common/assets/js/extension"
|
||||
import { InputSelectHooks } from "./../../../assets/js/input_select"
|
||||
import { GeolocateHooks } from "./../../../deps/bonfire_geolocate/assets/js/extension"
|
||||
// import { KanbanHooks } from "./../../../deps/bonfire_ui_kanban/assets/js/extension"
|
||||
import { EditorCkHooks } from "./../../../deps/bonfire_editor_ck/assets/js/extension"
|
||||
import { NotificationsHooks } from "./../../../assets/js/notifications"
|
||||
|
||||
Object.assign(ExtensionHooks, ThemeHooks, InputSelectHooks, CommonHooks, GeolocateHooks, EditorCkHooks, NotificationsHooks)
|
||||
|
||||
export { ExtensionHooks }
|
15
mix.lock
15
mix.lock
|
@ -1,5 +1,6 @@
|
|||
%{
|
||||
"absinthe": {:hex, :absinthe, "1.7.0", "36819e7b1fd5046c9c734f27fe7e564aed3bda59f0354c37cd2df88fd32dd014", [:mix], [{:dataloader, "~> 1.0.0", [hex: :dataloader, repo: "hexpm", optional: true]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0 or ~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "566a5b5519afc9b29c4d367f0c6768162de3ec03e9bf9916f9dc2bcbe7c09643"},
|
||||
"absinthe_client": {:git, "https://github.com/bonfire-networks/absinthe_client.git", "9c8ac919abb1509d91289ff39dd697f603929ed8", []},
|
||||
"absinthe_error_payload": {:hex, :absinthe_error_payload, "1.1.4", "502ff239148c8deaac028ddb600d6502d5be68d24fece0c93f4c3cf7e74c1a4d", [:make, :mix], [{:absinthe, "~> 1.3", [hex: :absinthe, repo: "hexpm", optional: false]}, {:ecto, "~> 3.1", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "9e262ef2fd4a2c644075e0cdde2573b1f713c0676ab905c8640eaa8a882b2aca"},
|
||||
"absinthe_phoenix": {:hex, :absinthe_phoenix, "2.0.2", "e607b438db900049b9b3760f8ecd0591017a46122fffed7057bf6989020992b5", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:absinthe_plug, "~> 1.5", [hex: :absinthe_plug, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.5", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}], "hexpm", "d36918925c380dc7d2ed7d039c9a3b4182ec36723f7417a68745ade5aab22f8d"},
|
||||
"absinthe_plug": {:hex, :absinthe_plug, "1.5.8", "38d230641ba9dca8f72f1fed2dfc8abd53b3907d1996363da32434ab6ee5d6ab", [:mix], [{:absinthe, "~> 1.5", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bbb04176647b735828861e7b2705465e53e2cf54ccf5a73ddd1ebd855f996e5a"},
|
||||
|
@ -14,26 +15,36 @@
|
|||
"blurhash": {:hex, :rinpatch_blurhash, "0.1.0", "01a888b0f5f1f382ab52e4396f01831cbe8486ea5828604c90f4dac533d39a4b", [:mix], [{:mogrify, "~> 0.8.0", [hex: :mogrify, repo: "hexpm", optional: true]}], "hexpm", "19911a5dcbb0acb9710169a72f702bce6cb048822b12de566ccd82b2cc42b907"},
|
||||
"bonfire_api_graphql": {:git, "https://github.com/bonfire-networks/bonfire_api_graphql", "52d434491f180d94477270dbbcf8b408db9c5a92", [branch: "main"]},
|
||||
"bonfire_boundaries": {:git, "https://github.com/bonfire-networks/bonfire_boundaries", "439134262aafb0397f7b89b44423b0f72445c09a", [branch: "main"]},
|
||||
"bonfire_breadpub": {:git, "https://github.com/bonfire-networks/bonfire_breadpub", "9a2e97943e90b711c056698701557d1f2bcd2fe9", [branch: "main"]},
|
||||
"bonfire_classify": {:git, "https://github.com/bonfire-networks/bonfire_classify", "da619b61fdb2b09963baff247fd8ca7a151c2888", [branch: "main"]},
|
||||
"bonfire_common": {:git, "https://github.com/bonfire-networks/bonfire_common", "98123dbfc12fdc8f70643dbfff515509fd61f51c", [branch: "main"]},
|
||||
"bonfire_data_access_control": {:git, "https://github.com/bonfire-networks/bonfire_data_access_control", "07d21c0c5c049ad7c4282e474f1850ec24ebf9ab", [branch: "main"]},
|
||||
"bonfire_data_activity_pub": {:git, "https://github.com/bonfire-networks/bonfire_data_activity_pub", "5522116c8e5b1a6264fe87139c0a0345aa715cd9", [branch: "main"]},
|
||||
"bonfire_data_assort": {:git, "https://github.com/bonfire-networks/bonfire_data_assort", "703fffbde20d49d38f938f1cb7b967af9043bd0f", []},
|
||||
"bonfire_data_edges": {:git, "https://github.com/bonfire-networks/bonfire_data_edges", "48694bb63a609cee2070091b06a743aabd389ece", [branch: "main"]},
|
||||
"bonfire_data_identity": {:git, "https://github.com/bonfire-networks/bonfire_data_identity", "e37af51f90966677858d57c7a14b033f12cdd4b4", [branch: "main"]},
|
||||
"bonfire_data_shared_user": {:git, "https://github.com/bonfire-networks/bonfire_data_shared_user", "507c2e9ce51d0c5fc477df4f80b7eaee7bfff5d4", [branch: "main"]},
|
||||
"bonfire_data_social": {:git, "https://github.com/bonfire-networks/bonfire_data_social", "e7257bb33ffde2d540c568396e706413b052fcbd", [branch: "main"]},
|
||||
"bonfire_ecto": {:git, "https://github.com/bonfire-networks/bonfire_ecto", "88546a783802d5ed48651c6b573328a2e3af4420", [branch: "main"]},
|
||||
"bonfire_editor_ck": {:git, "https://github.com/bonfire-networks/bonfire_editor_ck", "500b4dd5cc1561f1f865916b4cbbfaf54e6a0fbb", []},
|
||||
"bonfire_editor_ck": {:git, "https://github.com/bonfire-networks/bonfire_editor_ck", "5b0bd59df7bbdca82daf28791ae6abc679871598", []},
|
||||
"bonfire_epics": {:git, "https://github.com/bonfire-networks/bonfire_epics", "000fc95ecb4fbb6805fe35c9d0c32eb9037d2222", [branch: "main"]},
|
||||
"bonfire_fail": {:git, "https://github.com/bonfire-networks/bonfire_fail", "c436ca1b2edf89a13a076067ccaee89c6d2fc88a", [branch: "main"]},
|
||||
"bonfire_federate_activitypub": {:git, "https://github.com/bonfire-networks/bonfire_federate_activitypub", "af8c8e179748003779d80f85da1568ef182e19f5", [branch: "main"]},
|
||||
"bonfire_files": {:git, "https://github.com/bonfire-networks/bonfire_files", "9122b4edcf04a7c11258ae9a88861cb73b3f25c4", [branch: "main"]},
|
||||
"bonfire_geolocate": {:git, "https://github.com/bonfire-networks/bonfire_geolocate", "de1ca5e494e2514db200787981b3dc9295924a69", [branch: "main"]},
|
||||
"bonfire_invite_links": {:git, "https://github.com/bonfire-networks/bonfire_invite_links", "c3514d1c06427f4c3a03e20e982afd45eee5e90c", [branch: "main"]},
|
||||
"bonfire_mailer": {:git, "https://github.com/bonfire-networks/bonfire_mailer", "efaa2df39cd3fc121e68dec801f91ccc933479c4", [branch: "main"]},
|
||||
"bonfire_me": {:git, "https://github.com/bonfire-networks/bonfire_me", "3d918964295e712ad12bf147246f8ca6b453f845", [branch: "main"]},
|
||||
"bonfire_quantify": {:git, "https://github.com/bonfire-networks/bonfire_quantify", "7fd7dae026775f14c1f0c987a5a5ed93ae4edcef", [branch: "main"]},
|
||||
"bonfire_search": {:git, "https://github.com/bonfire-networks/bonfire_search", "2547ebf5f3ebb9a8ef0116825331bc2c98d58d5e", [branch: "main"]},
|
||||
"bonfire_social": {:git, "https://github.com/bonfire-networks/bonfire_social", "7c17ca615527667ecdd5950ce61998d2aa947d36", [branch: "main"]},
|
||||
"bonfire_tag": {:git, "https://github.com/bonfire-networks/bonfire_tag", "483b976d46f2e7252d318072fcddaf364be033ca", [branch: "main"]},
|
||||
"bonfire_ui_social": {:git, "https://github.com/bonfire-networks/bonfire_ui_social", "275b82c52133f9762f32db8ff4d093d38179457f", [branch: "main"]},
|
||||
"bonfire_ui_coordination": {:git, "https://github.com/bonfire-networks/bonfire_ui_coordination", "fb821d2ed6766fb46c3cdadea3009e426e1d8083", [branch: "main"]},
|
||||
"bonfire_ui_kanban": {:git, "https://github.com/bonfire-networks/bonfire_ui_kanban", "044ed7aa318034dd6ab163b2a9010ee1da962f5d", [branch: "main"]},
|
||||
"bonfire_ui_social": {:git, "https://github.com/bonfire-networks/bonfire_ui_social", "21efa92670e8c9e7cc30143e162cb1c5fc32dcaa", [branch: "main"]},
|
||||
"bonfire_ui_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_ui_valueflows", "b0073b87e75295c774cb4d49d1fff7d88eb6918e", [branch: "main"]},
|
||||
"bonfire_valueflows": {:git, "https://github.com/bonfire-networks/bonfire_valueflows", "58e7a1c81b4bea01ba9e2b95a333ab34a66828ba", [branch: "main"]},
|
||||
"bonfire_valueflows_observe": {:git, "https://github.com/bonfire-networks/bonfire_valueflows_observe", "d65a7ce9a3480618a62b89e9767d1036f31e83a3", []},
|
||||
"bonfire_website": {:git, "https://github.com/bonfire-networks/bonfire_website", "bea7e28ff1da863210e3fc605f2f108780a1c561", [branch: "main"]},
|
||||
"cachex": {:hex, :cachex, "3.4.0", "868b2959ea4aeb328c6b60ff66c8d5123c083466ad3c33d3d8b5f142e13101fb", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "370123b1ab4fba4d2965fb18f87fd758325709787c8c5fce35b3fe80645ccbe5"},
|
||||
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
|
||||
|
|
Loading…
Reference in a new issue