diff --git a/.github/workflows/build_ubi.yml b/.github/workflows/build_ubi.yml index 921b839704..d52b09683f 100644 --- a/.github/workflows/build_ubi.yml +++ b/.github/workflows/build_ubi.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 # cache: "yarn" # cache-dependency-path: "**/yarn.lock" - name: login to ironbank diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ea7aa176f3..a49f2e3d84 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 # cache: "yarn" # cache-dependency-path: "**/yarn.lock" - name: openc3.sh build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03fc00a7fa..98b5a094de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: working-directory: openc3 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 registry-url: "https://registry.npmjs.org" - name: Set up Python uses: actions/setup-python@v5 diff --git a/openc3-cosmos-init/Dockerfile b/openc3-cosmos-init/Dockerfile index 168882fbea..330f2b82c3 100644 --- a/openc3-cosmos-init/Dockerfile +++ b/openc3-cosmos-init/Dockerfile @@ -36,7 +36,7 @@ COPY ./plugins/packages/openc3-cosmos-demo/*.json packages/openc3-cosmos-demo/ ARG NPM_URL=https://registry.npmjs.org RUN yarn config set registry $NPM_URL && yarn --network-timeout 600000 -COPY ./plugins/docker-package-build.sh ./plugins/.eslintrc.cjs ./plugins/.nycrc ./ +COPY ./plugins/docker-package-build.sh ./plugins/eslint.config.mjs ./plugins/.nycrc ./ RUN chmod +x ./docker-package-build.sh COPY ./plugins/packages/openc3-tool-base/ packages/openc3-tool-base/ RUN ["/openc3/plugins/docker-package-build.sh", "openc3-tool-base"] diff --git a/openc3-cosmos-init/plugins/.eslintrc.cjs b/openc3-cosmos-init/plugins/.eslintrc.cjs deleted file mode 100644 index 1550d0a714..0000000000 --- a/openc3-cosmos-init/plugins/.eslintrc.cjs +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parserOptions: { - parser: '@babel/eslint-parser', - }, - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/.yarn/install-state.gz b/openc3-cosmos-init/plugins/.yarn/install-state.gz index a99ed10a54..6d8d6038ca 100644 Binary files a/openc3-cosmos-init/plugins/.yarn/install-state.gz and b/openc3-cosmos-init/plugins/.yarn/install-state.gz differ diff --git a/openc3-cosmos-init/plugins/.yarnrc.yml b/openc3-cosmos-init/plugins/.yarnrc.yml new file mode 100644 index 0000000000..3186f3f079 --- /dev/null +++ b/openc3-cosmos-init/plugins/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/openc3-cosmos-init/plugins/eslint.config.mjs b/openc3-cosmos-init/plugins/eslint.config.mjs new file mode 100644 index 0000000000..7ba5354a51 --- /dev/null +++ b/openc3-cosmos-init/plugins/eslint.config.mjs @@ -0,0 +1,54 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + ecmaVersion: 5, + sourceType: "commonjs", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/package.json b/openc3-cosmos-init/plugins/package.json index dd4f133b98..21cc699e80 100644 --- a/openc3-cosmos-init/plugins/package.json +++ b/openc3-cosmos-init/plugins/package.json @@ -3,5 +3,6 @@ "private": true, "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@1.22.22" } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.eslintrc.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.eslintrc.js deleted file mode 100644 index 753d3b863d..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/.eslintrc.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: ['plugin:prettier/recommended'], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - }, - parserOptions: { - parser: '@babel/eslint-parser', - }, -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/eslint.config.mjs new file mode 100644 index 0000000000..adfd651238 --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/eslint.config.mjs @@ -0,0 +1,42 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends("plugin:prettier/recommended"), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + ecmaVersion: 5, + sourceType: "commonjs", + + parserOptions: { + parser: "@babel/eslint-parser", + }, + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json index 87b8b04e54..5388f34fcf 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/package.json @@ -27,7 +27,7 @@ "@webpack-cli/generators": "^3.0.7", "babel-loader": "^9.2.1", "babel-plugin-istanbul": "7.0.0", - "eslint": "8.56.0", + "eslint": "9.16.0", "file-loader": "^6.2.0", "prettier": "3.3.3", "sass": "1.80.4", diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/eslint.config.mjs new file mode 100644 index 0000000000..f5b062c816 --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/eslint.config.mjs @@ -0,0 +1,62 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 5, + sourceType: "commonjs", + + parserOptions: { + parser: "@babel/eslint-parser", + }, + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/package.json index 9c3a9ec18b..319215d347 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/package.json @@ -14,7 +14,7 @@ "@rushstack/eslint-patch": "1.10.4", "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/package.json index 3feb537689..3f65928264 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-admin/package.json @@ -20,13 +20,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/package.json index f6b3b94e2d..417ffe7160 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-bucketexplorer/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/package.json index 42cfdf3b58..57f7357a5d 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdsender/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/eslint.config.mjs new file mode 100644 index 0000000000..b256144eee --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2022, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/package.json index c49240619c..4a10fdd3d0 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-cmdtlmserver/package.json @@ -21,13 +21,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/package.json index 31f239113c..761b7e3444 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/package.json @@ -21,13 +21,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/src/tools/DataExtractor/DataExtractor.vue b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/src/tools/DataExtractor/DataExtractor.vue index 05569c93ab..dacaddff1d 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/src/tools/DataExtractor/DataExtractor.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataextractor/src/tools/DataExtractor/DataExtractor.vue @@ -727,8 +727,8 @@ export default { } catch (e) { return } - this.startDateTime = startTemp.getTime() * 1_000_000 - this.endDateTime = endTemp.getTime() * 1_000_000 + this.startDateTime = startTemp.getTime() * 1000000 // TODO: eslint parser doesn't like 1_000_000 + this.endDateTime = endTemp.getTime() * 1000000 }, processItems: function () { // Check for a process in progress @@ -757,14 +757,12 @@ export default { return } // Check for a future End Time - if (new Date(this.endDateTime / 1_000_000) > Date.now()) { + if (new Date(this.endDateTime / 1000000) > Date.now()) { this.$notify.caution({ title: 'Note', body: `End date/time is greater than current date/time. Data will continue to stream in real-time until - ${new Date( - this.endDateTime / 1_000_000, - ).toISOString()} is reached.`, + ${new Date(this.endDateTime / 1000000).toISOString()} is reached.`, }) } @@ -999,7 +997,7 @@ export default { valueType, reducedType, ] = regularKey.split('__') - row[0] = new Date(packet['__time'] / 1_000_000).toISOString() + row[0] = new Date(packet['__time'] / 1000000).toISOString() row[1] = targetName row[2] = packetName } @@ -1048,8 +1046,8 @@ export default { if (dataExtractorRawData.length !== 0) { await this.createFile() } else if (this.fileCount === 0) { - let start = new Date(this.startDateTime / 1_000_000).toISOString() - let end = new Date(this.endDateTime / 1_000_000).toISOString() + let start = new Date(this.startDateTime / 1000000).toISOString() + let end = new Date(this.endDateTime / 1000000).toISOString() this.$notify.caution({ body: `No data found for the items in the requested time range of ${start} to ${end}`, }) diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/package.json index 6c7075d7d9..407ea5e93f 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DataViewer.vue b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DataViewer.vue index 73f2975acb..bf34e57cfa 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DataViewer.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DataViewer.vue @@ -380,8 +380,8 @@ export default { return } return { - start_time: startTemp.getTime() * 1_000_000, - end_time: endTemp ? endTemp.getTime() * 1_000_000 : null, + start_time: startTemp.getTime() * 1000000, + end_time: endTemp ? endTemp.getTime() * 1000000 : null, } }, allPackets: function () { @@ -477,7 +477,7 @@ export default { start: function () { this.autoStart = false // Check for a future start time - if (this.startEndTime.start_time > new Date().getTime() * 1_000_000) { + if (this.startEndTime.start_time > new Date().getTime() * 1000000) { this.warningText = 'Start date/time is in the future!' this.warning = true return diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DynamicComponent.vue b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DynamicComponent.vue index 7420a44e02..6972825168 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DynamicComponent.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-dataviewer/src/tools/DataViewer/DynamicComponent.vue @@ -53,8 +53,7 @@ export default { }, async mounted() { try { - /* eslint-disable-next-line */ - this.widgetType = await System.import(/* webpackIgnore: true */ this.url) + this.widgetType = await System.import(this.url) } catch (e) { throw new Error(`Unknown widget: ${this.name}`) } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/package.json index 090bebfb8f..abca8bf2b2 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-handbooks/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/package.json index e0a8c4c284..11fcee69f9 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-iframe/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/package.json index 467b45fd8f..7c361801ed 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-limitsmonitor/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/package.json index 4c790f08a9..cc60c20135 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-packetviewer/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/package.json index 2ecfdb68b3..633f010d47 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/package.json @@ -24,13 +24,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue index b3d3b60743..60447caba5 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/ScriptRunner.vue @@ -1644,7 +1644,6 @@ export default { let count = 0 for (let data of this.receivedEvents) { count += 1 - // eslint-disable-next-line // console.log(data) // Uncomment for debugging let index = 0 switch (data.type) { diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/annotations/regexAnnotator.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/annotations/regexAnnotator.js index 7a17d194b1..7d0de43884 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/annotations/regexAnnotator.js +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/annotations/regexAnnotator.js @@ -21,6 +21,8 @@ */ export default class RegexAnnotator { + // TODO: the eslint parser errors on these because of the # + // Not sure if this naming is needed for the Ace editor or something? #id #editor #pattern diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/mnemonicChecker.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/mnemonicChecker.js index 2680cf5327..bfaed44cb6 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/mnemonicChecker.js +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/mnemonicChecker.js @@ -57,7 +57,7 @@ export default class MnemonicChecker { }) } - checkText = async function (text) { + async checkText(text) { const { linesToCheck, linesToSkip } = text.split('\n').reduce( (result, line, index) => { line = line.trim() @@ -140,7 +140,7 @@ export default class MnemonicChecker { } } - _checkLines = async (linesToCheck) => { + async _checkLines(linesToCheck) { const problemLines = [] const targetGroups = groupBy( linesToCheck, diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/packetCompleter.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/packetCompleter.js index c02e4e70f5..978cfbc33d 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/packetCompleter.js +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/packetCompleter.js @@ -49,7 +49,7 @@ export default class PacketCompleter { }) } - getCompletions = function (editor, session, position, prefix, callback) { + getCompletions(_editor, session, position, _prefix, callback) { let matches = [] const lineBeforeCursor = session.doc.$lines[position.row].slice( 0, diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/tlmCompleter.js b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/tlmCompleter.js index af6b7b0d6a..580f86b9a9 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/tlmCompleter.js +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-scriptrunner/src/tools/ScriptRunner/autocomplete/tlmCompleter.js @@ -54,7 +54,7 @@ export default class TlmCompleter extends PacketCompleter { } // Override the parent's getCompletions to take advantage of the grouping by packet done in the constructor - getCompletions = function (editor, session, position, prefix, callback) { + getCompletions(_editor, session, position, _prefix, callback) { let matches = [] const lineBeforeCursor = session.doc.$lines[position.row].slice( 0, diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/package.json index 17de752ca7..687203d741 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tablemanager/package.json @@ -22,13 +22,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/package.json index d64b9c97c2..c478c31d11 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmgrapher/package.json @@ -24,13 +24,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/eslint.config.mjs new file mode 100644 index 0000000000..f099ec3f9e --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/eslint.config.mjs @@ -0,0 +1,58 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2020, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/package.json b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/package.json index baa8c9b05f..16e9f4457a 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-cosmos-tool-tlmviewer/package.json @@ -25,13 +25,14 @@ "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", "@vue/test-utils": "2.4.6", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.30.0", "prettier": "3.3.3", "sass": "1.80.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-tool-base/.eslintrc.cjs deleted file mode 100644 index 9548a63cec..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/.eslintrc.cjs +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/.prettierrc.js b/openc3-cosmos-init/plugins/packages/openc3-tool-base/.prettierrc.cjs similarity index 100% rename from openc3-cosmos-init/plugins/packages/openc3-tool-base/.prettierrc.js rename to openc3-cosmos-init/plugins/packages/openc3-tool-base/.prettierrc.cjs diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-tool-base/eslint.config.mjs new file mode 100644 index 0000000000..c3b2f3b2d5 --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/eslint.config.mjs @@ -0,0 +1,56 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + ecmaVersion: 2022, + sourceType: "module", + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/package.json b/openc3-cosmos-init/plugins/packages/openc3-tool-base/package.json index 1c51f82296..6d85ba0bbe 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/package.json @@ -5,7 +5,7 @@ "scripts": { "dev": "vite", "serve": "vite preview", - "lint": "eslint src --ext js", + "lint": "eslint src", "format": "prettier --write \"./**\"", "build": "vite build" }, @@ -23,11 +23,12 @@ "@babel/plugin-transform-modules-systemjs": "7.25.9", "@types/systemjs": "6.15.1", "@vitejs/plugin-vue": "5.1.5", - "eslint": "8.56.0", + "eslint": "9.16.0", "prettier": "3.3.3", "sass": "1.80.4", "serve": "14.2.4", "vite": "5.4.11", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html index 3494baf3bd..ae480434b8 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index-allow-http.html @@ -44,7 +44,7 @@ - + @@ -97,4 +97,4 @@ - \ No newline at end of file + diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html index 77b0be64af..753c574bd3 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/index.html @@ -44,7 +44,7 @@ - + @@ -97,4 +97,4 @@ - \ No newline at end of file + diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-5.9.5.min.js b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-5.9.5.min.js deleted file mode 100644 index 2691059571..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-5.9.5.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/* single-spa@5.9.5 - SystemJS - prod */ -System.register([],(function(t){"use strict";return{execute:function(){t({addErrorHandler:c,checkActivityFunctions:At,ensureJQuerySupport:pt,getAppNames:Tt,getAppStatus:Pt,getMountedApps:Ot,mountRootParcel:$,navigateToUrl:rt,pathToActiveWhen:Dt,registerApplication:bt,removeErrorHandler:s,setBootstrapMaxTime:J,setMountMaxTime:Q,setUnloadMaxTime:q,setUnmountMaxTime:V,start:Bt,triggerAppChange:Rt,unloadApplication:St,unregisterApplication:Nt});var n=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return bt},get unregisterApplication(){return Nt},get getMountedApps(){return Ot},get getAppStatus(){return Pt},get unloadApplication(){return St},get checkActivityFunctions(){return At},get getAppNames(){return Tt},get pathToActiveWhen(){return Dt},get navigateToUrl(){return rt},get triggerAppChange(){return Rt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return $},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return T},get MOUNTED(){return g},get UNLOADING(){return O},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return P}});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},u=[];function a(t,n,e){var r=l(t,n,e);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(e){var r=e===t;return n=n||r,!r})),n}function f(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var e=0;e=0&&nt[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function it(){It([],arguments)}function ut(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Z&&e===o||(Ct()?window.dispatchEvent(at(window.history.state,n)):It([])),r}}function at(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(tt){window.addEventListener("hashchange",it),window.addEventListener("popstate",it);var ct=window.addEventListener,st=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0)||D(nt[t],(function(t){return t===n})))return ct.apply(this,arguments);nt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0))return st.apply(this,arguments);nt[t]=nt[t].filter((function(t){return t!==n}))},window.history.pushState=ut(window.history.pushState,"pushState"),window.history.replaceState=ut(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=rt}function ft(t){var n=document.createElement("a");return n.href=t,n}var lt=!1;function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return ht.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return ht.call(this,e,window.removeEventListener,t,n,arguments)},lt=!0}}function ht(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){et.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var mt={};function dt(t){return Promise.resolve().then((function(){var n=mt[N(t)];if(!n)return t;if(t.status===p)return vt(t,n),t;if(t.status===O)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==T)return t;var e=t.status===T?Promise.resolve():z(t,"unload");return t.status=O,e.then((function(){return vt(t,n),t})).catch((function(e){return function(t,n,e){delete mt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(e,t,P),n.reject(e)}(t,n,e),t}))}))}function vt(t,n){delete mt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function wt(t,n,e,r){mt[N(t)]={app:t,resolve:e,reject:r},Object.defineProperty(mt[N(t)],"promise",{get:n})}function gt(t){return mt[t]}var Et=[];function yt(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return Et.forEach((function(i){var u=i.status!==P&&A(i);switch(i.status){case T:u&&o-i.loadErrorTime>=200&&e.push(i);break;case p:case h:u&&e.push(i);break;case m:case v:!u&>(N(i))?t.push(i):u&&r.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function Ot(){return Et.filter(b).map(N)}function Tt(){return Et.map(N)}function Pt(t){var n=D(Et,(function(n){return N(n)===t}));return n?n.status:null}function bt(t,n,r,o){var i=function(t,n,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===e(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,e){return n.indexOf(e)>=0?t:t.concat(e)}),[]);if(0!==r.length)throw Error(f(38,!1,n.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==e(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!Ut(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof e)throw Error(f(24,!1));if(!Ut(r))throw Error(f(22,!1))}(t,n,r,o),u.name=t,u.loadApp=n,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Dt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,r,o);if(-1!==Tt().indexOf(i.name))throw Error(f(21,!1,i.name));Et.push(U({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),tt&&(pt(),It())}function At(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Et.filter((function(n){return n.activeWhen(t)})).map(N)}function Nt(t){if(0===Et.filter((function(n){return N(n)===t})).length)throw Error(f(25,!1,t));return St(t).then((function(){var n=Et.map(N).indexOf(t);Et.splice(n,1)}))}function St(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var e=D(Et,(function(n){return N(n)===t}));if(!e)throw Error(f(27,!1,t));var r,o=gt(N(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){wt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,_t(e,o.resolve,o.reject)):r=new Promise((function(t,n){wt(e,(function(){return r}),t,n),_t(e,t,n)})),r}function _t(t,n,e){I(t).then(dt).then((function(){n(),setTimeout((function(){It()}))})).catch(e)}function Ut(t){return!t||"function"==typeof t||"object"===e(t)&&null!==t&&!Array.isArray(t)}function Dt(t,n){var e=function(t,n){var e=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Mt)return new Promise((function(t,e){Lt.push({resolve:t,reject:e,eventArguments:n})}));var e,o=yt(),u=o.appsToUnload,a=o.appsToUnmount,c=o.appsToLoad,s=o.appsToMount,f=!1,l=jt,h=jt=window.location.href;return Ct()?(Mt=!0,e=u.concat(c,a,s),w()):(e=c,d());function m(){f=!0}function d(){return Promise.resolve().then((function(){var t=c.map(Y);return Promise.all(t).then(y).then((function(){return[]})).catch((function(t){throw y(),t}))}))}function w(){return Promise.resolve().then((function(){if(window.dispatchEvent(new i(0===e.length?"single-spa:before-no-app-change":"single-spa:before-app-change",O(!0))),window.dispatchEvent(new i("single-spa:before-routing-event",O(!0,{cancelNavigation:m}))),f)return window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0))),E(),void rt(l);var n=u.map(dt),r=a.map(I).map((function(t){return t.then(dt)})).concat(n),o=Promise.all(r);o.then((function(){window.dispatchEvent(new i("single-spa:before-mount-routing-event",O(!0)))}));var p=c.map((function(t){return Y(t).then((function(t){return xt(t,o)}))})),h=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return xt(t,o)}));return o.catch((function(t){throw y(),t})).then((function(){return y(),Promise.all(p.concat(h)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(E)}))}))}function E(){var n=Ot();t.forEach((function(t){return t.resolve(n)}));try{var r=0===e.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new i(r,O())),window.dispatchEvent(new i("single-spa:routing-event",O()))}catch(t){setTimeout((function(){throw t}))}if(Mt=!1,Lt.length>0){var o=Lt;Lt=[],It(o)}return n}function y(){t.forEach((function(t){ot(t.eventArguments)})),ot(n)}function O(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,m={},d=(r(t={},g,[]),r(t,v,[]),r(t,p,[]),r(t,P,[]),t);o?(c.concat(s).forEach((function(t,n){E(t,g)})),u.forEach((function(t){E(t,p)})),a.forEach((function(t){E(t,v)}))):e.forEach((function(t){E(t)}));var w={detail:{newAppStatuses:m,appsByNewStatus:d,totalAppChanges:e.length,originalEvent:null==n?void 0:n[0],oldUrl:l,newUrl:h,navigationIsCanceled:f}};return i&&U(w.detail,i),w;function E(t,n){var e=N(t);n=n||Pt(e),m[e]=n,(d[n]=d[n]||[]).push(e)}}}function xt(t,n){return A(t)?R(t).then((function(t){return n.then((function(){return A(t)?B(t):t}))})):n.then((function(){return t}))}var Gt=!1;function Bt(t){var n;Gt=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,Z=n),tt&&It()}function Ct(){return Gt}tt&&setTimeout((function(){Gt||console.warn(f(1,!1))}),5e3);var Wt={getRawAppData:function(){return[].concat(Et)},reroute:It,NOT_LOADED:p,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:Nt};tt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Wt)}}})); -//# sourceMappingURL=single-spa.min.js.map diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-5.9.5.min.js.map b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-5.9.5.min.js.map deleted file mode 100644 index f5e44df6da..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-5.9.5.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"single-spa.min.js","sources":["../../node_modules/custom-event/index.js","../../src/applications/app-errors.js","../../src/applications/app.helpers.js","../../src/utils/assign.js","../../src/utils/find.js","../../src/lifecycles/lifecycle.helpers.js","../../src/lifecycles/bootstrap.js","../../src/lifecycles/unmount.js","../../src/lifecycles/mount.js","../../src/parcels/mount-parcel.js","../../src/lifecycles/update.js","../../src/lifecycles/prop.helpers.js","../../src/applications/timeouts.js","../../src/lifecycles/load.js","../../src/utils/runtime-environment.js","../../src/navigation/navigation-events.js","../../src/jquery-support.js","../../src/lifecycles/unload.js","../../src/applications/apps.js","../../src/navigation/reroute.js","../../src/start.js","../../src/devtools/devtools.js","../../src/single-spa.js"],"sourcesContent":["\nvar NativeCustomEvent = global.CustomEvent;\n\nfunction useNative () {\n try {\n var p = new NativeCustomEvent('cat', { detail: { foo: 'bar' } });\n return 'cat' === p.type && 'bar' === p.detail.foo;\n } catch (e) {\n }\n return false;\n}\n\n/**\n * Cross-browser `CustomEvent` constructor.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent.CustomEvent\n *\n * @public\n */\n\nmodule.exports = useNative() ? NativeCustomEvent :\n\n// IE >= 9\n'undefined' !== typeof document && 'function' === typeof document.createEvent ? function CustomEvent (type, params) {\n var e = document.createEvent('CustomEvent');\n if (params) {\n e.initCustomEvent(type, params.bubbles, params.cancelable, params.detail);\n } else {\n e.initCustomEvent(type, false, false, void 0);\n }\n return e;\n} :\n\n// IE <= 8\nfunction CustomEvent (type, params) {\n var e = document.createEventObject();\n e.type = type;\n if (params) {\n e.bubbles = Boolean(params.bubbles);\n e.cancelable = Boolean(params.cancelable);\n e.detail = params.detail;\n } else {\n e.bubbles = false;\n e.cancelable = false;\n e.detail = void 0;\n }\n return e;\n}\n","import { objectType, toName } from \"./app.helpers\";\n\nlet errorHandlers = [];\n\nexport function handleAppError(err, app, newStatus) {\n const transformedErr = transformErr(err, app, newStatus);\n\n if (errorHandlers.length) {\n errorHandlers.forEach((handler) => handler(transformedErr));\n } else {\n setTimeout(() => {\n throw transformedErr;\n });\n }\n}\n\nexport function addErrorHandler(handler) {\n if (typeof handler !== \"function\") {\n throw Error(\n formatErrorMessage(\n 28,\n __DEV__ && \"a single-spa error handler must be a function\"\n )\n );\n }\n\n errorHandlers.push(handler);\n}\n\nexport function removeErrorHandler(handler) {\n if (typeof handler !== \"function\") {\n throw Error(\n formatErrorMessage(\n 29,\n __DEV__ && \"a single-spa error handler must be a function\"\n )\n );\n }\n\n let removedSomething = false;\n errorHandlers = errorHandlers.filter((h) => {\n const isHandler = h === handler;\n removedSomething = removedSomething || isHandler;\n return !isHandler;\n });\n\n return removedSomething;\n}\n\nexport function formatErrorMessage(code, msg, ...args) {\n return `single-spa minified message #${code}: ${\n msg ? msg + \" \" : \"\"\n }See https://single-spa.js.org/error/?code=${code}${\n args.length ? `&arg=${args.join(\"&arg=\")}` : \"\"\n }`;\n}\n\nexport function transformErr(ogErr, appOrParcel, newStatus) {\n const errPrefix = `${objectType(appOrParcel)} '${toName(\n appOrParcel\n )}' died in status ${appOrParcel.status}: `;\n\n let result;\n\n if (ogErr instanceof Error) {\n try {\n ogErr.message = errPrefix + ogErr.message;\n } catch (err) {\n /* Some errors have read-only message properties, in which case there is nothing\n * that we can do.\n */\n }\n result = ogErr;\n } else {\n console.warn(\n formatErrorMessage(\n 30,\n __DEV__ &&\n `While ${appOrParcel.status}, '${toName(\n appOrParcel\n )}' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate.`,\n appOrParcel.status,\n toName(appOrParcel)\n )\n );\n try {\n result = Error(errPrefix + JSON.stringify(ogErr));\n } catch (err) {\n // If it's not an Error and you can't stringify it, then what else can you even do to it?\n result = ogErr;\n }\n }\n\n result.appOrParcelName = toName(appOrParcel);\n\n // We set the status after transforming the error so that the error message\n // references the state the application was in before the status change.\n appOrParcel.status = newStatus;\n\n return result;\n}\n","import { handleAppError } from \"./app-errors.js\";\n\n// App statuses\nexport const NOT_LOADED = \"NOT_LOADED\";\nexport const LOADING_SOURCE_CODE = \"LOADING_SOURCE_CODE\";\nexport const NOT_BOOTSTRAPPED = \"NOT_BOOTSTRAPPED\";\nexport const BOOTSTRAPPING = \"BOOTSTRAPPING\";\nexport const NOT_MOUNTED = \"NOT_MOUNTED\";\nexport const MOUNTING = \"MOUNTING\";\nexport const MOUNTED = \"MOUNTED\";\nexport const UPDATING = \"UPDATING\";\nexport const UNMOUNTING = \"UNMOUNTING\";\nexport const UNLOADING = \"UNLOADING\";\nexport const LOAD_ERROR = \"LOAD_ERROR\";\nexport const SKIP_BECAUSE_BROKEN = \"SKIP_BECAUSE_BROKEN\";\n\nexport function isActive(app) {\n return app.status === MOUNTED;\n}\n\nexport function shouldBeActive(app) {\n try {\n return app.activeWhen(window.location);\n } catch (err) {\n handleAppError(err, app, SKIP_BECAUSE_BROKEN);\n return false;\n }\n}\n\nexport function toName(app) {\n return app.name;\n}\n\nexport function isParcel(appOrParcel) {\n return Boolean(appOrParcel.unmountThisParcel);\n}\n\nexport function objectType(appOrParcel) {\n return isParcel(appOrParcel) ? \"parcel\" : \"application\";\n}\n","// Object.assign() is not available in IE11. And the babel compiled output for object spread\n// syntax checks a bunch of Symbol stuff and is almost a kb. So this function is the smaller replacement.\nexport function assign() {\n for (let i = arguments.length - 1; i > 0; i--) {\n for (let key in arguments[i]) {\n if (key === \"__proto__\") {\n continue;\n }\n arguments[i - 1][key] = arguments[i][key];\n }\n }\n\n return arguments[0];\n}\n","/* the array.prototype.find polyfill on npmjs.com is ~20kb (not worth it)\n * and lodash is ~200kb (not worth it)\n */\n\nexport function find(arr, func) {\n for (let i = 0; i < arr.length; i++) {\n if (func(arr[i])) {\n return arr[i];\n }\n }\n\n return null;\n}\n","import { find } from \"../utils/find.js\";\nimport { objectType, toName } from \"../applications/app.helpers.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\n\nexport function validLifecycleFn(fn) {\n return fn && (typeof fn === \"function\" || isArrayOfFns(fn));\n\n function isArrayOfFns(arr) {\n return (\n Array.isArray(arr) && !find(arr, (item) => typeof item !== \"function\")\n );\n }\n}\n\nexport function flattenFnArray(appOrParcel, lifecycle) {\n let fns = appOrParcel[lifecycle] || [];\n fns = Array.isArray(fns) ? fns : [fns];\n if (fns.length === 0) {\n fns = [() => Promise.resolve()];\n }\n\n const type = objectType(appOrParcel);\n const name = toName(appOrParcel);\n\n return function (props) {\n return fns.reduce((resultPromise, fn, index) => {\n return resultPromise.then(() => {\n const thisPromise = fn(props);\n return smellsLikeAPromise(thisPromise)\n ? thisPromise\n : Promise.reject(\n formatErrorMessage(\n 15,\n __DEV__ &&\n `Within ${type} ${name}, the lifecycle function ${lifecycle} at array index ${index} did not return a promise`,\n type,\n name,\n lifecycle,\n index\n )\n );\n });\n }, Promise.resolve());\n };\n}\n\nexport function smellsLikeAPromise(promise) {\n return (\n promise &&\n typeof promise.then === \"function\" &&\n typeof promise.catch === \"function\"\n );\n}\n","import {\n NOT_BOOTSTRAPPED,\n BOOTSTRAPPING,\n NOT_MOUNTED,\n SKIP_BECAUSE_BROKEN,\n} from \"../applications/app.helpers.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\nimport { handleAppError, transformErr } from \"../applications/app-errors.js\";\n\nexport function toBootstrapPromise(appOrParcel, hardFail) {\n return Promise.resolve().then(() => {\n if (appOrParcel.status !== NOT_BOOTSTRAPPED) {\n return appOrParcel;\n }\n\n appOrParcel.status = BOOTSTRAPPING;\n\n if (!appOrParcel.bootstrap) {\n // Default implementation of bootstrap\n return Promise.resolve().then(successfulBootstrap);\n }\n\n return reasonableTime(appOrParcel, \"bootstrap\")\n .then(successfulBootstrap)\n .catch((err) => {\n if (hardFail) {\n throw transformErr(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n } else {\n handleAppError(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n return appOrParcel;\n }\n });\n });\n\n function successfulBootstrap() {\n appOrParcel.status = NOT_MOUNTED;\n return appOrParcel;\n }\n}\n","import {\n UNMOUNTING,\n NOT_MOUNTED,\n MOUNTED,\n SKIP_BECAUSE_BROKEN,\n} from \"../applications/app.helpers.js\";\nimport { handleAppError, transformErr } from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\n\nexport function toUnmountPromise(appOrParcel, hardFail) {\n return Promise.resolve().then(() => {\n if (appOrParcel.status !== MOUNTED) {\n return appOrParcel;\n }\n appOrParcel.status = UNMOUNTING;\n\n const unmountChildrenParcels = Object.keys(\n appOrParcel.parcels\n ).map((parcelId) => appOrParcel.parcels[parcelId].unmountThisParcel());\n\n let parcelError;\n\n return Promise.all(unmountChildrenParcels)\n .then(unmountAppOrParcel, (parcelError) => {\n // There is a parcel unmount error\n return unmountAppOrParcel().then(() => {\n // Unmounting the app/parcel succeeded, but unmounting its children parcels did not\n const parentError = Error(parcelError.message);\n if (hardFail) {\n throw transformErr(parentError, appOrParcel, SKIP_BECAUSE_BROKEN);\n } else {\n handleAppError(parentError, appOrParcel, SKIP_BECAUSE_BROKEN);\n }\n });\n })\n .then(() => appOrParcel);\n\n function unmountAppOrParcel() {\n // We always try to unmount the appOrParcel, even if the children parcels failed to unmount.\n return reasonableTime(appOrParcel, \"unmount\")\n .then(() => {\n // The appOrParcel needs to stay in a broken status if its children parcels fail to unmount\n if (!parcelError) {\n appOrParcel.status = NOT_MOUNTED;\n }\n })\n .catch((err) => {\n if (hardFail) {\n throw transformErr(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n } else {\n handleAppError(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n }\n });\n }\n });\n}\n","import {\n NOT_MOUNTED,\n MOUNTED,\n SKIP_BECAUSE_BROKEN,\n} from \"../applications/app.helpers.js\";\nimport { handleAppError, transformErr } from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\nimport CustomEvent from \"custom-event\";\nimport { toUnmountPromise } from \"./unmount.js\";\n\nlet beforeFirstMountFired = false;\nlet firstMountFired = false;\n\nexport function toMountPromise(appOrParcel, hardFail) {\n return Promise.resolve().then(() => {\n if (appOrParcel.status !== NOT_MOUNTED) {\n return appOrParcel;\n }\n\n if (!beforeFirstMountFired) {\n window.dispatchEvent(new CustomEvent(\"single-spa:before-first-mount\"));\n beforeFirstMountFired = true;\n }\n\n return reasonableTime(appOrParcel, \"mount\")\n .then(() => {\n appOrParcel.status = MOUNTED;\n\n if (!firstMountFired) {\n window.dispatchEvent(new CustomEvent(\"single-spa:first-mount\"));\n firstMountFired = true;\n }\n\n return appOrParcel;\n })\n .catch((err) => {\n // If we fail to mount the appOrParcel, we should attempt to unmount it before putting in SKIP_BECAUSE_BROKEN\n // We temporarily put the appOrParcel into MOUNTED status so that toUnmountPromise actually attempts to unmount it\n // instead of just doing a no-op.\n appOrParcel.status = MOUNTED;\n return toUnmountPromise(appOrParcel, true).then(\n setSkipBecauseBroken,\n setSkipBecauseBroken\n );\n\n function setSkipBecauseBroken() {\n if (!hardFail) {\n handleAppError(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n return appOrParcel;\n } else {\n throw transformErr(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n }\n }\n });\n });\n}\n","import {\n validLifecycleFn,\n flattenFnArray,\n} from \"../lifecycles/lifecycle.helpers.js\";\nimport {\n NOT_BOOTSTRAPPED,\n NOT_MOUNTED,\n MOUNTED,\n LOADING_SOURCE_CODE,\n SKIP_BECAUSE_BROKEN,\n toName,\n} from \"../applications/app.helpers.js\";\nimport { toBootstrapPromise } from \"../lifecycles/bootstrap.js\";\nimport { toMountPromise } from \"../lifecycles/mount.js\";\nimport { toUpdatePromise } from \"../lifecycles/update.js\";\nimport { toUnmountPromise } from \"../lifecycles/unmount.js\";\nimport { ensureValidAppTimeouts } from \"../applications/timeouts.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\n\nlet parcelCount = 0;\nconst rootParcels = { parcels: {} };\n\n// This is a public api, exported to users of single-spa\nexport function mountRootParcel() {\n return mountParcel.apply(rootParcels, arguments);\n}\n\nexport function mountParcel(config, customProps) {\n const owningAppOrParcel = this;\n\n // Validate inputs\n if (!config || (typeof config !== \"object\" && typeof config !== \"function\")) {\n throw Error(\n formatErrorMessage(\n 2,\n __DEV__ &&\n \"Cannot mount parcel without a config object or config loading function\"\n )\n );\n }\n\n if (config.name && typeof config.name !== \"string\") {\n throw Error(\n formatErrorMessage(\n 3,\n __DEV__ &&\n `Parcel name must be a string, if provided. Was given ${typeof config.name}`,\n typeof config.name\n )\n );\n }\n\n if (typeof customProps !== \"object\") {\n throw Error(\n formatErrorMessage(\n 4,\n __DEV__ &&\n `Parcel ${name} has invalid customProps -- must be an object but was given ${typeof customProps}`,\n name,\n typeof customProps\n )\n );\n }\n\n if (!customProps.domElement) {\n throw Error(\n formatErrorMessage(\n 5,\n __DEV__ &&\n `Parcel ${name} cannot be mounted without a domElement provided as a prop`,\n name\n )\n );\n }\n\n const id = parcelCount++;\n\n const passedConfigLoadingFunction = typeof config === \"function\";\n const configLoadingFunction = passedConfigLoadingFunction\n ? config\n : () => Promise.resolve(config);\n\n // Internal representation\n const parcel = {\n id,\n parcels: {},\n status: passedConfigLoadingFunction\n ? LOADING_SOURCE_CODE\n : NOT_BOOTSTRAPPED,\n customProps,\n parentName: toName(owningAppOrParcel),\n unmountThisParcel() {\n return mountPromise\n .then(() => {\n if (parcel.status !== MOUNTED) {\n throw Error(\n formatErrorMessage(\n 6,\n __DEV__ &&\n `Cannot unmount parcel '${name}' -- it is in a ${parcel.status} status`,\n name,\n parcel.status\n )\n );\n }\n return toUnmountPromise(parcel, true);\n })\n .then((value) => {\n if (parcel.parentName) {\n delete owningAppOrParcel.parcels[parcel.id];\n }\n\n return value;\n })\n .then((value) => {\n resolveUnmount(value);\n return value;\n })\n .catch((err) => {\n parcel.status = SKIP_BECAUSE_BROKEN;\n rejectUnmount(err);\n throw err;\n });\n },\n };\n\n // We return an external representation\n let externalRepresentation;\n\n // Add to owning app or parcel\n owningAppOrParcel.parcels[id] = parcel;\n\n let loadPromise = configLoadingFunction();\n\n if (!loadPromise || typeof loadPromise.then !== \"function\") {\n throw Error(\n formatErrorMessage(\n 7,\n __DEV__ &&\n `When mounting a parcel, the config loading function must return a promise that resolves with the parcel config`\n )\n );\n }\n\n loadPromise = loadPromise.then((config) => {\n if (!config) {\n throw Error(\n formatErrorMessage(\n 8,\n __DEV__ &&\n `When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config`\n )\n );\n }\n\n const name = config.name || `parcel-${id}`;\n\n if (\n // ES Module objects don't have the object prototype\n Object.prototype.hasOwnProperty.call(config, \"bootstrap\") &&\n !validLifecycleFn(config.bootstrap)\n ) {\n throw Error(\n formatErrorMessage(\n 9,\n __DEV__ && `Parcel ${name} provided an invalid bootstrap function`,\n name\n )\n );\n }\n\n if (!validLifecycleFn(config.mount)) {\n throw Error(\n formatErrorMessage(\n 10,\n __DEV__ && `Parcel ${name} must have a valid mount function`,\n name\n )\n );\n }\n\n if (!validLifecycleFn(config.unmount)) {\n throw Error(\n formatErrorMessage(\n 11,\n __DEV__ && `Parcel ${name} must have a valid unmount function`,\n name\n )\n );\n }\n\n if (config.update && !validLifecycleFn(config.update)) {\n throw Error(\n formatErrorMessage(\n 12,\n __DEV__ && `Parcel ${name} provided an invalid update function`,\n name\n )\n );\n }\n\n const bootstrap = flattenFnArray(config, \"bootstrap\");\n const mount = flattenFnArray(config, \"mount\");\n const unmount = flattenFnArray(config, \"unmount\");\n\n parcel.status = NOT_BOOTSTRAPPED;\n parcel.name = name;\n parcel.bootstrap = bootstrap;\n parcel.mount = mount;\n parcel.unmount = unmount;\n parcel.timeouts = ensureValidAppTimeouts(config.timeouts);\n\n if (config.update) {\n parcel.update = flattenFnArray(config, \"update\");\n externalRepresentation.update = function (customProps) {\n parcel.customProps = customProps;\n\n return promiseWithoutReturnValue(toUpdatePromise(parcel));\n };\n }\n });\n\n // Start bootstrapping and mounting\n // The .then() causes the work to be put on the event loop instead of happening immediately\n const bootstrapPromise = loadPromise.then(() =>\n toBootstrapPromise(parcel, true)\n );\n const mountPromise = bootstrapPromise.then(() =>\n toMountPromise(parcel, true)\n );\n\n let resolveUnmount, rejectUnmount;\n\n const unmountPromise = new Promise((resolve, reject) => {\n resolveUnmount = resolve;\n rejectUnmount = reject;\n });\n\n externalRepresentation = {\n mount() {\n return promiseWithoutReturnValue(\n Promise.resolve().then(() => {\n if (parcel.status !== NOT_MOUNTED) {\n throw Error(\n formatErrorMessage(\n 13,\n __DEV__ &&\n `Cannot mount parcel '${name}' -- it is in a ${parcel.status} status`,\n name,\n parcel.status\n )\n );\n }\n\n // Add to owning app or parcel\n owningAppOrParcel.parcels[id] = parcel;\n\n return toMountPromise(parcel);\n })\n );\n },\n unmount() {\n return promiseWithoutReturnValue(parcel.unmountThisParcel());\n },\n getStatus() {\n return parcel.status;\n },\n loadPromise: promiseWithoutReturnValue(loadPromise),\n bootstrapPromise: promiseWithoutReturnValue(bootstrapPromise),\n mountPromise: promiseWithoutReturnValue(mountPromise),\n unmountPromise: promiseWithoutReturnValue(unmountPromise),\n };\n\n return externalRepresentation;\n}\n\nfunction promiseWithoutReturnValue(promise) {\n return promise.then(() => null);\n}\n","import {\n UPDATING,\n MOUNTED,\n SKIP_BECAUSE_BROKEN,\n toName,\n} from \"../applications/app.helpers.js\";\nimport {\n transformErr,\n formatErrorMessage,\n} from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\n\nexport function toUpdatePromise(parcel) {\n return Promise.resolve().then(() => {\n if (parcel.status !== MOUNTED) {\n throw Error(\n formatErrorMessage(\n 32,\n __DEV__ &&\n `Cannot update parcel '${toName(\n parcel\n )}' because it is not mounted`,\n toName(parcel)\n )\n );\n }\n\n parcel.status = UPDATING;\n\n return reasonableTime(parcel, \"update\")\n .then(() => {\n parcel.status = MOUNTED;\n return parcel;\n })\n .catch((err) => {\n throw transformErr(err, parcel, SKIP_BECAUSE_BROKEN);\n });\n });\n}\n","import * as singleSpa from \"../single-spa.js\";\nimport { mountParcel } from \"../parcels/mount-parcel.js\";\nimport { assign } from \"../utils/assign.js\";\nimport { isParcel, toName } from \"../applications/app.helpers.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\n\nexport function getProps(appOrParcel) {\n const name = toName(appOrParcel);\n let customProps =\n typeof appOrParcel.customProps === \"function\"\n ? appOrParcel.customProps(name, window.location)\n : appOrParcel.customProps;\n if (\n typeof customProps !== \"object\" ||\n customProps === null ||\n Array.isArray(customProps)\n ) {\n customProps = {};\n console.warn(\n formatErrorMessage(\n 40,\n __DEV__ &&\n `single-spa: ${name}'s customProps function must return an object. Received ${customProps}`\n ),\n name,\n customProps\n );\n }\n const result = assign({}, customProps, {\n name,\n mountParcel: mountParcel.bind(appOrParcel),\n singleSpa,\n });\n\n if (isParcel(appOrParcel)) {\n result.unmountSelf = appOrParcel.unmountThisParcel;\n }\n\n return result;\n}\n","import { assign } from \"../utils/assign\";\nimport { getProps } from \"../lifecycles/prop.helpers\";\nimport { objectType, toName } from \"./app.helpers\";\nimport { formatErrorMessage } from \"./app-errors\";\n\nconst defaultWarningMillis = 1000;\n\nconst globalTimeoutConfig = {\n bootstrap: {\n millis: 4000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n mount: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n unmount: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n unload: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n update: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n};\n\nexport function setBootstrapMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 16,\n __DEV__ &&\n `bootstrap max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.bootstrap = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setMountMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 17,\n __DEV__ &&\n `mount max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.mount = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setUnmountMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 18,\n __DEV__ &&\n `unmount max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.unmount = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setUnloadMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 19,\n __DEV__ &&\n `unload max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.unload = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function reasonableTime(appOrParcel, lifecycle) {\n const timeoutConfig = appOrParcel.timeouts[lifecycle];\n const warningPeriod = timeoutConfig.warningMillis;\n const type = objectType(appOrParcel);\n\n return new Promise((resolve, reject) => {\n let finished = false;\n let errored = false;\n\n appOrParcel[lifecycle](getProps(appOrParcel))\n .then((val) => {\n finished = true;\n resolve(val);\n })\n .catch((val) => {\n finished = true;\n reject(val);\n });\n\n setTimeout(() => maybeTimingOut(1), warningPeriod);\n setTimeout(() => maybeTimingOut(true), timeoutConfig.millis);\n\n const errMsg = formatErrorMessage(\n 31,\n __DEV__ &&\n `Lifecycle function ${lifecycle} for ${type} ${toName(\n appOrParcel\n )} lifecycle did not resolve or reject for ${timeoutConfig.millis} ms.`,\n lifecycle,\n type,\n toName(appOrParcel),\n timeoutConfig.millis\n );\n\n function maybeTimingOut(shouldError) {\n if (!finished) {\n if (shouldError === true) {\n errored = true;\n if (timeoutConfig.dieOnTimeout) {\n reject(Error(errMsg));\n } else {\n console.error(errMsg);\n //don't resolve or reject, we're waiting this one out\n }\n } else if (!errored) {\n const numWarnings = shouldError;\n const numMillis = numWarnings * warningPeriod;\n console.warn(errMsg);\n if (numMillis + warningPeriod < timeoutConfig.millis) {\n setTimeout(() => maybeTimingOut(numWarnings + 1), warningPeriod);\n }\n }\n }\n }\n });\n}\n\nexport function ensureValidAppTimeouts(timeouts) {\n const result = {};\n\n for (let key in globalTimeoutConfig) {\n result[key] = assign(\n {},\n globalTimeoutConfig[key],\n (timeouts && timeouts[key]) || {}\n );\n }\n\n return result;\n}\n","import {\n LOAD_ERROR,\n NOT_BOOTSTRAPPED,\n LOADING_SOURCE_CODE,\n SKIP_BECAUSE_BROKEN,\n NOT_LOADED,\n objectType,\n toName,\n} from \"../applications/app.helpers.js\";\nimport { ensureValidAppTimeouts } from \"../applications/timeouts.js\";\nimport {\n handleAppError,\n formatErrorMessage,\n} from \"../applications/app-errors.js\";\nimport {\n flattenFnArray,\n smellsLikeAPromise,\n validLifecycleFn,\n} from \"./lifecycle.helpers.js\";\nimport { getProps } from \"./prop.helpers.js\";\nimport { assign } from \"../utils/assign.js\";\n\nexport function toLoadPromise(app) {\n return Promise.resolve().then(() => {\n if (app.loadPromise) {\n return app.loadPromise;\n }\n\n if (app.status !== NOT_LOADED && app.status !== LOAD_ERROR) {\n return app;\n }\n\n app.status = LOADING_SOURCE_CODE;\n\n let appOpts, isUserErr;\n\n return (app.loadPromise = Promise.resolve()\n .then(() => {\n const loadPromise = app.loadApp(getProps(app));\n if (!smellsLikeAPromise(loadPromise)) {\n // The name of the app will be prepended to this error message inside of the handleAppError function\n isUserErr = true;\n throw Error(\n formatErrorMessage(\n 33,\n __DEV__ &&\n `single-spa loading function did not return a promise. Check the second argument to registerApplication('${toName(\n app\n )}', loadingFunction, activityFunction)`,\n toName(app)\n )\n );\n }\n return loadPromise.then((val) => {\n app.loadErrorTime = null;\n\n appOpts = val;\n\n let validationErrMessage, validationErrCode;\n\n if (typeof appOpts !== \"object\") {\n validationErrCode = 34;\n if (__DEV__) {\n validationErrMessage = `does not export anything`;\n }\n }\n\n if (\n // ES Modules don't have the Object prototype\n Object.prototype.hasOwnProperty.call(appOpts, \"bootstrap\") &&\n !validLifecycleFn(appOpts.bootstrap)\n ) {\n validationErrCode = 35;\n if (__DEV__) {\n validationErrMessage = `does not export a valid bootstrap function or array of functions`;\n }\n }\n\n if (!validLifecycleFn(appOpts.mount)) {\n validationErrCode = 36;\n if (__DEV__) {\n validationErrMessage = `does not export a mount function or array of functions`;\n }\n }\n\n if (!validLifecycleFn(appOpts.unmount)) {\n validationErrCode = 37;\n if (__DEV__) {\n validationErrMessage = `does not export a unmount function or array of functions`;\n }\n }\n\n const type = objectType(appOpts);\n\n if (validationErrCode) {\n let appOptsStr;\n try {\n appOptsStr = JSON.stringify(appOpts);\n } catch {}\n console.error(\n formatErrorMessage(\n validationErrCode,\n __DEV__ &&\n `The loading function for single-spa ${type} '${toName(\n app\n )}' resolved with the following, which does not have bootstrap, mount, and unmount functions`,\n type,\n toName(app),\n appOptsStr\n ),\n appOpts\n );\n handleAppError(validationErrMessage, app, SKIP_BECAUSE_BROKEN);\n return app;\n }\n\n if (appOpts.devtools && appOpts.devtools.overlays) {\n app.devtools.overlays = assign(\n {},\n app.devtools.overlays,\n appOpts.devtools.overlays\n );\n }\n\n app.status = NOT_BOOTSTRAPPED;\n app.bootstrap = flattenFnArray(appOpts, \"bootstrap\");\n app.mount = flattenFnArray(appOpts, \"mount\");\n app.unmount = flattenFnArray(appOpts, \"unmount\");\n app.unload = flattenFnArray(appOpts, \"unload\");\n app.timeouts = ensureValidAppTimeouts(appOpts.timeouts);\n\n delete app.loadPromise;\n\n return app;\n });\n })\n .catch((err) => {\n delete app.loadPromise;\n\n let newStatus;\n if (isUserErr) {\n newStatus = SKIP_BECAUSE_BROKEN;\n } else {\n newStatus = LOAD_ERROR;\n app.loadErrorTime = new Date().getTime();\n }\n handleAppError(err, app, newStatus);\n\n return app;\n }));\n });\n}\n","export const isInBrowser = typeof window !== \"undefined\";\n","import { reroute } from \"./reroute.js\";\nimport { find } from \"../utils/find.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\nimport { isInBrowser } from \"../utils/runtime-environment.js\";\nimport { isStarted } from \"../start.js\";\n\n/* We capture navigation event listeners so that we can make sure\n * that application navigation listeners are not called until\n * single-spa has ensured that the correct applications are\n * unmounted and mounted.\n */\nconst capturedEventListeners = {\n hashchange: [],\n popstate: [],\n};\n\nexport const routingEventsListeningTo = [\"hashchange\", \"popstate\"];\n\nexport function navigateToUrl(obj) {\n let url;\n if (typeof obj === \"string\") {\n url = obj;\n } else if (this && this.href) {\n url = this.href;\n } else if (\n obj &&\n obj.currentTarget &&\n obj.currentTarget.href &&\n obj.preventDefault\n ) {\n url = obj.currentTarget.href;\n obj.preventDefault();\n } else {\n throw Error(\n formatErrorMessage(\n 14,\n __DEV__ &&\n `singleSpaNavigate/navigateToUrl must be either called with a string url, with an tag as its context, or with an event whose currentTarget is an tag`\n )\n );\n }\n\n const current = parseUri(window.location.href);\n const destination = parseUri(url);\n\n if (url.indexOf(\"#\") === 0) {\n window.location.hash = destination.hash;\n } else if (current.host !== destination.host && destination.host) {\n if (process.env.BABEL_ENV === \"test\") {\n return { wouldHaveReloadedThePage: true };\n } else {\n window.location.href = url;\n }\n } else if (\n destination.pathname === current.pathname &&\n destination.search === current.search\n ) {\n window.location.hash = destination.hash;\n } else {\n // different path, host, or query params\n window.history.pushState(null, null, url);\n }\n}\n\nexport function callCapturedEventListeners(eventArguments) {\n if (eventArguments) {\n const eventType = eventArguments[0].type;\n if (routingEventsListeningTo.indexOf(eventType) >= 0) {\n capturedEventListeners[eventType].forEach((listener) => {\n try {\n // The error thrown by application event listener should not break single-spa down.\n // Just like https://github.com/single-spa/single-spa/blob/85f5042dff960e40936f3a5069d56fc9477fac04/src/navigation/reroute.js#L140-L146 did\n listener.apply(this, eventArguments);\n } catch (e) {\n setTimeout(() => {\n throw e;\n });\n }\n });\n }\n }\n}\n\nlet urlRerouteOnly;\n\nexport function setUrlRerouteOnly(val) {\n urlRerouteOnly = val;\n}\n\nfunction urlReroute() {\n reroute([], arguments);\n}\n\nfunction patchedUpdateState(updateState, methodName) {\n return function () {\n const urlBefore = window.location.href;\n const result = updateState.apply(this, arguments);\n const urlAfter = window.location.href;\n\n if (!urlRerouteOnly || urlBefore !== urlAfter) {\n if (isStarted()) {\n // fire an artificial popstate event once single-spa is started,\n // so that single-spa applications know about routing that\n // occurs in a different application\n window.dispatchEvent(\n createPopStateEvent(window.history.state, methodName)\n );\n } else {\n // do not fire an artificial popstate event before single-spa is started,\n // since no single-spa applications need to know about routing events\n // outside of their own router.\n reroute([]);\n }\n }\n\n return result;\n };\n}\n\nfunction createPopStateEvent(state, originalMethodName) {\n // https://github.com/single-spa/single-spa/issues/224 and https://github.com/single-spa/single-spa-angular/issues/49\n // We need a popstate event even though the browser doesn't do one by default when you call replaceState, so that\n // all the applications can reroute. We explicitly identify this extraneous event by setting singleSpa=true and\n // singleSpaTrigger= on the event instance.\n let evt;\n try {\n evt = new PopStateEvent(\"popstate\", { state });\n } catch (err) {\n // IE 11 compatibility https://github.com/single-spa/single-spa/issues/299\n // https://docs.microsoft.com/en-us/openspecs/ie_standards/ms-html5e/bd560f47-b349-4d2c-baa8-f1560fb489dd\n evt = document.createEvent(\"PopStateEvent\");\n evt.initPopStateEvent(\"popstate\", false, false, state);\n }\n evt.singleSpa = true;\n evt.singleSpaTrigger = originalMethodName;\n return evt;\n}\n\nif (isInBrowser) {\n // We will trigger an app change for any routing events.\n window.addEventListener(\"hashchange\", urlReroute);\n window.addEventListener(\"popstate\", urlReroute);\n\n // Monkeypatch addEventListener so that we can ensure correct timing\n const originalAddEventListener = window.addEventListener;\n const originalRemoveEventListener = window.removeEventListener;\n window.addEventListener = function (eventName, fn) {\n if (typeof fn === \"function\") {\n if (\n routingEventsListeningTo.indexOf(eventName) >= 0 &&\n !find(capturedEventListeners[eventName], (listener) => listener === fn)\n ) {\n capturedEventListeners[eventName].push(fn);\n return;\n }\n }\n\n return originalAddEventListener.apply(this, arguments);\n };\n\n window.removeEventListener = function (eventName, listenerFn) {\n if (typeof listenerFn === \"function\") {\n if (routingEventsListeningTo.indexOf(eventName) >= 0) {\n capturedEventListeners[eventName] = capturedEventListeners[\n eventName\n ].filter((fn) => fn !== listenerFn);\n return;\n }\n }\n\n return originalRemoveEventListener.apply(this, arguments);\n };\n\n window.history.pushState = patchedUpdateState(\n window.history.pushState,\n \"pushState\"\n );\n window.history.replaceState = patchedUpdateState(\n window.history.replaceState,\n \"replaceState\"\n );\n\n if (window.singleSpaNavigate) {\n console.warn(\n formatErrorMessage(\n 41,\n __DEV__ &&\n \"single-spa has been loaded twice on the page. This can result in unexpected behavior.\"\n )\n );\n } else {\n /* For convenience in `onclick` attributes, we expose a global function for navigating to\n * whatever an tag's href is.\n */\n window.singleSpaNavigate = navigateToUrl;\n }\n}\n\nfunction parseUri(str) {\n const anchor = document.createElement(\"a\");\n anchor.href = str;\n return anchor;\n}\n","import { routingEventsListeningTo } from \"./navigation/navigation-events.js\";\n\nlet hasInitialized = false;\n\nexport function ensureJQuerySupport(jQuery = window.jQuery) {\n if (!jQuery) {\n if (window.$ && window.$.fn && window.$.fn.jquery) {\n jQuery = window.$;\n }\n }\n\n if (jQuery && !hasInitialized) {\n const originalJQueryOn = jQuery.fn.on;\n const originalJQueryOff = jQuery.fn.off;\n\n jQuery.fn.on = function (eventString, fn) {\n return captureRoutingEvents.call(\n this,\n originalJQueryOn,\n window.addEventListener,\n eventString,\n fn,\n arguments\n );\n };\n\n jQuery.fn.off = function (eventString, fn) {\n return captureRoutingEvents.call(\n this,\n originalJQueryOff,\n window.removeEventListener,\n eventString,\n fn,\n arguments\n );\n };\n\n hasInitialized = true;\n }\n}\n\nfunction captureRoutingEvents(\n originalJQueryFunction,\n nativeFunctionToCall,\n eventString,\n fn,\n originalArgs\n) {\n if (typeof eventString !== \"string\") {\n return originalJQueryFunction.apply(this, originalArgs);\n }\n\n const eventNames = eventString.split(/\\s+/);\n eventNames.forEach((eventName) => {\n if (routingEventsListeningTo.indexOf(eventName) >= 0) {\n nativeFunctionToCall(eventName, fn);\n eventString = eventString.replace(eventName, \"\");\n }\n });\n\n if (eventString.trim() === \"\") {\n return this;\n } else {\n return originalJQueryFunction.apply(this, originalArgs);\n }\n}\n","import {\n NOT_MOUNTED,\n UNLOADING,\n NOT_LOADED,\n LOAD_ERROR,\n SKIP_BECAUSE_BROKEN,\n toName,\n} from \"../applications/app.helpers.js\";\nimport { handleAppError } from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\n\nconst appsToUnload = {};\n\nexport function toUnloadPromise(app) {\n return Promise.resolve().then(() => {\n const unloadInfo = appsToUnload[toName(app)];\n\n if (!unloadInfo) {\n /* No one has called unloadApplication for this app,\n */\n return app;\n }\n\n if (app.status === NOT_LOADED) {\n /* This app is already unloaded. We just need to clean up\n * anything that still thinks we need to unload the app.\n */\n finishUnloadingApp(app, unloadInfo);\n return app;\n }\n\n if (app.status === UNLOADING) {\n /* Both unloadApplication and reroute want to unload this app.\n * It only needs to be done once, though.\n */\n return unloadInfo.promise.then(() => app);\n }\n\n if (app.status !== NOT_MOUNTED && app.status !== LOAD_ERROR) {\n /* The app cannot be unloaded until it is unmounted.\n */\n return app;\n }\n\n const unloadPromise =\n app.status === LOAD_ERROR\n ? Promise.resolve()\n : reasonableTime(app, \"unload\");\n\n app.status = UNLOADING;\n\n return unloadPromise\n .then(() => {\n finishUnloadingApp(app, unloadInfo);\n return app;\n })\n .catch((err) => {\n errorUnloadingApp(app, unloadInfo, err);\n return app;\n });\n });\n}\n\nfunction finishUnloadingApp(app, unloadInfo) {\n delete appsToUnload[toName(app)];\n\n // Unloaded apps don't have lifecycles\n delete app.bootstrap;\n delete app.mount;\n delete app.unmount;\n delete app.unload;\n\n app.status = NOT_LOADED;\n\n /* resolve the promise of whoever called unloadApplication.\n * This should be done after all other cleanup/bookkeeping\n */\n unloadInfo.resolve();\n}\n\nfunction errorUnloadingApp(app, unloadInfo, err) {\n delete appsToUnload[toName(app)];\n\n // Unloaded apps don't have lifecycles\n delete app.bootstrap;\n delete app.mount;\n delete app.unmount;\n delete app.unload;\n\n handleAppError(err, app, SKIP_BECAUSE_BROKEN);\n unloadInfo.reject(err);\n}\n\nexport function addAppToUnload(app, promiseGetter, resolve, reject) {\n appsToUnload[toName(app)] = { app, resolve, reject };\n Object.defineProperty(appsToUnload[toName(app)], \"promise\", {\n get: promiseGetter,\n });\n}\n\nexport function getAppUnloadInfo(appName) {\n return appsToUnload[appName];\n}\n","import { ensureJQuerySupport } from \"../jquery-support.js\";\nimport {\n isActive,\n toName,\n NOT_LOADED,\n NOT_BOOTSTRAPPED,\n NOT_MOUNTED,\n MOUNTED,\n LOAD_ERROR,\n SKIP_BECAUSE_BROKEN,\n LOADING_SOURCE_CODE,\n shouldBeActive,\n} from \"./app.helpers.js\";\nimport { reroute } from \"../navigation/reroute.js\";\nimport { find } from \"../utils/find.js\";\nimport { toUnmountPromise } from \"../lifecycles/unmount.js\";\nimport {\n toUnloadPromise,\n getAppUnloadInfo,\n addAppToUnload,\n} from \"../lifecycles/unload.js\";\nimport { formatErrorMessage } from \"./app-errors.js\";\nimport { isInBrowser } from \"../utils/runtime-environment.js\";\nimport { assign } from \"../utils/assign\";\n\nconst apps = [];\n\nexport function getAppChanges() {\n const appsToUnload = [],\n appsToUnmount = [],\n appsToLoad = [],\n appsToMount = [];\n\n // We re-attempt to download applications in LOAD_ERROR after a timeout of 200 milliseconds\n const currentTime = new Date().getTime();\n\n apps.forEach((app) => {\n const appShouldBeActive =\n app.status !== SKIP_BECAUSE_BROKEN && shouldBeActive(app);\n\n switch (app.status) {\n case LOAD_ERROR:\n if (appShouldBeActive && currentTime - app.loadErrorTime >= 200) {\n appsToLoad.push(app);\n }\n break;\n case NOT_LOADED:\n case LOADING_SOURCE_CODE:\n if (appShouldBeActive) {\n appsToLoad.push(app);\n }\n break;\n case NOT_BOOTSTRAPPED:\n case NOT_MOUNTED:\n if (!appShouldBeActive && getAppUnloadInfo(toName(app))) {\n appsToUnload.push(app);\n } else if (appShouldBeActive) {\n appsToMount.push(app);\n }\n break;\n case MOUNTED:\n if (!appShouldBeActive) {\n appsToUnmount.push(app);\n }\n break;\n // all other statuses are ignored\n }\n });\n\n return { appsToUnload, appsToUnmount, appsToLoad, appsToMount };\n}\n\nexport function getMountedApps() {\n return apps.filter(isActive).map(toName);\n}\n\nexport function getAppNames() {\n return apps.map(toName);\n}\n\n// used in devtools, not (currently) exposed as a single-spa API\nexport function getRawAppData() {\n return [...apps];\n}\n\nexport function getAppStatus(appName) {\n const app = find(apps, (app) => toName(app) === appName);\n return app ? app.status : null;\n}\n\nexport function registerApplication(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n) {\n const registration = sanitizeArguments(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n );\n\n if (getAppNames().indexOf(registration.name) !== -1)\n throw Error(\n formatErrorMessage(\n 21,\n __DEV__ &&\n `There is already an app registered with name ${registration.name}`,\n registration.name\n )\n );\n\n apps.push(\n assign(\n {\n loadErrorTime: null,\n status: NOT_LOADED,\n parcels: {},\n devtools: {\n overlays: {\n options: {},\n selectors: [],\n },\n },\n },\n registration\n )\n );\n\n if (isInBrowser) {\n ensureJQuerySupport();\n reroute();\n }\n}\n\nexport function checkActivityFunctions(location = window.location) {\n return apps.filter((app) => app.activeWhen(location)).map(toName);\n}\n\nexport function unregisterApplication(appName) {\n if (apps.filter((app) => toName(app) === appName).length === 0) {\n throw Error(\n formatErrorMessage(\n 25,\n __DEV__ &&\n `Cannot unregister application '${appName}' because no such application has been registered`,\n appName\n )\n );\n }\n\n return unloadApplication(appName).then(() => {\n const appIndex = apps.map(toName).indexOf(appName);\n apps.splice(appIndex, 1);\n });\n}\n\nexport function unloadApplication(appName, opts = { waitForUnmount: false }) {\n if (typeof appName !== \"string\") {\n throw Error(\n formatErrorMessage(\n 26,\n __DEV__ && `unloadApplication requires a string 'appName'`\n )\n );\n }\n const app = find(apps, (App) => toName(App) === appName);\n if (!app) {\n throw Error(\n formatErrorMessage(\n 27,\n __DEV__ &&\n `Could not unload application '${appName}' because no such application has been registered`,\n appName\n )\n );\n }\n\n const appUnloadInfo = getAppUnloadInfo(toName(app));\n if (opts && opts.waitForUnmount) {\n // We need to wait for unmount before unloading the app\n\n if (appUnloadInfo) {\n // Someone else is already waiting for this, too\n return appUnloadInfo.promise;\n } else {\n // We're the first ones wanting the app to be resolved.\n const promise = new Promise((resolve, reject) => {\n addAppToUnload(app, () => promise, resolve, reject);\n });\n return promise;\n }\n } else {\n /* We should unmount the app, unload it, and remount it immediately.\n */\n\n let resultPromise;\n\n if (appUnloadInfo) {\n // Someone else is already waiting for this app to unload\n resultPromise = appUnloadInfo.promise;\n immediatelyUnloadApp(app, appUnloadInfo.resolve, appUnloadInfo.reject);\n } else {\n // We're the first ones wanting the app to be resolved.\n resultPromise = new Promise((resolve, reject) => {\n addAppToUnload(app, () => resultPromise, resolve, reject);\n immediatelyUnloadApp(app, resolve, reject);\n });\n }\n\n return resultPromise;\n }\n}\n\nfunction immediatelyUnloadApp(app, resolve, reject) {\n toUnmountPromise(app)\n .then(toUnloadPromise)\n .then(() => {\n resolve();\n setTimeout(() => {\n // reroute, but the unload promise is done\n reroute();\n });\n })\n .catch(reject);\n}\n\nfunction validateRegisterWithArguments(\n name,\n appOrLoadApp,\n activeWhen,\n customProps\n) {\n if (typeof name !== \"string\" || name.length === 0)\n throw Error(\n formatErrorMessage(\n 20,\n __DEV__ &&\n `The 1st argument to registerApplication must be a non-empty string 'appName'`\n )\n );\n\n if (!appOrLoadApp)\n throw Error(\n formatErrorMessage(\n 23,\n __DEV__ &&\n \"The 2nd argument to registerApplication must be an application or loading application function\"\n )\n );\n\n if (typeof activeWhen !== \"function\")\n throw Error(\n formatErrorMessage(\n 24,\n __DEV__ &&\n \"The 3rd argument to registerApplication must be an activeWhen function\"\n )\n );\n\n if (!validCustomProps(customProps))\n throw Error(\n formatErrorMessage(\n 22,\n __DEV__ &&\n \"The optional 4th argument is a customProps and must be an object\"\n )\n );\n}\n\nexport function validateRegisterWithConfig(config) {\n if (Array.isArray(config) || config === null)\n throw Error(\n formatErrorMessage(\n 39,\n __DEV__ && \"Configuration object can't be an Array or null!\"\n )\n );\n const validKeys = [\"name\", \"app\", \"activeWhen\", \"customProps\"];\n const invalidKeys = Object.keys(config).reduce(\n (invalidKeys, prop) =>\n validKeys.indexOf(prop) >= 0 ? invalidKeys : invalidKeys.concat(prop),\n []\n );\n if (invalidKeys.length !== 0)\n throw Error(\n formatErrorMessage(\n 38,\n __DEV__ &&\n `The configuration object accepts only: ${validKeys.join(\n \", \"\n )}. Invalid keys: ${invalidKeys.join(\", \")}.`,\n validKeys.join(\", \"),\n invalidKeys.join(\", \")\n )\n );\n if (typeof config.name !== \"string\" || config.name.length === 0)\n throw Error(\n formatErrorMessage(\n 20,\n __DEV__ &&\n \"The config.name on registerApplication must be a non-empty string\"\n )\n );\n if (typeof config.app !== \"object\" && typeof config.app !== \"function\")\n throw Error(\n formatErrorMessage(\n 20,\n __DEV__ &&\n \"The config.app on registerApplication must be an application or a loading function\"\n )\n );\n const allowsStringAndFunction = (activeWhen) =>\n typeof activeWhen === \"string\" || typeof activeWhen === \"function\";\n if (\n !allowsStringAndFunction(config.activeWhen) &&\n !(\n Array.isArray(config.activeWhen) &&\n config.activeWhen.every(allowsStringAndFunction)\n )\n )\n throw Error(\n formatErrorMessage(\n 24,\n __DEV__ &&\n \"The config.activeWhen on registerApplication must be a string, function or an array with both\"\n )\n );\n if (!validCustomProps(config.customProps))\n throw Error(\n formatErrorMessage(\n 22,\n __DEV__ && \"The optional config.customProps must be an object\"\n )\n );\n}\n\nfunction validCustomProps(customProps) {\n return (\n !customProps ||\n typeof customProps === \"function\" ||\n (typeof customProps === \"object\" &&\n customProps !== null &&\n !Array.isArray(customProps))\n );\n}\n\nfunction sanitizeArguments(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n) {\n const usingObjectAPI = typeof appNameOrConfig === \"object\";\n\n const registration = {\n name: null,\n loadApp: null,\n activeWhen: null,\n customProps: null,\n };\n\n if (usingObjectAPI) {\n validateRegisterWithConfig(appNameOrConfig);\n registration.name = appNameOrConfig.name;\n registration.loadApp = appNameOrConfig.app;\n registration.activeWhen = appNameOrConfig.activeWhen;\n registration.customProps = appNameOrConfig.customProps;\n } else {\n validateRegisterWithArguments(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n );\n registration.name = appNameOrConfig;\n registration.loadApp = appOrLoadApp;\n registration.activeWhen = activeWhen;\n registration.customProps = customProps;\n }\n\n registration.loadApp = sanitizeLoadApp(registration.loadApp);\n registration.customProps = sanitizeCustomProps(registration.customProps);\n registration.activeWhen = sanitizeActiveWhen(registration.activeWhen);\n\n return registration;\n}\n\nfunction sanitizeLoadApp(loadApp) {\n if (typeof loadApp !== \"function\") {\n return () => Promise.resolve(loadApp);\n }\n\n return loadApp;\n}\n\nfunction sanitizeCustomProps(customProps) {\n return customProps ? customProps : {};\n}\n\nfunction sanitizeActiveWhen(activeWhen) {\n let activeWhenArray = Array.isArray(activeWhen) ? activeWhen : [activeWhen];\n activeWhenArray = activeWhenArray.map((activeWhenOrPath) =>\n typeof activeWhenOrPath === \"function\"\n ? activeWhenOrPath\n : pathToActiveWhen(activeWhenOrPath)\n );\n\n return (location) =>\n activeWhenArray.some((activeWhen) => activeWhen(location));\n}\n\nexport function pathToActiveWhen(path, exactMatch) {\n const regex = toDynamicPathValidatorRegex(path, exactMatch);\n\n return (location) => {\n // compatible with IE10\n let origin = location.origin;\n if (!origin) {\n origin = `${location.protocol}//${location.host}`;\n }\n const route = location.href\n .replace(origin, \"\")\n .replace(location.search, \"\")\n .split(\"?\")[0];\n return regex.test(route);\n };\n}\n\nfunction toDynamicPathValidatorRegex(path, exactMatch) {\n let lastIndex = 0,\n inDynamic = false,\n regexStr = \"^\";\n\n if (path[0] !== \"/\") {\n path = \"/\" + path;\n }\n\n for (let charIndex = 0; charIndex < path.length; charIndex++) {\n const char = path[charIndex];\n const startOfDynamic = !inDynamic && char === \":\";\n const endOfDynamic = inDynamic && char === \"/\";\n if (startOfDynamic || endOfDynamic) {\n appendToRegex(charIndex);\n }\n }\n\n appendToRegex(path.length);\n return new RegExp(regexStr, \"i\");\n\n function appendToRegex(index) {\n const anyCharMaybeTrailingSlashRegex = \"[^/]+/?\";\n const commonStringSubPath = escapeStrRegex(path.slice(lastIndex, index));\n\n regexStr += inDynamic\n ? anyCharMaybeTrailingSlashRegex\n : commonStringSubPath;\n\n if (index === path.length) {\n if (inDynamic) {\n if (exactMatch) {\n // Ensure exact match paths that end in a dynamic portion don't match\n // urls with characters after a slash after the dynamic portion.\n regexStr += \"$\";\n }\n } else {\n // For exact matches, expect no more characters. Otherwise, allow\n // any characters.\n const suffix = exactMatch ? \"\" : \".*\";\n\n regexStr =\n // use charAt instead as we could not use es6 method endsWith\n regexStr.charAt(regexStr.length - 1) === \"/\"\n ? `${regexStr}${suffix}$`\n : `${regexStr}(/${suffix})?(#.*)?$`;\n }\n }\n\n inDynamic = !inDynamic;\n lastIndex = index;\n }\n\n function escapeStrRegex(str) {\n // borrowed from https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\");\n }\n}\n","import CustomEvent from \"custom-event\";\nimport { isStarted } from \"../start.js\";\nimport { toLoadPromise } from \"../lifecycles/load.js\";\nimport { toBootstrapPromise } from \"../lifecycles/bootstrap.js\";\nimport { toMountPromise } from \"../lifecycles/mount.js\";\nimport { toUnmountPromise } from \"../lifecycles/unmount.js\";\nimport {\n getAppStatus,\n getAppChanges,\n getMountedApps,\n} from \"../applications/apps.js\";\nimport {\n callCapturedEventListeners,\n navigateToUrl,\n} from \"./navigation-events.js\";\nimport { toUnloadPromise } from \"../lifecycles/unload.js\";\nimport {\n toName,\n shouldBeActive,\n NOT_MOUNTED,\n MOUNTED,\n NOT_LOADED,\n SKIP_BECAUSE_BROKEN,\n} from \"../applications/app.helpers.js\";\nimport { assign } from \"../utils/assign.js\";\nimport { isInBrowser } from \"../utils/runtime-environment.js\";\n\nlet appChangeUnderway = false,\n peopleWaitingOnAppChange = [],\n currentUrl = isInBrowser && window.location.href;\n\nexport function triggerAppChange() {\n // Call reroute with no arguments, intentionally\n return reroute();\n}\n\nexport function reroute(pendingPromises = [], eventArguments) {\n if (appChangeUnderway) {\n return new Promise((resolve, reject) => {\n peopleWaitingOnAppChange.push({\n resolve,\n reject,\n eventArguments,\n });\n });\n }\n\n const {\n appsToUnload,\n appsToUnmount,\n appsToLoad,\n appsToMount,\n } = getAppChanges();\n let appsThatChanged,\n navigationIsCanceled = false,\n oldUrl = currentUrl,\n newUrl = (currentUrl = window.location.href);\n\n if (isStarted()) {\n appChangeUnderway = true;\n appsThatChanged = appsToUnload.concat(\n appsToLoad,\n appsToUnmount,\n appsToMount\n );\n return performAppChanges();\n } else {\n appsThatChanged = appsToLoad;\n return loadApps();\n }\n\n function cancelNavigation() {\n navigationIsCanceled = true;\n }\n\n function loadApps() {\n return Promise.resolve().then(() => {\n const loadPromises = appsToLoad.map(toLoadPromise);\n\n return (\n Promise.all(loadPromises)\n .then(callAllEventListeners)\n // there are no mounted apps, before start() is called, so we always return []\n .then(() => [])\n .catch((err) => {\n callAllEventListeners();\n throw err;\n })\n );\n });\n }\n\n function performAppChanges() {\n return Promise.resolve().then(() => {\n // https://github.com/single-spa/single-spa/issues/545\n window.dispatchEvent(\n new CustomEvent(\n appsThatChanged.length === 0\n ? \"single-spa:before-no-app-change\"\n : \"single-spa:before-app-change\",\n getCustomEventDetail(true)\n )\n );\n\n window.dispatchEvent(\n new CustomEvent(\n \"single-spa:before-routing-event\",\n getCustomEventDetail(true, { cancelNavigation })\n )\n );\n\n if (navigationIsCanceled) {\n window.dispatchEvent(\n new CustomEvent(\n \"single-spa:before-mount-routing-event\",\n getCustomEventDetail(true)\n )\n );\n finishUpAndReturn();\n navigateToUrl(oldUrl);\n return;\n }\n\n const unloadPromises = appsToUnload.map(toUnloadPromise);\n\n const unmountUnloadPromises = appsToUnmount\n .map(toUnmountPromise)\n .map((unmountPromise) => unmountPromise.then(toUnloadPromise));\n\n const allUnmountPromises = unmountUnloadPromises.concat(unloadPromises);\n\n const unmountAllPromise = Promise.all(allUnmountPromises);\n\n unmountAllPromise.then(() => {\n window.dispatchEvent(\n new CustomEvent(\n \"single-spa:before-mount-routing-event\",\n getCustomEventDetail(true)\n )\n );\n });\n\n /* We load and bootstrap apps while other apps are unmounting, but we\n * wait to mount the app until all apps are finishing unmounting\n */\n const loadThenMountPromises = appsToLoad.map((app) => {\n return toLoadPromise(app).then((app) =>\n tryToBootstrapAndMount(app, unmountAllPromise)\n );\n });\n\n /* These are the apps that are already bootstrapped and just need\n * to be mounted. They each wait for all unmounting apps to finish up\n * before they mount.\n */\n const mountPromises = appsToMount\n .filter((appToMount) => appsToLoad.indexOf(appToMount) < 0)\n .map((appToMount) => {\n return tryToBootstrapAndMount(appToMount, unmountAllPromise);\n });\n return unmountAllPromise\n .catch((err) => {\n callAllEventListeners();\n throw err;\n })\n .then(() => {\n /* Now that the apps that needed to be unmounted are unmounted, their DOM navigation\n * events (like hashchange or popstate) should have been cleaned up. So it's safe\n * to let the remaining captured event listeners to handle about the DOM event.\n */\n callAllEventListeners();\n\n return Promise.all(loadThenMountPromises.concat(mountPromises))\n .catch((err) => {\n pendingPromises.forEach((promise) => promise.reject(err));\n throw err;\n })\n .then(finishUpAndReturn);\n });\n });\n }\n\n function finishUpAndReturn() {\n const returnValue = getMountedApps();\n pendingPromises.forEach((promise) => promise.resolve(returnValue));\n\n try {\n const appChangeEventName =\n appsThatChanged.length === 0\n ? \"single-spa:no-app-change\"\n : \"single-spa:app-change\";\n window.dispatchEvent(\n new CustomEvent(appChangeEventName, getCustomEventDetail())\n );\n window.dispatchEvent(\n new CustomEvent(\"single-spa:routing-event\", getCustomEventDetail())\n );\n } catch (err) {\n /* We use a setTimeout because if someone else's event handler throws an error, single-spa\n * needs to carry on. If a listener to the event throws an error, it's their own fault, not\n * single-spa's.\n */\n setTimeout(() => {\n throw err;\n });\n }\n\n /* Setting this allows for subsequent calls to reroute() to actually perform\n * a reroute instead of just getting queued behind the current reroute call.\n * We want to do this after the mounting/unmounting is done but before we\n * resolve the promise for the `reroute` function.\n */\n appChangeUnderway = false;\n\n if (peopleWaitingOnAppChange.length > 0) {\n /* While we were rerouting, someone else triggered another reroute that got queued.\n * So we need reroute again.\n */\n const nextPendingPromises = peopleWaitingOnAppChange;\n peopleWaitingOnAppChange = [];\n reroute(nextPendingPromises);\n }\n\n return returnValue;\n }\n\n /* We need to call all event listeners that have been delayed because they were\n * waiting on single-spa. This includes haschange and popstate events for both\n * the current run of performAppChanges(), but also all of the queued event listeners.\n * We want to call the listeners in the same order as if they had not been delayed by\n * single-spa, which means queued ones first and then the most recent one.\n */\n function callAllEventListeners() {\n pendingPromises.forEach((pendingPromise) => {\n callCapturedEventListeners(pendingPromise.eventArguments);\n });\n\n callCapturedEventListeners(eventArguments);\n }\n\n function getCustomEventDetail(isBeforeChanges = false, extraProperties) {\n const newAppStatuses = {};\n const appsByNewStatus = {\n // for apps that were mounted\n [MOUNTED]: [],\n // for apps that were unmounted\n [NOT_MOUNTED]: [],\n // apps that were forcibly unloaded\n [NOT_LOADED]: [],\n // apps that attempted to do something but are broken now\n [SKIP_BECAUSE_BROKEN]: [],\n };\n\n if (isBeforeChanges) {\n appsToLoad.concat(appsToMount).forEach((app, index) => {\n addApp(app, MOUNTED);\n });\n appsToUnload.forEach((app) => {\n addApp(app, NOT_LOADED);\n });\n appsToUnmount.forEach((app) => {\n addApp(app, NOT_MOUNTED);\n });\n } else {\n appsThatChanged.forEach((app) => {\n addApp(app);\n });\n }\n\n const result = {\n detail: {\n newAppStatuses,\n appsByNewStatus,\n totalAppChanges: appsThatChanged.length,\n originalEvent: eventArguments?.[0],\n oldUrl,\n newUrl,\n navigationIsCanceled,\n },\n };\n\n if (extraProperties) {\n assign(result.detail, extraProperties);\n }\n\n return result;\n\n function addApp(app, status) {\n const appName = toName(app);\n status = status || getAppStatus(appName);\n newAppStatuses[appName] = status;\n const statusArr = (appsByNewStatus[status] =\n appsByNewStatus[status] || []);\n statusArr.push(appName);\n }\n }\n}\n\n/**\n * Let's imagine that some kind of delay occurred during application loading.\n * The user without waiting for the application to load switched to another route,\n * this means that we shouldn't bootstrap and mount that application, thus we check\n * twice if that application should be active before bootstrapping and mounting.\n * https://github.com/single-spa/single-spa/issues/524\n */\nfunction tryToBootstrapAndMount(app, unmountAllPromise) {\n if (shouldBeActive(app)) {\n return toBootstrapPromise(app).then((app) =>\n unmountAllPromise.then(() =>\n shouldBeActive(app) ? toMountPromise(app) : app\n )\n );\n } else {\n return unmountAllPromise.then(() => app);\n }\n}\n","import { reroute } from \"./navigation/reroute.js\";\nimport { formatErrorMessage } from \"./applications/app-errors.js\";\nimport { setUrlRerouteOnly } from \"./navigation/navigation-events.js\";\nimport { isInBrowser } from \"./utils/runtime-environment.js\";\n\nlet started = false;\n\nexport function start(opts) {\n started = true;\n if (opts && opts.urlRerouteOnly) {\n setUrlRerouteOnly(opts.urlRerouteOnly);\n }\n if (isInBrowser) {\n reroute();\n }\n}\n\nexport function isStarted() {\n return started;\n}\n\nif (isInBrowser) {\n setTimeout(() => {\n if (!started) {\n console.warn(\n formatErrorMessage(\n 1,\n __DEV__ &&\n `singleSpa.start() has not been called, 5000ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted.`\n )\n );\n }\n }, 5000);\n}\n","import { getRawAppData, unregisterApplication } from \"../applications/apps\";\nimport { reroute } from \"../navigation/reroute\";\nimport { NOT_LOADED } from \"../applications/app.helpers\";\nimport { toLoadPromise } from \"../lifecycles/load\";\nimport { toBootstrapPromise } from \"../lifecycles/bootstrap\";\n\nexport default {\n getRawAppData,\n reroute,\n NOT_LOADED,\n toLoadPromise,\n toBootstrapPromise,\n unregisterApplication,\n};\n","export { start } from \"./start.js\";\nexport { ensureJQuerySupport } from \"./jquery-support.js\";\nexport {\n setBootstrapMaxTime,\n setMountMaxTime,\n setUnmountMaxTime,\n setUnloadMaxTime,\n} from \"./applications/timeouts.js\";\nexport {\n registerApplication,\n unregisterApplication,\n getMountedApps,\n getAppStatus,\n unloadApplication,\n checkActivityFunctions,\n getAppNames,\n pathToActiveWhen,\n} from \"./applications/apps.js\";\nexport { navigateToUrl } from \"./navigation/navigation-events.js\";\nexport { triggerAppChange } from \"./navigation/reroute.js\";\nexport {\n addErrorHandler,\n removeErrorHandler,\n} from \"./applications/app-errors.js\";\nexport { mountRootParcel } from \"./parcels/mount-parcel.js\";\n\nexport {\n NOT_LOADED,\n LOADING_SOURCE_CODE,\n NOT_BOOTSTRAPPED,\n BOOTSTRAPPING,\n NOT_MOUNTED,\n MOUNTING,\n UPDATING,\n LOAD_ERROR,\n MOUNTED,\n UNLOADING,\n UNMOUNTING,\n SKIP_BECAUSE_BROKEN,\n} from \"./applications/app.helpers.js\";\n\nimport devtools from \"./devtools/devtools\";\nimport { isInBrowser } from \"./utils/runtime-environment.js\";\n\nif (isInBrowser && window.__SINGLE_SPA_DEVTOOLS__) {\n window.__SINGLE_SPA_DEVTOOLS__.exposedMethods = devtools;\n}\n"],"names":["NativeCustomEvent","CustomEvent","p","detail","foo","type","e","useNative","document","createEvent","params","initCustomEvent","bubbles","cancelable","createEventObject","Boolean","errorHandlers","handleAppError","err","app","newStatus","transformedErr","transformErr","length","forEach","handler","setTimeout","addErrorHandler","Error","formatErrorMessage","push","removeErrorHandler","removedSomething","filter","h","isHandler","code","msg","args","join","ogErr","appOrParcel","result","errPrefix","objectType","toName","status","message","console","warn","JSON","stringify","appOrParcelName","NOT_LOADED","LOADING_SOURCE_CODE","NOT_BOOTSTRAPPED","BOOTSTRAPPING","NOT_MOUNTED","MOUNTING","MOUNTED","UPDATING","UNMOUNTING","UNLOADING","LOAD_ERROR","SKIP_BECAUSE_BROKEN","isActive","shouldBeActive","activeWhen","window","location","name","isParcel","unmountThisParcel","assign","i","arguments","key","find","arr","func","validLifecycleFn","fn","Array","isArray","item","flattenFnArray","lifecycle","fns","Promise","resolve","props","reduce","resultPromise","index","then","thisPromise","smellsLikeAPromise","reject","promise","catch","toBootstrapPromise","hardFail","bootstrap","reasonableTime","successfulBootstrap","toUnmountPromise","unmountChildrenParcels","Object","keys","parcels","map","parcelId","all","unmountAppOrParcel","parcelError","parentError","beforeFirstMountFired","firstMountFired","toMountPromise","dispatchEvent","setSkipBecauseBroken","parcelCount","rootParcels","mountRootParcel","mountParcel","apply","config","customProps","owningAppOrParcel","this","_typeof","domElement","externalRepresentation","id","passedConfigLoadingFunction","configLoadingFunction","parcel","parentName","mountPromise","value","resolveUnmount","rejectUnmount","loadPromise","bootstrapPromise","prototype","hasOwnProperty","call","mount","unmount","update","timeouts","ensureValidAppTimeouts","promiseWithoutReturnValue","toUpdatePromise","unmountPromise","getStatus","getProps","bind","singleSpa","unmountSelf","globalTimeoutConfig","millis","dieOnTimeout","warningMillis","unload","setBootstrapMaxTime","time","setMountMaxTime","setUnmountMaxTime","setUnloadMaxTime","timeoutConfig","warningPeriod","finished","errored","val","maybeTimingOut","errMsg","shouldError","error","numWarnings","numMillis","toLoadPromise","loadApp","isUserErr","validationErrCode","loadErrorTime","appOpts","appOptsStr","validationErrMessage","devtools","overlays","Date","getTime","urlRerouteOnly","isInBrowser","capturedEventListeners","hashchange","popstate","routingEventsListeningTo","navigateToUrl","obj","url","href","currentTarget","preventDefault","current","parseUri","destination","indexOf","hash","host","pathname","search","history","pushState","callCapturedEventListeners","eventArguments","eventType","listener","_this","urlReroute","reroute","patchedUpdateState","updateState","methodName","urlBefore","urlAfter","isStarted","createPopStateEvent","state","originalMethodName","evt","PopStateEvent","initPopStateEvent","singleSpaTrigger","addEventListener","originalAddEventListener","originalRemoveEventListener","removeEventListener","eventName","listenerFn","replaceState","singleSpaNavigate","str","anchor","createElement","hasInitialized","ensureJQuerySupport","jQuery","$","jquery","originalJQueryOn","on","originalJQueryOff","off","eventString","captureRoutingEvents","originalJQueryFunction","nativeFunctionToCall","originalArgs","split","replace","trim","appsToUnload","toUnloadPromise","unloadInfo","finishUnloadingApp","unloadPromise","errorUnloadingApp","addAppToUnload","promiseGetter","defineProperty","get","getAppUnloadInfo","appName","apps","getAppChanges","appsToUnmount","appsToLoad","appsToMount","currentTime","appShouldBeActive","getMountedApps","getAppNames","getAppStatus","registerApplication","appNameOrConfig","appOrLoadApp","registration","validKeys","invalidKeys","prop","concat","allowsStringAndFunction","every","validCustomProps","validateRegisterWithConfig","validateRegisterWithArguments","sanitizeCustomProps","activeWhenArray","activeWhenOrPath","pathToActiveWhen","some","sanitizeActiveWhen","sanitizeArguments","options","selectors","checkActivityFunctions","unregisterApplication","unloadApplication","appIndex","splice","opts","waitForUnmount","App","appUnloadInfo","immediatelyUnloadApp","path","exactMatch","regex","lastIndex","inDynamic","regexStr","charIndex","char","appendToRegex","RegExp","commonStringSubPath","slice","suffix","charAt","toDynamicPathValidatorRegex","origin","protocol","route","test","appChangeUnderway","peopleWaitingOnAppChange","currentUrl","triggerAppChange","pendingPromises","appsThatChanged","navigationIsCanceled","oldUrl","newUrl","performAppChanges","loadApps","cancelNavigation","loadPromises","callAllEventListeners","getCustomEventDetail","finishUpAndReturn","unloadPromises","allUnmountPromises","unmountAllPromise","loadThenMountPromises","tryToBootstrapAndMount","mountPromises","appToMount","returnValue","appChangeEventName","nextPendingPromises","pendingPromise","isBeforeChanges","extraProperties","newAppStatuses","appsByNewStatus","addApp","totalAppChanges","originalEvent","started","start","getRawAppData","__SINGLE_SPA_DEVTOOLS__","exposedMethods"],"mappings":";uxDACIA,mJAA2BC,cAE/B,WACE,IACE,IAAIC,EAAI,IAAIF,EAAkB,MAAO,CAAEG,OAAQ,CAAEC,IAAK,SACtD,MAAQ,QAAUF,EAAEG,MAAQ,QAAUH,EAAEC,OAAOC,IAC/C,MAAOE,IAET,OAAO,EAWQC,GAAcP,EAG/B,oBAAuBQ,UAAY,mBAAsBA,SAASC,YAAc,SAAsBJ,EAAMK,GAC1G,IAAIJ,EAAIE,SAASC,YAAY,eAM7B,OALIC,EACFJ,EAAEK,gBAAgBN,EAAMK,EAAOE,QAASF,EAAOG,WAAYH,EAAOP,QAElEG,EAAEK,gBAAgBN,GAAM,GAAO,OAAO,GAEjCC,GAIT,SAAsBD,EAAMK,GAC1B,IAAIJ,EAAIE,SAASM,oBAWjB,OAVAR,EAAED,KAAOA,EACLK,GACFJ,EAAEM,QAAUG,QAAQL,EAAOE,SAC3BN,EAAEO,WAAaE,QAAQL,EAAOG,YAC9BP,EAAEH,OAASO,EAAOP,SAElBG,EAAEM,SAAU,EACZN,EAAEO,YAAa,EACfP,EAAEH,YAAS,GAENG,GC5CLU,EAAgB,GAEb,SAASC,EAAeC,EAAKC,EAAKC,OACjCC,EAAiBC,EAAaJ,EAAKC,EAAKC,GAE1CJ,EAAcO,OAChBP,EAAcQ,SAAQ,SAACC,UAAYA,EAAQJ,MAE3CK,YAAW,iBACHL,KAKL,SAASM,EAAgBF,MACP,mBAAZA,QACHG,MACJC,EACE,IACA,IAKNb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,EACE,GACA,MAKL,YC1BU,CACbuV,cH0EK,2BACMjG,KG1EXtD,QAAAA,GACAxK,WAAAA,EACAgI,cAAAA,EACAjF,mBAAAA,EACAgN,sBAAAA,ICgCElH,IAAe9H,OAAOiT,0BACxBjT,OAAOiT,wBAAwBC,eAAiBzL"} \ No newline at end of file diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-6.0.3.min.js b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-6.0.3.min.js new file mode 100644 index 0000000000..c94c19080d --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-6.0.3.min.js @@ -0,0 +1,3 @@ +/* single-spa@6.0.3 - SystemJS ES5 - prod */ +System.register([],(function(t){"use strict";return{execute:function(){t({addErrorHandler:c,checkActivityFunctions:Ut,ensureJQuerySupport:vt,getAppNames:At,getAppStatus:Nt,getMountedApps:bt,mountRootParcel:k,navigateToUrl:it,patchHistoryApi:pt,pathToActiveWhen:Rt,registerApplication:_t,removeErrorHandler:s,setBootstrapMaxTime:V,setMountMaxTime:q,setUnloadMaxTime:X,setUnmountMaxTime:z,start:kt,triggerAppChange:Bt,unloadApplication:Mt,unregisterApplication:Dt});var n=Object.freeze({__proto__:null,get start(){return kt},get ensureJQuerySupport(){return vt},get setBootstrapMaxTime(){return V},get setMountMaxTime(){return q},get setUnmountMaxTime(){return z},get setUnloadMaxTime(){return X},get registerApplication(){return _t},get unregisterApplication(){return Dt},get getMountedApps(){return bt},get getAppStatus(){return Nt},get unloadApplication(){return Mt},get checkActivityFunctions(){return Ut},get getAppNames(){return At},get pathToActiveWhen(){return Rt},get navigateToUrl(){return it},get patchHistoryApi(){return pt},get triggerAppChange(){return Bt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return k},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return v},get NOT_MOUNTED(){return d},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return T},get MOUNTED(){return g},get UNLOADING(){return O},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return P}});function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=Boolean(n.bubbles),r.cancelable=Boolean(n.cancelable),r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r},u=[];function a(t,n,r){var e=l(t,n,r);u.length?u.forEach((function(t){return t(e)})):setTimeout((function(){throw e}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(r){var e=r===t;return n=n||e,!e})),n}function f(t,n){for(var r=arguments.length,e=new Array(r>2?r-2:0),o=2;o0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var r=0;r=0&&et[r].forEach((function(r){try{r.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function at(){Ct([],arguments)}function ct(t,n){return function(){var r=window.location.href,e=t.apply(this,arguments),o=window.location.href;return nt&&r===o||window.dispatchEvent(st(window.history.state,n)),e}}function st(t,n){var r;try{r=new PopStateEvent("popstate",{state:t})}catch(n){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return r.singleSpa=!0,r.singleSpaTrigger=n,r}var ft=null,lt=!1;function pt(t){if(lt)throw Error(f(43,!1));nt=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,lt=!0,ft=window.history.replaceState,window.addEventListener("hashchange",at),window.addEventListener("popstate",at);var n=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(t,r){if(!("function"==typeof r&&ot.indexOf(t)>=0)||D(et[t],(function(t){return t===r})))return n.apply(this,arguments);et[t].push(r)},window.removeEventListener=function(t,n){return"function"==typeof n&&ot.indexOf(t)>=0&&(et[t]=et[t].filter((function(t){return t!==n}))),r.apply(this,arguments)},window.history.pushState=ct(window.history.pushState,"pushState"),window.history.replaceState=ct(ft,"replaceState")}function ht(t){var n=document.createElement("a");return n.href=t,n}rt&&(window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=it);var mt=!1;function vt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!mt){var n=t.fn.on,r=t.fn.off;t.fn.on=function(t,r){return dt.call(this,n,window.addEventListener,t,r,arguments)},t.fn.off=function(t,n){return dt.call(this,r,window.removeEventListener,t,n,arguments)},mt=!0}}function dt(t,n,r,e,o){return"string"!=typeof r?t.apply(this,o):(r.split(/\s+/).forEach((function(t){ot.indexOf(t)>=0&&(n(t,e),r=r.replace(t,""))})),""===r.trim()?this:t.apply(this,o))}var wt={};function gt(t){return Promise.resolve().then((function(){var n=wt[N(t)];if(!n)return t;if(t.status===p)return Et(t,n),t;if(t.status===O)return n.promise.then((function(){return t}));if(t.status!==d&&t.status!==T)return t;var r=t.status===T?Promise.resolve():Y(t,"unload");return t.status=O,r.then((function(){return Et(t,n),t})).catch((function(r){return function(t,n,r){delete wt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(r,t,P),n.reject(r)}(t,n,r),t}))}))}function Et(t,n){delete wt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function yt(t,n,r,e){wt[N(t)]={app:t,resolve:r,reject:e},Object.defineProperty(wt[N(t)],"promise",{get:n})}function Ot(t){return wt[t]}var Tt=[];function Pt(){var t=[],n=[],r=[],e=[],o=(new Date).getTime();return Tt.forEach((function(i){var u=i.status!==P&&A(i);switch(i.status){case T:u&&o-i.loadErrorTime>=200&&r.push(i);break;case p:case h:u&&r.push(i);break;case m:case d:!u&&Ot(N(i))?t.push(i):u&&e.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:r,appsToMount:e}}function bt(){return Tt.filter(b).map(N)}function At(){return Tt.map(N)}function Nt(t){var n=D(Tt,(function(n){return N(n)===t}));return n?n.status:null}var St=!1;function _t(t,n,e,o){var i=function(t,n,e,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===r(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],e=Object.keys(t).reduce((function(t,r){return n.indexOf(r)>=0?t:t.concat(r)}),[]);if(0!==e.length)throw Error(f(38,!1,n.join(", "),e.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==r(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!jt(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,r,e){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof r)throw Error(f(24,!1));if(!jt(e))throw Error(f(22,!1))}(t,n,e,o),u.name=t,u.loadApp=n,u.activeWhen=e,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Rt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,e,o);if(Ht()||St||(St=!0,setTimeout((function(){Ht()||console.warn(f(1,!1))}),5e3)),-1!==At().indexOf(i.name))throw Error(f(21,!1,i.name));Tt.push(U({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),rt&&(vt(),Ct())}function Ut(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Tt.filter((function(n){return n.activeWhen(t)})).map(N)}function Dt(t){if(0===Tt.filter((function(n){return N(n)===t})).length)throw Error(f(25,!1,t));return(rt?Mt(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var n=Tt.map(N).indexOf(t);Tt.splice(n,1)}))}function Mt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var r=D(Tt,(function(n){return N(n)===t}));if(!r)throw Error(f(27,!1,t));var e,o=Ot(N(r));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){yt(r,(function(){return i}),t,n)}));return i}return o?(e=o.promise,Lt(r,o.resolve,o.reject)):e=new Promise((function(t,n){yt(r,(function(){return e}),t,n),Lt(r,t,n)})),e}function Lt(t,n,r){Promise.resolve().then((function(){if(D(Ut(),(function(n){return n===N(t)})))return Bt()})).then((function(){return x(t).then(gt).then((function(){n(),setTimeout((function(){Ct()}))}))})).catch(r)}function jt(t){return!t||"function"==typeof t||"object"===r(t)&&null!==t&&!Array.isArray(t)}function Rt(t,n){var r=function(t,n){var r=0,e=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(It)return new Promise((function(t,r){xt.push({resolve:t,reject:r,eventArguments:n})}));var o,u=Pt(),a=u.appsToUnload,c=u.appsToUnmount,s=u.appsToLoad,l=u.appsToMount,h=[],m=Gt,v=Gt=window.location.href;return Ht()?(It=!0,o=a.concat(s,c,l),y()):(o=s,E());function w(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(n.catch((function(t){return console.warn(Error(f(42,!1))),console.warn(t),!1})))}function E(){return Promise.resolve().then((function(){var t=s.map(tt);return Promise.all(t).then(T).then((function(){return[]})).catch((function(t){throw T(),t})).finally((function(){}))}))}function y(){return Promise.resolve().then((function(){return A(0===o.length?"before-no-app-change":"before-app-change",b(!0)),A("before-routing-event",b(!0,{cancelNavigation:w})),Promise.all(h).then((function(r){if(r.some((function(t){return t})))return ft.call(window.history,history.state,"",m.substring(location.origin.length)),Gt=location.href,It=!1,Ct(t,n,!0);var e=a.map(gt),o=c.map(x).map((function(t){return t.then(gt)})).concat(e),i=Promise.all(o);i.then((function(){A("before-mount-routing-event",b(!0))}),(function(t){throw t}));var u=s.map((function(t){return tt(t).then((function(t){return Wt(t,i)}))})),f=l.filter((function(t){return s.indexOf(t)<0})).map((function(t){return Wt(t,i)}));return i.catch((function(t){throw T(),t})).then((function(){return T(),Promise.all(u.concat(f)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(O).then((function(){}),(function(t){throw t}))}))}))}))}function O(){var n=bt();t.forEach((function(t){return t.resolve(n)}));try{A(0===o.length?"no-app-change":"app-change",b()),A("routing-event",b())}catch(t){setTimeout((function(){throw t}))}if(It=!1,xt.length>0){var r=xt;xt=[],Ct(r)}return n}function T(){r||(t.forEach((function(t){ut(t.eventArguments)})),ut(n))}function b(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,u={},f=(e(t={},g,[]),e(t,d,[]),e(t,p,[]),e(t,P,[]),t);r?(s.concat(l).forEach((function(t,n){w(t,g)})),a.forEach((function(t){w(t,p)})),c.forEach((function(t){w(t,d)}))):o.forEach((function(t){w(t)}));var h={detail:{newAppStatuses:u,appsByNewStatus:f,totalAppChanges:o.length,originalEvent:null==n?void 0:n[0],oldUrl:m,newUrl:v}};return i&&U(h.detail,i),h;function w(t,n){var r=N(t);n=n||Nt(r),u[r]=n,(f[n]=f[n]||[]).push(r)}}function A(t,n){r||window.dispatchEvent(new i("single-spa:".concat(t),n))}}function Wt(t,n){return A(t)?I(t).then((function(t){return n.then((function(){return A(t)?C(t):t}))})):n.then((function(){return t}))}var $t=!1;function kt(t){$t=!0,rt&&(pt(t),Ct())}function Ht(){return $t}var Kt={getRawAppData:function(){return[].concat(Tt)},reroute:Ct,NOT_LOADED:p,toLoadPromise:tt,toBootstrapPromise:I,unregisterApplication:Dt,getProfilerData:function(){return R}};rt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Kt)}}})); +//# sourceMappingURL=single-spa.min.js.map diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-6.0.3.min.js.map b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-6.0.3.min.js.map new file mode 100644 index 0000000000..13bdecfd5b --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/public/js/single-spa-6.0.3.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"single-spa.min.js","sources":["../../../node_modules/.pnpm/custom-event@1.0.1/node_modules/custom-event/index.js","../../../src/applications/app-errors.js","../../../src/applications/app.helpers.js","../../../src/utils/assign.js","../../../src/utils/find.js","../../../src/lifecycles/lifecycle.helpers.js","../../../src/devtools/profiler.js","../../../src/lifecycles/bootstrap.js","../../../src/lifecycles/unmount.js","../../../src/lifecycles/mount.js","../../../src/parcels/mount-parcel.js","../../../src/lifecycles/update.js","../../../src/lifecycles/prop.helpers.js","../../../src/applications/timeouts.js","../../../src/lifecycles/load.js","../../../src/utils/runtime-environment.js","../../../src/navigation/navigation-events.js","../../../src/jquery-support.js","../../../src/lifecycles/unload.js","../../../src/applications/apps.js","../../../src/navigation/reroute.js","../../../src/start.js","../../../src/devtools/devtools.js","../../../src/single-spa.js"],"sourcesContent":["\nvar NativeCustomEvent = global.CustomEvent;\n\nfunction useNative () {\n try {\n var p = new NativeCustomEvent('cat', { detail: { foo: 'bar' } });\n return 'cat' === p.type && 'bar' === p.detail.foo;\n } catch (e) {\n }\n return false;\n}\n\n/**\n * Cross-browser `CustomEvent` constructor.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent.CustomEvent\n *\n * @public\n */\n\nmodule.exports = useNative() ? NativeCustomEvent :\n\n// IE >= 9\n'undefined' !== typeof document && 'function' === typeof document.createEvent ? function CustomEvent (type, params) {\n var e = document.createEvent('CustomEvent');\n if (params) {\n e.initCustomEvent(type, params.bubbles, params.cancelable, params.detail);\n } else {\n e.initCustomEvent(type, false, false, void 0);\n }\n return e;\n} :\n\n// IE <= 8\nfunction CustomEvent (type, params) {\n var e = document.createEventObject();\n e.type = type;\n if (params) {\n e.bubbles = Boolean(params.bubbles);\n e.cancelable = Boolean(params.cancelable);\n e.detail = params.detail;\n } else {\n e.bubbles = false;\n e.cancelable = false;\n e.detail = void 0;\n }\n return e;\n}\n","import { objectType, toName } from \"./app.helpers\";\n\nlet errorHandlers = [];\n\nexport function handleAppError(err, app, newStatus) {\n const transformedErr = transformErr(err, app, newStatus);\n\n if (errorHandlers.length) {\n errorHandlers.forEach((handler) => handler(transformedErr));\n } else {\n setTimeout(() => {\n throw transformedErr;\n });\n }\n}\n\nexport function addErrorHandler(handler) {\n if (typeof handler !== \"function\") {\n throw Error(\n formatErrorMessage(\n 28,\n __DEV__ && \"a single-spa error handler must be a function\"\n )\n );\n }\n\n errorHandlers.push(handler);\n}\n\nexport function removeErrorHandler(handler) {\n if (typeof handler !== \"function\") {\n throw Error(\n formatErrorMessage(\n 29,\n __DEV__ && \"a single-spa error handler must be a function\"\n )\n );\n }\n\n let removedSomething = false;\n errorHandlers = errorHandlers.filter((h) => {\n const isHandler = h === handler;\n removedSomething = removedSomething || isHandler;\n return !isHandler;\n });\n\n return removedSomething;\n}\n\nexport function formatErrorMessage(code, msg, ...args) {\n return `single-spa minified message #${code}: ${\n msg ? msg + \" \" : \"\"\n }See https://single-spa.js.org/error/?code=${code}${\n args.length ? `&arg=${args.join(\"&arg=\")}` : \"\"\n }`;\n}\n\nexport function transformErr(ogErr, appOrParcel, newStatus) {\n const errPrefix = `${objectType(appOrParcel)} '${toName(\n appOrParcel\n )}' died in status ${appOrParcel.status}: `;\n\n let result;\n\n if (ogErr instanceof Error) {\n try {\n ogErr.message = errPrefix + ogErr.message;\n } catch (err) {\n /* Some errors have read-only message properties, in which case there is nothing\n * that we can do.\n */\n }\n result = ogErr;\n } else {\n console.warn(\n formatErrorMessage(\n 30,\n __DEV__ &&\n `While ${appOrParcel.status}, '${toName(\n appOrParcel\n )}' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate.`,\n appOrParcel.status,\n toName(appOrParcel)\n )\n );\n try {\n result = Error(errPrefix + JSON.stringify(ogErr));\n } catch (err) {\n // If it's not an Error and you can't stringify it, then what else can you even do to it?\n result = ogErr;\n }\n }\n\n result.appOrParcelName = toName(appOrParcel);\n\n // We set the status after transforming the error so that the error message\n // references the state the application was in before the status change.\n appOrParcel.status = newStatus;\n\n return result;\n}\n","import { handleAppError } from \"./app-errors.js\";\n\n// App statuses\nexport const NOT_LOADED = \"NOT_LOADED\";\nexport const LOADING_SOURCE_CODE = \"LOADING_SOURCE_CODE\";\nexport const NOT_BOOTSTRAPPED = \"NOT_BOOTSTRAPPED\";\nexport const BOOTSTRAPPING = \"BOOTSTRAPPING\";\nexport const NOT_MOUNTED = \"NOT_MOUNTED\";\nexport const MOUNTING = \"MOUNTING\";\nexport const MOUNTED = \"MOUNTED\";\nexport const UPDATING = \"UPDATING\";\nexport const UNMOUNTING = \"UNMOUNTING\";\nexport const UNLOADING = \"UNLOADING\";\nexport const LOAD_ERROR = \"LOAD_ERROR\";\nexport const SKIP_BECAUSE_BROKEN = \"SKIP_BECAUSE_BROKEN\";\n\nexport function isActive(app) {\n return app.status === MOUNTED;\n}\n\nexport function shouldBeActive(app) {\n try {\n return app.activeWhen(window.location);\n } catch (err) {\n handleAppError(err, app, SKIP_BECAUSE_BROKEN);\n return false;\n }\n}\n\nexport function toName(app) {\n return app.name;\n}\n\nexport function isParcel(appOrParcel) {\n return Boolean(appOrParcel.unmountThisParcel);\n}\n\nexport function objectType(appOrParcel) {\n return isParcel(appOrParcel) ? \"parcel\" : \"application\";\n}\n","// Object.assign() is not available in IE11. And the babel compiled output for object spread\n// syntax checks a bunch of Symbol stuff and is almost a kb. So this function is the smaller replacement.\nexport function assign() {\n for (let i = arguments.length - 1; i > 0; i--) {\n for (let key in arguments[i]) {\n if (key === \"__proto__\") {\n continue;\n }\n arguments[i - 1][key] = arguments[i][key];\n }\n }\n\n return arguments[0];\n}\n","/* the array.prototype.find polyfill on npmjs.com is ~20kb (not worth it)\n * and lodash is ~200kb (not worth it)\n */\n\nexport function find(arr, func) {\n for (let i = 0; i < arr.length; i++) {\n if (func(arr[i])) {\n return arr[i];\n }\n }\n\n return null;\n}\n","import { find } from \"../utils/find.js\";\nimport { objectType, toName } from \"../applications/app.helpers.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\n\nexport function validLifecycleFn(fn) {\n return fn && (typeof fn === \"function\" || isArrayOfFns(fn));\n\n function isArrayOfFns(arr) {\n return (\n Array.isArray(arr) && !find(arr, (item) => typeof item !== \"function\")\n );\n }\n}\n\nexport function flattenFnArray(appOrParcel, lifecycle) {\n let fns = appOrParcel[lifecycle] || [];\n fns = Array.isArray(fns) ? fns : [fns];\n if (fns.length === 0) {\n fns = [() => Promise.resolve()];\n }\n\n const type = objectType(appOrParcel);\n const name = toName(appOrParcel);\n\n return function (props) {\n return fns.reduce((resultPromise, fn, index) => {\n return resultPromise.then(() => {\n const thisPromise = fn(props);\n return smellsLikeAPromise(thisPromise)\n ? thisPromise\n : Promise.reject(\n formatErrorMessage(\n 15,\n __DEV__ &&\n `Within ${type} ${name}, the lifecycle function ${lifecycle} at array index ${index} did not return a promise`,\n type,\n name,\n lifecycle,\n index\n )\n );\n });\n }, Promise.resolve());\n };\n}\n\nexport function smellsLikeAPromise(promise) {\n return (\n promise &&\n typeof promise.then === \"function\" &&\n typeof promise.catch === \"function\"\n );\n}\n","let profileEntries = [];\n\nexport function getProfilerData() {\n return profileEntries;\n}\n\n/**\n *\n * @type {'application' | 'parcel' | 'routing'} ProfileType\n *\n * @param {ProfileType} type\n * @param {String} name\n * @param {number} start\n * @param {number} end\n */\nexport function addProfileEntry(\n type,\n name,\n kind,\n start,\n end,\n operationSucceeded\n) {\n profileEntries.push({\n type,\n name,\n start,\n end,\n kind,\n operationSucceeded,\n });\n}\n\nexport function clearProfilerData() {\n profileEntries = [];\n}\n","import {\n NOT_BOOTSTRAPPED,\n BOOTSTRAPPING,\n NOT_MOUNTED,\n SKIP_BECAUSE_BROKEN,\n toName,\n isParcel,\n} from \"../applications/app.helpers.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\nimport { handleAppError, transformErr } from \"../applications/app-errors.js\";\nimport { addProfileEntry } from \"../devtools/profiler.js\";\n\nexport function toBootstrapPromise(appOrParcel, hardFail) {\n let startTime, profileEventType;\n\n return Promise.resolve().then(() => {\n if (appOrParcel.status !== NOT_BOOTSTRAPPED) {\n return appOrParcel;\n }\n\n if (__PROFILE__) {\n profileEventType = isParcel(appOrParcel) ? \"parcel\" : \"application\";\n startTime = performance.now();\n }\n\n appOrParcel.status = BOOTSTRAPPING;\n\n if (!appOrParcel.bootstrap) {\n // Default implementation of bootstrap\n return Promise.resolve().then(successfulBootstrap);\n }\n\n return reasonableTime(appOrParcel, \"bootstrap\")\n .then(successfulBootstrap)\n .catch((err) => {\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"bootstrap\",\n startTime,\n performance.now(),\n false\n );\n }\n\n if (hardFail) {\n throw transformErr(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n } else {\n handleAppError(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n return appOrParcel;\n }\n });\n });\n\n function successfulBootstrap() {\n appOrParcel.status = NOT_MOUNTED;\n\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"bootstrap\",\n startTime,\n performance.now(),\n true\n );\n }\n\n return appOrParcel;\n }\n}\n","import {\n UNMOUNTING,\n NOT_MOUNTED,\n MOUNTED,\n SKIP_BECAUSE_BROKEN,\n toName,\n isParcel,\n} from \"../applications/app.helpers.js\";\nimport { handleAppError, transformErr } from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\nimport { addProfileEntry } from \"../devtools/profiler.js\";\n\nexport function toUnmountPromise(appOrParcel, hardFail) {\n return Promise.resolve().then(() => {\n if (appOrParcel.status !== MOUNTED) {\n return appOrParcel;\n }\n\n let startTime, profileEventType;\n\n if (__PROFILE__) {\n startTime = performance.now();\n profileEventType = isParcel(appOrParcel) ? \"parcel\" : \"application\";\n }\n\n appOrParcel.status = UNMOUNTING;\n\n const unmountChildrenParcels = Object.keys(appOrParcel.parcels).map(\n (parcelId) => appOrParcel.parcels[parcelId].unmountThisParcel()\n );\n\n let parcelError;\n\n return Promise.all(unmountChildrenParcels)\n .then(unmountAppOrParcel, (parcelError) => {\n // There is a parcel unmount error\n return unmountAppOrParcel().then(() => {\n // Unmounting the app/parcel succeeded, but unmounting its children parcels did not\n const parentError = Error(parcelError.message);\n if (hardFail) {\n throw transformErr(parentError, appOrParcel, SKIP_BECAUSE_BROKEN);\n } else {\n handleAppError(parentError, appOrParcel, SKIP_BECAUSE_BROKEN);\n }\n });\n })\n .then(() => appOrParcel);\n\n function unmountAppOrParcel() {\n // We always try to unmount the appOrParcel, even if the children parcels failed to unmount.\n return reasonableTime(appOrParcel, \"unmount\").then(\n () => {\n // The appOrParcel needs to stay in a broken status if its children parcels fail to unmount\n if (!parcelError) {\n appOrParcel.status = NOT_MOUNTED;\n }\n\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"unmount\",\n startTime,\n performance.now(),\n true\n );\n }\n },\n (err) => {\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"unmount\",\n startTime,\n performance.now(),\n false\n );\n }\n\n if (hardFail) {\n throw transformErr(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n } else {\n handleAppError(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n }\n }\n );\n }\n });\n}\n","import {\n NOT_MOUNTED,\n MOUNTED,\n SKIP_BECAUSE_BROKEN,\n MOUNTING,\n toName,\n isParcel,\n} from \"../applications/app.helpers.js\";\nimport { handleAppError, transformErr } from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\nimport CustomEvent from \"custom-event\";\nimport { toUnmountPromise } from \"./unmount.js\";\nimport { addProfileEntry } from \"../devtools/profiler.js\";\n\nlet beforeFirstMountFired = false;\nlet firstMountFired = false;\n\nexport function toMountPromise(appOrParcel, hardFail) {\n return Promise.resolve().then(() => {\n if (appOrParcel.status !== NOT_MOUNTED) {\n return appOrParcel;\n }\n\n let startTime, profileEventType;\n\n if (__PROFILE__) {\n profileEventType = isParcel(appOrParcel) ? \"parcel\" : \"application\";\n startTime = performance.now();\n }\n\n if (!beforeFirstMountFired) {\n window.dispatchEvent(new CustomEvent(\"single-spa:before-first-mount\"));\n beforeFirstMountFired = true;\n }\n\n appOrParcel.status = MOUNTING;\n\n return reasonableTime(appOrParcel, \"mount\")\n .then(() => {\n appOrParcel.status = MOUNTED;\n\n if (!firstMountFired) {\n window.dispatchEvent(new CustomEvent(\"single-spa:first-mount\"));\n firstMountFired = true;\n }\n\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"mount\",\n startTime,\n performance.now(),\n true\n );\n }\n\n return appOrParcel;\n })\n .catch((err) => {\n // If we fail to mount the appOrParcel, we should attempt to unmount it before putting in SKIP_BECAUSE_BROKEN\n // We temporarily put the appOrParcel into MOUNTED status so that toUnmountPromise actually attempts to unmount it\n // instead of just doing a no-op.\n appOrParcel.status = MOUNTED;\n return toUnmountPromise(appOrParcel, true).then(\n setSkipBecauseBroken,\n setSkipBecauseBroken\n );\n\n function setSkipBecauseBroken() {\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"mount\",\n startTime,\n performance.now(),\n false\n );\n }\n\n if (!hardFail) {\n handleAppError(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n return appOrParcel;\n } else {\n throw transformErr(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n }\n }\n });\n });\n}\n","import {\n validLifecycleFn,\n flattenFnArray,\n} from \"../lifecycles/lifecycle.helpers.js\";\nimport {\n NOT_BOOTSTRAPPED,\n NOT_MOUNTED,\n MOUNTED,\n LOADING_SOURCE_CODE,\n SKIP_BECAUSE_BROKEN,\n toName,\n} from \"../applications/app.helpers.js\";\nimport { toBootstrapPromise } from \"../lifecycles/bootstrap.js\";\nimport { toMountPromise } from \"../lifecycles/mount.js\";\nimport { toUpdatePromise } from \"../lifecycles/update.js\";\nimport { toUnmountPromise } from \"../lifecycles/unmount.js\";\nimport { ensureValidAppTimeouts } from \"../applications/timeouts.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\n\nlet parcelCount = 0;\nconst rootParcels = { parcels: {} };\n\n// This is a public api, exported to users of single-spa\nexport function mountRootParcel() {\n return mountParcel.apply(rootParcels, arguments);\n}\n\nexport function mountParcel(config, customProps) {\n const owningAppOrParcel = this;\n\n // Validate inputs\n if (!config || (typeof config !== \"object\" && typeof config !== \"function\")) {\n throw Error(\n formatErrorMessage(\n 2,\n __DEV__ &&\n \"Cannot mount parcel without a config object or config loading function\"\n )\n );\n }\n\n if (config.name && typeof config.name !== \"string\") {\n throw Error(\n formatErrorMessage(\n 3,\n __DEV__ &&\n `Parcel name must be a string, if provided. Was given ${typeof config.name}`,\n typeof config.name\n )\n );\n }\n\n const id = parcelCount++;\n let name = config.name || `parcel-${id}`;\n\n if (typeof customProps !== \"object\") {\n throw Error(\n formatErrorMessage(\n 4,\n __DEV__ &&\n `Parcel ${name} has invalid customProps -- must be an object but was given ${typeof customProps}`,\n name,\n typeof customProps\n )\n );\n }\n\n if (!customProps.domElement) {\n throw Error(\n formatErrorMessage(\n 5,\n __DEV__ &&\n `Parcel ${name} cannot be mounted without a domElement provided as a prop`,\n name\n )\n );\n }\n\n const passedConfigLoadingFunction = typeof config === \"function\";\n const configLoadingFunction = passedConfigLoadingFunction\n ? config\n : () => Promise.resolve(config);\n\n // Internal representation\n const parcel = {\n id,\n parcels: {},\n status: passedConfigLoadingFunction\n ? LOADING_SOURCE_CODE\n : NOT_BOOTSTRAPPED,\n customProps,\n parentName: toName(owningAppOrParcel),\n unmountThisParcel() {\n return mountPromise\n .then(() => {\n if (parcel.status !== MOUNTED) {\n throw Error(\n formatErrorMessage(\n 6,\n __DEV__ &&\n `Cannot unmount parcel '${name}' -- it is in a ${parcel.status} status`,\n name,\n parcel.status\n )\n );\n }\n return toUnmountPromise(parcel, true);\n })\n .then((value) => {\n if (parcel.parentName) {\n delete owningAppOrParcel.parcels[parcel.id];\n }\n\n return value;\n })\n .then((value) => {\n resolveUnmount(value);\n return value;\n })\n .catch((err) => {\n parcel.status = SKIP_BECAUSE_BROKEN;\n rejectUnmount(err);\n throw err;\n });\n },\n };\n\n // We return an external representation\n let externalRepresentation;\n\n // Add to owning app or parcel\n owningAppOrParcel.parcels[id] = parcel;\n\n let loadPromise = configLoadingFunction();\n\n if (!loadPromise || typeof loadPromise.then !== \"function\") {\n throw Error(\n formatErrorMessage(\n 7,\n __DEV__ &&\n `When mounting a parcel, the config loading function must return a promise that resolves with the parcel config`\n )\n );\n }\n\n loadPromise = loadPromise.then((config) => {\n if (!config) {\n throw Error(\n formatErrorMessage(\n 8,\n __DEV__ &&\n `When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config`\n )\n );\n }\n\n name = config.name || `parcel-${id}`;\n\n if (\n // ES Module objects don't have the object prototype\n Object.prototype.hasOwnProperty.call(config, \"bootstrap\") &&\n !validLifecycleFn(config.bootstrap)\n ) {\n throw Error(\n formatErrorMessage(\n 9,\n __DEV__ && `Parcel ${name} provided an invalid bootstrap function`,\n name\n )\n );\n }\n\n if (!validLifecycleFn(config.mount)) {\n throw Error(\n formatErrorMessage(\n 10,\n __DEV__ && `Parcel ${name} must have a valid mount function`,\n name\n )\n );\n }\n\n if (!validLifecycleFn(config.unmount)) {\n throw Error(\n formatErrorMessage(\n 11,\n __DEV__ && `Parcel ${name} must have a valid unmount function`,\n name\n )\n );\n }\n\n if (config.update && !validLifecycleFn(config.update)) {\n throw Error(\n formatErrorMessage(\n 12,\n __DEV__ && `Parcel ${name} provided an invalid update function`,\n name\n )\n );\n }\n\n const bootstrap = flattenFnArray(config, \"bootstrap\");\n const mount = flattenFnArray(config, \"mount\");\n const unmount = flattenFnArray(config, \"unmount\");\n\n parcel.status = NOT_BOOTSTRAPPED;\n parcel.name = name;\n parcel.bootstrap = bootstrap;\n parcel.mount = mount;\n parcel.unmount = unmount;\n parcel.timeouts = ensureValidAppTimeouts(config.timeouts);\n\n if (config.update) {\n parcel.update = flattenFnArray(config, \"update\");\n externalRepresentation.update = function (customProps) {\n parcel.customProps = customProps;\n\n return promiseWithoutReturnValue(toUpdatePromise(parcel));\n };\n }\n });\n\n // Start bootstrapping and mounting\n // The .then() causes the work to be put on the event loop instead of happening immediately\n const bootstrapPromise = loadPromise.then(() =>\n toBootstrapPromise(parcel, true)\n );\n const mountPromise = bootstrapPromise.then(() =>\n toMountPromise(parcel, true)\n );\n\n let resolveUnmount, rejectUnmount;\n\n const unmountPromise = new Promise((resolve, reject) => {\n resolveUnmount = resolve;\n rejectUnmount = reject;\n });\n\n externalRepresentation = {\n mount() {\n return promiseWithoutReturnValue(\n Promise.resolve().then(() => {\n if (parcel.status !== NOT_MOUNTED) {\n throw Error(\n formatErrorMessage(\n 13,\n __DEV__ &&\n `Cannot mount parcel '${name}' -- it is in a ${parcel.status} status`,\n name,\n parcel.status\n )\n );\n }\n\n // Add to owning app or parcel\n owningAppOrParcel.parcels[id] = parcel;\n\n return toMountPromise(parcel);\n })\n );\n },\n unmount() {\n return promiseWithoutReturnValue(parcel.unmountThisParcel());\n },\n getStatus() {\n return parcel.status;\n },\n loadPromise: promiseWithoutReturnValue(loadPromise),\n bootstrapPromise: promiseWithoutReturnValue(bootstrapPromise),\n mountPromise: promiseWithoutReturnValue(mountPromise),\n unmountPromise: promiseWithoutReturnValue(unmountPromise),\n };\n\n return externalRepresentation;\n}\n\nfunction promiseWithoutReturnValue(promise) {\n return promise.then(() => null);\n}\n","import {\n UPDATING,\n MOUNTED,\n SKIP_BECAUSE_BROKEN,\n toName,\n isParcel,\n} from \"../applications/app.helpers.js\";\nimport {\n transformErr,\n formatErrorMessage,\n} from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\nimport { addProfileEntry } from \"../devtools/profiler.js\";\n\nexport function toUpdatePromise(appOrParcel) {\n return Promise.resolve().then(() => {\n let startTime, profileEventType;\n\n if (__PROFILE__) {\n profileEventType = isParcel(appOrParcel) ? \"parcel\" : \"application\";\n startTime = performance.now();\n }\n\n if (appOrParcel.status !== MOUNTED) {\n throw Error(\n formatErrorMessage(\n 32,\n __DEV__ &&\n `Cannot update parcel '${toName(\n appOrParcel\n )}' because it is not mounted`,\n toName(appOrParcel)\n )\n );\n }\n\n appOrParcel.status = UPDATING;\n\n return reasonableTime(appOrParcel, \"update\")\n .then(() => {\n appOrParcel.status = MOUNTED;\n\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"update\",\n startTime,\n performance.now(),\n true\n );\n }\n\n return appOrParcel;\n })\n .catch((err) => {\n if (__PROFILE__) {\n addProfileEntry(\n profileEventType,\n toName(appOrParcel),\n \"update\",\n startTime,\n performance.now(),\n false\n );\n }\n\n throw transformErr(err, appOrParcel, SKIP_BECAUSE_BROKEN);\n });\n });\n}\n","import * as singleSpa from \"../single-spa.js\";\nimport { mountParcel } from \"../parcels/mount-parcel.js\";\nimport { assign } from \"../utils/assign.js\";\nimport { isParcel, toName } from \"../applications/app.helpers.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\n\nexport function getProps(appOrParcel) {\n const name = toName(appOrParcel);\n let customProps =\n typeof appOrParcel.customProps === \"function\"\n ? appOrParcel.customProps(name, window.location)\n : appOrParcel.customProps;\n if (\n typeof customProps !== \"object\" ||\n customProps === null ||\n Array.isArray(customProps)\n ) {\n customProps = {};\n console.warn(\n formatErrorMessage(\n 40,\n __DEV__ &&\n `single-spa: ${name}'s customProps function must return an object. Received ${customProps}`\n ),\n name,\n customProps\n );\n }\n const result = assign({}, customProps, {\n name,\n mountParcel: mountParcel.bind(appOrParcel),\n singleSpa,\n });\n\n if (isParcel(appOrParcel)) {\n result.unmountSelf = appOrParcel.unmountThisParcel;\n }\n\n return result;\n}\n","import { assign } from \"../utils/assign\";\nimport { getProps } from \"../lifecycles/prop.helpers\";\nimport { objectType, toName } from \"./app.helpers\";\nimport { formatErrorMessage } from \"./app-errors\";\n\nconst defaultWarningMillis = 1000;\n\nconst globalTimeoutConfig = {\n bootstrap: {\n millis: 4000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n mount: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n unmount: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n unload: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n update: {\n millis: 3000,\n dieOnTimeout: false,\n warningMillis: defaultWarningMillis,\n },\n};\n\nexport function setBootstrapMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 16,\n __DEV__ &&\n `bootstrap max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.bootstrap = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setMountMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 17,\n __DEV__ &&\n `mount max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.mount = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setUnmountMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 18,\n __DEV__ &&\n `unmount max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.unmount = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function setUnloadMaxTime(time, dieOnTimeout, warningMillis) {\n if (typeof time !== \"number\" || time <= 0) {\n throw Error(\n formatErrorMessage(\n 19,\n __DEV__ &&\n `unload max time must be a positive integer number of milliseconds`\n )\n );\n }\n\n globalTimeoutConfig.unload = {\n millis: time,\n dieOnTimeout,\n warningMillis: warningMillis || defaultWarningMillis,\n };\n}\n\nexport function reasonableTime(appOrParcel, lifecycle) {\n const timeoutConfig = appOrParcel.timeouts[lifecycle];\n const warningPeriod = timeoutConfig.warningMillis;\n const type = objectType(appOrParcel);\n\n return new Promise((resolve, reject) => {\n let finished = false;\n let errored = false;\n\n appOrParcel[lifecycle](getProps(appOrParcel))\n .then((val) => {\n finished = true;\n resolve(val);\n })\n .catch((val) => {\n finished = true;\n reject(val);\n });\n\n setTimeout(() => maybeTimingOut(1), warningPeriod);\n setTimeout(() => maybeTimingOut(true), timeoutConfig.millis);\n\n const errMsg = formatErrorMessage(\n 31,\n __DEV__ &&\n `Lifecycle function ${lifecycle} for ${type} ${toName(\n appOrParcel\n )} lifecycle did not resolve or reject for ${timeoutConfig.millis} ms.`,\n lifecycle,\n type,\n toName(appOrParcel),\n timeoutConfig.millis\n );\n\n function maybeTimingOut(shouldError) {\n if (!finished) {\n if (shouldError === true) {\n errored = true;\n if (timeoutConfig.dieOnTimeout) {\n reject(Error(errMsg));\n } else {\n console.error(errMsg);\n //don't resolve or reject, we're waiting this one out\n }\n } else if (!errored) {\n const numWarnings = shouldError;\n const numMillis = numWarnings * warningPeriod;\n console.warn(errMsg);\n if (numMillis + warningPeriod < timeoutConfig.millis) {\n setTimeout(() => maybeTimingOut(numWarnings + 1), warningPeriod);\n }\n }\n }\n }\n });\n}\n\nexport function ensureValidAppTimeouts(timeouts) {\n const result = {};\n\n for (let key in globalTimeoutConfig) {\n result[key] = assign(\n {},\n globalTimeoutConfig[key],\n (timeouts && timeouts[key]) || {}\n );\n }\n\n return result;\n}\n","import {\n LOAD_ERROR,\n NOT_BOOTSTRAPPED,\n LOADING_SOURCE_CODE,\n SKIP_BECAUSE_BROKEN,\n NOT_LOADED,\n objectType,\n toName,\n} from \"../applications/app.helpers.js\";\nimport { ensureValidAppTimeouts } from \"../applications/timeouts.js\";\nimport {\n handleAppError,\n formatErrorMessage,\n} from \"../applications/app-errors.js\";\nimport {\n flattenFnArray,\n smellsLikeAPromise,\n validLifecycleFn,\n} from \"./lifecycle.helpers.js\";\nimport { getProps } from \"./prop.helpers.js\";\nimport { assign } from \"../utils/assign.js\";\nimport { addProfileEntry } from \"../devtools/profiler.js\";\n\nexport function toLoadPromise(appOrParcel) {\n return Promise.resolve().then(() => {\n if (appOrParcel.loadPromise) {\n return appOrParcel.loadPromise;\n }\n\n if (\n appOrParcel.status !== NOT_LOADED &&\n appOrParcel.status !== LOAD_ERROR\n ) {\n return appOrParcel;\n }\n\n let startTime;\n\n if (__PROFILE__) {\n startTime = performance.now();\n }\n\n appOrParcel.status = LOADING_SOURCE_CODE;\n\n let appOpts, isUserErr;\n\n return (appOrParcel.loadPromise = Promise.resolve()\n .then(() => {\n const loadPromise = appOrParcel.loadApp(getProps(appOrParcel));\n if (!smellsLikeAPromise(loadPromise)) {\n // The name of the app will be prepended to this error message inside of the handleAppError function\n isUserErr = true;\n throw Error(\n formatErrorMessage(\n 33,\n __DEV__ &&\n `single-spa loading function did not return a promise. Check the second argument to registerApplication('${toName(\n appOrParcel\n )}', loadingFunction, activityFunction)`,\n toName(appOrParcel)\n )\n );\n }\n return loadPromise.then((val) => {\n appOrParcel.loadErrorTime = null;\n\n appOpts = val;\n\n let validationErrMessage, validationErrCode;\n\n if (typeof appOpts !== \"object\") {\n validationErrCode = 34;\n if (__DEV__) {\n validationErrMessage = `does not export anything`;\n }\n }\n\n if (\n // ES Modules don't have the Object prototype\n Object.prototype.hasOwnProperty.call(appOpts, \"bootstrap\") &&\n !validLifecycleFn(appOpts.bootstrap)\n ) {\n validationErrCode = 35;\n if (__DEV__) {\n validationErrMessage = `does not export a valid bootstrap function or array of functions`;\n }\n }\n\n if (!validLifecycleFn(appOpts.mount)) {\n validationErrCode = 36;\n if (__DEV__) {\n validationErrMessage = `does not export a mount function or array of functions`;\n }\n }\n\n if (!validLifecycleFn(appOpts.unmount)) {\n validationErrCode = 37;\n if (__DEV__) {\n validationErrMessage = `does not export a unmount function or array of functions`;\n }\n }\n\n const type = objectType(appOpts);\n\n if (validationErrCode) {\n let appOptsStr;\n try {\n appOptsStr = JSON.stringify(appOpts);\n } catch {}\n console.error(\n formatErrorMessage(\n validationErrCode,\n __DEV__ &&\n `The loading function for single-spa ${type} '${toName(\n appOrParcel\n )}' resolved with the following, which does not have bootstrap, mount, and unmount functions`,\n type,\n toName(appOrParcel),\n appOptsStr\n ),\n appOpts\n );\n handleAppError(\n validationErrMessage,\n appOrParcel,\n SKIP_BECAUSE_BROKEN\n );\n return appOrParcel;\n }\n\n if (appOpts.devtools && appOpts.devtools.overlays) {\n appOrParcel.devtools.overlays = assign(\n {},\n appOrParcel.devtools.overlays,\n appOpts.devtools.overlays\n );\n }\n\n appOrParcel.status = NOT_BOOTSTRAPPED;\n appOrParcel.bootstrap = flattenFnArray(appOpts, \"bootstrap\");\n appOrParcel.mount = flattenFnArray(appOpts, \"mount\");\n appOrParcel.unmount = flattenFnArray(appOpts, \"unmount\");\n appOrParcel.unload = flattenFnArray(appOpts, \"unload\");\n appOrParcel.timeouts = ensureValidAppTimeouts(appOpts.timeouts);\n\n delete appOrParcel.loadPromise;\n\n if (__PROFILE__) {\n addProfileEntry(\n \"application\",\n toName(appOrParcel),\n \"load\",\n startTime,\n performance.now(),\n true\n );\n }\n\n return appOrParcel;\n });\n })\n .catch((err) => {\n delete appOrParcel.loadPromise;\n\n let newStatus;\n if (isUserErr) {\n newStatus = SKIP_BECAUSE_BROKEN;\n } else {\n newStatus = LOAD_ERROR;\n appOrParcel.loadErrorTime = new Date().getTime();\n }\n handleAppError(err, appOrParcel, newStatus);\n\n if (__PROFILE__) {\n addProfileEntry(\n \"application\",\n toName(appOrParcel),\n \"load\",\n startTime,\n performance.now(),\n false\n );\n }\n\n return appOrParcel;\n }));\n });\n}\n","export const isInBrowser = typeof window !== \"undefined\";\n","import { reroute } from \"./reroute.js\";\nimport { find } from \"../utils/find.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\nimport { isInBrowser } from \"../utils/runtime-environment.js\";\n\n/* We capture navigation event listeners so that we can make sure\n * that application navigation listeners are not called until\n * single-spa has ensured that the correct applications are\n * unmounted and mounted.\n */\nconst capturedEventListeners = {\n hashchange: [],\n popstate: [],\n};\n\nexport const routingEventsListeningTo = [\"hashchange\", \"popstate\"];\n\nexport function navigateToUrl(obj) {\n let url;\n if (typeof obj === \"string\") {\n url = obj;\n } else if (this && this.href) {\n url = this.href;\n } else if (\n obj &&\n obj.currentTarget &&\n obj.currentTarget.href &&\n obj.preventDefault\n ) {\n url = obj.currentTarget.href;\n obj.preventDefault();\n } else {\n throw Error(\n formatErrorMessage(\n 14,\n __DEV__ &&\n `singleSpaNavigate/navigateToUrl must be either called with a string url, with an tag as its context, or with an event whose currentTarget is an tag`\n )\n );\n }\n\n const current = parseUri(window.location.href);\n const destination = parseUri(url);\n\n if (url.indexOf(\"#\") === 0) {\n window.location.hash = destination.hash;\n } else if (current.host !== destination.host && destination.host) {\n if (process.env.BABEL_ENV === \"test\") {\n return { wouldHaveReloadedThePage: true };\n } else {\n window.location.href = url;\n }\n } else if (\n destination.pathname === current.pathname &&\n destination.search === current.search\n ) {\n window.location.hash = destination.hash;\n } else {\n // different path, host, or query params\n window.history.pushState(null, null, url);\n }\n}\n\nexport function callCapturedEventListeners(eventArguments) {\n if (eventArguments) {\n const eventType = eventArguments[0].type;\n if (routingEventsListeningTo.indexOf(eventType) >= 0) {\n capturedEventListeners[eventType].forEach((listener) => {\n try {\n // The error thrown by application event listener should not break single-spa down.\n // Just like https://github.com/single-spa/single-spa/blob/85f5042dff960e40936f3a5069d56fc9477fac04/src/navigation/reroute.js#L140-L146 did\n listener.apply(this, eventArguments);\n } catch (e) {\n setTimeout(() => {\n throw e;\n });\n }\n });\n }\n }\n}\n\nlet urlRerouteOnly;\n\nfunction urlReroute() {\n reroute([], arguments);\n}\n\nfunction patchedUpdateState(updateState, methodName) {\n return function () {\n const urlBefore = window.location.href;\n const result = updateState.apply(this, arguments);\n const urlAfter = window.location.href;\n\n if (!urlRerouteOnly || urlBefore !== urlAfter) {\n // fire an artificial popstate event so that\n // single-spa applications know about routing that\n // occurs in a different application\n window.dispatchEvent(\n createPopStateEvent(window.history.state, methodName)\n );\n }\n\n return result;\n };\n}\n\nfunction createPopStateEvent(state, originalMethodName) {\n // https://github.com/single-spa/single-spa/issues/224 and https://github.com/single-spa/single-spa-angular/issues/49\n // We need a popstate event even though the browser doesn't do one by default when you call replaceState, so that\n // all the applications can reroute. We explicitly identify this extraneous event by setting singleSpa=true and\n // singleSpaTrigger= on the event instance.\n let evt;\n try {\n evt = new PopStateEvent(\"popstate\", { state });\n } catch (err) {\n // IE 11 compatibility https://github.com/single-spa/single-spa/issues/299\n // https://docs.microsoft.com/en-us/openspecs/ie_standards/ms-html5e/bd560f47-b349-4d2c-baa8-f1560fb489dd\n evt = document.createEvent(\"PopStateEvent\");\n evt.initPopStateEvent(\"popstate\", false, false, state);\n }\n evt.singleSpa = true;\n evt.singleSpaTrigger = originalMethodName;\n return evt;\n}\n\nexport let originalReplaceState = null;\n\nlet historyApiIsPatched = false;\n\n// We patch the history API so single-spa is notified of all calls to pushState/replaceState.\n// We patch addEventListener/removeEventListener so we can capture all popstate/hashchange event listeners,\n// and delay calling them until single-spa has finished mounting/unmounting applications\nexport function patchHistoryApi(opts) {\n if (historyApiIsPatched) {\n throw Error(\n formatErrorMessage(\n 43,\n __DEV__ &&\n `single-spa: patchHistoryApi() was called after the history api was already patched.`\n )\n );\n }\n\n // True by default, as a performance optimization that reduces\n // the number of extraneous popstate events\n urlRerouteOnly =\n opts && opts.hasOwnProperty(\"urlRerouteOnly\") ? opts.urlRerouteOnly : true;\n\n historyApiIsPatched = true;\n\n originalReplaceState = window.history.replaceState;\n\n // We will trigger an app change for any routing events.\n window.addEventListener(\"hashchange\", urlReroute);\n window.addEventListener(\"popstate\", urlReroute);\n\n // Monkeypatch addEventListener so that we can ensure correct timing\n const originalAddEventListener = window.addEventListener;\n const originalRemoveEventListener = window.removeEventListener;\n window.addEventListener = function (eventName, fn) {\n if (typeof fn === \"function\") {\n if (\n routingEventsListeningTo.indexOf(eventName) >= 0 &&\n !find(capturedEventListeners[eventName], (listener) => listener === fn)\n ) {\n capturedEventListeners[eventName].push(fn);\n return;\n }\n }\n\n return originalAddEventListener.apply(this, arguments);\n };\n\n window.removeEventListener = function (eventName, listenerFn) {\n if (typeof listenerFn === \"function\") {\n if (routingEventsListeningTo.indexOf(eventName) >= 0) {\n capturedEventListeners[eventName] = capturedEventListeners[\n eventName\n ].filter((fn) => fn !== listenerFn);\n }\n }\n\n return originalRemoveEventListener.apply(this, arguments);\n };\n\n window.history.pushState = patchedUpdateState(\n window.history.pushState,\n \"pushState\"\n );\n window.history.replaceState = patchedUpdateState(\n originalReplaceState,\n \"replaceState\"\n );\n}\n\n// Detect if single-spa has already been loaded on the page.\n// If so, warn because this can result in lots of problems, including\n// lots of extraneous popstate events and unexpected results for\n// apis like getAppNames().\nif (isInBrowser) {\n if (window.singleSpaNavigate) {\n console.warn(\n formatErrorMessage(\n 41,\n __DEV__ &&\n \"single-spa has been loaded twice on the page. This can result in unexpected behavior.\"\n )\n );\n } else {\n /* For convenience in `onclick` attributes, we expose a global function for navigating to\n * whatever an tag's href is.\n */\n window.singleSpaNavigate = navigateToUrl;\n }\n}\n\nfunction parseUri(str) {\n const anchor = document.createElement(\"a\");\n anchor.href = str;\n return anchor;\n}\n","import { routingEventsListeningTo } from \"./navigation/navigation-events.js\";\n\nlet hasInitialized = false;\n\nexport function ensureJQuerySupport(jQuery = window.jQuery) {\n if (!jQuery) {\n if (window.$ && window.$.fn && window.$.fn.jquery) {\n jQuery = window.$;\n }\n }\n\n if (jQuery && !hasInitialized) {\n const originalJQueryOn = jQuery.fn.on;\n const originalJQueryOff = jQuery.fn.off;\n\n jQuery.fn.on = function (eventString, fn) {\n return captureRoutingEvents.call(\n this,\n originalJQueryOn,\n window.addEventListener,\n eventString,\n fn,\n arguments\n );\n };\n\n jQuery.fn.off = function (eventString, fn) {\n return captureRoutingEvents.call(\n this,\n originalJQueryOff,\n window.removeEventListener,\n eventString,\n fn,\n arguments\n );\n };\n\n hasInitialized = true;\n }\n}\n\nfunction captureRoutingEvents(\n originalJQueryFunction,\n nativeFunctionToCall,\n eventString,\n fn,\n originalArgs\n) {\n if (typeof eventString !== \"string\") {\n return originalJQueryFunction.apply(this, originalArgs);\n }\n\n const eventNames = eventString.split(/\\s+/);\n eventNames.forEach((eventName) => {\n if (routingEventsListeningTo.indexOf(eventName) >= 0) {\n nativeFunctionToCall(eventName, fn);\n eventString = eventString.replace(eventName, \"\");\n }\n });\n\n if (eventString.trim() === \"\") {\n return this;\n } else {\n return originalJQueryFunction.apply(this, originalArgs);\n }\n}\n","import {\n NOT_MOUNTED,\n UNLOADING,\n NOT_LOADED,\n LOAD_ERROR,\n SKIP_BECAUSE_BROKEN,\n toName,\n} from \"../applications/app.helpers.js\";\nimport { handleAppError } from \"../applications/app-errors.js\";\nimport { reasonableTime } from \"../applications/timeouts.js\";\nimport { addProfileEntry } from \"../devtools/profiler.js\";\n\nconst appsToUnload = {};\n\nexport function toUnloadPromise(appOrParcel) {\n return Promise.resolve().then(() => {\n const unloadInfo = appsToUnload[toName(appOrParcel)];\n\n if (!unloadInfo) {\n /* No one has called unloadApplication for this app,\n */\n return appOrParcel;\n }\n\n if (appOrParcel.status === NOT_LOADED) {\n /* This app is already unloaded. We just need to clean up\n * anything that still thinks we need to unload the app.\n */\n finishUnloadingApp(appOrParcel, unloadInfo);\n return appOrParcel;\n }\n\n if (appOrParcel.status === UNLOADING) {\n /* Both unloadApplication and reroute want to unload this app.\n * It only needs to be done once, though.\n */\n return unloadInfo.promise.then(() => appOrParcel);\n }\n\n if (\n appOrParcel.status !== NOT_MOUNTED &&\n appOrParcel.status !== LOAD_ERROR\n ) {\n /* The app cannot be unloaded until it is unmounted.\n */\n return appOrParcel;\n }\n\n let startTime;\n\n if (__PROFILE__) {\n startTime = performance.now();\n }\n\n const unloadPromise =\n appOrParcel.status === LOAD_ERROR\n ? Promise.resolve()\n : reasonableTime(appOrParcel, \"unload\");\n\n appOrParcel.status = UNLOADING;\n\n return unloadPromise\n .then(() => {\n if (__PROFILE__) {\n addProfileEntry(\n \"application\",\n toName(appOrParcel),\n \"unload\",\n startTime,\n performance.now(),\n true\n );\n }\n\n finishUnloadingApp(appOrParcel, unloadInfo);\n\n return appOrParcel;\n })\n .catch((err) => {\n if (__PROFILE__) {\n addProfileEntry(\n \"application\",\n toName(appOrParcel),\n \"unload\",\n startTime,\n performance.now(),\n false\n );\n }\n\n errorUnloadingApp(appOrParcel, unloadInfo, err);\n\n return appOrParcel;\n });\n });\n}\n\nfunction finishUnloadingApp(app, unloadInfo) {\n delete appsToUnload[toName(app)];\n\n // Unloaded apps don't have lifecycles\n delete app.bootstrap;\n delete app.mount;\n delete app.unmount;\n delete app.unload;\n\n app.status = NOT_LOADED;\n\n /* resolve the promise of whoever called unloadApplication.\n * This should be done after all other cleanup/bookkeeping\n */\n unloadInfo.resolve();\n}\n\nfunction errorUnloadingApp(app, unloadInfo, err) {\n delete appsToUnload[toName(app)];\n\n // Unloaded apps don't have lifecycles\n delete app.bootstrap;\n delete app.mount;\n delete app.unmount;\n delete app.unload;\n\n handleAppError(err, app, SKIP_BECAUSE_BROKEN);\n unloadInfo.reject(err);\n}\n\nexport function addAppToUnload(app, promiseGetter, resolve, reject) {\n appsToUnload[toName(app)] = { app, resolve, reject };\n Object.defineProperty(appsToUnload[toName(app)], \"promise\", {\n get: promiseGetter,\n });\n}\n\nexport function getAppUnloadInfo(appName) {\n return appsToUnload[appName];\n}\n","import { ensureJQuerySupport } from \"../jquery-support.js\";\nimport {\n isActive,\n toName,\n NOT_LOADED,\n NOT_BOOTSTRAPPED,\n NOT_MOUNTED,\n MOUNTED,\n LOAD_ERROR,\n SKIP_BECAUSE_BROKEN,\n LOADING_SOURCE_CODE,\n shouldBeActive,\n} from \"./app.helpers.js\";\nimport { reroute, triggerAppChange } from \"../navigation/reroute.js\";\nimport { find } from \"../utils/find.js\";\nimport { toUnmountPromise } from \"../lifecycles/unmount.js\";\nimport {\n toUnloadPromise,\n getAppUnloadInfo,\n addAppToUnload,\n} from \"../lifecycles/unload.js\";\nimport { formatErrorMessage } from \"./app-errors.js\";\nimport { isInBrowser } from \"../utils/runtime-environment.js\";\nimport { assign } from \"../utils/assign\";\nimport { isStarted } from \"../start.js\";\n\nconst apps = [];\n\nexport function getAppChanges() {\n const appsToUnload = [],\n appsToUnmount = [],\n appsToLoad = [],\n appsToMount = [];\n\n // We re-attempt to download applications in LOAD_ERROR after a timeout of 200 milliseconds\n const currentTime = new Date().getTime();\n\n apps.forEach((app) => {\n const appShouldBeActive =\n app.status !== SKIP_BECAUSE_BROKEN && shouldBeActive(app);\n\n switch (app.status) {\n case LOAD_ERROR:\n if (appShouldBeActive && currentTime - app.loadErrorTime >= 200) {\n appsToLoad.push(app);\n }\n break;\n case NOT_LOADED:\n case LOADING_SOURCE_CODE:\n if (appShouldBeActive) {\n appsToLoad.push(app);\n }\n break;\n case NOT_BOOTSTRAPPED:\n case NOT_MOUNTED:\n if (!appShouldBeActive && getAppUnloadInfo(toName(app))) {\n appsToUnload.push(app);\n } else if (appShouldBeActive) {\n appsToMount.push(app);\n }\n break;\n case MOUNTED:\n if (!appShouldBeActive) {\n appsToUnmount.push(app);\n }\n break;\n // all other statuses are ignored\n }\n });\n\n return { appsToUnload, appsToUnmount, appsToLoad, appsToMount };\n}\n\nexport function getMountedApps() {\n return apps.filter(isActive).map(toName);\n}\n\nexport function getAppNames() {\n return apps.map(toName);\n}\n\n// used in devtools, not (currently) exposed as a single-spa API\nexport function getRawAppData() {\n return [...apps];\n}\n\nexport function getAppStatus(appName) {\n const app = find(apps, (app) => toName(app) === appName);\n return app ? app.status : null;\n}\n\nlet startWarningInitialized = false;\n\nexport function registerApplication(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n) {\n const registration = sanitizeArguments(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n );\n\n if (!isStarted() && !startWarningInitialized) {\n startWarningInitialized = true;\n\n setTimeout(() => {\n if (!isStarted()) {\n console.warn(\n formatErrorMessage(\n 1,\n __DEV__ &&\n `singleSpa.start() has not been called, 5000ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted.`\n )\n );\n }\n }, 5000);\n }\n\n if (getAppNames().indexOf(registration.name) !== -1)\n throw Error(\n formatErrorMessage(\n 21,\n __DEV__ &&\n `There is already an app registered with name ${registration.name}`,\n registration.name\n )\n );\n\n apps.push(\n assign(\n {\n loadErrorTime: null,\n status: NOT_LOADED,\n parcels: {},\n devtools: {\n overlays: {\n options: {},\n selectors: [],\n },\n },\n },\n registration\n )\n );\n\n if (isInBrowser) {\n ensureJQuerySupport();\n reroute();\n }\n}\n\nexport function checkActivityFunctions(location = window.location) {\n return apps.filter((app) => app.activeWhen(location)).map(toName);\n}\n\nexport function unregisterApplication(appName) {\n if (apps.filter((app) => toName(app) === appName).length === 0) {\n throw Error(\n formatErrorMessage(\n 25,\n __DEV__ &&\n `Cannot unregister application '${appName}' because no such application has been registered`,\n appName\n )\n );\n }\n\n const unloadPromise = isInBrowser\n ? // See https://github.com/single-spa/single-spa/issues/871 for why waitForUnmount is false\n unloadApplication(appName, { waitForUnmount: false })\n : Promise.resolve();\n\n return unloadPromise.then(() => {\n const appIndex = apps.map(toName).indexOf(appName);\n apps.splice(appIndex, 1);\n });\n}\n\nexport function unloadApplication(appName, opts = { waitForUnmount: false }) {\n if (typeof appName !== \"string\") {\n throw Error(\n formatErrorMessage(\n 26,\n __DEV__ && `unloadApplication requires a string 'appName'`\n )\n );\n }\n const app = find(apps, (App) => toName(App) === appName);\n if (!app) {\n throw Error(\n formatErrorMessage(\n 27,\n __DEV__ &&\n `Could not unload application '${appName}' because no such application has been registered`,\n appName\n )\n );\n }\n\n const appUnloadInfo = getAppUnloadInfo(toName(app));\n if (opts && opts.waitForUnmount) {\n // We need to wait for unmount before unloading the app\n\n if (appUnloadInfo) {\n // Someone else is already waiting for this, too\n return appUnloadInfo.promise;\n } else {\n // We're the first ones wanting the app to be resolved.\n const promise = new Promise((resolve, reject) => {\n addAppToUnload(app, () => promise, resolve, reject);\n });\n return promise;\n }\n } else {\n /* We should unmount the app, unload it, and remount it immediately.\n */\n\n let resultPromise;\n\n if (appUnloadInfo) {\n // Someone else is already waiting for this app to unload\n resultPromise = appUnloadInfo.promise;\n immediatelyUnloadApp(app, appUnloadInfo.resolve, appUnloadInfo.reject);\n } else {\n // We're the first ones wanting the app to be resolved.\n resultPromise = new Promise((resolve, reject) => {\n addAppToUnload(app, () => resultPromise, resolve, reject);\n immediatelyUnloadApp(app, resolve, reject);\n });\n }\n\n return resultPromise;\n }\n}\n\nfunction immediatelyUnloadApp(app, resolve, reject) {\n Promise.resolve()\n .then(() => {\n // Before unmounting the application, we first must wait for it to finish mounting\n // Otherwise, the test for issue 871 in unregister-application.spec.js fails because\n // the application isn't really unmounted.\n if (\n find(checkActivityFunctions(), (activeApp) => activeApp === toName(app))\n ) {\n return triggerAppChange();\n }\n })\n .then(() => {\n return toUnmountPromise(app)\n .then(toUnloadPromise)\n .then(() => {\n resolve();\n setTimeout(() => {\n // reroute, but the unload promise is done\n reroute();\n });\n });\n })\n .catch(reject);\n}\n\nfunction validateRegisterWithArguments(\n name,\n appOrLoadApp,\n activeWhen,\n customProps\n) {\n if (typeof name !== \"string\" || name.length === 0)\n throw Error(\n formatErrorMessage(\n 20,\n __DEV__ &&\n `The 1st argument to registerApplication must be a non-empty string 'appName'`\n )\n );\n\n if (!appOrLoadApp)\n throw Error(\n formatErrorMessage(\n 23,\n __DEV__ &&\n \"The 2nd argument to registerApplication must be an application or loading application function\"\n )\n );\n\n if (typeof activeWhen !== \"function\")\n throw Error(\n formatErrorMessage(\n 24,\n __DEV__ &&\n \"The 3rd argument to registerApplication must be an activeWhen function\"\n )\n );\n\n if (!validCustomProps(customProps))\n throw Error(\n formatErrorMessage(\n 22,\n __DEV__ &&\n \"The optional 4th argument is a customProps and must be an object\"\n )\n );\n}\n\nexport function validateRegisterWithConfig(config) {\n if (Array.isArray(config) || config === null)\n throw Error(\n formatErrorMessage(\n 39,\n __DEV__ && \"Configuration object can't be an Array or null!\"\n )\n );\n const validKeys = [\"name\", \"app\", \"activeWhen\", \"customProps\"];\n const invalidKeys = Object.keys(config).reduce(\n (invalidKeys, prop) =>\n validKeys.indexOf(prop) >= 0 ? invalidKeys : invalidKeys.concat(prop),\n []\n );\n if (invalidKeys.length !== 0)\n throw Error(\n formatErrorMessage(\n 38,\n __DEV__ &&\n `The configuration object accepts only: ${validKeys.join(\n \", \"\n )}. Invalid keys: ${invalidKeys.join(\", \")}.`,\n validKeys.join(\", \"),\n invalidKeys.join(\", \")\n )\n );\n if (typeof config.name !== \"string\" || config.name.length === 0)\n throw Error(\n formatErrorMessage(\n 20,\n __DEV__ &&\n \"The config.name on registerApplication must be a non-empty string\"\n )\n );\n if (typeof config.app !== \"object\" && typeof config.app !== \"function\")\n throw Error(\n formatErrorMessage(\n 20,\n __DEV__ &&\n \"The config.app on registerApplication must be an application or a loading function\"\n )\n );\n const allowsStringAndFunction = (activeWhen) =>\n typeof activeWhen === \"string\" || typeof activeWhen === \"function\";\n if (\n !allowsStringAndFunction(config.activeWhen) &&\n !(\n Array.isArray(config.activeWhen) &&\n config.activeWhen.every(allowsStringAndFunction)\n )\n )\n throw Error(\n formatErrorMessage(\n 24,\n __DEV__ &&\n \"The config.activeWhen on registerApplication must be a string, function or an array with both\"\n )\n );\n if (!validCustomProps(config.customProps))\n throw Error(\n formatErrorMessage(\n 22,\n __DEV__ && \"The optional config.customProps must be an object\"\n )\n );\n}\n\nfunction validCustomProps(customProps) {\n return (\n !customProps ||\n typeof customProps === \"function\" ||\n (typeof customProps === \"object\" &&\n customProps !== null &&\n !Array.isArray(customProps))\n );\n}\n\nfunction sanitizeArguments(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n) {\n const usingObjectAPI = typeof appNameOrConfig === \"object\";\n\n const registration = {\n name: null,\n loadApp: null,\n activeWhen: null,\n customProps: null,\n };\n\n if (usingObjectAPI) {\n validateRegisterWithConfig(appNameOrConfig);\n registration.name = appNameOrConfig.name;\n registration.loadApp = appNameOrConfig.app;\n registration.activeWhen = appNameOrConfig.activeWhen;\n registration.customProps = appNameOrConfig.customProps;\n } else {\n validateRegisterWithArguments(\n appNameOrConfig,\n appOrLoadApp,\n activeWhen,\n customProps\n );\n registration.name = appNameOrConfig;\n registration.loadApp = appOrLoadApp;\n registration.activeWhen = activeWhen;\n registration.customProps = customProps;\n }\n\n registration.loadApp = sanitizeLoadApp(registration.loadApp);\n registration.customProps = sanitizeCustomProps(registration.customProps);\n registration.activeWhen = sanitizeActiveWhen(registration.activeWhen);\n\n return registration;\n}\n\nfunction sanitizeLoadApp(loadApp) {\n if (typeof loadApp !== \"function\") {\n return () => Promise.resolve(loadApp);\n }\n\n return loadApp;\n}\n\nfunction sanitizeCustomProps(customProps) {\n return customProps ? customProps : {};\n}\n\nfunction sanitizeActiveWhen(activeWhen) {\n let activeWhenArray = Array.isArray(activeWhen) ? activeWhen : [activeWhen];\n activeWhenArray = activeWhenArray.map((activeWhenOrPath) =>\n typeof activeWhenOrPath === \"function\"\n ? activeWhenOrPath\n : pathToActiveWhen(activeWhenOrPath)\n );\n\n return (location) =>\n activeWhenArray.some((activeWhen) => activeWhen(location));\n}\n\nexport function pathToActiveWhen(path, exactMatch) {\n const regex = toDynamicPathValidatorRegex(path, exactMatch);\n\n return (location) => {\n // compatible with IE10\n let origin = location.origin;\n if (!origin) {\n origin = `${location.protocol}//${location.host}`;\n }\n const route = location.href\n .replace(origin, \"\")\n .replace(location.search, \"\")\n .split(\"?\")[0];\n return regex.test(route);\n };\n}\n\nfunction toDynamicPathValidatorRegex(path, exactMatch) {\n let lastIndex = 0,\n inDynamic = false,\n regexStr = \"^\";\n\n if (path[0] !== \"/\") {\n path = \"/\" + path;\n }\n\n for (let charIndex = 0; charIndex < path.length; charIndex++) {\n const char = path[charIndex];\n const startOfDynamic = !inDynamic && char === \":\";\n const endOfDynamic = inDynamic && char === \"/\";\n if (startOfDynamic || endOfDynamic) {\n appendToRegex(charIndex);\n }\n }\n\n appendToRegex(path.length);\n return new RegExp(regexStr, \"i\");\n\n function appendToRegex(index) {\n const anyCharMaybeTrailingSlashRegex = \"[^/]+/?\";\n const commonStringSubPath = escapeStrRegex(path.slice(lastIndex, index));\n\n regexStr += inDynamic\n ? anyCharMaybeTrailingSlashRegex\n : commonStringSubPath;\n\n if (index === path.length) {\n if (inDynamic) {\n if (exactMatch) {\n // Ensure exact match paths that end in a dynamic portion don't match\n // urls with characters after a slash after the dynamic portion.\n regexStr += \"$\";\n }\n } else {\n // For exact matches, expect no more characters. Otherwise, allow\n // any characters.\n const suffix = exactMatch ? \"\" : \".*\";\n\n regexStr =\n // use charAt instead as we could not use es6 method endsWith\n regexStr.charAt(regexStr.length - 1) === \"/\"\n ? `${regexStr}${suffix}$`\n : `${regexStr}(/${suffix})?(#.*)?$`;\n }\n }\n\n inDynamic = !inDynamic;\n lastIndex = index;\n }\n\n function escapeStrRegex(str) {\n // borrowed from https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\");\n }\n}\n","import CustomEvent from \"custom-event\";\nimport { isStarted } from \"../start.js\";\nimport { toLoadPromise } from \"../lifecycles/load.js\";\nimport { toBootstrapPromise } from \"../lifecycles/bootstrap.js\";\nimport { toMountPromise } from \"../lifecycles/mount.js\";\nimport { toUnmountPromise } from \"../lifecycles/unmount.js\";\nimport {\n getAppStatus,\n getAppChanges,\n getMountedApps,\n} from \"../applications/apps.js\";\nimport {\n callCapturedEventListeners,\n originalReplaceState,\n} from \"./navigation-events.js\";\nimport { toUnloadPromise } from \"../lifecycles/unload.js\";\nimport {\n toName,\n shouldBeActive,\n NOT_MOUNTED,\n MOUNTED,\n NOT_LOADED,\n SKIP_BECAUSE_BROKEN,\n} from \"../applications/app.helpers.js\";\nimport { assign } from \"../utils/assign.js\";\nimport { isInBrowser } from \"../utils/runtime-environment.js\";\nimport { formatErrorMessage } from \"../applications/app-errors.js\";\nimport { addProfileEntry } from \"../devtools/profiler.js\";\n\nlet appChangeUnderway = false,\n peopleWaitingOnAppChange = [],\n currentUrl = isInBrowser && window.location.href;\n\nexport function triggerAppChange() {\n // Call reroute with no arguments, intentionally\n return reroute();\n}\n\nexport function reroute(\n pendingPromises = [],\n eventArguments,\n silentNavigation = false\n) {\n if (appChangeUnderway) {\n return new Promise((resolve, reject) => {\n peopleWaitingOnAppChange.push({\n resolve,\n reject,\n eventArguments,\n });\n });\n }\n\n let startTime, profilerKind;\n\n if (__PROFILE__) {\n startTime = performance.now();\n if (silentNavigation) {\n profilerKind = \"silentNavigation\";\n } else if (eventArguments) {\n profilerKind = \"browserNavigation\";\n } else {\n profilerKind = \"triggerAppChange\";\n }\n }\n\n const { appsToUnload, appsToUnmount, appsToLoad, appsToMount } =\n getAppChanges();\n let appsThatChanged,\n cancelPromises = [],\n oldUrl = currentUrl,\n newUrl = (currentUrl = window.location.href);\n\n if (isStarted()) {\n appChangeUnderway = true;\n appsThatChanged = appsToUnload.concat(\n appsToLoad,\n appsToUnmount,\n appsToMount\n );\n return performAppChanges();\n } else {\n appsThatChanged = appsToLoad;\n return loadApps();\n }\n\n function cancelNavigation(val = true) {\n const promise =\n typeof val?.then === \"function\" ? val : Promise.resolve(val);\n cancelPromises.push(\n promise.catch((err) => {\n console.warn(\n Error(\n formatErrorMessage(\n 42,\n __DEV__ &&\n `single-spa: A cancelNavigation promise rejected with the following value: ${err}`\n )\n )\n );\n console.warn(err);\n\n // Interpret a Promise rejection to mean that the navigation should not be canceled\n return false;\n })\n );\n }\n\n function loadApps() {\n return Promise.resolve().then(() => {\n const loadPromises = appsToLoad.map(toLoadPromise);\n let succeeded;\n\n return (\n Promise.all(loadPromises)\n .then(callAllEventListeners)\n // there are no mounted apps, before start() is called, so we always return []\n .then(() => {\n if (__PROFILE__) {\n succeeded = true;\n }\n\n return [];\n })\n .catch((err) => {\n if (__PROFILE__) {\n succeeded = false;\n }\n\n callAllEventListeners();\n throw err;\n })\n .finally(() => {\n if (__PROFILE__) {\n addProfileEntry(\n \"routing\",\n \"loadApps\",\n profilerKind,\n startTime,\n performance.now(),\n succeeded\n );\n }\n })\n );\n });\n }\n\n function performAppChanges() {\n return Promise.resolve().then(() => {\n // https://github.com/single-spa/single-spa/issues/545\n fireSingleSpaEvent(\n appsThatChanged.length === 0\n ? \"before-no-app-change\"\n : \"before-app-change\",\n getCustomEventDetail(true)\n );\n\n fireSingleSpaEvent(\n \"before-routing-event\",\n getCustomEventDetail(true, { cancelNavigation })\n );\n\n return Promise.all(cancelPromises).then((cancelValues) => {\n const navigationIsCanceled = cancelValues.some((v) => v);\n\n if (navigationIsCanceled) {\n // Change url back to old url, without triggering the normal single-spa reroute\n originalReplaceState.call(\n window.history,\n history.state,\n \"\",\n oldUrl.substring(location.origin.length)\n );\n\n // Single-spa's internal tracking of current url needs to be updated after the url change above\n currentUrl = location.href;\n\n // necessary for the reroute function to know that the current reroute is finished\n appChangeUnderway = false;\n\n if (__PROFILE__) {\n addProfileEntry(\n \"routing\",\n \"navigationCanceled\",\n profilerKind,\n startTime,\n performance.now(),\n true\n );\n }\n\n // Tell single-spa to reroute again, this time with the url set to the old URL\n return reroute(pendingPromises, eventArguments, true);\n }\n\n const unloadPromises = appsToUnload.map(toUnloadPromise);\n\n const unmountUnloadPromises = appsToUnmount\n .map(toUnmountPromise)\n .map((unmountPromise) => unmountPromise.then(toUnloadPromise));\n\n const allUnmountPromises = unmountUnloadPromises.concat(unloadPromises);\n\n const unmountAllPromise = Promise.all(allUnmountPromises);\n\n let unmountFinishedTime;\n\n unmountAllPromise.then(\n () => {\n if (__PROFILE__) {\n unmountFinishedTime = performance.now();\n\n addProfileEntry(\n \"routing\",\n \"unmountAndUnload\",\n profilerKind,\n startTime,\n performance.now(),\n true\n );\n }\n fireSingleSpaEvent(\n \"before-mount-routing-event\",\n getCustomEventDetail(true)\n );\n },\n (err) => {\n if (__PROFILE__) {\n addProfileEntry(\n \"routing\",\n \"unmountAndUnload\",\n profilerKind,\n startTime,\n performance.now(),\n true\n );\n }\n\n throw err;\n }\n );\n\n /* We load and bootstrap apps while other apps are unmounting, but we\n * wait to mount the app until all apps are finishing unmounting\n */\n const loadThenMountPromises = appsToLoad.map((app) => {\n return toLoadPromise(app).then((app) =>\n tryToBootstrapAndMount(app, unmountAllPromise)\n );\n });\n\n /* These are the apps that are already bootstrapped and just need\n * to be mounted. They each wait for all unmounting apps to finish up\n * before they mount.\n */\n const mountPromises = appsToMount\n .filter((appToMount) => appsToLoad.indexOf(appToMount) < 0)\n .map((appToMount) => {\n return tryToBootstrapAndMount(appToMount, unmountAllPromise);\n });\n return unmountAllPromise\n .catch((err) => {\n callAllEventListeners();\n throw err;\n })\n .then(() => {\n /* Now that the apps that needed to be unmounted are unmounted, their DOM navigation\n * events (like hashchange or popstate) should have been cleaned up. So it's safe\n * to let the remaining captured event listeners to handle about the DOM event.\n */\n callAllEventListeners();\n\n return Promise.all(loadThenMountPromises.concat(mountPromises))\n .catch((err) => {\n pendingPromises.forEach((promise) => promise.reject(err));\n throw err;\n })\n .then(finishUpAndReturn)\n .then(\n () => {\n if (__PROFILE__) {\n addProfileEntry(\n \"routing\",\n \"loadAndMount\",\n profilerKind,\n unmountFinishedTime,\n performance.now(),\n true\n );\n }\n },\n (err) => {\n if (__PROFILE__) {\n addProfileEntry(\n \"routing\",\n \"loadAndMount\",\n profilerKind,\n unmountFinishedTime,\n performance.now(),\n false\n );\n }\n\n throw err;\n }\n );\n });\n });\n });\n }\n\n function finishUpAndReturn() {\n const returnValue = getMountedApps();\n pendingPromises.forEach((promise) => promise.resolve(returnValue));\n\n try {\n const appChangeEventName =\n appsThatChanged.length === 0 ? \"no-app-change\" : \"app-change\";\n fireSingleSpaEvent(appChangeEventName, getCustomEventDetail());\n fireSingleSpaEvent(\"routing-event\", getCustomEventDetail());\n } catch (err) {\n /* We use a setTimeout because if someone else's event handler throws an error, single-spa\n * needs to carry on. If a listener to the event throws an error, it's their own fault, not\n * single-spa's.\n */\n setTimeout(() => {\n throw err;\n });\n }\n\n /* Setting this allows for subsequent calls to reroute() to actually perform\n * a reroute instead of just getting queued behind the current reroute call.\n * We want to do this after the mounting/unmounting is done but before we\n * resolve the promise for the `reroute` function.\n */\n appChangeUnderway = false;\n\n if (peopleWaitingOnAppChange.length > 0) {\n /* While we were rerouting, someone else triggered another reroute that got queued.\n * So we need reroute again.\n */\n const nextPendingPromises = peopleWaitingOnAppChange;\n peopleWaitingOnAppChange = [];\n reroute(nextPendingPromises);\n }\n\n return returnValue;\n }\n\n /* We need to call all event listeners that have been delayed because they were\n * waiting on single-spa. This includes haschange and popstate events for both\n * the current run of performAppChanges(), but also all of the queued event listeners.\n * We want to call the listeners in the same order as if they had not been delayed by\n * single-spa, which means queued ones first and then the most recent one.\n */\n function callAllEventListeners() {\n // During silent navigation (when navigation was canceled and we're going back to the old URL),\n // we should not fire any popstate / hashchange events\n if (!silentNavigation) {\n pendingPromises.forEach((pendingPromise) => {\n callCapturedEventListeners(pendingPromise.eventArguments);\n });\n\n callCapturedEventListeners(eventArguments);\n }\n }\n\n function getCustomEventDetail(isBeforeChanges = false, extraProperties) {\n const newAppStatuses = {};\n const appsByNewStatus = {\n // for apps that were mounted\n [MOUNTED]: [],\n // for apps that were unmounted\n [NOT_MOUNTED]: [],\n // apps that were forcibly unloaded\n [NOT_LOADED]: [],\n // apps that attempted to do something but are broken now\n [SKIP_BECAUSE_BROKEN]: [],\n };\n\n if (isBeforeChanges) {\n appsToLoad.concat(appsToMount).forEach((app, index) => {\n addApp(app, MOUNTED);\n });\n appsToUnload.forEach((app) => {\n addApp(app, NOT_LOADED);\n });\n appsToUnmount.forEach((app) => {\n addApp(app, NOT_MOUNTED);\n });\n } else {\n appsThatChanged.forEach((app) => {\n addApp(app);\n });\n }\n\n const result = {\n detail: {\n newAppStatuses,\n appsByNewStatus,\n totalAppChanges: appsThatChanged.length,\n originalEvent: eventArguments?.[0],\n oldUrl,\n newUrl,\n },\n };\n\n if (extraProperties) {\n assign(result.detail, extraProperties);\n }\n\n return result;\n\n function addApp(app, status) {\n const appName = toName(app);\n status = status || getAppStatus(appName);\n newAppStatuses[appName] = status;\n const statusArr = (appsByNewStatus[status] =\n appsByNewStatus[status] || []);\n statusArr.push(appName);\n }\n }\n\n function fireSingleSpaEvent(name, eventProperties) {\n // During silent navigation (caused by navigation cancelation), we should not\n // fire any single-spa events\n if (!silentNavigation) {\n window.dispatchEvent(\n new CustomEvent(`single-spa:${name}`, eventProperties)\n );\n }\n }\n}\n\n/**\n * Let's imagine that some kind of delay occurred during application loading.\n * The user without waiting for the application to load switched to another route,\n * this means that we shouldn't bootstrap and mount that application, thus we check\n * twice if that application should be active before bootstrapping and mounting.\n * https://github.com/single-spa/single-spa/issues/524\n */\nfunction tryToBootstrapAndMount(app, unmountAllPromise) {\n if (shouldBeActive(app)) {\n return toBootstrapPromise(app).then((app) =>\n unmountAllPromise.then(() =>\n shouldBeActive(app) ? toMountPromise(app) : app\n )\n );\n } else {\n return unmountAllPromise.then(() => app);\n }\n}\n","import { reroute } from \"./navigation/reroute.js\";\nimport { patchHistoryApi } from \"./navigation/navigation-events.js\";\nimport { isInBrowser } from \"./utils/runtime-environment.js\";\n\nlet started = false;\n\nexport function start(opts) {\n started = true;\n if (isInBrowser) {\n patchHistoryApi(opts);\n reroute();\n }\n}\n\nexport function isStarted() {\n return started;\n}\n","import { getRawAppData, unregisterApplication } from \"../applications/apps\";\nimport { reroute } from \"../navigation/reroute\";\nimport { NOT_LOADED } from \"../applications/app.helpers\";\nimport { toLoadPromise } from \"../lifecycles/load\";\nimport { toBootstrapPromise } from \"../lifecycles/bootstrap\";\nimport { getProfilerData } from \"./profiler\";\n\nexport default {\n getRawAppData,\n reroute,\n NOT_LOADED,\n toLoadPromise,\n toBootstrapPromise,\n unregisterApplication,\n getProfilerData,\n};\n","export { start } from \"./start.js\";\nexport { ensureJQuerySupport } from \"./jquery-support.js\";\nexport {\n setBootstrapMaxTime,\n setMountMaxTime,\n setUnmountMaxTime,\n setUnloadMaxTime,\n} from \"./applications/timeouts.js\";\nexport {\n registerApplication,\n unregisterApplication,\n getMountedApps,\n getAppStatus,\n unloadApplication,\n checkActivityFunctions,\n getAppNames,\n pathToActiveWhen,\n} from \"./applications/apps.js\";\nexport {\n navigateToUrl,\n patchHistoryApi,\n} from \"./navigation/navigation-events.js\";\nexport { triggerAppChange } from \"./navigation/reroute.js\";\nexport {\n addErrorHandler,\n removeErrorHandler,\n} from \"./applications/app-errors.js\";\nexport { mountRootParcel } from \"./parcels/mount-parcel.js\";\n\nexport {\n NOT_LOADED,\n LOADING_SOURCE_CODE,\n NOT_BOOTSTRAPPED,\n BOOTSTRAPPING,\n NOT_MOUNTED,\n MOUNTING,\n UPDATING,\n LOAD_ERROR,\n MOUNTED,\n UNLOADING,\n UNMOUNTING,\n SKIP_BECAUSE_BROKEN,\n} from \"./applications/app.helpers.js\";\n\nimport devtools from \"./devtools/devtools\";\nimport { isInBrowser } from \"./utils/runtime-environment.js\";\n\nif (isInBrowser && window.__SINGLE_SPA_DEVTOOLS__) {\n window.__SINGLE_SPA_DEVTOOLS__.exposedMethods = devtools;\n}\n"],"names":["NativeCustomEvent","CustomEvent","customEvent","p","detail","foo","type","e","useNative","document","createEvent","params","initCustomEvent","bubbles","cancelable","createEventObject","Boolean","errorHandlers","handleAppError","err","app","newStatus","transformedErr","transformErr","length","forEach","handler","setTimeout","addErrorHandler","Error","formatErrorMessage","push","removeErrorHandler","removedSomething","filter","h","isHandler","code","msg","_len","arguments","args","Array","_key","concat","join","ogErr","appOrParcel","result","errPrefix","objectType","toName","status","message","console","warn","JSON","stringify","appOrParcelName","NOT_LOADED","LOADING_SOURCE_CODE","NOT_BOOTSTRAPPED","BOOTSTRAPPING","NOT_MOUNTED","MOUNTING","MOUNTED","UPDATING","UNMOUNTING","UNLOADING","LOAD_ERROR","SKIP_BECAUSE_BROKEN","isActive","shouldBeActive","activeWhen","window","location","name","isParcel","unmountThisParcel","assign","i","key","find","arr","func","validLifecycleFn","fn","isArray","item","isArrayOfFns","flattenFnArray","lifecycle","fns","Promise","resolve","props","reduce","resultPromise","index","then","thisPromise","smellsLikeAPromise","reject","promise","catch","profileEntries","toBootstrapPromise","hardFail","bootstrap","reasonableTime","successfulBootstrap","toUnmountPromise","unmountChildrenParcels","Object","keys","parcels","map","parcelId","all","unmountAppOrParcel","parcelError","parentError","beforeFirstMountFired","firstMountFired","toMountPromise","dispatchEvent","setSkipBecauseBroken","parcelCount","rootParcels","mountRootParcel","mountParcel","apply","config","customProps","owningAppOrParcel","this","_typeof","id","domElement","externalRepresentation","passedConfigLoadingFunction","configLoadingFunction","parcel","parentName","mountPromise","value","resolveUnmount","rejectUnmount","loadPromise","bootstrapPromise","prototype","hasOwnProperty","call","mount","unmount","update","timeouts","ensureValidAppTimeouts","promiseWithoutReturnValue","unmountPromise","getStatus","getProps","bind","singleSpa","unmountSelf","defaultWarningMillis","globalTimeoutConfig","millis","dieOnTimeout","warningMillis","unload","setBootstrapMaxTime","time","setMountMaxTime","setUnmountMaxTime","setUnloadMaxTime","timeoutConfig","warningPeriod","finished","errored","val","maybeTimingOut","errMsg","shouldError","error","numWarnings","numMillis","toLoadPromise","loadApp","isUserErr","validationErrMessage","validationErrCode","loadErrorTime","appOpts","appOptsStr","devtools","overlays","Date","getTime","urlRerouteOnly","isInBrowser","capturedEventListeners","hashchange","popstate","routingEventsListeningTo","navigateToUrl","obj","url","href","currentTarget","preventDefault","current","parseUri","destination","indexOf","hash","host","pathname","search","history","pushState","callCapturedEventListeners","eventArguments","_this","eventType","listener","urlReroute","reroute","patchedUpdateState","updateState","methodName","urlBefore","urlAfter","createPopStateEvent","state","originalMethodName","evt","PopStateEvent","initPopStateEvent","singleSpaTrigger","originalReplaceState","historyApiIsPatched","patchHistoryApi","opts","replaceState","addEventListener","originalAddEventListener","originalRemoveEventListener","removeEventListener","eventName","listenerFn","str","anchor","createElement","singleSpaNavigate","hasInitialized","ensureJQuerySupport","jQuery","undefined","$","jquery","originalJQueryOn","on","originalJQueryOff","off","eventString","captureRoutingEvents","originalJQueryFunction","nativeFunctionToCall","originalArgs","split","replace","trim","appsToUnload","toUnloadPromise","unloadInfo","finishUnloadingApp","unloadPromise","errorUnloadingApp","addAppToUnload","promiseGetter","defineProperty","get","getAppUnloadInfo","appName","apps","getAppChanges","appsToUnmount","appsToLoad","appsToMount","currentTime","appShouldBeActive","getMountedApps","getAppNames","getAppStatus","startWarningInitialized","registerApplication","appNameOrConfig","appOrLoadApp","registration","validKeys","invalidKeys","prop","allowsStringAndFunction","every","validCustomProps","validateRegisterWithConfig","validateRegisterWithArguments","sanitizeCustomProps","activeWhenArray","activeWhenOrPath","pathToActiveWhen","some","sanitizeActiveWhen","sanitizeArguments","isStarted","options","selectors","checkActivityFunctions","unregisterApplication","unloadApplication","waitForUnmount","appIndex","splice","App","appUnloadInfo","immediatelyUnloadApp","activeApp","triggerAppChange","path","exactMatch","regex","lastIndex","inDynamic","regexStr","charIndex","char","appendToRegex","RegExp","anyCharMaybeTrailingSlashRegex","commonStringSubPath","slice","suffix","charAt","toDynamicPathValidatorRegex","origin","protocol","route","test","appChangeUnderway","peopleWaitingOnAppChange","currentUrl","pendingPromises","silentNavigation","appsThatChanged","_getAppChanges","cancelPromises","oldUrl","newUrl","performAppChanges","loadApps","cancelNavigation","loadPromises","callAllEventListeners","finally","fireSingleSpaEvent","getCustomEventDetail","cancelValues","v","substring","unloadPromises","allUnmountPromises","unmountAllPromise","loadThenMountPromises","tryToBootstrapAndMount","mountPromises","appToMount","finishUpAndReturn","returnValue","nextPendingPromises","pendingPromise","_appsByNewStatus","isBeforeChanges","extraProperties","newAppStatuses","appsByNewStatus","_defineProperty","addApp","totalAppChanges","originalEvent","eventProperties","started","start","getRawAppData","getProfilerData","__SINGLE_SPA_DEVTOOLS__","exposedMethods"],"mappings":";20DACIA,mJAA2BC,YAmB/BC,EAjBA,WACE,IACE,IAAIC,EAAI,IAAIH,EAAkB,MAAO,CAAEI,OAAQ,CAAEC,IAAK,SACtD,MAAQ,QAAUF,EAAEG,MAAQ,QAAUH,EAAEC,OAAOC,IAC/C,MAAOE,IAET,OAAO,EAWQC,GAAcR,EAG/B,oBAAuBS,UAAY,mBAAsBA,SAASC,YAAc,SAAsBJ,EAAMK,GAC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G,gBAAiBlC,EAAgB1U,OACjC6W,cAAevK,MAAAA,OAAAA,EAAAA,EAAiB,GAChCuI,OAAAA,EACAC,OAAAA,IAQJ,OAJIyB,GACFhT,EAAO/B,EAAO5C,OAAQ2X,GAGjB/U,EAEP,SAASmV,EAAO/W,EAAKgC,GACnB,IAAMwO,EAAUzO,EAAO/B,GACvBgC,EAASA,GAAUkP,GAAaV,GAChCoG,EAAepG,GAAWxO,GACP6U,EAAgB7U,GACjC6U,EAAgB7U,IAAW,IACnBrB,KAAK6P,IAInB,SAASiF,EAAmBjS,EAAM0T,GAG3BrC,GACHvR,OAAOmD,cACL,IAAI5H,EAA0B2E,cAAAA,OAAAA,GAAQ0T,KAa9C,SAAShB,GAAuBlW,EAAKgW,GACnC,OAAI5S,EAAepD,GACVsF,EAAmBtF,GAAK+E,MAAK,SAAC/E,GACnCgW,OAAAA,EAAkBjR,MAAK,WACrB3B,OAAAA,EAAepD,GAAOwG,EAAexG,GAAOA,QAIzCgW,EAAkBjR,MAAK,WAAA,OAAM/E,KC9bxC,IAAImX,IAAU,EAEP,SAASC,GAAMrJ,GACpBoJ,IAAU,EACN/L,KACF0C,GAAgBC,GAChBhB,MAIG,SAASwF,KACd,OAAO4E,GCRM,IAAApM,GAAA,CACbsM,cH0EK,WACL,MAAA,GAAA7V,OAAWiP,KG1EX1D,QAAAA,GACAxK,WAAAA,EACAgI,cAAAA,GACAjF,mBAAAA,EACAqN,sBAAAA,GACA2E,gBhBZK,WACL,OAAOjS,IiB4CL+F,IAAe9H,OAAOiU,0BACxBjU,OAAOiU,wBAAwBC,eAAiBzM"} \ No newline at end of file diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/main.js b/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/main.js index 5a9755f184..b388afbd8b 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/main.js +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/main.js @@ -10,7 +10,7 @@ import Notify from '@openc3/tool-common/src/plugins/notify' defineCustomElements() -Object.getPrototypeOf(System).firstGlobalProp = true; +Object.getPrototypeOf(System).firstGlobalProp = true const app = createApp(App) diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/router.js b/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/router.js index 3fe2145827..51bac6be1d 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/router.js +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-base/src/router.js @@ -31,16 +31,13 @@ const router = createRouter({ path: '/login', name: 'Login', component: () => - import( - '@openc3/tool-common/src/tools/base/components/Login' - ), + import('@openc3/tool-common/src/tools/base/components/Login'), }, { // Empty component for all other routes to avoid VueRouter warnings, since all other routes are handled by single-spa path: '/:pathMatch(.*)*', name: '', - component: () => - import('@openc3/tool-common/src/components/Empty'), + component: () => import('@openc3/tool-common/src/components/Empty'), }, ], }) diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-common/.eslintrc.cjs b/openc3-cosmos-init/plugins/packages/openc3-tool-common/.eslintrc.cjs deleted file mode 100644 index 3e278f14fe..0000000000 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-common/.eslintrc.cjs +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'plugin:prettier/recommended', - '@vue/prettier', - ], - plugins: ['prettier'], - rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'prettier/prettier': [ - 'warn', - { - endOfLine: 'auto', - }, - ], - 'vue/multi-word-component-names': 'off', - 'vue/valid-v-slot': [ - 'error', - { - allowModifiers: true, - }, - ], - }, - parser: 'vue-eslint-parser', - overrides: [ - { - files: [ - '**/__tests__/*.{j,t}s?(x)', - '**/tests/unit/**/*.spec.{j,t}s?(x)', - ], - env: { - jest: true, - }, - }, - ], -} diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-common/eslint.config.mjs b/openc3-cosmos-init/plugins/packages/openc3-tool-common/eslint.config.mjs new file mode 100644 index 0000000000..9c694f6897 --- /dev/null +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-common/eslint.config.mjs @@ -0,0 +1,56 @@ +import prettier from "eslint-plugin-prettier"; +import globals from "globals"; +import parser from "vue-eslint-parser"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends( + "plugin:vue/vue3-essential", + "plugin:prettier/recommended", + "@vue/prettier", +), { + plugins: { + prettier, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: parser, + }, + + rules: { + "no-console": "error", + "no-debugger": "error", + + "prettier/prettier": ["warn", { + endOfLine: "auto", + }], + + "vue/multi-word-component-names": "off", + + "vue/valid-v-slot": ["error", { + allowModifiers: true, + }], + }, +}, { + files: ["**/__tests__/*.{j,t}s?(x)", "**/tests/unit/**/*.spec.{j,t}s?(x)"], + + languageOptions: { + globals: { + ...globals.jest, + }, + }, +}]; diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-common/package.json b/openc3-cosmos-init/plugins/packages/openc3-tool-common/package.json index 88c3009392..67e5b1b0c7 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-common/package.json +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-common/package.json @@ -11,7 +11,7 @@ "date-fns-tz": "3.2.0", "lodash": "4.17.21", "sass": "1.80.4", - "single-spa": "5.9.5", + "single-spa": "6.0.3", "sortablejs": "1.15.3", "sprintf-js": "1.1.3", "uplot": "1.6.31" @@ -19,13 +19,13 @@ "devDependencies": { "@vitejs/plugin-vue": "5.1.5", "@vue/eslint-config-prettier": "9.0.0", - "eslint": "8.56.0", + "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-vue": "9.27.0", "prettier": "3.3.3", "vite": "5.4.11", - "vue-eslint-parser": "9.4.3", - "vue": "3.5.13" + "vue": "3.5.13", + "vue-eslint-parser": "9.4.3" } } diff --git a/playwright/package.json b/playwright/package.json index e18311ccef..7303fe55d3 100644 --- a/playwright/package.json +++ b/playwright/package.json @@ -29,5 +29,6 @@ ".ts", ".vue" ] - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" }