初始化

This commit is contained in:
yziiy
2025-08-11 11:06:07 +08:00
parent 083bc37c00
commit 5607d11395
19772 changed files with 3108723 additions and 18 deletions

View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2020 kazuya kawaguchi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,7 @@
# @intlify/message-compiler
The message compiler for intlify project
## :copyright: License
[MIT](http://opensource.org/licenses/MIT)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,197 @@
import { RawSourceMap } from 'source-map';
export declare function baseCompile(source: string, options?: CompileOptions): CodeGenResult;
export declare interface CodeGenOptions {
mode?: 'normal' | 'arrow';
breakLineCode?: '\n' | ';';
needIndent?: boolean;
onError?: CompileErrorHandler;
sourceMap?: boolean;
filename?: string;
}
declare interface CodeGenResult {
code: string;
ast: ResourceNode;
map?: RawSourceMap;
}
export declare type CompileCacheKeyHandler = (source: string) => string;
export declare type CompileDomain = 'tokenizer' | 'parser' | 'generator' | 'transformer' | 'compiler';
export declare interface CompileError extends SyntaxError {
code: number;
domain?: CompileDomain;
location?: SourceLocation;
}
export declare const enum CompileErrorCodes {
EXPECTED_TOKEN = 0,
INVALID_TOKEN_IN_PLACEHOLDER = 1,
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER = 2,
UNKNOWN_ESCAPE_SEQUENCE = 3,
INVALID_UNICODE_ESCAPE_SEQUENCE = 4,
UNBALANCED_CLOSING_BRACE = 5,
UNTERMINATED_CLOSING_BRACE = 6,
EMPTY_PLACEHOLDER = 7,
NOT_ALLOW_NEST_PLACEHOLDER = 8,
INVALID_LINKED_FORMAT = 9,
MUST_HAVE_MESSAGES_IN_PLURAL = 10,
UNEXPECTED_EMPTY_LINKED_MODIFIER = 11,
UNEXPECTED_EMPTY_LINKED_KEY = 12,
UNEXPECTED_LEXICAL_ANALYSIS = 13,
__EXTEND_POINT__ = 14
}
export declare type CompileErrorHandler = (error: CompileError) => void;
export declare type CompileOptions = {
warnHtmlMessage?: boolean;
onCacheKey?: CompileCacheKeyHandler;
} & TransformOptions & CodeGenOptions & ParserOptions & TokenizeOptions;
export declare function createCompileError<T extends number>(code: T, loc: SourceLocation | null, options?: CreateCompileErrorOptions): CompileError;
export declare interface CreateCompileErrorOptions {
domain?: CompileDomain;
messages?: {
[code: number]: string;
};
args?: unknown[];
}
export declare function createLocation(start: Position, end: Position, source?: string): SourceLocation;
export declare function createParser(options?: ParserOptions): Parser;
export declare function createPosition(line: number, column: number, offset: number): Position;
/* Excluded from this release type: defaultOnError */
export declare const ERROR_DOMAIN = "parser";
/* Excluded from this release type: errorMessages */
export declare const enum HelperNameMap {
LIST = "list",
NAMED = "named",
PLURAL = "plural",
LINKED = "linked",
MESSAGE = "message",
TYPE = "type",
INTERPOLATE = "interpolate",
NORMALIZE = "normalize"
}
export declare type Identifier = string;
export declare interface LinkedKeyNode extends Node_2 {
type: NodeTypes.LinkedKey;
value: string;
}
export declare interface LinkedModifierNode extends Node_2 {
type: NodeTypes.LinkedModifier;
value: Identifier;
}
export declare interface LinkedNode extends Node_2 {
type: NodeTypes.Linked;
modifier?: LinkedModifierNode;
key: LinkedKeyNode | NamedNode | ListNode | LiteralNode;
}
export declare interface ListNode extends Node_2 {
type: NodeTypes.List;
index: number;
}
export declare interface LiteralNode extends Node_2 {
type: NodeTypes.Literal;
value: string;
}
export declare const LocationStub: SourceLocation;
declare type MessageElementNode = TextNode | NamedNode | ListNode | LiteralNode | LinkedNode;
export declare interface MessageNode extends Node_2 {
type: NodeTypes.Message;
items: MessageElementNode[];
}
export declare interface NamedNode extends Node_2 {
type: NodeTypes.Named;
key: Identifier;
}
declare interface Node_2 {
type: NodeTypes;
start: number;
end: number;
loc?: SourceLocation;
}
export { Node_2 as Node }
export declare const enum NodeTypes {
Resource = 0,
Plural = 1,
Message = 2,
Text = 3,
Named = 4,
List = 5,
Linked = 6,
LinkedKey = 7,
LinkedModifier = 8,
Literal = 9
}
export declare interface Parser {
parse(source: string): ResourceNode;
}
export declare interface ParserOptions {
location?: boolean;
onError?: CompileErrorHandler;
}
export declare interface PluralNode extends Node_2 {
type: NodeTypes.Plural;
cases: MessageNode[];
}
export declare interface Position {
offset: number;
line: number;
column: number;
}
export declare interface ResourceNode extends Node_2 {
type: NodeTypes.Resource;
body: MessageNode | PluralNode;
helpers?: string[];
}
export declare interface SourceLocation {
start: Position;
end: Position;
source?: string;
}
export declare interface TextNode extends Node_2 {
type: NodeTypes.Text;
value: string;
}
export declare interface TokenizeOptions {
location?: boolean;
onError?: CompileErrorHandler;
}
export declare interface TransformOptions {
onError?: CompileErrorHandler;
}
export { }

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/message-compiler.cjs.prod.js')
} else {
module.exports = require('./dist/message-compiler.cjs.js')
}

View File

@@ -0,0 +1,56 @@
{
"name": "@intlify/message-compiler",
"version": "9.1.9",
"description": "@intlify/message-compiler",
"keywords": [
"compiler",
"i18n",
"internationalization",
"intlify",
"message-format"
],
"license": "MIT",
"author": {
"name": "kazuya kawaguchi",
"email": "kawakazu80@gmail.com"
},
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/message-compiler#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/intlify/vue-i18n-next.git",
"directory": "packages/message-compiler"
},
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/message-compiler.esm-bundler.js",
"unpkg": "dist/message-compiler.global.js",
"jsdelivr": "dist/message-compiler.global.js",
"types": "dist/message-compiler.d.ts",
"dependencies": {
"@intlify/message-resolver": "9.1.9",
"@intlify/shared": "9.1.9",
"source-map": "0.6.1"
},
"engines": {
"node": ">= 10"
},
"buildOptions": {
"name": "IntlifyMessageCompiler",
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"publishConfig": {
"access": "public"
},
"sideEffects": false
}