@joystick.js/node-canary 0.0.0-canary.461 → 0.0.0-canary.463

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.
@@ -1 +1 @@
1
- import"./get_platform_safe_path.js";const e=async(t="")=>(await(process.platform==="win32"?import(`file://${t}`):import(t)))?.default;var f=e;export{f as default};
1
+ import"./get_platform_safe_path.js";const e=async(o="")=>(console.log(process.platform==="win32"?`file://${o}`:o),(await(process.platform==="win32"?import(`file://${o}`):import(o)))?.default);var i=e;export{i as default};
@@ -1 +1 @@
1
- import t from"fs";import"./replace_backslashes_with_forward_slashes.js";import"./replace_file_protocol.js";const r=()=>["development","test"].includes(process.env.NODE_ENV)||t.existsSync(".joystick/build")?".joystick/build/":"",o=()=>{const e=r();return`${process.cwd().replace(e,"")}/${e}`};var l=o;export{l as default};
1
+ import t from"fs";import"./replace_file_protocol.js";const o=()=>["development","test"].includes(process.env.NODE_ENV)||t.existsSync(".joystick/build")?".joystick/build/":"",r=()=>{const e=o();return`${process.cwd().replace(e,"")}/${e}`};var c=r;export{c as default};
@@ -1 +1 @@
1
- import g from"fs";import p from"./dynamic_import.js";import"./get_platform_safe_path.js";import _ from"../app/settings/load.js";import h from"./path_exists.js";import d from"./types.js";const c=_(),m=async(t="",n="",a="")=>{const r=await p(`${n}/i18n/${t}?v=${new Date().getTime()}`);if(console.log({language_file:r}),r&&d.is_object(r)){const e=r[a];return e||r}return{}},$=(t="",n=[],a="")=>{let r=[];t&&r.push(t);const i=n?.filter(e=>!e?.includes("*"));return r.push(...i),(c?.config?.i18n?.defaultLanguage||c?.config?.i18n?.default_language)&&r.push(c?.config?.i18n?.defaultLanguage||c?.config?.i18n?.default_language),r?.flatMap(e=>{const s=[e];return e?.length===2&&s.push(`${e.substring(0,2)}-`),e?.length>2&&(s.push(`${e?.split("-")[0]}`),s.push(`${e?.split("-")[0]}-`)),s})?.map(e=>e[e.length-1]==="-"?new RegExp(a?`^${a}_${e}[A-Z]+.js`:`^${e}[A-Z]+.js`,"g"):new RegExp(a?`^${a}_${e}.js`:`^${e}.js`,"g"))},w=(t="")=>t.split(",")?.map(a=>a.split(";")[0]),b=async(t={})=>{const n=t?.is_email?`${t?.joystick_build_path}i18n/email`:`${t?.joystick_build_path}i18n`,a=await h(n)&&g.readdirSync(n)||[],r=t?.is_email?[]:w(t?.req?.headers["accept-language"]),i=$(t?.req?.context?.user?.language,r,t?.email_template_name);let e=null;for(let l=0;l<i.length;l+=1){const u=i[l],f=a.find(o=>!!o.match(u));if(f){e=f;break}}return(e?await m(e,t?.joystick_build_path,t?.render_component_path):null)||{}};var E=b;export{E as default};
1
+ import g from"fs";import p from"./dynamic_import.js";import"./get_platform_safe_path.js";import _ from"../app/settings/load.js";import h from"./path_exists.js";import d from"./types.js";const c=_(),m=async(t="",n="",a="")=>{const r=await p(`${n}/i18n/${t}?v=${new Date().getTime()}`);if(r&&d.is_object(r)){const e=r[a];return e||r}return{}},$=(t="",n=[],a="")=>{let r=[];t&&r.push(t);const i=n?.filter(e=>!e?.includes("*"));return r.push(...i),(c?.config?.i18n?.defaultLanguage||c?.config?.i18n?.default_language)&&r.push(c?.config?.i18n?.defaultLanguage||c?.config?.i18n?.default_language),r?.flatMap(e=>{const s=[e];return e?.length===2&&s.push(`${e.substring(0,2)}-`),e?.length>2&&(s.push(`${e?.split("-")[0]}`),s.push(`${e?.split("-")[0]}-`)),s})?.map(e=>e[e.length-1]==="-"?new RegExp(a?`^${a}_${e}[A-Z]+.js`:`^${e}[A-Z]+.js`,"g"):new RegExp(a?`^${a}_${e}.js`:`^${e}.js`,"g"))},w=(t="")=>t.split(",")?.map(a=>a.split(";")[0]),b=async(t={})=>{const n=t?.is_email?`${t?.joystick_build_path}i18n/email`:`${t?.joystick_build_path}i18n`,a=await h(n)&&g.readdirSync(n)||[],r=t?.is_email?[]:w(t?.req?.headers["accept-language"]),i=$(t?.req?.context?.user?.language,r,t?.email_template_name);let e=null;for(let l=0;l<i.length;l+=1){const u=i[l],f=a.find(o=>!!o.match(u));if(f){e=f;break}}return(e?await m(e,t?.joystick_build_path,t?.render_component_path):null)||{}};var E=b;export{E as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@joystick.js/node-canary",
3
3
  "type": "module",
4
- "version": "0.0.0-canary.461",
4
+ "version": "0.0.0-canary.463",
5
5
  "description": "The Node.js framework for Joystick.",
6
6
  "main": "./dist/index.js",
7
7
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  import get_platform_safe_path from "./get_platform_safe_path.js";
2
2
 
3
3
  const dynamic_import = async (path = '') => {
4
+ console.log(process.platform === 'win32' ? `file://${path}` : path);
4
5
  const file = await import(process.platform === 'win32' ? `file://${path}` : path);
5
6
  return file?.default;
6
7
  };
@@ -1,5 +1,4 @@
1
1
  import fs from 'fs';
2
- import replace_backslashes_with_forward_slashes from './replace_backslashes_with_forward_slashes.js';
3
2
  import replace_file_protocol from './replace_file_protocol.js';
4
3
 
5
4
  const get_build_path_for_environment = () => {
@@ -12,8 +12,6 @@ const get_translations_file = async (language_file_path = '', joystick_build_pat
12
12
  `${joystick_build_path}/i18n/${language_file_path}?v=${new Date().getTime()}`
13
13
  );
14
14
 
15
- console.log({ language_file });
16
-
17
15
  const is_valid_language_file = language_file && types.is_object(language_file);
18
16
 
19
17
  if (is_valid_language_file) {
@@ -1 +0,0 @@
1
- import e from"os";const s=(r="")=>e.platform()==="win32"?r.replace(/\\/g,"/"):r;var o=s;export{o as default};
@@ -1,8 +0,0 @@
1
- import os from 'os';
2
-
3
- const replace_backslashes_with_forward_slashes = (path = '') => {
4
- // NOTE: This is why serial killers exist.
5
- return os.platform() === 'win32' ? path.replace(/\\/g, '/') : path;
6
- };
7
-
8
- export default replace_backslashes_with_forward_slashes;