shopify-accelerate-app 1.0.21 → 1.0.23
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 +18 -19
- package/src/tailwind/tailwind-watch.ts +58 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shopify-accelerate-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "Shopify App development with full Typescript Support",
|
|
5
5
|
"author": "Felix Tellmann",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,45 +32,44 @@
|
|
|
32
32
|
"cms"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@swc/
|
|
37
|
-
"@swc/helpers": "^0.5.6",
|
|
35
|
+
"@swc/core": "^1.9.3",
|
|
36
|
+
"@swc/helpers": "^0.5.15",
|
|
38
37
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
39
38
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
40
|
-
"autoprefixer": "^10.4.
|
|
39
|
+
"autoprefixer": "^10.4.20",
|
|
41
40
|
"chalk": "4.1.2",
|
|
42
|
-
"commander": "^12.
|
|
41
|
+
"commander": "^12.1.0",
|
|
43
42
|
"dotenv-mono": "^1.3.14",
|
|
44
43
|
"esbuild": "^0.24.0",
|
|
45
44
|
"esbuild-plugin-d.ts": "^1.3.1",
|
|
46
45
|
"immer": "^10.0.3",
|
|
47
46
|
"import-fresh": "^3.3.0",
|
|
48
|
-
"inquirer": "
|
|
49
|
-
"jsdom": "^
|
|
50
|
-
"json-schema-to-typescript": "^
|
|
51
|
-
"json2toml": "^6.1.
|
|
47
|
+
"inquirer": "12.1.0",
|
|
48
|
+
"jsdom": "^25.0.1",
|
|
49
|
+
"json-schema-to-typescript": "^15.0.3",
|
|
50
|
+
"json2toml": "^6.1.1",
|
|
52
51
|
"node-watch": "^0.7.4",
|
|
53
|
-
"postcss": "^8.4.
|
|
52
|
+
"postcss": "^8.4.49",
|
|
54
53
|
"postcss-import": "^16.1.0",
|
|
55
|
-
"preact": "^10.
|
|
54
|
+
"preact": "^10.25.0",
|
|
56
55
|
"prompts": "^2.4.2",
|
|
57
56
|
"regenerator-runtime": "^0.14.1",
|
|
58
57
|
"shopify-typed-node-api": "^2.1.1",
|
|
59
|
-
"tailwindcss": "
|
|
58
|
+
"tailwindcss": "0.0.0-insiders.6069a81",
|
|
60
59
|
"tailwindcss-container-queries-with-max-width": "^0.1.5",
|
|
61
60
|
"toml": "^3.0.0",
|
|
62
61
|
"ts-node": "^10.9.2",
|
|
63
62
|
"tsconfig-paths": "^4.2.0",
|
|
64
|
-
"zustand": "^
|
|
63
|
+
"zustand": "^5.0.1"
|
|
65
64
|
},
|
|
66
65
|
"devDependencies": {
|
|
67
66
|
"@types/inquirer": "^9.0.7",
|
|
68
|
-
"@types/node": "^
|
|
69
|
-
"@types/react": "^18.
|
|
70
|
-
"@types/react-dom": "^18.
|
|
67
|
+
"@types/node": "^22.9.1",
|
|
68
|
+
"@types/react": "^18.3.12",
|
|
69
|
+
"@types/react-dom": "^18.3.1",
|
|
71
70
|
"fx-style": "^3.0.3",
|
|
72
71
|
"pnpm": "^8.15.5",
|
|
73
|
-
"typescript": "^5.
|
|
72
|
+
"typescript": "^5.6.3"
|
|
74
73
|
},
|
|
75
74
|
"eslintConfig": {
|
|
76
75
|
"env": {
|
|
@@ -108,5 +107,5 @@
|
|
|
108
107
|
"importFormatting": "oneline",
|
|
109
108
|
"endOfLine": "auto"
|
|
110
109
|
},
|
|
111
|
-
"packageManager": "pnpm@9.
|
|
110
|
+
"packageManager": "pnpm@9.14.2"
|
|
112
111
|
}
|
|
@@ -21,7 +21,7 @@ export const runTailwindCSSWatcher = () => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const filePath = path.join(config.extension_path, `assets`, `tailwind_pre_sort.css`);
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
/*= =============== Tailwind Watcher ================ */
|
|
26
26
|
console.log(path.join(root_dir, `assets`, `_tailwind.css`));
|
|
27
27
|
console.log(path.join(package_root, `src/tailwind/tailwind.config.js`));
|
|
@@ -53,70 +53,73 @@ export const runTailwindCSSWatcher = () => {
|
|
|
53
53
|
|
|
54
54
|
/*= =============== Tailwind Plugin Order ================ */
|
|
55
55
|
watch(path.join(config.extension_path, "assets"), { recursive: false }, async (evt, name) => {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
try {
|
|
57
|
+
if (!name.match(/tailwind_pre_sort.css$/) || !fs.existsSync(filePath)) return;
|
|
58
|
+
const file = fs.readFileSync(filePath, { encoding: "utf-8" });
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
const top = file
|
|
61
|
+
.split(/\n}/gi)
|
|
62
|
+
.filter((str) => !/\n@container \(/gi.test(str))
|
|
63
|
+
.join("\n}");
|
|
64
|
+
const bottom = `${file
|
|
65
|
+
.split(/\n}/gi)
|
|
66
|
+
.filter((str) => /\n@container \(/gi.test(str))
|
|
67
|
+
.join("\n}")}\n`;
|
|
68
|
+
const content = top + bottom;
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
const classesInOrder = [];
|
|
71
|
+
const omitCompoundClasses = [":not", ":where", ">", "*", ","];
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
content.split("\n").forEach((line) => {
|
|
74
|
+
if (!line.startsWith(".")) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
76
77
|
|
|
77
|
-
|
|
78
|
+
let writeOut = true;
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
omitCompoundClasses.forEach((classToOmit) => {
|
|
81
|
+
if (line.includes(classToOmit)) {
|
|
82
|
+
writeOut = false;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
if (writeOut) {
|
|
88
|
+
const finalClassName = line
|
|
89
|
+
.replace(/\./g, "")
|
|
90
|
+
.replace(/{/g, "")
|
|
91
|
+
.replace(/}/g, "")
|
|
92
|
+
.replace(/\\/g, "")
|
|
93
|
+
.trim();
|
|
94
|
+
if (finalClassName !== "") {
|
|
95
|
+
classesInOrder.push(`${finalClassName}`);
|
|
96
|
+
}
|
|
83
97
|
}
|
|
84
98
|
});
|
|
85
99
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
.replace(/{/g, "")
|
|
90
|
-
.replace(/}/g, "")
|
|
91
|
-
.replace(/\\/g, "")
|
|
92
|
-
.trim();
|
|
93
|
-
if (finalClassName !== "") {
|
|
94
|
-
classesInOrder.push(`${finalClassName}`);
|
|
95
|
-
}
|
|
100
|
+
writeCompareFile(path.join(config.extension_path, `assets/tailwind.css`), content);
|
|
101
|
+
if (process.env.SHOPIFY_ACCELERATE_THEME_OUTPUT_PATH) {
|
|
102
|
+
writeCompareFile(path.join(config.theme_output_path, `assets/tailwind.css`), content);
|
|
96
103
|
}
|
|
97
|
-
});
|
|
98
104
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
writeCompareFile(
|
|
106
|
+
path.join(process.cwd(), ".tailwindorder"),
|
|
107
|
+
classesInOrder
|
|
108
|
+
.join("\n")
|
|
109
|
+
.replace(
|
|
110
|
+
new RegExp(
|
|
111
|
+
`${
|
|
112
|
+
process.env.SHOPIFY_ACCELERATE_TAILWIND_PREFIX
|
|
113
|
+
? `${process.env.SHOPIFY_ACCELERATE_TAILWIND_PREFIX}-`
|
|
114
|
+
: ""
|
|
115
|
+
}`,
|
|
116
|
+
"gi"
|
|
117
|
+
),
|
|
118
|
+
""
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
} catch (err) {
|
|
122
|
+
console.log(err);
|
|
102
123
|
}
|
|
103
|
-
fs.unlinkSync(filePath);
|
|
104
|
-
|
|
105
|
-
writeCompareFile(
|
|
106
|
-
path.join(process.cwd(), ".tailwindorder"),
|
|
107
|
-
classesInOrder
|
|
108
|
-
.join("\n")
|
|
109
|
-
.replace(
|
|
110
|
-
new RegExp(
|
|
111
|
-
`${
|
|
112
|
-
process.env.SHOPIFY_ACCELERATE_TAILWIND_PREFIX
|
|
113
|
-
? `${process.env.SHOPIFY_ACCELERATE_TAILWIND_PREFIX}-`
|
|
114
|
-
: ""
|
|
115
|
-
}`,
|
|
116
|
-
"gi"
|
|
117
|
-
),
|
|
118
|
-
""
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
124
|
});
|
|
122
125
|
};
|