nuxt-typed-router 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ export default defineNuxtConfig({
|
|
|
94
94
|
- [ ] Add `path` autocomplete with TS string templates
|
|
95
95
|
- [ ] Enforce strong params typing depending of origin route
|
|
96
96
|
- [ ] Add support for `validate` in `definePageMeta`
|
|
97
|
-
- [
|
|
97
|
+
- [x] Add `strict` option to prevent path navigation
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
## Development
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1035,11 +1035,27 @@ const module = defineNuxtModule({
|
|
|
1035
1035
|
setup(moduleOptions, nuxt) {
|
|
1036
1036
|
const { resolve } = createResolver(import.meta.url);
|
|
1037
1037
|
const rootDir = nuxt.options.rootDir;
|
|
1038
|
-
|
|
1038
|
+
let i18nLocales = [];
|
|
1039
|
+
const hasi18nModuleRegistered = nuxt.options.modules.some((mod) => {
|
|
1040
|
+
if (Array.isArray(mod)) {
|
|
1041
|
+
const [moduleName, options] = mod;
|
|
1042
|
+
const isRegistered = moduleName === "@nuxtjs/i18n";
|
|
1043
|
+
if (isRegistered) {
|
|
1044
|
+
i18nLocales = options?.locales ?? [];
|
|
1045
|
+
}
|
|
1046
|
+
return isRegistered;
|
|
1047
|
+
} else {
|
|
1048
|
+
const isRegistered = mod === "@nuxtjs/i18n";
|
|
1049
|
+
if (isRegistered) {
|
|
1050
|
+
i18nLocales = nuxt.options.i18n?.locales ?? [];
|
|
1051
|
+
}
|
|
1052
|
+
return isRegistered;
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1039
1055
|
moduleOptionStore.updateOptions({
|
|
1040
1056
|
...moduleOptions,
|
|
1041
1057
|
i18n: hasi18nModuleRegistered,
|
|
1042
|
-
i18nLocales
|
|
1058
|
+
i18nLocales
|
|
1043
1059
|
});
|
|
1044
1060
|
nuxt.options.alias = {
|
|
1045
1061
|
...nuxt.options.alias,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-typed-router",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Provide autocompletion for pages route names generated by Nuxt router",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/module.cjs",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"prepack": "nuxt-module-build",
|
|
20
20
|
"dev": "nuxi dev playground",
|
|
21
|
+
"prepare": "nuxi prepare playground",
|
|
21
22
|
"dev:build": "nuxi build playground",
|
|
22
23
|
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground && pnpm run test:prepare-fixtures",
|
|
23
24
|
"build:test": "cross-env NUXT_BUILD_TYPE=stub pnpm run prepack && pnpm run dev:build",
|