Add remoteStorage.js and Places module
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled

This commit is contained in:
Râu Cao 2026-01-15 20:45:07 +07:00
parent 283b73e0e6
commit caa48537bc
Signed by: raucao
GPG Key ID: 37036C356E56CC51
8 changed files with 127 additions and 22 deletions

View File

@ -26,7 +26,6 @@ const setupMap = modifier((element) => {
});
apply(openfreemap, 'https://tiles.openfreemap.org/styles/positron');
});
<template>

28
app/services/storage.js Normal file
View File

@ -0,0 +1,28 @@
import Service from '@ember/service';
import RemoteStorage from 'remotestoragejs';
import Places from '@remotestorage/module-places';
import Widget from 'remotestorage-widget';
export default class StorageService extends Service {
rs;
constructor() {
super(...arguments);
console.log('ohai');
this.rs = new RemoteStorage({
modules: [Places],
});
this.rs.access.claim('places', 'rw');
this.rs.caching.enable('/places/');
window.remoteStorage = this.rs;
// const widget = new Widget(this.rs);
// widget.attach();
}
get places() {
return this.rs.places;
}
}

View File

@ -1,15 +0,0 @@
import { useLegacyStore } from '@warp-drive/legacy';
import { JSONAPICache } from '@warp-drive/json-api';
const Store = useLegacyStore({
linksMode: true,
cache: JSONAPICache,
handlers: [
// -- your handlers here
],
schemas: [
// -- your schemas here
],
});
export default Store;

View File

@ -18,3 +18,11 @@ body {
[style*='position: absolute; inset: 0;'] {
background: #f8f9fa;
}
/* Ensure RS widget is above the map */
#remotestorage-widget {
position: absolute;
top: 10px;
right: 10px;
z-index: 1000;
}

View File

@ -1,10 +1,23 @@
import Component from '@glimmer/component';
import { pageTitle } from 'ember-page-title';
import Map from '#components/map';
import { service } from '@ember/service';
<template>
{{pageTitle "M/\RCO"}}
export default class ApplicationComponent extends Component {
@service storage;
<Map />
constructor() {
super(...arguments);
console.log('Application component constructed');
// Access the service to ensure it is instantiated
this.storage;
}
{{outlet}}
</template>
<template>
{{pageTitle "M/\RCO"}}
<Map />
{{outlet}}
</template>
}

View File

@ -85,7 +85,10 @@
"edition": "octane"
},
"dependencies": {
"@remotestorage/module-places": "link:vendor/remotestorage-module-places",
"ol": "^10.7.0",
"ol-mapbox-style": "^13.2.0"
"ol-mapbox-style": "^13.2.0",
"remotestorage-widget": "^1.8.0",
"remotestoragejs": "2.0.0-beta.8"
}
}

68
pnpm-lock.yaml generated
View File

@ -8,12 +8,21 @@ importers:
.:
dependencies:
'@remotestorage/module-places':
specifier: link:vendor/remotestorage-module-places
version: link:vendor/remotestorage-module-places
ol:
specifier: ^10.7.0
version: 10.7.0
ol-mapbox-style:
specifier: ^13.2.0
version: 13.2.0(ol@10.7.0)
remotestorage-widget:
specifier: ^1.8.0
version: 1.8.0
remotestoragejs:
specifier: 2.0.0-beta.8
version: 2.0.0-beta.8
devDependencies:
'@babel/core':
specifier: ^7.28.5
@ -1362,6 +1371,9 @@ packages:
'@types/minimatch@3.0.5':
resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==}
'@types/node@20.14.0':
resolution: {integrity: sha512-5cHBxFGJx6L4s56Bubp4fglrEpmyJypsqI6RgzMfBHWUJQGWAAi8cWcgetEbZXHYXo9C2Fa4EEds/uSyS4cxmA==}
'@types/node@25.0.7':
resolution: {integrity: sha512-C/er7DlIZgRJO7WtTdYovjIFzGsz0I95UlMyR9anTb4aCpBSRWe5Jc1/RvLKUfzmOxHPGjSE5+63HgLtndxU4w==}
@ -1374,6 +1386,9 @@ packages:
'@types/symlink-or-copy@1.2.2':
resolution: {integrity: sha512-MQ1AnmTLOncwEf9IVU+B2e4Hchrku5N67NkgcAHW0p3sdzPe0FNMANxEm6OJUzPniEQGkeT3OROLlCwZJLWFZA==}
'@types/tv4@1.2.33':
resolution: {integrity: sha512-7phCVTXC6Bj50IV1iKOwqGkR4JONJyMbRZnKTSuujv1S/tO9rG5OdCt7BMSjytO+zJmYdn1/I4fd3SH0gtO99g==}
'@typescript-eslint/tsconfig-utils@8.53.0':
resolution: {integrity: sha512-K6Sc0R5GIG6dNoPdOooQ+KtvT5KCKAvTcY8h2rIuul19vxH5OTQk7ArKkd4yTzkw66WnNY0kPPzzcmWA+XRmiA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -2411,6 +2426,10 @@ packages:
jiti:
optional: true
esm@3.2.25:
resolution: {integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==}
engines: {node: '>=6'}
espree@10.4.0:
resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -3601,6 +3620,12 @@ packages:
resolution: {integrity: sha512-NZQZdC5wOE/H3UT28fVGL+ikOZcEzfMGk/c3iN9UGxzWHMa1op7274oyiUVrAG4B2EuFhus8SvkaYnhvW92p9Q==}
hasBin: true
remotestorage-widget@1.8.0:
resolution: {integrity: sha512-l8AE2npC2nNkC8bAU6WhWO5Wl4exaXbE2yR82s5Oiqg6h0KN2mYwvLLTQGkp6mSmZTA86e7XaOcNp4lXS8CsBA==}
remotestoragejs@2.0.0-beta.8:
resolution: {integrity: sha512-rtyHTG2VbtiKTRmbwjponRf5VTPJMcHv/ijNid1zX48C0Z0F8ZCBBfkKD2QCxTQyQvCupkWNy3wuIu4HE+AEng==}
remove-types@1.0.0:
resolution: {integrity: sha512-G7Hk1Q+UJ5DvlNAoJZObxANkBZGiGdp589rVcTW/tYqJWJ5rwfraSnKSQaETN8Epaytw8J40nS/zC7bcHGv36w==}
@ -4053,6 +4078,10 @@ packages:
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tv4@1.3.0:
resolution: {integrity: sha512-afizzfpJgvPr+eDkREK4MxJ/+r8nEEHcmitwgnPUqpaP+FpwQyadnxNoSACbgc/b1LsZYtODGoPiFxQrgJgjvw==}
engines: {node: '>= 0.8.0'}
type-check@0.4.0:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'}
@ -4084,6 +4113,9 @@ packages:
underscore@1.13.7:
resolution: {integrity: sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==}
undici-types@5.26.5:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
undici-types@7.16.0:
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
@ -4207,6 +4239,9 @@ packages:
web-worker@1.5.0:
resolution: {integrity: sha512-RiMReJrTAiA+mBjGONMnjVDP2u3p9R1vkcGz6gDIrOMT3oGuYwX2WRMYI9ipkphSuE5XKEhydbhNEJh4NY9mlw==}
webfinger.js@2.8.2:
resolution: {integrity: sha512-Zqn9KXkGrD1tVEm029bVUIfmzef2KXs3G7OZrdqehDHtgv9YSxX1oy4RoPoMk2PHWIifwWCA0xwKZOAZqXMpfg==}
webidl-conversions@7.0.0:
resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==}
engines: {node: '>=12'}
@ -4288,6 +4323,10 @@ packages:
utf-8-validate:
optional: true
xhr2@0.2.1:
resolution: {integrity: sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw==}
engines: {node: '>= 6'}
xml-name-validator@5.0.0:
resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==}
engines: {node: '>=18'}
@ -5743,6 +5782,10 @@ snapshots:
'@types/minimatch@3.0.5': {}
'@types/node@20.14.0':
dependencies:
undici-types: 5.26.5
'@types/node@25.0.7':
dependencies:
undici-types: 7.16.0
@ -5756,6 +5799,8 @@ snapshots:
'@types/symlink-or-copy@1.2.2': {}
'@types/tv4@1.2.33': {}
'@typescript-eslint/tsconfig-utils@8.53.0(typescript@5.9.3)':
dependencies:
typescript: 5.9.3
@ -6981,6 +7026,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
esm@3.2.25: {}
espree@10.4.0:
dependencies:
acorn: 8.15.0
@ -8234,6 +8281,19 @@ snapshots:
dependencies:
jsesc: 3.1.0
remotestorage-widget@1.8.0: {}
remotestoragejs@2.0.0-beta.8:
dependencies:
'@types/node': 20.14.0
'@types/tv4': 1.2.33
esm: 3.2.25
tv4: 1.3.0
webfinger.js: 2.8.2
xhr2: 0.2.1
optionalDependencies:
fsevents: 2.3.3
remove-types@1.0.0:
dependencies:
'@babel/core': 7.28.6
@ -8864,6 +8924,8 @@ snapshots:
tslib@2.8.1: {}
tv4@1.3.0: {}
type-check@0.4.0:
dependencies:
prelude-ls: 1.2.1
@ -8889,6 +8951,8 @@ snapshots:
underscore@1.13.7: {}
undici-types@5.26.5: {}
undici-types@7.16.0: {}
unicode-canonical-property-names-ecmascript@2.0.1: {}
@ -8974,6 +9038,8 @@ snapshots:
web-worker@1.5.0: {}
webfinger.js@2.8.2: {}
webidl-conversions@7.0.0: {}
whatwg-encoding@3.1.1:
@ -9036,6 +9102,8 @@ snapshots:
ws@8.19.0: {}
xhr2@0.2.1: {}
xml-name-validator@5.0.0: {}
xml-utils@1.10.2: {}

1
vendor/remotestorage-module-places vendored Symbolic link
View File

@ -0,0 +1 @@
/home/basti/src/remotestorage/modules/remotestorage-module-places