@izumisy-tailor/omakase-modules 0.4.0 → 0.4.1
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izumisy-tailor/omakase-modules",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"description": "Modularization mechanism for Tailor Platform application powered by Tailor SDK",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"author": "Tailor Inc.",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/node": "^25.0.
|
|
26
|
-
"typedoc": "^0.28.
|
|
25
|
+
"@types/node": "^25.0.8",
|
|
26
|
+
"typedoc": "^0.28.16",
|
|
27
27
|
"typedoc-plugin-markdown": "^4.9.0",
|
|
28
28
|
"typescript": "^5",
|
|
29
|
-
"vite-tsconfig-paths": "^6.0.
|
|
30
|
-
"vitest": "^4.0.
|
|
29
|
+
"vite-tsconfig-paths": "^6.0.4",
|
|
30
|
+
"vitest": "^4.0.17"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@tailor-platform/sdk": "^
|
|
33
|
+
"@tailor-platform/sdk": "^1.2.6"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"dedent": "^1.7.1"
|
|
@@ -2,6 +2,15 @@ import dedent from "dedent";
|
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Sanitize a package name for use in file paths.
|
|
7
|
+
* Removes leading @ and replaces / with __ to create a flat directory structure.
|
|
8
|
+
* e.g., "@izumisy-tailor/hoge-modules" -> "izumisy-tailor__hoge-modules"
|
|
9
|
+
*/
|
|
10
|
+
export const sanitizePackageName = (packageName: string): string => {
|
|
11
|
+
return packageName.replace(/^@/, "").replace(/\//g, "__");
|
|
12
|
+
};
|
|
13
|
+
|
|
5
14
|
/**
|
|
6
15
|
* Path alias for importing modules config.
|
|
7
16
|
* App's tsconfig.json should have: "@omakase-modules/config": ["./modules"]
|
|
@@ -154,7 +163,7 @@ export abstract class WrapperStrategy {
|
|
|
154
163
|
): Promise<string> {
|
|
155
164
|
const categoryWrapperDir = path.join(
|
|
156
165
|
wrapperDir,
|
|
157
|
-
this.packageName,
|
|
166
|
+
sanitizePackageName(this.packageName),
|
|
158
167
|
this.category
|
|
159
168
|
);
|
|
160
169
|
await fs.mkdir(categoryWrapperDir, { recursive: true });
|