@koine/i18n 2.0.0-beta.113 → 2.0.0-beta.115

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/api.cjs.js CHANGED
@@ -12,8 +12,7 @@ var promises = require('node:fs/promises');
12
12
  var glob = require('glob');
13
13
  var node_https = require('node:https');
14
14
 
15
- function _interopNamespace(e) {
16
- if (e && e.__esModule) return e;
15
+ function _interopNamespaceDefault(e) {
17
16
  var n = Object.create(null);
18
17
  if (e) {
19
18
  Object.keys(e).forEach(function (k) {
@@ -26,11 +25,11 @@ function _interopNamespace(e) {
26
25
  }
27
26
  });
28
27
  }
29
- n["default"] = e;
28
+ n.default = e;
30
29
  return Object.freeze(n);
31
30
  }
32
31
 
33
- var t__namespace = /*#__PURE__*/_interopNamespace(t$1);
32
+ var t__namespace = /*#__PURE__*/_interopNamespaceDefault(t$1);
34
33
 
35
34
  // /**
36
35
  // * Adapter creator function, either _sync_ or _async_
@@ -3637,7 +3636,7 @@ r)=>{
3637
3636
  skipLibCheck: !0,
3638
3637
  noEmitHelpers: !0,
3639
3638
  importHelpers: !0,
3640
- ...r || {}
3639
+ ...{}
3641
3640
  }, // Create a Program with an in-memory emit
3642
3641
  // const createdFiles: Record<string, string> = {};
3643
3642
  // const host = ts.createCompilerHost(compilerOptions);
package/api.esm.js CHANGED
@@ -1,14 +1,14 @@
1
+ import { rmSync } from 'node:fs';
2
+ import { join, dirname, basename, extname, sep } from 'node:path';
3
+ import { fsWrite } from '@koine/node';
1
4
  import { objectMergeWithDefaults, escapeRegExp, isPrimitive, isString, isNumber, isBoolean, isArray, areEqual, changeCaseSnake, splitReverse, isNumericLiteral, forin, split, objectPick, isObject, arrayUniqueByProperties, isPromise, objectSortByKeysMatching, objectFlat, objectSort, normaliseUrl, arraySum } from '@koine/utils';
5
+ import { f as formatRoutePathname } from './formatRoutePathname.esm.js';
6
+ import * as t$1 from 'typescript';
7
+ import { minimatch } from 'minimatch';
2
8
  import { isAbsoluteUrl } from 'next/dist/shared/lib/utils';
3
- import { rmSync } from 'node:fs';
4
9
  import { readFile } from 'node:fs/promises';
5
- import { join, dirname, basename, extname, sep } from 'node:path';
6
10
  import { glob } from 'glob';
7
11
  import { request } from 'node:https';
8
- import { minimatch } from 'minimatch';
9
- import { f as formatRoutePathname } from './formatRoutePathname.esm.js';
10
- import { fsWrite } from '@koine/node';
11
- import * as t$1 from 'typescript';
12
12
 
13
13
  // /**
14
14
  // * Adapter creator function, either _sync_ or _async_
@@ -3615,7 +3615,7 @@ r)=>{
3615
3615
  skipLibCheck: !0,
3616
3616
  noEmitHelpers: !0,
3617
3617
  importHelpers: !0,
3618
- ...r || {}
3618
+ ...{}
3619
3619
  }, // Create a Program with an in-memory emit
3620
3620
  // const createdFiles: Record<string, string> = {};
3621
3621
  // const host = ts.createCompilerHost(compilerOptions);
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var synckit = require('synckit');
6
4
 
7
5
  let i18nCompilerSync = synckit.createSyncFn(require.resolve("./compiler-worker.cjs")); // {
@@ -0,0 +1 @@
1
+ export * from "./compiler-sync";
@@ -0,0 +1 @@
1
+ export * from "./compiler-worker";
@@ -1,15 +1,15 @@
1
1
  import { runAsWorker } from 'synckit';
2
2
  import { i as i18nCompiler } from './api.esm.js';
3
+ import 'node:fs';
4
+ import 'node:path';
5
+ import '@koine/node';
3
6
  import '@koine/utils';
7
+ import './formatRoutePathname.esm.js';
8
+ import 'typescript';
9
+ import 'minimatch';
4
10
  import 'next/dist/shared/lib/utils';
5
- import 'node:fs';
6
11
  import 'node:fs/promises';
7
- import 'node:path';
8
12
  import 'glob';
9
13
  import 'node:https';
10
- import 'minimatch';
11
- import './formatRoutePathname.esm.js';
12
- import '@koine/node';
13
- import 'typescript';
14
14
 
15
15
  runAsWorker(i18nCompiler);
package/compiler.cjs.js CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var api = require('./api.cjs.js');
6
4
  require('node:fs');
7
5
  require('node:path');
@@ -0,0 +1 @@
1
+ export * from "./compiler";
package/compiler.esm.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export { i as i18nCompiler } from './api.esm.js';
2
+ import 'node:fs';
3
+ import 'node:path';
4
+ import '@koine/node';
2
5
  import '@koine/utils';
6
+ import './formatRoutePathname.esm.js';
7
+ import 'typescript';
8
+ import 'minimatch';
3
9
  import 'next/dist/shared/lib/utils';
4
- import 'node:fs';
5
10
  import 'node:fs/promises';
6
- import 'node:path';
7
11
  import 'glob';
8
12
  import 'node:https';
9
- import 'minimatch';
10
- import './formatRoutePathname.esm.js';
11
- import '@koine/node';
12
- import 'typescript';
package/index.cjs.js CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var formatRoutePathname = require('./formatRoutePathname.cjs.js');
6
4
  var utils = require('@koine/utils');
7
5
 
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./index";
package/index.esm.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { f as formatRoutePathname } from './formatRoutePathname.esm.js';
2
- export { f as formatRoutePathname } from './formatRoutePathname.esm.js';
3
2
  import { getType } from '@koine/utils';
4
3
 
5
4
  /**
@@ -41,4 +40,4 @@ o) {
41
40
 
42
41
  let routeHasDynamicPortion = (t)=>/\[/.test(t);
43
42
 
44
- export { interpolateTo, routeHasDynamicPortion };
43
+ export { formatRoutePathname, interpolateTo, routeHasDynamicPortion };
package/next.cjs.js CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var utils = require('@koine/utils');
6
4
  var api = require('./api.cjs.js');
7
5
  var webpack = require('webpack');
@@ -19,24 +17,7 @@ require('glob');
19
17
  require('node:https');
20
18
  require('synckit');
21
19
 
22
- function _interopNamespace(e) {
23
- if (e && e.__esModule) return e;
24
- var n = Object.create(null);
25
- if (e) {
26
- Object.keys(e).forEach(function (k) {
27
- if (k !== 'default') {
28
- var d = Object.getOwnPropertyDescriptor(e, k);
29
- Object.defineProperty(n, k, d.get ? d : {
30
- enumerable: true,
31
- get: function () { return e[k]; }
32
- });
33
- }
34
- });
35
- }
36
- n["default"] = e;
37
- return Object.freeze(n);
38
- }
39
-
20
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
40
21
  // & { _branded: true };
41
22
  function r(e, t) {
42
23
  let { [t]: n, ...l } = e;
@@ -303,7 +284,7 @@ let getRewrites = async (e, t)=>{
303
284
  let { code: { options: { adapter: c } } } = m;
304
285
  if ("next-translate" === c.name && // const options = i18nConfig.code.adapter.options;
305
286
  !1 !== c.options.loader) try {
306
- s = (await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('next-translate-plugin')); }).then((t)=>t.default))(s);
287
+ s = (await import('next-translate-plugin').then((t)=>t.default))(s);
307
288
  } // TODO: verify this:
308
289
  // when using the locale param name structure just force to opt-out from
309
290
  // next.js built in i18n support for pages router, this should also
@@ -318,7 +299,7 @@ let getRewrites = async (e, t)=>{
318
299
 
319
300
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
320
301
  // @ts-ignore problem with cjs output
321
- let l = node_module.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('next.cjs.js', document.baseURI).href)));
302
+ let l = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('next.cjs.js', document.baseURI).href)));
322
303
  let withI18n = (e = {})=>{
323
304
  let { i18nCompiler: n, redirects: m, rewrites: a, ...p } = e, s = p;
324
305
  // bail if user has not defined the compiler options object
package/next.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./next";
package/next.esm.js CHANGED
@@ -3,16 +3,16 @@ import { g as generateRedirectForPathname, a as generateRewriteForPathname, b as
3
3
  import { ContextReplacementPlugin } from 'webpack';
4
4
  import { createRequire } from 'node:module';
5
5
  import { i18nCompilerSync } from './compiler-sync.esm.js';
6
- import 'next/dist/shared/lib/utils';
7
6
  import 'node:fs';
8
- import 'node:fs/promises';
9
7
  import 'node:path';
10
- import 'glob';
11
- import 'node:https';
12
- import 'minimatch';
13
- import './formatRoutePathname.esm.js';
14
8
  import '@koine/node';
9
+ import './formatRoutePathname.esm.js';
15
10
  import 'typescript';
11
+ import 'minimatch';
12
+ import 'next/dist/shared/lib/utils';
13
+ import 'node:fs/promises';
14
+ import 'glob';
15
+ import 'node:https';
16
16
  import 'synckit';
17
17
 
18
18
  // & { _branded: true };
package/package.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "name": "@koine/i18n",
3
3
  "sideEffects": false,
4
4
  "dependencies": {
5
- "@koine/node": "2.0.0-beta.113",
6
- "@koine/utils": "2.0.0-beta.113",
5
+ "@koine/node": "2.0.0-beta.115",
6
+ "@koine/utils": "2.0.0-beta.115",
7
7
  "glob": "^10.3.10",
8
8
  "webpack": "^5.90.1",
9
9
  "minimatch": "^9.0.3",
@@ -58,5 +58,5 @@
58
58
  },
59
59
  "module": "./index.esm.js",
60
60
  "main": "./index.cjs.js",
61
- "version": "2.0.0-beta.113"
61
+ "version": "2.0.0-beta.115"
62
62
  }