You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Without this object in the package.json file, the cicero archive command throws the following expected error:
ERROR: /Users/martin/hello-world is not a valid cicero template. Make sure that package.json exists and that it has a cicero entry.
Assume you have the following grammar.tem.md file:
namespace [email protected]
@template
concept HelloWorld {
o String name
}
Attempting to execute cicero archive as a Clause template with this grammar.tem.md will result in the error:
ERROR: Failed to find an asset that extends org.accordproject.contract.Clause. The model for the template must contain a single asset that extends org.accordproject.contract.Clause.
Attempting to execute cicero archive as a Contract template with this grammar.tem.md will result in the error:
ERROR: Failed to find an asset that extends org.accordproject.contract.Contract. The model for the template must contain a single asset that extends org.accordproject.contract.Contract.
Attempted Fix 1:
Attempt to fix the issue by adding extends Contract or extends Clause to concept, like so:
namespace [email protected]
@template
concept HelloWorld extends Contract {
o String name
}
This results in the error:
ERROR: Could not find super type Contract File '/Users/martin/hello-world/model/model.cto': line 3 column 1, to line 6 column 2.
-- OR --
namespace [email protected]
@template
concept HelloWorld extends Clause {
o String name
}
This results in the error:
ERROR: Could not find super type Clause File '/Users/martin/hello-world/model/model.cto': line 3 column 1, to line 6 column 2.
@mttrbrts@dselman - Not surprisingly, error occurs for other cicero commands too.
% cicero --version
0.24.1-20230722135139
% cicero compile --template ./hello-world --target Rust --output ./
1:18:13 pm - ERROR: Failed to find an asset that extends org.accordproject.contract.Contract. The model for the template must contain a single asset that extends org.accordproject.contract.Contract.
Error: Failed to find an asset that extends org.accordproject.contract.Contract. The model for the template must contain a single asset that extends org.accordproject.contract.Contract.
at findTemplateModel (/Users/martin/.nvm/versions/node/v19.9.0/lib/node_modules/@accordproject/cicero-cli/node_modules/@accordproject/markdown-template/lib/templatemarkutil.js:108:11)
at templateMarkTyping (/Users/martin/.nvm/versions/node/v19.9.0/lib/node_modules/@accordproject/cicero-cli/node_modules/@accordproject/markdown-template/lib/templatemarkutil.js:162:15)
at ParserManager.initParser (/Users/martin/.nvm/versions/node/v19.9.0/lib/node_modules/@accordproject/cicero-cli/node_modules/@accordproject/markdown-template/lib/parsermanager.js:186:27)
at ParserManager.buildParser (/Users/martin/.nvm/versions/node/v19.9.0/lib/node_modules/@accordproject/cicero-cli/node_modules/@accordproject/markdown-template/lib/parsermanager.js:198:12)
at TemplateLoader.fromDirectory (/Users/martin/.nvm/versions/node/v19.9.0/lib/node_modules/@accordproject/cicero-cli/node_modules/@accordproject/cicero-core/src/templateloader.js:192:36)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1:18:13 pm - INFO: Completed.
Bug Report 🐛
The
cicero archive
command requires a validpackage.json
file which must contain either:-- OR --
Note: Without this object in the
package.json
file, thecicero archive
command throws the following expected error:ERROR: /Users/martin/hello-world is not a valid cicero template. Make sure that package.json exists and that it has a cicero entry.
Assume you have the following
grammar.tem.md
file:Attempting to execute
cicero archive
as a Clause template with thisgrammar.tem.md
will result in the error:ERROR: Failed to find an asset that extends org.accordproject.contract.Clause. The model for the template must contain a single asset that extends org.accordproject.contract.Clause.
Attempting to execute
cicero archive
as a Contract template with thisgrammar.tem.md
will result in the error:ERROR: Failed to find an asset that extends org.accordproject.contract.Contract. The model for the template must contain a single asset that extends org.accordproject.contract.Contract.
Attempted Fix 1:
Attempt to fix the issue by adding
extends Contract
orextends Clause
toconcept
, like so:This results in the error:
ERROR: Could not find super type Contract File '/Users/martin/hello-world/model/model.cto': line 3 column 1, to line 6 column 2.
-- OR --
This results in the error:
ERROR: Could not find super type Clause File '/Users/martin/hello-world/model/model.cto': line 3 column 1, to line 6 column 2.
Attempted Fix 2:
Add
contract
import tomodel.cto
like so:This results in the error:
ERROR: ConceptDeclaration (HelloWorld) cannot extend AssetDeclaration (Contract) File '/Users/martin/hello-world/model/model.cto': line 5 column 1, to line 8 column 2.
Context (Environment)
Summary
It seems that
cicero archive
requires an asset to extend eitherContract
orClause
but theconcerto
syntax no longer considers this as valid syntax.Note: Also tried
concerto compile --model ./hello-world/model/model.cto --target Rust
and got same error.The text was updated successfully, but these errors were encountered: