mirror of
https://github.com/modrinth/code.git
synced 2026-07-31 21:26:40 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f392e4ae84 | ||
|
|
c18fa02116 | ||
|
|
f21b1061b4 | ||
|
|
a26c360e3c | ||
|
|
f37bedba0e |
+4
-1
@@ -52,4 +52,7 @@ dist
|
|||||||
.vscode/*
|
.vscode/*
|
||||||
|
|
||||||
# Don't ignore VS Code settings that configure ESLint extension
|
# Don't ignore VS Code settings that configure ESLint extension
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
|
|
||||||
|
# Nuxt
|
||||||
|
.nuxt
|
||||||
+7
-1
@@ -21,8 +21,10 @@
|
|||||||
"docs:build": "turbo run --no-daemon @vintl-dev/docs#build",
|
"docs:build": "turbo run --no-daemon @vintl-dev/docs#build",
|
||||||
"docs:start": "turbo run --no-daemon @vintl-dev/docs#start",
|
"docs:start": "turbo run --no-daemon @vintl-dev/docs#start",
|
||||||
"docs:lint": "turbo run --no-daemon @vintl-dev/docs#lint",
|
"docs:lint": "turbo run --no-daemon @vintl-dev/docs#lint",
|
||||||
|
"mod:prepare": "turbo run --no-daemon @vintl/nuxt#dev:prepare",
|
||||||
"mod:build": "turbo run --no-daemon @vintl/nuxt#build",
|
"mod:build": "turbo run --no-daemon @vintl/nuxt#build",
|
||||||
"mod:lint": "turbo run --no-daemon @vintl/nuxt#lint",
|
"mod:lint": "turbo run --no-daemon @vintl/nuxt#lint",
|
||||||
|
"mod:typecheck": "turbo run --no-daemon @vintl/nuxt#typecheck",
|
||||||
"all:prepare": "turbo run --no-daemon prepare",
|
"all:prepare": "turbo run --no-daemon prepare",
|
||||||
"all:lint": "turbo run --no-daemon lint",
|
"all:lint": "turbo run --no-daemon lint",
|
||||||
"_ci:publish": "changeset publish"
|
"_ci:publish": "changeset publish"
|
||||||
@@ -36,5 +38,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@9.4.0"
|
"packageManager": "pnpm@9.4.0",
|
||||||
|
"dependencies": {
|
||||||
|
"prettier": "^3.3.2",
|
||||||
|
"prettier-plugin-jsdoc": "^1.3.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"root": true,
|
|
||||||
"extends": ["@vintl-dev/eslint-config-peony"],
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": ["./src/**/*.ts", "./types/*.d.ts"],
|
|
||||||
"excludedFiles": ["./src/runtime/**/*.ts", "./dist"],
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": ["./build.config.ts"],
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.build.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": [
|
|
||||||
"./stubs/*.{d.ts,js}",
|
|
||||||
"./src/runtime/**/*.{ts,mts}",
|
|
||||||
"./types/*.d.ts"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./tsconfig.runtime.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"ignorePatterns": ["/dist"]
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
# @vintl/nuxt
|
# @vintl/nuxt
|
||||||
|
|
||||||
|
## 1.9.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- a26c360: Switch to the official Nuxt module template
|
||||||
|
|
||||||
|
This should resolve any issues with our Nuxt-specific imports, e.g., breakage of the Nuxt injections (added through `provide`s in plugins) due to the invalid `Plugin` type specified by our package (sorry for that!).
|
||||||
|
|
||||||
## 1.9.0
|
## 1.9.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
|||||||
@@ -3,16 +3,6 @@ import { defineBuildConfig } from 'unbuild'
|
|||||||
export default defineBuildConfig({
|
export default defineBuildConfig({
|
||||||
hooks: {
|
hooks: {
|
||||||
'build:before'(ctx) {
|
'build:before'(ctx) {
|
||||||
for (const entry of ctx.options.entries) {
|
|
||||||
if (
|
|
||||||
entry.builder === 'mkdist' &&
|
|
||||||
'ext' in entry &&
|
|
||||||
entry.input.endsWith('vintl-nuxt/src/runtime')
|
|
||||||
) {
|
|
||||||
entry.ext = 'js'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.options.entries.push({
|
ctx.options.entries.push({
|
||||||
builder: 'rollup',
|
builder: 'rollup',
|
||||||
name: 'options',
|
name: 'options',
|
||||||
|
|||||||
@@ -1,43 +1,7 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
|
||||||
|
import overrides from '@vintl-dev/eslint-config-peony/overrides'
|
||||||
|
|
||||||
import { dirname, resolve } from 'node:path'
|
export default createConfigForNuxt({
|
||||||
import { fileURLToPath } from 'node:url'
|
features: { tooling: true },
|
||||||
import config from '@vintl-dev/eslint-config-peony'
|
}).append(overrides)
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
|
||||||
const __dirname = dirname(__filename)
|
|
||||||
|
|
||||||
export default config.append([
|
|
||||||
{
|
|
||||||
name: 'vintl/nuxt/module',
|
|
||||||
files: ['./src/**/*.ts', './types/*.d.ts'],
|
|
||||||
ignores: ['./src/runtime/**/*.ts', './dist'],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: resolve(__dirname, 'tsconfig.json'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'vintl/nuxt/build',
|
|
||||||
files: ['./build.config.ts'],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: resolve(__dirname, 'tsconfig.build.json'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'vintl/nuxt/runtime',
|
|
||||||
files: [
|
|
||||||
'./stubs/*.{d.ts,js}',
|
|
||||||
'./src/runtime/**/*.{ts,mts}',
|
|
||||||
'./types/*.d.ts',
|
|
||||||
],
|
|
||||||
languageOptions: {
|
|
||||||
parserOptions: {
|
|
||||||
project: resolve(__dirname, 'tsconfig.runtime.json'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
export default defineNuxtConfig({
|
||||||
|
typescript: {
|
||||||
|
tsConfig: {
|
||||||
|
compilerOptions: {
|
||||||
|
moduleResolution: 'bundler',
|
||||||
|
allowImportingTsExtensions: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vintl/nuxt",
|
"name": "@vintl/nuxt",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"description": "Nuxt Module for VIntl integration",
|
"description": "Nuxt Module for VIntl integration",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"i18n",
|
"i18n",
|
||||||
@@ -27,32 +27,33 @@
|
|||||||
"require": "./dist/module.cjs"
|
"require": "./dist/module.cjs"
|
||||||
},
|
},
|
||||||
"./options": {
|
"./options": {
|
||||||
"types": "./dist/options.d.mts",
|
|
||||||
"import": "./dist/options.mjs"
|
"import": "./dist/options.mjs"
|
||||||
},
|
},
|
||||||
"./package.json": "./package.json"
|
"./package.json": "./package.json"
|
||||||
},
|
},
|
||||||
"module": "./dist/module.mjs",
|
"module": "./dist/module.mjs",
|
||||||
|
"main": "./dist/module.cjs",
|
||||||
"types": "./dist/types.d.ts",
|
"types": "./dist/types.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxt-module-build build",
|
"build": "nuxt-module-build build",
|
||||||
"lint": "eslint --cache .",
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare",
|
||||||
"prepack": "pnpm run -s lint && pnpm run -s build"
|
"lint": "eslint .",
|
||||||
|
"typecheck": "vue-tsc --noEmit"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@nuxt/devtools": "^1.3.9",
|
||||||
|
"@nuxt/eslint-config": "^0.3.13",
|
||||||
"@nuxt/module-builder": "^0.8.1",
|
"@nuxt/module-builder": "^0.8.1",
|
||||||
"@nuxt/schema": "^3.12.2",
|
"@nuxt/schema": "^3.12.2",
|
||||||
"@types/hash-sum": "^1.0.2",
|
"@types/hash-sum": "^1.0.2",
|
||||||
"@types/node": "^18.19.39",
|
"@types/node": "^18.19.39",
|
||||||
"@unhead/vue": "^1.9.14",
|
|
||||||
"@vintl-dev/eslint-config-peony": "workspace:^",
|
"@vintl-dev/eslint-config-peony": "workspace:^",
|
||||||
"hookable": "^5.5.3",
|
"nuxt": "^3.12.2",
|
||||||
"prettier-plugin-jsdoc": "^1.3.0",
|
"typescript": "^5.4.5",
|
||||||
"typescript": "^5.5.2",
|
"vue-tsc": "^2.0.24"
|
||||||
"vue-router": "^4.4.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@formatjs/intl": "^2.10.4",
|
"@formatjs/intl": "^2.10.4",
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ export function assertLanguageTagValid(
|
|||||||
input: unknown,
|
input: unknown,
|
||||||
): asserts input is LanguageTag {
|
): asserts input is LanguageTag {
|
||||||
if (typeof input !== 'string') {
|
if (typeof input !== 'string') {
|
||||||
throw new Error('Language tag must be a string')
|
throw new TypeError('Language tag must be a string')
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new Intl.Locale(input)
|
new Intl.Locale(input)
|
||||||
} catch {
|
} catch {
|
||||||
throw new Error('Language tag must be a valid BCP 47 language tag')
|
throw new RangeError('Language tag must be a valid BCP 47 language tag')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { useHead } from '#imports'
|
import { useRouter as _useRouter, useHead, useRequestURL } from '#imports'
|
||||||
import type { SEOOptions } from '@vintl/nuxt-runtime/options'
|
import type { SEOOptions } from '@vintl/nuxt-runtime/options'
|
||||||
import type { IntlController } from '@vintl/vintl/controller'
|
import type { IntlController } from '@vintl/vintl/controller'
|
||||||
import { useRouter as _useRouter, useRequestURL } from 'nuxt/app'
|
|
||||||
import { joinURL } from 'ufo'
|
import { joinURL } from 'ufo'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import type { LocationQuery, useRouter as _useRouter$type } from 'vue-router'
|
import type { LocationQuery, useRouter as _useRouter$type } from 'vue-router'
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import type {
|
|||||||
} from '@vintl/vintl/events'
|
} from '@vintl/vintl/events'
|
||||||
import { useNavigatorLanguage } from '@vintl/vintl/sources/navigator'
|
import { useNavigatorLanguage } from '@vintl/vintl/sources/navigator'
|
||||||
import { useAcceptLanguageHeader } from '@vintl/vintl/sources/header'
|
import { useAcceptLanguageHeader } from '@vintl/vintl/sources/header'
|
||||||
import { defineNuxtPlugin } from 'nuxt/app'
|
import { defineNuxtPlugin } from '#imports'
|
||||||
import { syncCaller } from './utils/hookable.js'
|
import { syncCaller } from './utils/hookable.js'
|
||||||
import { initHead } from './head.js'
|
import { initHead } from './head.js'
|
||||||
import { match as matchLocales } from '@formatjs/intl-localematcher'
|
import { match as matchLocales } from '@formatjs/intl-localematcher'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Plugin } from 'nuxt/app'
|
import type { Plugin } from '#app'
|
||||||
|
|
||||||
type _NuxtApp = Parameters<Plugin>[0]
|
type _NuxtApp = Parameters<Plugin>[0]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useCookie } from 'nuxt/app'
|
import { useCookie } from '#imports'
|
||||||
import { defineStorageAdapter } from '../storage-adapter.js'
|
import { defineStorageAdapter } from '../storage-adapter.js'
|
||||||
|
|
||||||
export default defineStorageAdapter(() => {
|
export default defineStorageAdapter(() => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { readdir, stat } from 'node:fs/promises'
|
import { readdir, stat } from 'node:fs/promises'
|
||||||
import { join } from 'path'
|
import { join } from 'node:path'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a generator that yields for each file in the directory, and files
|
* Creates a generator that yields for each file in the directory, and files
|
||||||
|
|||||||
Vendored
-1
@@ -1 +0,0 @@
|
|||||||
export * from 'nuxt/app'
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
export { useHead } from '@unhead/vue'
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ESNext",
|
|
||||||
|
|
||||||
"rootDir": ".",
|
|
||||||
|
|
||||||
"strict": true,
|
|
||||||
"strictBindCallApply": true,
|
|
||||||
|
|
||||||
"verbatimModuleSyntax": true,
|
|
||||||
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"esModuleInterop": false,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
|
|
||||||
"skipLibCheck": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
|
|
||||||
"module": "NodeNext",
|
|
||||||
|
|
||||||
"moduleResolution": "NodeNext",
|
|
||||||
|
|
||||||
"esModuleInterop": true,
|
|
||||||
|
|
||||||
"types": ["node"],
|
|
||||||
|
|
||||||
"allowJs": true,
|
|
||||||
|
|
||||||
"emitDeclarationOnly": true
|
|
||||||
},
|
|
||||||
"include": ["./build.config.ts", "./eslint.config.mjs"]
|
|
||||||
}
|
|
||||||
@@ -1,25 +1,8 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./.nuxt/tsconfig.json",
|
||||||
"compilerOptions": {
|
"exclude": [
|
||||||
"module": "esnext",
|
"dist",
|
||||||
"moduleResolution": "bundler",
|
"node_modules",
|
||||||
|
"playground",
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
|
|
||||||
"types": ["./types/nuxt"],
|
|
||||||
|
|
||||||
"outDir": "./dist",
|
|
||||||
|
|
||||||
"noEmit": true
|
|
||||||
},
|
|
||||||
"include": ["./src/**/*.ts", "./types/*.d.ts"],
|
|
||||||
"exclude": ["./src/runtime/**/*.ts", "dist"],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.build.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.runtime.json"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
|
|
||||||
"module": "nodenext",
|
|
||||||
"moduleResolution": "nodenext",
|
|
||||||
|
|
||||||
"types": ["./types/nuxt"],
|
|
||||||
|
|
||||||
"outDir": "./dist",
|
|
||||||
"paths": {
|
|
||||||
"#imports": ["./stubs/imports.js"],
|
|
||||||
"#app": ["./stubs/app.js"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"./stubs/*.d.ts",
|
|
||||||
"./stubs/*.js",
|
|
||||||
"./src/runtime/**/*.ts",
|
|
||||||
"./src/runtime/**/*.mts",
|
|
||||||
"./types/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Vendored
+1
-7
@@ -1,11 +1,5 @@
|
|||||||
/// <reference types="nuxt" />
|
import type { ModuleHooks } from '../src/module.ts'
|
||||||
|
|
||||||
import type { ModuleHooks } from '../src/module.js'
|
|
||||||
|
|
||||||
declare module '@nuxt/schema' {
|
declare module '@nuxt/schema' {
|
||||||
interface NuxtHooks extends ModuleHooks {}
|
interface NuxtHooks extends ModuleHooks {}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '#imports' {
|
|
||||||
export { useHead } from '@unhead/vue'
|
|
||||||
}
|
|
||||||
|
|||||||
Generated
+785
-1656
File diff suppressed because it is too large
Load Diff
+11
-1
@@ -1,12 +1,18 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://turbo.build/schema.json",
|
"$schema": "https://turbo.build/schema.json",
|
||||||
"tasks": {
|
"tasks": {
|
||||||
|
"@vintl/nuxt#dev:prepare": {
|
||||||
|
"inputs": ["package.json", "nuxt.config.ts", "src"],
|
||||||
|
"outputs": [".nuxt"]
|
||||||
|
},
|
||||||
"@vintl/nuxt#build": {
|
"@vintl/nuxt#build": {
|
||||||
|
"dependsOn": ["@vintl/nuxt#dev:prepare"],
|
||||||
"outputs": ["dist"]
|
"outputs": ["dist"]
|
||||||
},
|
},
|
||||||
"@vintl/nuxt#lint": {
|
"@vintl/nuxt#lint": {
|
||||||
"outputs": [".eslintcache"]
|
"outputs": [".eslintcache"]
|
||||||
},
|
},
|
||||||
|
"@vintl/nuxt#typecheck": {},
|
||||||
"@vintl-dev/pg#intl:extract": {
|
"@vintl-dev/pg#intl:extract": {
|
||||||
"outputs": ["./locales/en-US.json"]
|
"outputs": ["./locales/en-US.json"]
|
||||||
},
|
},
|
||||||
@@ -64,7 +70,11 @@
|
|||||||
"outputs": [".eslintcache"]
|
"outputs": [".eslintcache"]
|
||||||
},
|
},
|
||||||
"//#prepare": {
|
"//#prepare": {
|
||||||
"dependsOn": ["@vintl-dev/pg#dev:prepare", "@vintl-dev/docs#dev:prepare"]
|
"dependsOn": [
|
||||||
|
"@vintl/nuxt#dev:prepare",
|
||||||
|
"@vintl-dev/pg#dev:prepare",
|
||||||
|
"@vintl-dev/docs#dev:prepare"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"//#build": {
|
"//#build": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
|
|||||||
Reference in New Issue
Block a user