Skip to content

Commit

Permalink
v0.9.27
Browse files Browse the repository at this point in the history
fix: error upon running generator script
  • Loading branch information
solvedDev committed Aug 22, 2022
1 parent 15ad665 commit f1ca8e6
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 26 deletions.
14 changes: 11 additions & 3 deletions dist/dash-compiler.bundled.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -7469,7 +7469,9 @@ const TypeScriptPlugin = ({ options }) => {
sourceMaps: (options == null ? void 0 : options.inlineSourceMap) ? "inline" : void 0,
jsc: {
parser: {
syntax: "typescript"
syntax: "typescript",
preserveAllComments: false,
topLevelAwait: true
},
target: "es2020"
}
Expand Down Expand Up @@ -7779,7 +7781,8 @@ const GeneratorScriptsPlugin = ({
await unlinkOutputFiles([
...generatedFiles,
...currentTemplates
]);
]).catch(() => {
});
usedTemplateMap.set(filePath, currentTemplates);
return module.__default__;
}
Expand Down Expand Up @@ -7845,6 +7848,7 @@ const builtInPlugins = {
simpleRewrite: SimpleRewrite,
rewriteForPackaging: RewriteForPackaging,
moLang: MoLangPlugin,
molang: MoLangPlugin,
entityIdentifierAlias: EntityIdentifierAlias,
customEntityComponents: CustomEntityComponentPlugin,
customItemComponents: CustomItemComponentPlugin,
Expand Down Expand Up @@ -8837,8 +8841,12 @@ class Dash {
async unlinkMultiple(paths, saveDashFile = true, onlyChangeOutput = false) {
if (!this.isCompilerActivated || paths.length === 0)
return;
const errors = [];
for (const path2 of paths) {
await this.unlink(path2, false, onlyChangeOutput);
await this.unlink(path2, false, onlyChangeOutput).catch((err) => errors.push(err));
}
if (errors.length > 0) {
throw errors[0];
}
if (saveDashFile)
await this.saveDashFile();
Expand Down
28 changes: 14 additions & 14 deletions dist/dash-compiler.bundled.umd.js

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions dist/dash-compiler.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,9 @@ const TypeScriptPlugin = ({ options }) => {
sourceMaps: (options == null ? void 0 : options.inlineSourceMap) ? "inline" : void 0,
jsc: {
parser: {
syntax: "typescript"
syntax: "typescript",
preserveAllComments: false,
topLevelAwait: true
},
target: "es2020"
}
Expand Down Expand Up @@ -1607,7 +1609,8 @@ const GeneratorScriptsPlugin = ({
await unlinkOutputFiles([
...generatedFiles,
...currentTemplates
]);
]).catch(() => {
});
usedTemplateMap.set(filePath, currentTemplates);
return module.__default__;
}
Expand Down Expand Up @@ -1673,6 +1676,7 @@ const builtInPlugins = {
simpleRewrite: SimpleRewrite,
rewriteForPackaging: RewriteForPackaging,
moLang: MoLangPlugin,
molang: MoLangPlugin,
entityIdentifierAlias: EntityIdentifierAlias,
customEntityComponents: CustomEntityComponentPlugin,
customItemComponents: CustomItemComponentPlugin,
Expand Down Expand Up @@ -2516,8 +2520,12 @@ class Dash {
async unlinkMultiple(paths, saveDashFile = true, onlyChangeOutput = false) {
if (!this.isCompilerActivated || paths.length === 0)
return;
const errors = [];
for (const path of paths) {
await this.unlink(path, false, onlyChangeOutput);
await this.unlink(path, false, onlyChangeOutput).catch((err) => errors.push(err));
}
if (errors.length > 0) {
throw errors[0];
}
if (saveDashFile)
await this.saveDashFile();
Expand Down
6 changes: 3 additions & 3 deletions dist/dash-compiler.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-compiler",
"version": "0.9.26",
"version": "0.9.27",
"description": "A fast compiler for Minecraft Add-Ons",
"scripts": {
"build:types": "tsc --project tsconfig.json",
Expand Down
10 changes: 9 additions & 1 deletion src/Dash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,16 @@ export class Dash<TSetupArg = void> {
) {
if (!this.isCompilerActivated || paths.length === 0) return

const errors: Error[] = []

for (const path of paths) {
await this.unlink(path, false, onlyChangeOutput)
await this.unlink(path, false, onlyChangeOutput).catch((err) =>
errors.push(err)
)
}

if (errors.length > 0) {
throw errors[0]
}

if (saveDashFile) await this.saveDashFile()
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/BuiltIn/GeneratorScripts/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const GeneratorScriptsPlugin: TCompilerPluginFactory<{
await unlinkOutputFiles([
...generatedFiles,
...currentTemplates,
])
]).catch(() => {})

usedTemplateMap.set(filePath, currentTemplates)

Expand Down

0 comments on commit f1ca8e6

Please sign in to comment.