@nuxtjp/localized-site 0.1.0 → 0.1.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.ja.md ADDED
@@ -0,0 +1,66 @@
1
+ # @nuxtjp/localized-site
2
+
3
+ [English](README.md)
4
+
5
+ 日本語・英語の紹介サイトを、1つの検証済み設定から構成します。`/`、`/docs`、`/docs/getting-started`、`/docs/security`と各英語ページを生成し、言語切替とSEOを適用します。
6
+
7
+ ## 導入と設定
8
+
9
+ `0.1.0`はnpmで公開済みです。Node.js 22.19以降または24.11以降、Nuxt 4.5.1以降の4系、Vue `^3.5.40`を使用してください。
10
+
11
+ ```sh
12
+ pnpm add --save-exact @nuxtjp/localized-site@0.1.0 nuxt@4.5.1 vue@3.5.43
13
+ ```
14
+
15
+ ```ts
16
+ export default defineNuxtConfig({
17
+ modules: [['@nuxtjp/localized-site', { contentRoot: '.' }]]
18
+ })
19
+ ```
20
+
21
+ `contentRoot`を明示します。[汎用設定サンプル](examples/content/site.config.json)を、そのディレクトリに`site.config.json`として置き、サイト固有の内容に置き換えてください。
22
+ `siteId`、`serviceId`、`origin`、`audienceScope`、完全なja/enコンテンツ、ちょうど3つのfeatures、導入・セキュリティ文書、privacy/contact説明、`externalActions: false`が必須です。
23
+
24
+ ```sh
25
+ pnpm exec nuxtjp-localized-site validate --content-root .
26
+ pnpm exec nuxt build
27
+ ```
28
+
29
+ ## 動作と制約
30
+
31
+ privacy/contactは説明文として表示し、未設定のリンクや操作を生成しません。
32
+ メンテナンス表示は、ブラウザから同一originの`/maintenance.json`を読みます。取得・形式・期限の検証に失敗した場合は表示せず、サイト本文と言語切替は利用できます。
33
+ 配布物だけを試す場合は、registry版の代わりに承認された正確なTGZを導入してください。この手順はサイトの公開やregistry設定を行いません。
34
+
35
+ ## 型付きメッセージ
36
+
37
+ ```ts
38
+ const messages = defineLocalizedMessages({
39
+ ja: { save: '保存', cancel: 'キャンセル' },
40
+ en: { save: 'Save', cancel: 'Cancel' }
41
+ })
42
+ const { t } = useLocalizedMessages(messages)
43
+ t('save')
44
+ ```
45
+
46
+ 英語のキーは日本語と一致させます。空のメッセージは`fallbackLocale`、次に`defaultLocale`へfallbackします。
47
+
48
+ ## 開発
49
+
50
+ ```sh
51
+ pnpm install --frozen-lockfile
52
+ pnpm test
53
+ pnpm typecheck
54
+ pnpm build
55
+ pnpm validate:example
56
+ pnpm pack
57
+ ```
58
+
59
+ `prepack`はテスト、型検査、build、サンプル検証を実行します。リリース前に、実際のarchiveを別hostで確認してください。
60
+
61
+ ## 文書とライセンス
62
+
63
+ [使い方](https://github.com/nuxtjp/nuxt-localized-site/blob/main/docs/getting-started.md) · [Schema](schemas/localized-site-v1.schema.json) · [テスト](https://github.com/nuxtjp/nuxt-localized-site/tree/main/test) · [セキュリティ報告](https://github.com/nuxtjp/nuxt-localized-site/blob/main/SECURITY.md)
64
+
65
+ コードは[Apache-2.0](LICENSE)です。[LICENSE-PREVIOUS](LICENSE-PREVIOUS)に以前の許諾、[NOTICE](NOTICE)に帰属表示を保持します。
66
+ [LICENSE-ASSETS](LICENSE-ASSETS)は対象となるブランド・コンテンツ素材の別条件を保持します。コードのライセンスを変更せず、第三者やサイト所有者のコンテンツの権利を追加で許諾するものでもありません。
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # @nuxtjp/localized-site
2
2
 
3
- ## 日本語
3
+ [日本語](README.ja.md)
4
4
 
5
- 日本語・英語の紹介サイトを1つの検証済み設定から構成します。
6
- `/`、`/docs`、`/docs/getting-started`、`/docs/security`と各英語ページを生成し、言語切替とSEOを適用します。
5
+ Generate a Japanese/English introduction site from one validated configuration. The module supplies `/`, `/docs`, `/docs/getting-started`, `/docs/security` and their English counterparts, locale links and SEO metadata.
7
6
 
8
- 公開準備中です。以下のregistry導入は`@nuxtjp/localized-site@0.1.0`の公開確認後に使います。
9
- Node.js 22.19以降または24.11以降、Nuxt 4.5.1以降の4系、Vue `^3.5.40`を使用してください。
7
+ ## Install and configure
8
+
9
+ Version `0.1.0` is published on npm. Use Node.js 22.19+ or 24.11+, Nuxt 4.5.1+ in major 4, and Vue `^3.5.40`.
10
10
 
11
11
  ```sh
12
12
  pnpm add --save-exact @nuxtjp/localized-site@0.1.0 nuxt@4.5.1 vue@3.5.43
@@ -18,29 +18,18 @@ export default defineNuxtConfig({
18
18
  })
19
19
  ```
20
20
 
21
- [`site.config.json`の汎用サンプル](examples/content/site.config.json)を指定したcontent rootに置き、サイト固有の内容に置き換えます。
22
- `siteId`、`serviceId`、`origin`、`audienceScope`、ja/enのコンテンツ、3つのfeatures、導入・セキュリティ文書、privacy/contact説明、`externalActions: false`が必須です。
21
+ Set `contentRoot` explicitly. Copy the [generic configuration](examples/content/site.config.json) there as `site.config.json`, and replace it with the site's own content.
22
+ The configuration requires `siteId`, `serviceId`, `origin`, `audienceScope`, complete ja/en content, exactly three features, getting-started and security documents, privacy/contact notices, and `externalActions: false`.
23
23
 
24
24
  ```sh
25
25
  pnpm exec nuxtjp-localized-site validate --content-root .
26
26
  pnpm exec nuxt build
27
27
  ```
28
28
 
29
- privacy/contactは説明文として表示し、未設定のリンクや操作を生成しません。
30
- メンテナンス表示はブラウザから同一originの`/maintenance.json`を読みます。取得・形式・期限の検証に失敗した場合は表示せず、本文と言語切替は利用できます。
31
- 配布物だけを試す際は、registry版の代わりに承認されたTGZをインストールしてください。サイトの公開やregistry設定はこの手順に含みません。
32
-
33
- ## English
34
-
35
- Generate a Japanese/English introduction site from one validated configuration.
36
- The module supplies landing, overview, getting-started and security pages, locale links and SEO metadata.
29
+ ## Behavior and limits
37
30
 
38
- Publication is pending. After verifying registry availability, use the installation command above with Node.js 22.19+ or 24.11+, Nuxt 4.5.1+ in major 4, and Vue `^3.5.40`.
39
- Set `contentRoot` explicitly, copy the generic example to that directory as `site.config.json`, replace its content, validate it, then build the host application.
40
- The configuration requires site/service identifiers, origin, audience scope, complete ja/en content, exactly three features, documents and privacy/contact notices, and `externalActions: false`.
41
-
42
- Privacy/contact notices are text; the module creates no unset links or actions.
43
- In the browser, the optional maintenance notice reads same-origin `/maintenance.json`. Failed retrieval, invalid data or expired data hides the notice while the site remains usable.
31
+ Privacy/contact notices are text. The module creates no unset links or actions.
32
+ In the browser, the optional maintenance notice reads same-origin `/maintenance.json`. Failed retrieval, invalid data or expired data hides that notice; the site and locale switching remain usable.
44
33
  For archive testing, install the exact reviewed TGZ instead of the registry version. These commands do not publish a website or configure registry access.
45
34
 
46
35
  ## Typed messages
@@ -56,7 +45,7 @@ t('save')
56
45
 
57
46
  English keys must match Japanese keys. Empty messages fall back to `fallbackLocale`, then `defaultLocale`.
58
47
 
59
- ## Development / 開発
48
+ ## Development
60
49
 
61
50
  ```sh
62
51
  pnpm install --frozen-lockfile
@@ -67,8 +56,11 @@ pnpm validate:example
67
56
  pnpm pack
68
57
  ```
69
58
 
70
- `prepack` runs the tests, typecheck, build and example validation. Verify the actual archive in a separate host before release.
71
- See [usage](docs/getting-started.md), [schema](schemas/localized-site-v1.schema.json), [tests](test), and [security reporting](SECURITY.md).
59
+ `prepack` runs tests, typecheck, build and example validation. Verify the actual archive in a separate host before a release.
60
+
61
+ ## Documentation and license
62
+
63
+ [Usage guide](https://github.com/nuxtjp/nuxt-localized-site/blob/main/docs/getting-started.md) · [Schema](schemas/localized-site-v1.schema.json) · [Tests](https://github.com/nuxtjp/nuxt-localized-site/tree/main/test) · [Security reporting](https://github.com/nuxtjp/nuxt-localized-site/blob/main/SECURITY.md)
72
64
 
73
- Code: [Apache-2.0](LICENSE). Retained prior grants: [LICENSE-PREVIOUS](LICENSE-PREVIOUS). [NOTICE](NOTICE) preserves attribution.
74
- [LICENSE-ASSETS](LICENSE-ASSETS) retains separate terms for covered brand/content assets; it does not change the code license or grant rights to third-party/site-owned content.
65
+ Code: [Apache-2.0](LICENSE). [LICENSE-PREVIOUS](LICENSE-PREVIOUS) retains prior grants, and [NOTICE](NOTICE) preserves attribution.
66
+ [LICENSE-ASSETS](LICENSE-ASSETS) retains separate terms for covered brand/content assets. It does not change the code license or grant rights to third-party or site-owned content.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.5.1"
6
6
  },
7
- "version": "0.1.0",
7
+ "version": "0.1.1",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "unknown"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjp/localized-site",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Contract-first Japanese and English public-site module for Nuxt",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -18,7 +18,8 @@
18
18
  "README.md",
19
19
  "NOTICE",
20
20
  "LICENSE-ASSETS",
21
- "LICENSE-PREVIOUS"
21
+ "LICENSE-PREVIOUS",
22
+ "README.ja.md"
22
23
  ],
23
24
  "bin": {
24
25
  "nuxtjp-localized-site": "./bin/nuxtjp-localized-site.mjs"