@intlify/core 9.2.0-beta.10

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/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 kazuya kawaguchi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @intlify/core
2
+
3
+ The intlify core module for i18n
4
+
5
+ ## Which dist file to use?
6
+
7
+ ### From CDN or without a Bundler
8
+
9
+ - **`core(.runtime).global(.prod).js`**:
10
+ - For direct use via `<script src="...">` in the browser. Exposes the `IntlifyCore` global
11
+ - Note that global builds are not [UMD](https://github.com/umdjs/umd) builds. They are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) and is only meant for direct use via `<script src="...">`
12
+ - In-browser locale messages compilation:
13
+ - **`core.global.js`** is the "full" build that includes both the compiler and the runtime so it supports compiling locale messages on the fly
14
+ - **`core.runtime.global.js`** contains only the runtime and requires locale messages to be pre-compiled during a build step
15
+ - Inlines internal the bellow packages - i.e. it’s a single file with no dependencies on other files. This means you **must** import everything from this file and this file only to ensure you are getting the same instance of code
16
+ - `@intlify/shared`
17
+ - `@intlify/message-compiler`
18
+ - Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the `*.prod.js` files for production
19
+
20
+ - **`core(.runtime).esm-browser(.prod).js`**:
21
+ - For usage via native ES modules imports (in browser via `<script type="module">`)
22
+ - Shares the same runtime compilation, dependency inlining and hard-coded prod/dev behavior with the global build
23
+
24
+ ### With a Bundler
25
+
26
+ - **`core(.runtime).esm-bundler.js`**:
27
+ - For use with bundlers like `webpack`, `rollup` and `parcel`
28
+ - Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler)
29
+ - Does not ship minified builds (to be done together with the rest of the code after bundling)
30
+ - Imports dependencies (e.g. `@intlify/message-compiler`)
31
+ - Imported dependencies are also `esm-bundler` builds and will in turn import their dependencies (e.g. `@intlify/message-compiler` imports `@intlify/shared`)
32
+ - This means you **can** install/import these deps individually without ending up with different instances of these dependencies, but you must make sure they all resolve to the same version
33
+ - In-browser locale messages compilation:
34
+ - **`core.runtime.esm-bundler.js` (default)** is runtime only, and requires all locale messages to be pre-compiled. This is the default entry for bundlers (via `module` field in `package.json`) because when using a bundler templates are typically pre-compiled (e.g. in `*.json` files)
35
+ - **`core.esm-bundler.js`**: includes the runtime compiler. Use this if you are using a bundler but still want locale messages compilation (e.g. templates via inline JavaScript strings)
36
+
37
+ ### For Node.js (Server-Side)
38
+
39
+ - **`core.cjs(.prod).js`**:
40
+ - For use in Node.js via `require()`
41
+ - If you bundle your app with webpack with `target: 'node'` and properly externalize `@intlify/core`, this is the build that will be loaded
42
+ - The dev/prod files are pre-built, but the appropriate file is automatically required based on `process.env.NODE_ENV`
43
+
44
+ ## :copyright: License
45
+
46
+ [MIT](http://opensource.org/licenses/MIT)
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * core v9.2.0-beta.10
3
+ * (c) 2021 kazuya kawaguchi
4
+ * Released under the MIT License.
5
+ */
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ var coreBase = require('@intlify/core-base');
11
+
12
+ // register message compiler at @intlify/core
13
+ coreBase.registerMessageCompiler(coreBase.compileToFunction);
14
+ // register message resolver at @intlify/core
15
+ coreBase.registerMessageResolver(coreBase.resolveValue);
16
+ // register fallback locale at @intlify/core
17
+ coreBase.registerLocaleFallbacker(coreBase.fallbackWithLocaleChain);
18
+
19
+ Object.keys(coreBase).forEach(function (k) {
20
+ if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = coreBase[k];
21
+ });
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * core v9.2.0-beta.10
3
+ * (c) 2021 kazuya kawaguchi
4
+ * Released under the MIT License.
5
+ */
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ var coreBase = require('@intlify/core-base');
11
+
12
+ // register message compiler at @intlify/core
13
+ coreBase.registerMessageCompiler(coreBase.compileToFunction);
14
+ // register message resolver at @intlify/core
15
+ coreBase.registerMessageResolver(coreBase.resolveValue);
16
+ // register fallback locale at @intlify/core
17
+ coreBase.registerLocaleFallbacker(coreBase.fallbackWithLocaleChain);
18
+
19
+ Object.keys(coreBase).forEach(function (k) {
20
+ if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = coreBase[k];
21
+ });
package/dist/core.d.ts ADDED
@@ -0,0 +1,4 @@
1
+
2
+ export * from "@intlify/core-base";
3
+
4
+ export { }