create-auto-app 1.29.0 → 1.31.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-auto-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "Create Auto Engineer apps with no configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"fs-extra": "^11.2.0",
|
|
34
34
|
"inquirer": "^9.2.15",
|
|
35
35
|
"ora": "^8.0.1",
|
|
36
|
-
"@auto-engineer/id": "1.
|
|
36
|
+
"@auto-engineer/id": "1.31.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -131,3 +131,24 @@
|
|
|
131
131
|
background-color: #3d4663 !important;
|
|
132
132
|
}
|
|
133
133
|
</style>
|
|
134
|
+
<script>
|
|
135
|
+
(function() {
|
|
136
|
+
if (window.parent === window) return;
|
|
137
|
+
function notify() {
|
|
138
|
+
window.parent.postMessage({ type: 'iframe-url-change', url: location.href }, '*');
|
|
139
|
+
}
|
|
140
|
+
var pushState = history.pushState;
|
|
141
|
+
var replaceState = history.replaceState;
|
|
142
|
+
history.pushState = function() {
|
|
143
|
+
pushState.apply(this, arguments);
|
|
144
|
+
notify();
|
|
145
|
+
};
|
|
146
|
+
history.replaceState = function() {
|
|
147
|
+
replaceState.apply(this, arguments);
|
|
148
|
+
notify();
|
|
149
|
+
};
|
|
150
|
+
window.addEventListener('popstate', notify);
|
|
151
|
+
window.addEventListener('hashchange', notify);
|
|
152
|
+
notify();
|
|
153
|
+
})();
|
|
154
|
+
</script>
|
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
import tailwindcss from '@tailwindcss/vite';
|
|
2
2
|
import react from '@vitejs/plugin-react-swc';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
|
-
import { defineConfig } from 'vite';
|
|
4
|
+
import { defineConfig, type Plugin } from 'vite';
|
|
5
|
+
|
|
6
|
+
function iframeNavigationTracking(): Plugin {
|
|
7
|
+
return {
|
|
8
|
+
name: 'iframe-navigation-tracking',
|
|
9
|
+
transformIndexHtml(html) {
|
|
10
|
+
return html.replace(
|
|
11
|
+
'</head>',
|
|
12
|
+
`<script>
|
|
13
|
+
(function() {
|
|
14
|
+
if (window.parent === window) return;
|
|
15
|
+
function notify() {
|
|
16
|
+
window.parent.postMessage({ type: 'iframe-url-change', url: location.href }, '*');
|
|
17
|
+
}
|
|
18
|
+
var pushState = history.pushState;
|
|
19
|
+
var replaceState = history.replaceState;
|
|
20
|
+
history.pushState = function() {
|
|
21
|
+
pushState.apply(this, arguments);
|
|
22
|
+
notify();
|
|
23
|
+
};
|
|
24
|
+
history.replaceState = function() {
|
|
25
|
+
replaceState.apply(this, arguments);
|
|
26
|
+
notify();
|
|
27
|
+
};
|
|
28
|
+
window.addEventListener('popstate', notify);
|
|
29
|
+
window.addEventListener('hashchange', notify);
|
|
30
|
+
notify();
|
|
31
|
+
})();
|
|
32
|
+
</script>
|
|
33
|
+
</head>`,
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
5
38
|
|
|
6
39
|
export default defineConfig({
|
|
7
|
-
plugins: [react(), tailwindcss()],
|
|
40
|
+
plugins: [react(), tailwindcss(), iframeNavigationTracking()],
|
|
8
41
|
resolve: {
|
|
9
42
|
alias: {
|
|
10
43
|
'@': resolve(__dirname, './src'),
|