@antigenic-oss/paint 0.2.5 → 0.2.6
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/bin/paint.js +21 -1
- package/{next.config.ts → next.config.mjs} +1 -3
- package/package.json +2 -2
package/bin/paint.js
CHANGED
|
@@ -22,6 +22,7 @@ const APP_VERSION = (() => {
|
|
|
22
22
|
const RUNNING_FROM_NODE_MODULES = APP_ROOT.includes(
|
|
23
23
|
`${path.sep}node_modules${path.sep}`,
|
|
24
24
|
)
|
|
25
|
+
const RUNTIME_SCHEMA_VERSION = 2
|
|
25
26
|
const RUNTIME_ROOT = RUNNING_FROM_NODE_MODULES
|
|
26
27
|
? path.join(STATE_DIR, 'runtime', APP_VERSION)
|
|
27
28
|
: APP_ROOT
|
|
@@ -71,7 +72,25 @@ function ensureRuntimeRoot() {
|
|
|
71
72
|
if (!RUNNING_FROM_NODE_MODULES) return APP_ROOT
|
|
72
73
|
|
|
73
74
|
const stampFile = path.join(RUNTIME_ROOT, '.paint-runtime-stamp.json')
|
|
75
|
+
let needsRefresh = true
|
|
76
|
+
|
|
74
77
|
if (fs.existsSync(stampFile)) {
|
|
78
|
+
try {
|
|
79
|
+
const stamp = JSON.parse(fs.readFileSync(stampFile, 'utf8'))
|
|
80
|
+
const hasConfigMjs = fs.existsSync(path.join(RUNTIME_ROOT, 'next.config.mjs'))
|
|
81
|
+
const hasLegacyConfigTs = fs.existsSync(
|
|
82
|
+
path.join(RUNTIME_ROOT, 'next.config.ts'),
|
|
83
|
+
)
|
|
84
|
+
needsRefresh =
|
|
85
|
+
stamp?.schemaVersion !== RUNTIME_SCHEMA_VERSION ||
|
|
86
|
+
!hasConfigMjs ||
|
|
87
|
+
hasLegacyConfigTs
|
|
88
|
+
} catch {
|
|
89
|
+
needsRefresh = true
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (!needsRefresh) {
|
|
75
94
|
return RUNTIME_ROOT
|
|
76
95
|
}
|
|
77
96
|
|
|
@@ -87,7 +106,7 @@ function ensureRuntimeRoot() {
|
|
|
87
106
|
'public',
|
|
88
107
|
'src',
|
|
89
108
|
'next-env.d.ts',
|
|
90
|
-
'next.config.
|
|
109
|
+
'next.config.mjs',
|
|
91
110
|
'postcss.config.mjs',
|
|
92
111
|
'tsconfig.json',
|
|
93
112
|
'package.json',
|
|
@@ -111,6 +130,7 @@ function ensureRuntimeRoot() {
|
|
|
111
130
|
stampFile,
|
|
112
131
|
JSON.stringify(
|
|
113
132
|
{
|
|
133
|
+
schemaVersion: RUNTIME_SCHEMA_VERSION,
|
|
114
134
|
version: APP_VERSION,
|
|
115
135
|
sourceRoot: APP_ROOT,
|
|
116
136
|
preparedAt: now(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antigenic-oss/paint",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Visual editor for localhost web projects with a global paint CLI",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/Antigenic-OSS/pAInt",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"public",
|
|
27
27
|
"src",
|
|
28
28
|
"next-env.d.ts",
|
|
29
|
-
"next.config.
|
|
29
|
+
"next.config.mjs",
|
|
30
30
|
"postcss.config.mjs",
|
|
31
31
|
"tsconfig.json",
|
|
32
32
|
"README.md",
|