nextcloud/tests
Ferdinand Thiessen f0e020f97d fix(template): add import map for JS module entry points
Currently apps are broken if they have exports in the JS entry point,
because they then will import from the entry point but because they do
not know about the Nextcloud cache buster they will import without cache
buster.

This results in two problem:
1. The module might be outdated (old cached)
2. The module is duplicated, so the module will be loaded twice and will
   have two different - out of sync - states. This also means it will
   re-run sideeffects of the entry point.

To fix this we generate an import map which basically maps the plain
entry point script to the script with cache buster added.

(Some background: Bundler will try to minimize chunks (reduce page
loading time) so they can inline modules into entry points and thus
extend the entry point exports and then this issue would be caused).

For example:
```js
// entry.mjs
console.error('called')

async function onClick() {
  await import('./chunk.mjs')
}

export const name = 'foo'

// chunk.mjs
import { name } from './entry.mjs'

console.error(name)
```

When calling `onClick` without this fix the output will be:
> called
> called
> foo

With this fix:
> called
> foo

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-01-12 13:34:11 +01:00
..
apps chore: Add SPDX header 2024-05-13 17:41:36 +02:00
blueprints chore: split frontend building into legacy Vue 2 and Vue 3 2025-10-22 17:10:28 +02:00
Core Merge pull request #55861 from nextcloud/feat/allow-decrypt-all-with-encryption-disabled 2026-01-08 14:19:06 +01:00
data feat(previews): previews and tests for large remote videos w/o full download 2025-09-05 10:08:19 +02:00
docker chore: Add SPDX header 2024-05-13 17:41:36 +02:00
lib fix(template): add import map for JS module entry points 2026-01-12 13:34:11 +01:00
objectstore chore: Add SPDX header 2024-05-22 19:58:12 +02:00
autoload.php chore: Add an autoload.php file for tests relying on core class 2025-05-19 11:30:37 +02:00
bootstrap.php test: add env option to disable loading all installed apps during tests 2025-08-11 13:35:57 +02:00
databases-all-config.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
drone-run-php-tests.sh chore: Add SPDX header 2024-05-13 17:41:36 +02:00
drone-wait-objectstore.sh chore: Add SPDX header 2024-05-13 17:41:36 +02:00
enable_all.php chore: Replace last calls to OC_App::enable by IAppManager 2025-08-18 17:09:39 +02:00
phpunit-autotest-external.xml ci: Migrate PHPUnit configs 2025-06-06 14:36:31 +02:00
phpunit-autotest.xml ci: Migrate PHPUnit configs 2025-06-06 14:36:31 +02:00
preseed-config.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
redis-cluster.config.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
redis.config.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
startsessionlistener.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00