@teqfw/di 0.21.0 → 0.22.0

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.
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "nuxt-app",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "nuxt build",
7
+ "deploy": "nuxt generate && gh-pages --dotfiles -d .output/public",
8
+ "dev": "nuxt dev",
9
+ "generate": "nuxt generate",
10
+ "postinstall": "nuxt prepare",
11
+ "preview": "nuxt preview"
12
+ },
13
+ "devDependencies": {
14
+ "@nuxt/devtools": "latest",
15
+ "gh-pages": "latest",
16
+ "nuxt": "^3.7.4",
17
+ "vue": "^3.3.4",
18
+ "vue-router": "^4.2.5"
19
+ },
20
+ "dependencies": {
21
+ "@nuxt/content": "^2.8.5",
22
+ "@nuxtjs/google-fonts": "^3.0.2",
23
+ "nuxt-gtag": "^1.1.1"
24
+ }
25
+ }
@@ -0,0 +1,6 @@
1
+ <script setup>
2
+ </script>
3
+
4
+ <template>
5
+ <ContentDoc/>
6
+ </template>
@@ -0,0 +1,6 @@
1
+ <script setup>
2
+ </script>
3
+
4
+ <template>
5
+ <ContentDoc/>
6
+ </template>
File without changes
@@ -0,0 +1 @@
1
+ di.teqfw.com
Binary file
@@ -0,0 +1 @@
1
+ <svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#fff"/></svg>
Binary file
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../.nuxt/tsconfig.server.json"
3
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ // https://nuxt.com/docs/guide/concepts/typescript
3
+ "extends": "./.nuxt/tsconfig.json"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teqfw/di",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "Dependency Injection container for ES6 modules that works in both browser and Node.js apps.",
5
5
  "keywords": [
6
6
  "dependency injection",
@@ -9,7 +9,7 @@ import Defs from '../../../../Defs.js';
9
9
 
10
10
  // VARS
11
11
  /** @type {RegExp} expression for default object key (Ns_Module[.|#]export$[F|A][S|I]) */
12
- const REGEXP = /^((([A-Z])[A-Za-z0-9_]*)((#|\.)?([A-Za-z0-9]*)((\$)([F|A])?([S|I])?)?)?)$/;
12
+ const REGEXP = /^((([A-Z])[A-Za-z0-9_]*)((#|\.)?([A-Za-z0-9_]*)((\$)([F|A])?([S|I])?)?)?)$/;
13
13
 
14
14
  /**
15
15
  * @implements TeqFw_Di_Api_Container_Parser_Chunk
@@ -26,16 +26,20 @@ export default class TeqFw_Di_Container_Resolver {
26
26
  constructor() {
27
27
  // VARS
28
28
  const _regNs = {};
29
+ let _isWindows = false; // flag of the runtime env - win or *nix/web
29
30
  let _namespaces = [];
30
31
  let _ps = '/'; // web & unix path separator
31
32
 
32
33
  // INSTANCE METHODS
33
34
 
34
35
  this.addNamespaceRoot = function (ns, path, ext) {
36
+ const lead = (_isWindows) ? path.replace(/^\\/, '') : path; // remove leading backslash for Win
37
+ const norm = lead.replace(/\\/g, '/'); // replace all windows path separators
38
+ const root = (_isWindows) ? `file://${norm}` : norm;
35
39
  _regNs[ns] = {
36
40
  [KEY_EXT]: ext ?? Defs.EXT,
37
41
  [KEY_NS]: ns,
38
- [KEY_PATH]: path,
42
+ [KEY_PATH]: root,
39
43
  };
40
44
  _namespaces = Object.keys(_regNs).sort((a, b) => b.localeCompare(a));
41
45
  };
@@ -61,5 +65,14 @@ export default class TeqFw_Di_Container_Resolver {
61
65
  return `${root}${_ps}${file}.${ext}`;
62
66
  } else return moduleName;
63
67
  };
68
+
69
+ /**
70
+ * 'true' - to use '\' as path separator to resolve paths.
71
+ * @param {boolean} isWindows
72
+ */
73
+ this.setWindowsEnv = function (isWindows = true) {
74
+ _isWindows = isWindows;
75
+ _ps = (isWindows) ? '\\' : '/';
76
+ };
64
77
  }
65
78
  };