hackmud-script-manager 0.19.0-c12fd7c → 0.19.0-dbb7332
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/LICENSE +21 -674
- package/bin/hsm.js +4 -7
- package/index.js +13 -10
- package/package.json +28 -25
- package/processScript/index.js +15 -12
- package/processScript/preprocess.js +1 -2
- package/processScript/transform.js +5 -6
- package/push.js +13 -10
- package/tsconfig.tsbuildinfo +1 -1
- package/watch.js +18 -15
package/watch.js
CHANGED
@@ -10,18 +10,21 @@ import { generateTypeDeclaration } from './generateTypeDeclaration.js';
|
|
10
10
|
import { processScript } from './processScript/index.js';
|
11
11
|
import '@babel/generator';
|
12
12
|
import '@babel/parser';
|
13
|
-
import '@babel/plugin-proposal-class-properties';
|
14
|
-
import '@babel/plugin-proposal-class-static-block';
|
15
13
|
import '@babel/plugin-proposal-decorators';
|
16
|
-
import '@babel/plugin-proposal-
|
17
|
-
import '@babel/plugin-proposal-
|
18
|
-
import '@babel/plugin-
|
19
|
-
import '@babel/plugin-
|
20
|
-
import '@babel/plugin-proposal-object-rest-spread';
|
21
|
-
import '@babel/plugin-proposal-optional-catch-binding';
|
22
|
-
import '@babel/plugin-proposal-optional-chaining';
|
23
|
-
import '@babel/plugin-proposal-private-property-in-object';
|
14
|
+
import '@babel/plugin-proposal-destructuring-private';
|
15
|
+
import '@babel/plugin-proposal-explicit-resource-management';
|
16
|
+
import '@babel/plugin-transform-class-properties';
|
17
|
+
import '@babel/plugin-transform-class-static-block';
|
24
18
|
import '@babel/plugin-transform-exponentiation-operator';
|
19
|
+
import '@babel/plugin-transform-json-strings';
|
20
|
+
import '@babel/plugin-transform-logical-assignment-operators';
|
21
|
+
import '@babel/plugin-transform-nullish-coalescing-operator';
|
22
|
+
import '@babel/plugin-transform-numeric-separator';
|
23
|
+
import '@babel/plugin-transform-object-rest-spread';
|
24
|
+
import '@babel/plugin-transform-optional-catch-binding';
|
25
|
+
import '@babel/plugin-transform-optional-chaining';
|
26
|
+
import '@babel/plugin-transform-private-property-in-object';
|
27
|
+
import '@babel/plugin-transform-unicode-sets-regex';
|
25
28
|
import '@babel/traverse';
|
26
29
|
import '@babel/types';
|
27
30
|
import '@rollup/plugin-babel';
|
@@ -117,7 +120,7 @@ const watch = async (sourceDirectory, hackmudDirectory, {
|
|
117
120
|
for (const user of scriptNamesToUsers.get(scriptName)) usersToPushToSet.add(user);
|
118
121
|
const usersToPushTo = [...usersToPushToSet].filter(user => !scriptNamesToUsersToSkip.has(user));
|
119
122
|
if (!usersToPushTo.length) {
|
120
|
-
onPush
|
123
|
+
onPush?.({
|
121
124
|
file: path,
|
122
125
|
users: [],
|
123
126
|
minLength: 0,
|
@@ -144,7 +147,7 @@ const watch = async (sourceDirectory, hackmudDirectory, {
|
|
144
147
|
}));
|
145
148
|
} catch (error) {
|
146
149
|
assert(error instanceof Error);
|
147
|
-
onPush
|
150
|
+
onPush?.({
|
148
151
|
file: path,
|
149
152
|
users: [],
|
150
153
|
minLength: 0,
|
@@ -153,7 +156,7 @@ const watch = async (sourceDirectory, hackmudDirectory, {
|
|
153
156
|
return;
|
154
157
|
}
|
155
158
|
await Promise.all(usersToPushTo.map(user => writeFilePersistent(resolve(hackmudDirectory, user, `scripts/${scriptName}.js`), minifiedCode.replace(new RegExp(`\\$${uniqueID}\\$SCRIPT_USER\\$`, `g`), user).replace(new RegExp(`\\$${uniqueID}\\$FULL_SCRIPT_NAME\\$`, `g`), `${user}.${scriptName}`))));
|
156
|
-
onPush
|
159
|
+
onPush?.({
|
157
160
|
file: path,
|
158
161
|
users: usersToPushTo,
|
159
162
|
minLength: countHackmudCharacters(minifiedCode),
|
@@ -181,7 +184,7 @@ const watch = async (sourceDirectory, hackmudDirectory, {
|
|
181
184
|
}));
|
182
185
|
} catch (error) {
|
183
186
|
assert(error instanceof Error);
|
184
|
-
onPush
|
187
|
+
onPush?.({
|
185
188
|
file: path,
|
186
189
|
users: [],
|
187
190
|
minLength: 0,
|
@@ -190,7 +193,7 @@ const watch = async (sourceDirectory, hackmudDirectory, {
|
|
190
193
|
return;
|
191
194
|
}
|
192
195
|
await writeFilePersistent(resolve(hackmudDirectory, user, `scripts`, `${scriptName}.js`), script);
|
193
|
-
onPush
|
196
|
+
onPush?.({
|
194
197
|
file: path,
|
195
198
|
users: [user],
|
196
199
|
minLength: countHackmudCharacters(script),
|