Giter Club home page Giter Club logo

yarnspinner-console's People

Contributors

17cupsofcoffee avatar desplesda avatar dogboydog avatar mcjones avatar ndrwl avatar sanbox-irl avatar weaversam8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yarnspinner-console's Issues

The default output filenames should match the name of the `.yarn` file

ysc version 1 correctly inferred the name of the output files from the input .yarn file when running ysc compile. For example, ysc compile file.yarn would output file.yarnc and file.csv.

ysc version 2 adds the ability to provide the name of the output files as command line flags (--output-name and --output-string-table-name) which is great, but defaults to a less descriptive name (Output.yarnc and Output.csv respectively.) The default output name should be determined from the name of the .yarn file.

Notarise macOS builds

Builds for macOS are not currently notarised, which means that users need to reduce the security of their system in order to use it. We should be signing release builds; Secret Lab can sponsor the signing, using our existing Apple Developer account.

Allow setting variables from args

The --start-node option is pretty useful for testing parts of a conversation. It would be even more useful if it was also possible to set variables.

I.e. something like

ysc run main.yarn --start-node some_deep_node --set-variable met_sally=true --set-variable money=123

ysc tag feature broken

running ysc tag does not work on a yarn file that compiles and runs successfully.

Given the following start.yarn file:

title: start
position: 251,240

<<declare $value = "" as string>>
<<declare $parameter = "" as string>>
<<declare $component = "" as string>>
<<declare $type = "" as string>>
<<declare $diagnosisId = "" as string>>
<<declare $bodyTextOverride = "" as string>>
<<declare $noDiys = false as bool>>
<<declare $createWorkOrder = false as bool>>
<<declare $target = "" as string>>
<<declare $confirmSuccess = false as bool>>
<<declare $currentContent = "" as string>>
<<declare $ghostNode = "" as string>>
<<declare $stringRecord = "" as string>>
<<declare $assetTag = "" as string>>
<<declare $targetOverrides = "" as string>>
<<declare $tempFlowLoop = "" as string>>

<>

===

Running ysc tag start.yarn produces this:

title: start
position: 251,240

<<declare $value=""asstring>>
<<declare $parameter=""asstring>>
<<declare $component=""asstring>>
<<declare $type=""asstring>>
<<declare $diagnosisId=""asstring>>
<<declare $bodyTextOverride=""asstring>>
<<declare $noDiys=falseasbool>>
<<declare $createWorkOrder=falseasbool>>
<<declare $target=""asstring>>
<<declare $confirmSuccess=falseasbool>>
<<declare $currentContent=""asstring>>
<<declare $ghostNode=""asstring>>
<<declare $stringRecord=""asstring>>
<<declare $assetTag=""asstring>>
<<declare $targetOverrides=""asstring>>
<<declare $tempFlowLoop=""asstring>>
<indent to 3>
<dedent from 3><>

===

Declarations / Initial Values lost when compiling?

Hello there. I'm collaborating with YarnRunner-Python and I was wondering how would be the best approach to support initializing/declaring variables as the language server suggests.

I see at the moment of compiling, CompilationResult has a Declarations enumerable that doesn't get serialized, and the class Program has a InitialValues property. AFAIK the Program class gets serialized with Google's Protobuf, but I don't understand/know how to retrieve those values. It's possible from a compiled .yarnc file get those back?

Emit Non-Zero Exit Status on Error

Right now, ysc always returns 0, even on error. This makes piloting ysc with other tools much harder, since we must devolve into checking if the stdout is empty or not. (Fwiw, I'm not sure what the politics of stdout or stderr are! The name would suggest stderr is better, but I've never really seen a pattern in other code).

--output-directory misbehaves if a trailing slash is not included.

Running the following command in Windows 11 terminal
./ysc.exe tag --output-directory output game.yarn

Expected behaviour is to output a file game.yarn in a subfolder named output of the current directory.
Instead what happens is a file called outputgame.yarn is created in the current directory.

Interestingly, the output will still fail with "Directory does not exist", if subfolder output does not exist. But it just doesn't get used.

To achieve the expected behaviour, I must run the following command
./ysc.exe tag --output-directory output/ game.yarn

On running ysc.exe get error Required Command Was Not Provided, unable to install

This may be related to ticket #2, but that ticket has no description so I can't tell for sure.

I downloaded the most recent version of YS-Console: ysc-win-2.2.0-6526114, extracted the zip but upon running the exe a command prompt flashes briefly with the message:
Required Command Was Not Provided

Furthermore, when I try to run ysc upgrade myFile.yarn in the folder containing myFile.yarn, I get the following error:

ysc : The term 'ysc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ysc upgrade myFile.yarn
+ ~~~
    + CategoryInfo          : ObjectNotFound: (ysc:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I'm about to download an older version to see if that gives me the same result (maybe the most recent exe is broken?) but in the meantime - is there a solution for this error?

EDIT: 2.1.0 and 2.0.2 are giving me the same error.

EDIT 2: Here's my current environment, if that helps.

 Version:   5.0.412
 Commit:    805c28eb1f

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.412\

global.json file:
  Not found

Host:
  Version:      6.0.9
  Architecture: x64
  Commit:       163a63591c

.NET SDKs installed:
  3.1.423 [C:\Program Files\dotnet\sdk]
  5.0.104 [C:\Program Files\dotnet\sdk]
  5.0.303 [C:\Program Files\dotnet\sdk]
  5.0.412 [C:\Program Files\dotnet\sdk]

Thanks!

`ysc upgrade` doesn't correctly identify instances where a variable is set to null

This might be out of scope for the upgrade tool, but upgrading this yarn file:

title: Start
---
<<set $value_string to "string">>
<<set $value_float to 1.25>>
<<set $value_bool to true>>
<<set $value_null to null>>
===

produced the message No upgrades required., which isn't correct. I didn't realize it at the time, but variables are no longer permitted to be null in Yarn Spinner 2.0, which could theoretically be caught by the upgrade tool.

For future users encountering this problem, the error I saw in Yarn Spinner Console looked like this, which was challenging to debug:

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at YarnSpinnerConsole.YarnSpinnerConsole.CompileFiles(FileInfo[] inputs, DirectoryInfo outputDirectory, String outputName, String outputStringTableName)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass24_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseExceptionHandler>b__0>d.MoveNext()

`ysc` doesn't properly surface error messages

The error message displayed in #9 doesn't seem to be very descriptive, or related to the problem. It turns out, ysc surfaces this error message in multiple places, including during compilation (instead of providing descriptive compilation errors.)

I'm using ysc@2.0.1-a2eff4c.

For an example, try to compile this simple file, which features a node name with period characters (which are now invalid as of YS2.)

title: Start
---
This is a start node.
<<jump invalid.node.name>>
===

You'll encounter the same error message as in #9.

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at YarnSpinnerConsole.YarnSpinnerConsole.CompileFiles(FileInfo[] inputs, DirectoryInfo outputDirectory, String outputName, String outputStringTableName)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass24_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseExceptionHandler>b__0>d.MoveNext()

Variables not printing as expected

With the following simple yarn example this is the output.

example.yarn

title: Start
---
Hello
<<set $variableName to "a string value">>
The value of variableName is {$variableName}.
===

output:
Screenshot 2023-01-05 at 5 41 06 PM

Variables are printing as {0} when run with ysc run

Any ideas?

Regression: `ysc run` doesn't work with 2.4.0

Running anything via ysc run <file.yarn> will give:

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: An item with the same key has already been added. Key: visited
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey , TValue , InsertionBehavior )
   at YarnSpinnerConsole.RunCommand.RunFiles(FileInfo[] inputs, String startNode, Boolean autoAdvance)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object , Span`1& , Signature , Boolean , Boolean )
   at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__20_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass24_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__21_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseExceptionHandler>b__0>d.MoveNext()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.