農業生産者向け販売カート
[ 注意 ] 元となる sveltejs/template は既に更新が止まり Public Archive となり vite への移行が促されていますのでご注意下さい。
svelte 4 へのバージョンアップがされています(2023-07-25)。
この Svelte apps は https://github.com/sveltejs/template に基づいています。
特に農業生産者による農作物の販売向けに制作されています。
クロスプラットフォームとして Linux, Windows, iOS, Android(4.4-) 等何れの環境においても動作します。
UI として Google社の Material Components を使用しています。
IE11 への対応とWEB技術に疎遠な方にも容易に導入出来るよう最適化されています(バージョン 11.1087.16299.0 で確認)。
※ 最新技術を採り入れたものは別バージョンとして予定しています。
開発環境:Linux(Debian), Node.js 15.8.0。
GitHub Pages: svelte-eCart
https://ru-museum.github.io/svelte-eCart/
npx degit ru-museum/svelte-eCart svelte-app
cd svelte-app
! could not find commit hash for master
npx degit ru-museum/svelte-eCart#main svelte-app
参照 ⇒ github / renaming: Renaming the default branch from master
複数の同時記述は不可となっています。
:global()
contains multiple selectors (#5907):global(...):some-pseudoclass
selectors not being seen as global (#6306)[!] (plugin svelte) ValidationError: :global(...) must contain a single selector
...
:global(app, body, html) {
^
:global(app),:global(body),:global(html){
marked v. 4.0.0- において下記のエラーが表示される場合は以下を参照して下さい。
ファイルが cjs.js, esm.js, umd.js とに分割されています。
[!] Error: 'default' is not exported by node_modules/marked/lib/marked.esm.js, imported by src/*.svelte
import marked from 'marked';
^
module 名を { } で明示する必要があります。 ``` import { marked } from 'marked';
marked(text) OR marked.parse(text)
参照 ⇒ [Error: "[name] is not exported by [module]"] (https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module)
### 【注意: 4】(2022-12-11)
* Rollup のバージョンアップ(v.3)に伴い以下のパッケージに不具合が生じています。
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-terser": "^7.0.2",
Could not resolve dependency: npm ERR! peer rollup@"1 || 2" from rollup-plugin-css-only@3.1.0 npm ERR! node_modules/rollup-plugin-css-only npm ERR! dev rollup-plugin-css-only@"^3.1.0" from the root project .... npm ERR! Could not resolve dependency: npm ERR! peer rollup@"^2.0.0" from rollup-plugin-terser@7.0.2 npm ERR! node_modules/rollup-plugin-terser npm ERR! dev rollup-plugin-terser@"^7.0.2" from the root project
* rollup-plugin-css-only のパッケージ作者は更新終了を宣告しており、解決方法は以下の解説に依っています。
Samuele:[How To Update Rollup to Version 3](https://betterprogramming.pub/how-to-update-rollup-to-version-3-10c59139cbeb)
### 【解決方法】
1. パッケージを削除します。
npm uninstall rollup-plugin-css-only rollup-plugin-terser
2. Samuele 氏提供のパッケージをインストールします。
npm install @el3um4s/rollup-plugin-css-only @el3um4s/rollup-plugin-terser
3. package.json を編集します。
cd svelte-app
npm install
npm run dev
npm run build
src / App.svelte の設定値を変更しビルド(npm run build)します。
let administration = 1 ; // デフォルト値
管理用:1、公開用:0 となっています。
public/build フォルダ内のバンドルファイル名を公開用は bundle.js、管理用は bundle-admin.js とします。
※ 管理用と公開用との違いは、メニューの表示・非表示のみです。
(!) Plugin svelte: '*変数名*' is not defined
画面右上にある緑色の [Code] ボタンをクリックして Download ZIP ファイルをダウンロードし、お使いのパソコンの適当な場所へ解凍します。
フォルダ /docs 内の index-admin.html (管理用)或いは index.html (公開用)ファイルをクリックするとローカルでデモサイトが開きます。
※ 公開用の index.html を開くには、インターネットへの接続が必要です。
カスタマイズ編集後、**/docs** 内のファイルをそのままの構成でサーバーにアップロードして下さい。
※ カスタマイズ編集は「管理者用設定」のヘルプに従って下さい。