yamatoaita
@yamatoaita

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

JavaScript/Github.Page : 汎用コードをどのプロジェクトでも使えるようにする方法

解決したいこと

開発時によく使う関数やクラスをutils.jsといったファイルにまとめて記述して、どの開発でもimport的なことをして使えるようにしたいです。

この考え方は『リーダブルコード ―より良いコードを書くためのシンプルで実践的なテクニック』(2012), Dustin Boswell、Trevor Foucher 著、角 征典 訳, O'Reillyの以下の文が元です。

===引用テキスト====
10.4. 汎用コードをたくさん作る 
ReadFileToString()やformat_pretty()は「無関係の下位問題」のいい例だ。いずれも基本的で広く適用可能なので、複数のプロジェクトで再利用できる。このようなコードには、簡単に共有できるように特別なディレクトリ(例:util/)を用意する。

(135pより)

プログラマーの先輩方はどのようにして、どのプロジェクトでも使える汎用コードをまとめているのか教えていただきたいです。

発生している問題・分からないこと

わからないこと:どのプロジェクトでも使用可能な汎用コードのまとめかた。

開発環境はVisual Studio Codeを使用し、JavaScript, HTML, CSSを書いてGithub.Pageにレポジトリを作成して、github上のリンクでサイトを公開しています。

自分で試したこと

試したこと

chat gptに聞きながら次のことを試しました(結局、無理でした)
①npmでutils.jsのパッケージを公開しました。
npmのページ

②git bushでhttps://yamatoaita.github.io/yamato-utils/というレポジトリにパッケージをアップロードしました

→結果はUncaught SyntaxError: The requested module does not provide an export named 'FirebaseFunctions' というエラーがでてしまい結果的にnpmの方法はあきらめました。

補足

私はJavaScript3か月目の初心者です。先輩方がどのように汎用コードをまとめて、いつでも使えるようにしているのか知恵をいただきたいです。

私は今後もgithub.pageにて自作の機能をアップロードして、身内に共有したいと考えています。その際に使えるアドバイスをいただければ幸いです。

追記
マルチポストをしました。
こちらがterailさんのリンクです
https://teratail.com/questions/4sa54e72wbuc4q

追記:npmで公開して、github pageでimportで使おうとしたらエラーがでて結局うまくいかなかlt現物のコード

⓵index.js

qiita.rb
const { initializeApp } = require('firebase/app');
const { getDatabase, ref,  get, set } = require('firebase/database');

function add(a, b) {
    return a + b;
}

export class FirebaseFunctions{
    constructor(FIREBASE_CONFIG){              
        // Initialize Firebase
        const APP = initializeApp(FIREBASE_CONFIG); 
        this.DB = getDatabase(APP);
        this.DB_REF_COOKIE =  ref(this.DB, `data/cookie`);
    
        this.__initTipFlg();
        
    }
    
    uploadExpiringCookie(data, EXPIRE_AFTER_X_TIME = 3000){
        var expire = new Date();
        expire.setTime(expire.getTime()+EXPIRE_AFTER_X_TIME);
        
        const DB_REF_DATA =  ref(this.DB, "data/cookie");

        //この関数を使用するとき、様々なデータを扱うだろう
        //例えばログイン状態を一時的に保存するために使われる。
        //他には、遷移先のページで実行させたい動作を保存するかもしれない。
        //(例:一度ログイン画面を経由して、設定画面に移動したい時にGogingToSetting:trueのように使う)
        //様々な種類のデータを扱うため、object型で  data.isloginとかdata.isGoingSettingのように
        //使ったほうが コードが読みやすくなると考えた。そのため、dictionary型を推奨することを
        //console logで表示させる。バグのもとになりそうだからだ。
        if(typeof(data)=="object" && Array.isArray(data) == false){
            //推奨されるデータ型です
        }else{
            this.__showCaution("uploadExpiringCookie",data);
        }
      

        const LIST_DATA = [expire,data];
        const JSON_DATA = JSON.stringify(LIST_DATA);

        set(DB_REF_DATA,JSON_DATA);
    }


    uploadData(rawPath,data){
        rawPath = `data/${rawPath}`;
        var reviewdPath = this.__reviewPath(rawPath);

        const DB_REF_DATA =  ref(this.DB, reviewdPath);
        if(typeof(data)=="string"){
            data = ["json",data];
            //JSONにするには、配列でなければならない。
            //そのため、0番目に識別子jsonをつけて配列にする
        }
        const JSON_DATA = JSON.stringify(data);
        set(DB_REF_DATA,JSON_DATA);
    }

    async downloadExpiringCookie(){
        this.__tellTips("downloadData");

        const DB_REF_DATA = ref(this.DB,"data/cookie");
        try {
            const snapshot = await get(DB_REF_DATA); // await で結果を待機
            if (snapshot.exists()) { // パスワードが登録されていた場合
                const JSON_DATA = snapshot.val(); // データを格納
               
                if(typeof(JSON_DATA)=="string"){
                    var parsedData = JSON.parse(JSON_DATA); 
                }else{
                    var parsedData = JSON_DATA; 
                }
                
                let EXPIRE_DATE = new Date(parsedData[0]); // cookie_dateを格納
                let CURRENT_DATE = new Date(); // 現在の時刻を取得

                // cookie_dateから現在時刻までの経過時間をミリ秒で取得
                let ELAPSED_TIME    = EXPIRE_DATE    - CURRENT_DATE; 
                // 1000ms(  valid)  = 12:00:03       -  12:00:02
                //    1ms(  valid)  = 12:00:03:0000  -  12:00:02:999
                //    0ms(invalid)  = 12:00:03       -  12:00:03
                //-2000ms(invalid)  = 12:00:03       -  12:00:05

                if (ELAPSED_TIME > 0) {
                    this.__uploadAndResetInfo();
                    const DICT_DATA =  parsedData[1];
                    return DICT_DATA; // 取得したデータを返す
                } else {
                    //ログイン情報の有効期限が切れた場合は、falseを返す
                    this.uploadData("data/info",`Cookieの有効期限が切れています。\n有効期限:${EXPIRE_DATE}\n現在時刻:${CURRENT_DATE}\n時差:${ELAPSED_TIME/1000}秒`)
                    await new Promise(resolve => setTimeout(resolve, 2000));
                    return false;
                }



            } else {
                console.log('No data available');
                return null;
            }
        } catch (error) {
            this.__alertMessage(error);
            console.error('Error getting data:', error);
            throw error; // エラーを呼び出し元に伝える
        }
    }
    
    async downloadData(rawPath) {
        this.__tellTips("downloadData");

        rawPath = `data/${rawPath}`;
        var reviewedPath = this.__reviewPath(rawPath);
        const DB_REF_DATA = ref(this.DB, reviewedPath);
    
        try {
            const snapshot = await get(DB_REF_DATA); // await で結果を待機
            if (snapshot.exists()) { // パスワードが登録されていた場合
                const JSON_DATA = snapshot.val(); // データを格納
               
                if(typeof(JSON_DATA)=="string"){
                    var parsedData = JSON.parse(JSON_DATA); 
                }else{
                    var parsedData = JSON_DATA; 
                }
                
                


                if(Array.isArray(parsedData)){
                    if(parsedData.length >0 && parsedData[0]==="json"){
                        //配列が空だと次の処理が undefined errorとなる。
                        //これを防ぐために parsedData.length>0の条件をはさむ。
                        parsedData = parsedData[1];
                        //JSONは配列やobject型じゃなければパースできない。
                        //そのため、listに直してからパースしている。
                        //データを取り出す時には、元のデータ(文字列や数値)のみ抽出して返す
                    }                 
                }

                return parsedData; // 取得したデータを返す
            } else {
                console.log('No data available');
                return null;
            }
        } catch (error) {
            this.__alertMessage(error);
            console.error('Error getting data:', error);
            throw error; // エラーを呼び出し元に伝える
        }
    } 

    __uploadAndResetInfo(){
        this.uploadData("data/info","");
    }

    __reviewPath(PATH){
        return PATH.replace(/(\/?data\/)+/, "data/");
        //:  / /は正規表現を宣言
        //:  \/は/のエスケープ文字
    }

    __alertMessage(INFO){
        alert(`Error: yamatoaita@gmail.comにこの文章をお知らせください。\nError info : ${INFO}`)
    }

    __initTipFlg(){
        this.isShowTip = {
                            "downloadData" : true
                        
                        }
    }
    
    __tellTips(METHOD){
        const GREEN = "color:green";
        const RED = "color:red";
        const BLUE = "color:blue";
        const NORMAL = "color:black;font-weight:normal"
        const BOLD  ="font-weight:bold`"

        if(METHOD == "downloadData" && this.isShowTip["downloadData"]){
            this.isShowTip["downloadData"] = false;

            console.log(
`
============================================================================
|                       %cTip of [downloadData]%c:                             |
|--------------------------------------------------------------------------|
|downloadDataメソッドを実行する際は以下のように使います。                  |
|--------------------------------------------------------------------------|
|    class ClassName{                                                      |
|        constructor(){                                                    |
|            ・・・処理・・・                                              |
|            this.init(); // データ取得後に実行させたいコードは            |
|                        // init関数にくくる。                             |
|        }                                                                 |
|        %casync%c init(){                                                     |
|            const DATA = %cawait%c this.FIREBASE_APP.downloadData("cookie");  |
|            console.log(データが取得後に表示されます‘${DATA}‘)         |
|            console.log("このログはその後に表示されます")                 |
|        }                                                                 |
|    }                                                                     |
|--------------------------------------------------------------------------|
|                %cReturnで値を取得したい場合の記載例%c:                       |
|--------------------------------------------------------------------------|
|    %casync%c exampleFunction(){                                              |
|          const VALUE = %cawait%c this.returnFunction();                      |
|    }                                                                     |
|    %casync%c returnFunction(){                                               |
|        const RETURN_VALUE = %cawait%c this.FIREBASE_APP.downloadData("path");|
|        return RETURN_VALUE;                                              |
|    }                                                                     |
|--------------------------------------------------------------------------|
|                %caddEventListenerで行う場合の記載例%c:                       |
|--------------------------------------------------------------------------|
|    setBtnEvent(){                                                        |
|        const BTN = document.getElementById("btn");                       |
|        BTN.addEventListener("click", %casync%c ()=>{                         |
|            const VALUE = %cawait%c this.returnFunction();                    |
|        })                                                                |
|    }                                                                     |
============================================================================
    ` ,`${GREEN};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`,

    `${GREEN};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`,

    `${GREEN};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`,
    `${BLUE};${BOLD}`,`${NORMAL}`
   )
        }
    }

    __showCaution(FUNCTION_NAME,ITEM){
        var stack = new Error().stack.replace("Error","");
        stack = stack.replace(/^\s*at FirebaseFunctions.*$/gm, "");


        if(FUNCTION_NAME=="uploadExpiringCookie"){
            alert(`注意 : アップロードしようとしているものはDictionary型ではありません。\n
uploadExpiringCookie関数は仕様上、Dictionary型を渡すことを推奨します。\n
渡された値:${ITEM}   データ型:${typeof(ITEM)}\n
現在の行番号:${stack}`)
          

        }
    }

}

export { FirebaseFunctions };

⓶package.json

qiita.rb
{
  "name": "utils-of-yamatoaita",
  "version": "1.0.2",
  "description": "",
  "homepage": "https://github.com/yamatoaita/utils.github.io#readme",
  "bugs": {
    "url": "https://github.com/yamatoaita/utils.github.io/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/yamatoaita/utils.github.io.git"
  },
  "license": "MIT",
  "author": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "firebase": "^11.3.1"
  },
  "type": "module"

}

⓷package-lock.json

qiita.rb
{
  "name": "utils-of-yamatoaita",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "utils-of-yamatoaita",
      "version": "1.0.0",
      "license": "ISC",
      "dependencies": {
        "firebase": "^11.3.1"
      }
    },
    "node_modules/@firebase/analytics": {
      "version": "0.10.11",
      "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.11.tgz",
      "integrity": "sha512-zwuPiRE0+hgcS95JZbJ6DFQN4xYFO8IyGxpeePTV51YJMwCf3lkBa6FnZ/iXIqDKcBPMgMuuEZozI0BJWaLEYg==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/installations": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/analytics-compat": {
      "version": "0.2.17",
      "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.17.tgz",
      "integrity": "sha512-SJNVOeTvzdqZQvXFzj7yAirXnYcLDxh57wBFROfeowq/kRN1AqOw1tG6U4OiFOEhqi7s3xLze/LMkZatk2IEww==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/analytics": "0.10.11",
        "@firebase/analytics-types": "0.8.3",
        "@firebase/component": "0.6.12",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/analytics-types": {
      "version": "0.8.3",
      "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.3.tgz",
      "integrity": "sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/app": {
      "version": "0.11.1",
      "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.11.1.tgz",
      "integrity": "sha512-Vz4DrNLPfDx3RwQf+4klXtu7OUYDO6xz2hlRyFawWskS7YqdtNzkDDxrqH20KDfjCF1lib46/NgchIj1+8h4wQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "idb": "7.1.1",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@firebase/app-check": {
      "version": "0.8.11",
      "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.11.tgz",
      "integrity": "sha512-42zIfRI08/7bQqczAy7sY2JqZYEv3a1eNa4fLFdtJ54vNevbBIRSEA3fZgRqWFNHalh5ohsBXdrYgFqaRIuCcQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/app-check-compat": {
      "version": "0.3.18",
      "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.18.tgz",
      "integrity": "sha512-qjozwnwYmAIdrsVGrJk+hnF1WBois54IhZR6gO0wtZQoTvWL/GtiA2F31TIgAhF0ayUiZhztOv1RfC7YyrZGDQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/app-check": "0.8.11",
        "@firebase/app-check-types": "0.5.3",
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/app-check-interop-types": {
      "version": "0.3.3",
      "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.3.tgz",
      "integrity": "sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/app-check-types": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.3.tgz",
      "integrity": "sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/app-compat": {
      "version": "0.2.50",
      "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.50.tgz",
      "integrity": "sha512-7yD362icKgjoNvFxwth420TNZgqCfuTJ28yQCdpyjC2fXyaZHhAbxVKnHEXGTAaUKSHWxsIy46lBKGi/x/Mflw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/app": "0.11.1",
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@firebase/app-types": {
      "version": "0.9.3",
      "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.3.tgz",
      "integrity": "sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/auth": {
      "version": "1.9.0",
      "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.9.0.tgz",
      "integrity": "sha512-Xz2mbEYauF689qXG/4HppS2+/yGo9R7B6eNUBh3H2+XpAZTGdx8d8TFsW/BMTAK9Q95NB0pb1Bbvfx0lwofq8Q==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x",
        "@react-native-async-storage/async-storage": "^1.18.1"
      },
      "peerDependenciesMeta": {
        "@react-native-async-storage/async-storage": {
          "optional": true
        }
      }
    },
    "node_modules/@firebase/auth-compat": {
      "version": "0.5.18",
      "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.18.tgz",
      "integrity": "sha512-dFBev8AMNb2AgIt9afwf/Ku4/0Wq9R9OFSeBB/xjyJt+RfQ9PnNWqU2oFphews23byLg6jle8twRA7iOYfRGRw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/auth": "1.9.0",
        "@firebase/auth-types": "0.13.0",
        "@firebase/component": "0.6.12",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/auth-interop-types": {
      "version": "0.2.4",
      "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.4.tgz",
      "integrity": "sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/auth-types": {
      "version": "0.13.0",
      "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.13.0.tgz",
      "integrity": "sha512-S/PuIjni0AQRLF+l9ck0YpsMOdE8GO2KU6ubmBB7P+7TJUCQDa3R1dlgYm9UzGbbePMZsp0xzB93f2b/CgxMOg==",
      "license": "Apache-2.0",
      "peerDependencies": {
        "@firebase/app-types": "0.x",
        "@firebase/util": "1.x"
      }
    },
    "node_modules/@firebase/component": {
      "version": "0.6.12",
      "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.12.tgz",
      "integrity": "sha512-YnxqjtohLbnb7raXt2YuA44cC1wA9GiehM/cmxrsoxKlFxBLy2V0OkRSj9gpngAE0UoJ421Wlav9ycO7lTPAUw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@firebase/data-connect": {
      "version": "0.3.0",
      "resolved": "https://registry.npmjs.org/@firebase/data-connect/-/data-connect-0.3.0.tgz",
      "integrity": "sha512-inbLq0JyQD/d02Al3Lso0Hc8z1BVpB3dYSMFcQkeKhYyjn5bspLczLdasPbCOEUp8MOkLblLZhJuRs7Q/spFnw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/auth-interop-types": "0.2.4",
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/database": {
      "version": "1.0.12",
      "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.12.tgz",
      "integrity": "sha512-psFl5t6rSFHq3i3fnU1QQlc4BB9Hnhh8TgEqvQlPPm8kDLw8gYxvjqYw3c5CZW0+zKR837nwT6im/wtJUivMKw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/app-check-interop-types": "0.3.3",
        "@firebase/auth-interop-types": "0.2.4",
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "faye-websocket": "0.11.4",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@firebase/database-compat": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-2.0.3.tgz",
      "integrity": "sha512-uHGQrSUeJvsDfA+IyHW5O4vdRPsCksEzv4T4Jins+bmQgYy20ZESU4x01xrQCn/nzqKHuQMEW99CoCO7D+5NiQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/database": "1.0.12",
        "@firebase/database-types": "1.0.8",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@firebase/database-types": {
      "version": "1.0.8",
      "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.8.tgz",
      "integrity": "sha512-6lPWIGeufhUq1heofZULyVvWFhD01TUrkkB9vyhmksjZ4XF7NaivQp9rICMk7QNhqwa+uDCaj4j+Q8qqcSVZ9g==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/app-types": "0.9.3",
        "@firebase/util": "1.10.3"
      }
    },
    "node_modules/@firebase/firestore": {
      "version": "4.7.8",
      "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.8.tgz",
      "integrity": "sha512-eDvVJ/I5vSmIdGmLHJAK1OcviigIxjjia6i5/AkMFq6vZMt7CBXA0B5Xz9pGRCZ7WewFcsCbK1ZUQoYJ91+Cew==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "@firebase/webchannel-wrapper": "1.0.3",
        "@grpc/grpc-js": "~1.9.0",
        "@grpc/proto-loader": "^0.7.8",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/firestore-compat": {
      "version": "0.3.43",
      "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.43.tgz",
      "integrity": "sha512-zxg7YS07XQnTetGs3GADM/eA6HB4vWUp+Av4iugmTbft0fQxuTSnGm7ifctaYuR7VMTPckU9CW+oFC9QUNSYvg==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/firestore": "4.7.8",
        "@firebase/firestore-types": "3.0.3",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/firestore-types": {
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.3.tgz",
      "integrity": "sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q==",
      "license": "Apache-2.0",
      "peerDependencies": {
        "@firebase/app-types": "0.x",
        "@firebase/util": "1.x"
      }
    },
    "node_modules/@firebase/functions": {
      "version": "0.12.2",
      "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.12.2.tgz",
      "integrity": "sha512-iKpFDoCYk/Qm+Qwv5ynRb9/yq64QOt0A0+t9NuekyAZnSoV56kSNq/PmsVmBauar5SlmEjhHk6QKdMBP9S0gXA==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/app-check-interop-types": "0.3.3",
        "@firebase/auth-interop-types": "0.2.4",
        "@firebase/component": "0.6.12",
        "@firebase/messaging-interop-types": "0.2.3",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/functions-compat": {
      "version": "0.3.19",
      "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.19.tgz",
      "integrity": "sha512-uw4tR8NcJCDu86UD63Za8A8SgFgmAVFb1XsGlkuBY7gpLyZWEFavWnwRkZ/8cUwpqUhp/SptXFZ1WFJSnOokLw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/functions": "0.12.2",
        "@firebase/functions-types": "0.6.3",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/functions-types": {
      "version": "0.6.3",
      "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.3.tgz",
      "integrity": "sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/installations": {
      "version": "0.6.12",
      "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.12.tgz",
      "integrity": "sha512-ES/WpuAV2k2YtBTvdaknEo7IY8vaGjIjS3zhnHSAIvY9KwTR8XZFXOJoZ3nSkjN1A5R4MtEh+07drnzPDg9vaw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/util": "1.10.3",
        "idb": "7.1.1",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/installations-compat": {
      "version": "0.2.12",
      "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.12.tgz",
      "integrity": "sha512-RhcGknkxmFu92F6Jb3rXxv6a4sytPjJGifRZj8MSURPuv2Xu+/AispCXEfY1ZraobhEHTG5HLGsP6R4l9qB5aA==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/installations": "0.6.12",
        "@firebase/installations-types": "0.5.3",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/installations-types": {
      "version": "0.5.3",
      "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.3.tgz",
      "integrity": "sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA==",
      "license": "Apache-2.0",
      "peerDependencies": {
        "@firebase/app-types": "0.x"
      }
    },
    "node_modules/@firebase/logger": {
      "version": "0.4.4",
      "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.4.tgz",
      "integrity": "sha512-mH0PEh1zoXGnaR8gD1DeGeNZtWFKbnz9hDO91dIml3iou1gpOnLqXQ2dJfB71dj6dpmUjcQ6phY3ZZJbjErr9g==",
      "license": "Apache-2.0",
      "dependencies": {
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@firebase/messaging": {
      "version": "0.12.16",
      "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.16.tgz",
      "integrity": "sha512-VJ8sCEIeP3+XkfbJA7410WhYGHdloYFZXoHe/vt+vNVDGw8JQPTQSVTRvjrUprEf5I4Tbcnpr2H34lS6zhCHSA==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/installations": "0.6.12",
        "@firebase/messaging-interop-types": "0.2.3",
        "@firebase/util": "1.10.3",
        "idb": "7.1.1",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/messaging-compat": {
      "version": "0.2.16",
      "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.16.tgz",
      "integrity": "sha512-9HZZ88Ig3zQ0ok/Pwt4gQcNsOhoEy8hDHoGsV1am6ulgMuGuDVD2gl11Lere2ksL+msM12Lddi2x/7TCqmODZw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/messaging": "0.12.16",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/messaging-interop-types": {
      "version": "0.2.3",
      "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.3.tgz",
      "integrity": "sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/performance": {
      "version": "0.7.0",
      "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.7.0.tgz",
      "integrity": "sha512-L91PwYuiJdKXKSRqsWNicvTppAJVzKjye03UlegeD6TkpKjb93T8AmJ9B0Mt0bcWHCNtnnRBCdSCvD2U9GZDjw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/installations": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0",
        "web-vitals": "^4.2.4"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/performance-compat": {
      "version": "0.2.13",
      "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.13.tgz",
      "integrity": "sha512-pB0SMQj2TLQ6roDcX0YQDWvUnVgsVOl0VnUvyT/VBdCUuQYDHobZsPEuQsoEqmPA44KS/Gl0oyKqf+I8UPtRgw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/performance": "0.7.0",
        "@firebase/performance-types": "0.2.3",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/performance-types": {
      "version": "0.2.3",
      "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.3.tgz",
      "integrity": "sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/remote-config": {
      "version": "0.5.0",
      "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.5.0.tgz",
      "integrity": "sha512-weiEbpBp5PBJTHUWR4GwI7ZacaAg68BKha5QnZ8Go65W4oQjEWqCW/rfskABI/OkrGijlL3CUmCB/SA6mVo0qA==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/installations": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/remote-config-compat": {
      "version": "0.2.12",
      "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.12.tgz",
      "integrity": "sha512-91jLWPtubIuPBngg9SzwvNCWzhMLcyBccmt7TNZP+y1cuYFNOWWHKUXQ3IrxCLB7WwLqQaEu7fTDAjHsTyBsSw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/remote-config": "0.5.0",
        "@firebase/remote-config-types": "0.4.0",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/remote-config-types": {
      "version": "0.4.0",
      "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.4.0.tgz",
      "integrity": "sha512-7p3mRE/ldCNYt8fmWMQ/MSGRmXYlJ15Rvs9Rk17t8p0WwZDbeK7eRmoI1tvCPaDzn9Oqh+yD6Lw+sGLsLg4kKg==",
      "license": "Apache-2.0"
    },
    "node_modules/@firebase/storage": {
      "version": "0.13.6",
      "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.6.tgz",
      "integrity": "sha512-BEJLYQzVgAoglRl5VRIRZ91RRBZgS/O37/PSGQJBYNuoLmFZUrtwrlLTOAwG776NlO9VQR+K2j15/36Lr2EqHA==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x"
      }
    },
    "node_modules/@firebase/storage-compat": {
      "version": "0.3.16",
      "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.16.tgz",
      "integrity": "sha512-EeMuok/s0r938lEomia8XILEqSYULm7HcYZ/GTZLDWur0kMf2ktuPVZiTdRiwEV3Iki7FtQO5txrQ/0pLRVLAw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/component": "0.6.12",
        "@firebase/storage": "0.13.6",
        "@firebase/storage-types": "0.8.3",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app-compat": "0.x"
      }
    },
    "node_modules/@firebase/storage-types": {
      "version": "0.8.3",
      "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.3.tgz",
      "integrity": "sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg==",
      "license": "Apache-2.0",
      "peerDependencies": {
        "@firebase/app-types": "0.x",
        "@firebase/util": "1.x"
      }
    },
    "node_modules/@firebase/util": {
      "version": "1.10.3",
      "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.10.3.tgz",
      "integrity": "sha512-wfoF5LTy0m2ufUapV0ZnpcGQvuavTbJ5Qr1Ze9OJGL70cSMvhDyjS4w2121XdA3lGZSTOsDOyGhpoDtYwck85A==",
      "license": "Apache-2.0",
      "dependencies": {
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@firebase/vertexai": {
      "version": "1.0.4",
      "resolved": "https://registry.npmjs.org/@firebase/vertexai/-/vertexai-1.0.4.tgz",
      "integrity": "sha512-Nkf/r4u166b4Id6zrrW0Qtg1KyZpQvvYchtkebamnHtIfY+Qnt51I/sx4Saos/WrmO8SnrSU850LfmJ7pehYXg==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/app-check-interop-types": "0.3.3",
        "@firebase/component": "0.6.12",
        "@firebase/logger": "0.4.4",
        "@firebase/util": "1.10.3",
        "tslib": "^2.1.0"
      },
      "engines": {
        "node": ">=18.0.0"
      },
      "peerDependencies": {
        "@firebase/app": "0.x",
        "@firebase/app-types": "0.x"
      }
    },
    "node_modules/@firebase/webchannel-wrapper": {
      "version": "1.0.3",
      "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.3.tgz",
      "integrity": "sha512-2xCRM9q9FlzGZCdgDMJwc0gyUkWFtkosy7Xxr6sFgQwn+wMNIWd7xIvYNauU1r64B5L5rsGKy/n9TKJ0aAFeqQ==",
      "license": "Apache-2.0"
    },
    "node_modules/@grpc/grpc-js": {
      "version": "1.9.15",
      "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz",
      "integrity": "sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "@grpc/proto-loader": "^0.7.8",
        "@types/node": ">=12.12.47"
      },
      "engines": {
        "node": "^8.13.0 || >=10.10.0"
      }
    },
    "node_modules/@grpc/proto-loader": {
      "version": "0.7.13",
      "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz",
      "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==",
      "license": "Apache-2.0",
      "dependencies": {
        "lodash.camelcase": "^4.3.0",
        "long": "^5.0.0",
        "protobufjs": "^7.2.5",
        "yargs": "^17.7.2"
      },
      "bin": {
        "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
      },
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/@protobufjs/aspromise": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
      "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/base64": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
      "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/codegen": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
      "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/eventemitter": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
      "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/fetch": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
      "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
      "license": "BSD-3-Clause",
      "dependencies": {
        "@protobufjs/aspromise": "^1.1.1",
        "@protobufjs/inquire": "^1.1.0"
      }
    },
    "node_modules/@protobufjs/float": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
      "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/inquire": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
      "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/path": {
      "version": "1.1.2",
      "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
      "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/pool": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
      "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@protobufjs/utf8": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
      "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
      "license": "BSD-3-Clause"
    },
    "node_modules/@types/node": {
      "version": "22.13.4",
      "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.4.tgz",
      "integrity": "sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg==",
      "license": "MIT",
      "dependencies": {
        "undici-types": "~6.20.0"
      }
    },
    "node_modules/ansi-regex": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
      "license": "MIT",
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/ansi-styles": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
      "license": "MIT",
      "dependencies": {
        "color-convert": "^2.0.1"
      },
      "engines": {
        "node": ">=8"
      },
      "funding": {
        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
      }
    },
    "node_modules/cliui": {
      "version": "8.0.1",
      "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
      "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
      "license": "ISC",
      "dependencies": {
        "string-width": "^4.2.0",
        "strip-ansi": "^6.0.1",
        "wrap-ansi": "^7.0.0"
      },
      "engines": {
        "node": ">=12"
      }
    },
    "node_modules/color-convert": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
      "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
      "license": "MIT",
      "dependencies": {
        "color-name": "~1.1.4"
      },
      "engines": {
        "node": ">=7.0.0"
      }
    },
    "node_modules/color-name": {
      "version": "1.1.4",
      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
      "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
      "license": "MIT"
    },
    "node_modules/emoji-regex": {
      "version": "8.0.0",
      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
      "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
      "license": "MIT"
    },
    "node_modules/escalade": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
      "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
      "license": "MIT",
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/faye-websocket": {
      "version": "0.11.4",
      "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz",
      "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==",
      "license": "Apache-2.0",
      "dependencies": {
        "websocket-driver": ">=0.5.1"
      },
      "engines": {
        "node": ">=0.8.0"
      }
    },
    "node_modules/firebase": {
      "version": "11.3.1",
      "resolved": "https://registry.npmjs.org/firebase/-/firebase-11.3.1.tgz",
      "integrity": "sha512-P4YVFM0Bm2d8aO61SCEMF8E1pYgieGLrmr/LFw7vs6sAMebwuwHt+Wug+1qL2fhAHWPwpWbCLsdJH8NQ+4Sw8Q==",
      "license": "Apache-2.0",
      "dependencies": {
        "@firebase/analytics": "0.10.11",
        "@firebase/analytics-compat": "0.2.17",
        "@firebase/app": "0.11.1",
        "@firebase/app-check": "0.8.11",
        "@firebase/app-check-compat": "0.3.18",
        "@firebase/app-compat": "0.2.50",
        "@firebase/app-types": "0.9.3",
        "@firebase/auth": "1.9.0",
        "@firebase/auth-compat": "0.5.18",
        "@firebase/data-connect": "0.3.0",
        "@firebase/database": "1.0.12",
        "@firebase/database-compat": "2.0.3",
        "@firebase/firestore": "4.7.8",
        "@firebase/firestore-compat": "0.3.43",
        "@firebase/functions": "0.12.2",
        "@firebase/functions-compat": "0.3.19",
        "@firebase/installations": "0.6.12",
        "@firebase/installations-compat": "0.2.12",
        "@firebase/messaging": "0.12.16",
        "@firebase/messaging-compat": "0.2.16",
        "@firebase/performance": "0.7.0",
        "@firebase/performance-compat": "0.2.13",
        "@firebase/remote-config": "0.5.0",
        "@firebase/remote-config-compat": "0.2.12",
        "@firebase/storage": "0.13.6",
        "@firebase/storage-compat": "0.3.16",
        "@firebase/util": "1.10.3",
        "@firebase/vertexai": "1.0.4"
      }
    },
    "node_modules/get-caller-file": {
      "version": "2.0.5",
      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
      "license": "ISC",
      "engines": {
        "node": "6.* || 8.* || >= 10.*"
      }
    },
    "node_modules/http-parser-js": {
      "version": "0.5.9",
      "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.9.tgz",
      "integrity": "sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw==",
      "license": "MIT"
    },
    "node_modules/idb": {
      "version": "7.1.1",
      "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz",
      "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==",
      "license": "ISC"
    },
    "node_modules/is-fullwidth-code-point": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
      "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
      "license": "MIT",
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/lodash.camelcase": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
      "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",
      "license": "MIT"
    },
    "node_modules/long": {
      "version": "5.3.1",
      "resolved": "https://registry.npmjs.org/long/-/long-5.3.1.tgz",
      "integrity": "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng==",
      "license": "Apache-2.0"
    },
    "node_modules/protobufjs": {
      "version": "7.4.0",
      "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz",
      "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==",
      "hasInstallScript": true,
      "license": "BSD-3-Clause",
      "dependencies": {
        "@protobufjs/aspromise": "^1.1.2",
        "@protobufjs/base64": "^1.1.2",
        "@protobufjs/codegen": "^2.0.4",
        "@protobufjs/eventemitter": "^1.1.0",
        "@protobufjs/fetch": "^1.1.0",
        "@protobufjs/float": "^1.0.2",
        "@protobufjs/inquire": "^1.1.0",
        "@protobufjs/path": "^1.1.2",
        "@protobufjs/pool": "^1.1.0",
        "@protobufjs/utf8": "^1.1.0",
        "@types/node": ">=13.7.0",
        "long": "^5.0.0"
      },
      "engines": {
        "node": ">=12.0.0"
      }
    },
    "node_modules/require-directory": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
      "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
      "license": "MIT",
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/safe-buffer": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
      "funding": [
        {
          "type": "github",
          "url": "https://github.com/sponsors/feross"
        },
        {
          "type": "patreon",
          "url": "https://www.patreon.com/feross"
        },
        {
          "type": "consulting",
          "url": "https://feross.org/support"
        }
      ],
      "license": "MIT"
    },
    "node_modules/string-width": {
      "version": "4.2.3",
      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
      "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
      "license": "MIT",
      "dependencies": {
        "emoji-regex": "^8.0.0",
        "is-fullwidth-code-point": "^3.0.0",
        "strip-ansi": "^6.0.1"
      },
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/strip-ansi": {
      "version": "6.0.1",
      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
      "license": "MIT",
      "dependencies": {
        "ansi-regex": "^5.0.1"
      },
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/tslib": {
      "version": "2.8.1",
      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
      "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
      "license": "0BSD"
    },
    "node_modules/undici-types": {
      "version": "6.20.0",
      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
      "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
      "license": "MIT"
    },
    "node_modules/web-vitals": {
      "version": "4.2.4",
      "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz",
      "integrity": "sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==",
      "license": "Apache-2.0"
    },
    "node_modules/websocket-driver": {
      "version": "0.7.4",
      "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
      "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==",
      "license": "Apache-2.0",
      "dependencies": {
        "http-parser-js": ">=0.5.1",
        "safe-buffer": ">=5.1.0",
        "websocket-extensions": ">=0.1.1"
      },
      "engines": {
        "node": ">=0.8.0"
      }
    },
    "node_modules/websocket-extensions": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
      "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
      "license": "Apache-2.0",
      "engines": {
        "node": ">=0.8.0"
      }
    },
    "node_modules/wrap-ansi": {
      "version": "7.0.0",
      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
      "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
      "license": "MIT",
      "dependencies": {
        "ansi-styles": "^4.0.0",
        "string-width": "^4.1.0",
        "strip-ansi": "^6.0.0"
      },
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
      }
    },
    "node_modules/y18n": {
      "version": "5.0.8",
      "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
      "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
      "license": "ISC",
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/yargs": {
      "version": "17.7.2",
      "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
      "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
      "license": "MIT",
      "dependencies": {
        "cliui": "^8.0.1",
        "escalade": "^3.1.1",
        "get-caller-file": "^2.0.5",
        "require-directory": "^2.1.1",
        "string-width": "^4.2.3",
        "y18n": "^5.0.5",
        "yargs-parser": "^21.1.1"
      },
      "engines": {
        "node": ">=12"
      }
    },
    "node_modules/yargs-parser": {
      "version": "21.1.1",
      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
      "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
      "license": "ISC",
      "engines": {
        "node": ">=12"
      }
    }
  }
}

0

5Answer

当初の質問になかったコードが追記されているようなのでそれについてコメントします。

まず index.js ですが、 require() を使っているのでブラウザで読み込んだらエラーが出ます。また、最初の質問にあった

→結果はUncaught SyntaxError: The requested module does not provide an export named 'FirebaseFunctions' というエラーがでてしまい結果的にnpmの方法はあきらめました。

というエラーは出ません。書き換えながら試すのはいいですが、貼るコードはどの時点のものか分かるようにし、関係ない情報が混ざらないようにしてください。(これは隣のコメント欄のやりとりでも言えることです。 import {FirebaseFunction} from "./utils.js"; と書くように回答されて「すると、SyntaxError:Unexpected stringとなりました。」と返事していましたが、それは勝手に import を削ったコードから出たエラーのことでしたよね。不正な文法のコードからエラーが出るのは当然ですし、それは回答者には想定外のことです。書き換えたならそのように言ってください。)また出たエラーは省略や要約をせずに出たままコピペしてください。

次に「npmで公開」と言っていますが、 npm で公開するとは一般的に npm publish コマンドを使ってパッケージを https://www.npmjs.com または互換のレジストリに公開することをいいます。 GitHub Pages に JavaScript コードを置くことは npm とは関係ありません。

それと質問とは関係ありませんが、リポジトリ名になんでもかんでも .github.io をつける必要はないです。 あなたのユーザー名.github.io というリポジトリ名だけ GitHub Pages で特別扱いされ、それ以外は特に意味はありません。 linktree.github.io ではなく linktree でいいということです。

2Like

Comments

  1. @yamatoaita

    Questioner

    @usaiさん

    分かりにくくなり、貼り付けたものも時間系列がおかしな事になっており、すみませんでした。
    (最初書いた質問のエラーは2/17時点でみれたものです。
    その後、貼り付けたコードは2/18に色々と書きかえて 違うエラーが出た時のものです。これじゃあ回答者の方々にわかりにくく、不適切な説明でした)
    以後気をつけます。

②git bushでhttps://yamatoaita.github.io/yamato-utils/ というレポジトリにパッケージをアップロードしました

それは github io の URL であって リポジトリではないのではないでしょうか……?

js の import 自体は *.js を import すれば使えると思いますが、変更が怖いので 必要なファイルだけ プロジェクトに持ち越ししていますね。

0Like

Comments

  1. @yamatoaita

    Questioner

    回答ありがとうございます!!

    それは github io の URL であって リポジトリではないのではないでしょうか……?
    →その通りです。私が間違っています。Settingタブ_Pageにあったリンクをただ持ってきました。

    js の import 自体は *.js を import すれば使えると思いますが、変更が怖いので 必要なファイルだけ プロジェクトに持ち越ししていますね。
    →なるほど。より詳しく知りたいです。
    私はgithub.pageにutils.jsという名前のファイルをアップロードし
    index.htmlで読み込むindex.jsの中、1行目に次のように書いたことがありました。
    (結局エラー:「そんなファイル見つからないよ」のようなものがでてうまくいきませんでした)

    import {FirebaseFunction} from utils.js

    具体的にはどのような手順でどのように使っているのか教えていただけないでしょうか

  2. それは この誤りではないですか?

    import {FirebaseFunction} from "./utils.js";
    

    あと、ドメインが違うところからの import は CORS の制約を受けるので ヘッダで許可されないとダメなところに注意が必要です。

  3. @yamatoaita

    Questioner

    ありがとうございます! github.pageにてindex.js1行目に上記を書入れました。

    すると、SyntaxError:Unexpected stringとなりました。

  4. それ発生しているの utils.js では……?(一緒にどこで発生したか書いてありませんか?

  5. 個人的には、このファイルの文法が気になってます。この問題とは関係のないファイルなのかもしれないですが。

  6. https://yamatoaita.github.io/yamato-utils/utils.js この utils.js のことだとすると、 deno check utils.js したところシンタックスエラーはなかったので別の箇所で出ていそうです。

    同じ階層に index.html がないので別のページまたはローカル環境から読み込もうとしているんですかね。だとすると import {FirebaseFunction} from "./utils.js"; のパスも変える必要があるかもしれません。

  7. @lhankor_mhy お、それっぽいですね。1行目の import が抜けてますね。同じ場所に utils.js もあるので(私がリンクしたのとは内容が違いますが)インポートパスは正しそうです。

  8. @yamatoaita

    Questioner

    @juner それ発生しているの utils.jsでは……………?(一 緒にどこで発生したか書いてありませんか?

    ▶すみません。発生場所はutils.jsを読み込んだファイルで発生しています。

    今作ってるのはlinktree.jsというファイルです。そこに、utils.jsを読み込ませています。(utils.jsの中身は、firebaseのgetやsetを楽にするクラスです)

    index.htmlでlinktree.jsを読み込むと このエラーがでました

  9. @yamatoaita

    Questioner

    @lhankor_mhy 個人的には、このファイルの文法が気になっ てます。この問題とは関係のないファイルなのかもしれないですが。

    ▶コメントありがとうございます!

    このファイルはnpmでパッケージを公開しようとした時に作ったものです。

    1行目 :{FirebaseFunctions} from "./utils.js";

    これは、chat gptに聞いたらば「こうすると動くよ」と言われて書いたものです。結論、動かずエラー(確か そんなファイルないよ 的なもの)がでました。 文法はおかしいです。

  10. @yamatoaita

    Questioner

    @uasi @lhankor_mhy お、それっぽいですね。1行 目の import が抜けてますね。同じ場所に u tils.js もあるので(私がリンクしたのとは内 容が違いますが) インポートパスは正しそう です。

    ▶コメントありがとうございます!
    Import抜けてますよね。 1日前にimport入れた上で書いた時がありました。

    すると、エラー(FirebaseFunctionsなんてモジュールはexportされてないよ)が出てしまいました。 そこで、importを書かないで公開してみました。(import書いてないので 動かないですが)
    Chat gpt頼りで、基盤となる知識がないとダメだと反省です。

  11. エラーが出ている現物のコードを提示された方が話が早いのでは? 何か事情があるのかもしれませんが、コードを出さない質問はたいていの場合は回答が的外れになります。

  12. というか、よくよくコードを読むと、linktree.github.io/utils.js は名前付きエクスポートしているみたいですし、yamato-utils/utils.js はESモジュールでさえなくないですか?

    もしかして、なにかしらのビルドツールを使ってませんか?

  13. @yamatoaita

    Questioner

    @lhankor_mhy
    というか、よくよくコードを読むと、linktree.github.io/utils.js は名前付きエクスポートしているみたいですし、yamato-utils/utils.js はESモジュールでさえなくないですか?

    もしかして、なにかしらのビルドツールを使ってませんか?

    →現物を 質問本文に追記します。ビルドツールがよくわかっていません。
    私が使ったのは以下のものです

    〇VS Code(コードの編集のため)
    〇Command Prompt
    〇Power Shell
    〇Git bush
    〇Github Page(これもよくわかっていません。私はhttps://github.com/のサイトの意味で使っています)

  14. ご提示のコードには import してる部分がないようでした。

    もしかすると、FirebaseFunction→FirebaseFunctionsという打ち間違いが原因かもしれない、という気分になっています。これは応答の中でsが落ちてしまっただけかな……?

  15. @yamatoaita

    Questioner

    ChatGptとの履歴をみてきました。どうやら、エラーが起こっていた時にはFirebaseFunctionsと正しく書いていたようでした。その後、公開したパッケージ(importを書かなかったもの)には-sが抜けているようでした。こちらもエラーがでていますが。

    また、scriptタグで

        <script type = "module" src="linktree.js"></script>
    

    のようにindex.htmlに書き試してみました。すると、エラー

    utils.js:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec

    となってしまいました。 なかなか手ごわいです

  16. @lhankor_mhy

    たぶん、とりあえず、普通に script タグで https://raw.githubusercontent.com/yamatoaita/yamato-utils/refs/heads/main/utils.js のコードを読み込めば動作するようなきがします。

    ブラウザで動かす場合だと window.firebase が存在することを前提としているようなので、その前に Firebase の何かしらを読み込む必要もありそうです。

    というかこの utils.js の冒頭ってビルドツールが吐いたような見た目ですが、そのわりには質問者さんが理解して書いたとは思えないコメントがついているので、どこかからコピペしたか ChatGPT が生成したかなのでは。

    @yamatoaita JavaScript のモジュールの仕組みを理解しないまま適当に書いても泥沼なので、まずはまとまった資料で勉強してください。

  17. @yamatoaita

    Questioner

    @uasiさん

    Chatgdpが作ったものです。
    ーーーーーー
    @yamatoaita JavaScript のモジュールの仕組みを理解しないまま適当に書いても泥沼なので、まずはまとまった資料で勉強してください。
    ▶全くその通りでございます。 知識が0でやろうとしています。泥沼です。 まずは知識を蓄えます

  18. teratail の方でご解決されたようですから、このご質問もクローズされることをお勧めします。

This answer has been deleted for violation of our Terms of Service.

リポジトリ名についても、ありがとうございます。

必ず付けないと行けないんだと思ってました。
ありがとうございます

0Like

皆様 ありがとうございました。

Terailさんの方での回答にて「必要な時だけutils.jsの内容をコピーして使えば十分」というのがありました。

結果、必要な時だけ手動でコピペして使うことにしました。

ありがとうございました

0Like

Comments

  1. 解決したのであれば、本問をクローズしましょう。

Your answer might help someone💌