Giter VIP home page Giter VIP logo

nujan-io / nujan-ide Goto Github PK

View Code? Open in Web Editor NEW
84.0 5.0 7.0 1020 KB

Web IDE, powered by Nujan, is your ultimate browser-based IDE designed to simplify the journey of writing, testing, compiling, deploying, and interacting with smart contracts on TON. Write smart contracts from anywhere, No setups, no downloads, just pure convenience and versatility.

Home Page: https://ide.nujan.io

License: Other

JavaScript 0.43% TypeScript 85.97% HTML 1.45% SCSS 12.15%
hack-ton-berfest hacktoberfest ide web-ide ton-ide

nujan-ide's Introduction

What is Nujan?

Web IDE, powered by Nujan, is your ultimate browser-based IDE designed to simplify the journey of writing, testing, compiling, deploying, and interacting with smart contracts on TON. Write smart contracts from anywhere, No setups, no downloads, just pure convenience and versatility.

What we offer 🤝

  • User-friendly Code Editor & Syntax Highlighter
  • Efficient File Manager & Compiler
  • One-click deployment using Nujan IDE - Sandbox, Testnet, Mainnet
  • Easy Interaction with Contract

We Are Live on 🤩

We are pleased to announce that our project is now live, and you can access it at ide.nujan.io

IDE Preview

IDE Preview

📖 Documentation

The documentation for Nujan can be found at docs.nujan.io

Feedback

If you have any feedback, please reach out to us

We have put significant effort into developing and refining our codebase, and we invite developers, collaborators, and enthusiasts to explore our repository. Your feedback, contributions, and engagement with our project are highly valued as we continue to evolve and improve our platform. Thank you for your interest, and we look forward to building a vibrant and productive community around our GitHub repository.

License

Business Source License 1.1

nujan-ide's People

Contributors

rahulyadav-57 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

nujan-ide's Issues

Start using LSP for Tact

Problem

At the moment, only the FunC's language server is used, see: lsp.ts.

Proposal

Tact has it's own language server built into the VSCode extension, which may also be used on Nujan to provide auto-completion, hover and much more!

Custom libraries support

Add ability to add custom libraries ( packages ) into project. It should be able to add some config file and list all dependencies developer need.
Possible solutions:

  1. User adds npm package name into config file, and this [ackage being added into IDE locally, only for this user. (No idea on how to implement this)
  2. Supported packages are suggested by users and, after approval, added to IDE

Thinking about 2'nd solution, i'm also being nervous about security. I mean, somebody can suggest package, that runs malicious code.

In cases of connection issues, Nujan doesn't provide meaningful info

Observed behaviour

Build & deploy to Sandbox work as intended (or seem that way), however pressing any of the getter/receiver activation buttons results in a cryptic message in the logs panel:

image

Where t[f] is not a function is caused by pressing on getter buttons, while Invalid message type is caused by pressing on receiver buttons.

Expected behavior or possible solutions

A pop-up or some sort of notification about connection issues. Maybe, just a message in the logs about the disconnect.

Tact files cannot reference FunC contracts in imports

This is almost like issue #4, but for FunC imports this time. Let's say we have these two files:

The main Tact project:

// main
import "@stdlib/deploy";
import "./native.fc";

struct Pair {
    fst: Int;
    snd: Int;
}

@name(get_pair)
native getPair(): Pair;

contract Native with Deployable {

    init() {}

    receive("go") {
        dump(getPair().fst);
        dump(getPair().snd);
    }
}

And a FunC file:

// native.fc
(int, int) get_pair() {
    return (4, 2);
}

When trying to build main.tact, I get the following error message:

Could not resolve import ./native.fc in /main.tact

Change notifications UI

I have an issue with popup notifications containing compilation errors. They overlaying some of ui elements.
I think that it will be nice to replace popup notifications with some kind of notifications tray.
I've drew some example as i think it should to look like:
Снимок экрана 2023-06-16 в 23 58 43
All messages should be stored in some local cache until session ends ( page reloaded ).

Getter and receiver buttons don't refresh

Observed behaviour

Often enough UI buttons get stale even after multiple save→build→deploy buttons and don't appear for new getters and receivers. To resolve this, one has to select and de-select the deployed contract until new buttons appear:

image

Expected behavior or possible solutions

Resolving this issue #17 may help, as it suggests making the cycle automatic (or at least semi-automatic) for deploying in the Sandbox.

`Send internal message` button state blocked until refresh

Spotted with Tonkeeper Desktop v3.6.0:

  • Connect the wallet;
  • Leave the wallet application by any prefer way;
  • Initiate in-IDE interaction, i.e Send internal message, which subsequently will lead to the element state change;
  • Re-open the wallet application.

The element (button) retains previous state, requiring manual page refresh.

how to send map message

like this example, how to send the map items

import "@stdlib/deploy";


// messages can contain maps
message Test {
    items: map<Int as uint8, Int as uint8>;
}

contract BlankContract with Deployable {
    init() {
                
    }

    get fun test(msg: Test) {
        dump(msg.items);
    }
}

Display Tact compilation errors

Observed behaviour

Upon compilation error, user sees a cryptic "Error while building" message in the log output. And that's it, no details.

Expected behavior or possible solutions

Tact compiler provides details on compilation errors and it would be nice to see them in the log output even if the stack trace is truncated.

Introduce automatic save-build-deploy cycle

Observed behaviour

At the moment, one has to manually:

  1. Save
  2. Press build
  3. Press deploy

And all that on each change to the code, which very quickly builds up especially when doing many smaller incremental changes in the course of exploratory-like programming in Tact or FunC.

Expected behavior or possible solutions

Introduce an automatic save→build→deploy cycle when the target of deployments is Sandbox, which would re-fresh the UI and provide new interface each time.

Display compiler versions (and, optionally, to switch between them)

Observed behaviour

At the moment, one has to do a set of heuristics to determine which compiler version of FunC or Tact the project is using.

For example, to check if the compiler supports Tact v1.2.0, you may try to use += operator. And if that doesn't work, the version must be lower than 1.2.0.

Repeat this process to find the actual version used at the moment (or look into Nujan source code to find out faster, though still a bit impractical :)

Expected behavior or possible solutions

  1. Display the currently used compiler version — it may be hidden under the cog icon of settings on the lower left.
  2. Optionally, make it possible to switch between a pre-defined set of FunC/Tact versions.

Nujan ide website cannot reference a contract in another file in one file

a.tact file

import "@stdlib/deploy";
import "./b.tact";

message HiFromParent {
    greeting: String;
}

// we have one instance of the parent
contract TodoParent with Deployable {
 
    init() {}

    receive("greet 3") {
        let i: Int = 0;
        repeat (3) {
            i = i + 1;
            let init: StateInit = initOf TodoChild(i);
            send(SendParameters{
                to: contractAddress(init),
                body: HiFromParent{greeting: "darling"}.toCell(),
                value: ton("0.1"),              // pay for message and potential deployment
                mode: SendIgnoreErrors,
                code: init.code,                // if child is not deployed, also deploy it
                data: init.data
            });
        }
    }

    receive(msg: HiFromChild) {
        dump("😑 handling hi from child");
        dump(msg.fromSeqno);
    }
}

b.tact file

message HiFromChild {
    fromSeqno: Int as uint64;
    greeting: String;
}

message HiFromParent {
    greeting: String;
}

// we have multiple instances of the children
contract TodoChild {

    seqno: Int as uint64;
 
    // when deploying an instance, we must specify its index (sequence number)
    init(seqno: Int) {
        self.seqno = seqno;
    }

    receive(msg: HiFromParent) {
        dump(self.seqno);
        dump("😃 handling hi from parent");
        self.reply(HiFromChild{fromSeqno: self.seqno, greeting: "sup"}.toCell());
    }
}

The build error is displayed as Could not resolve import ./b.tact in a.tact

This kind of introduction method can be implemented in vscode import "./b";

image

Incorrect snippet: `map`

Observed behaviour

Snippet map expands in map[type]type, which is a map in Golang, but not in Tact.

Expected behavior or possible solutions

Snippet map should expand in map<k, v>, where k is the key type and v is the value type of the map.

Please, edit the following lines:

{
label: 'map',
code: 'map[${1:type1}]${2:type2};',
description: 'mapping declaration',
},

Contract recognition error

Example Contract

import "@stdlib/deploy";

contract TodoChild {

    seqno: Int as uint64;
 
    
    init(seqno: Int) {
        self.seqno = seqno;
    }

    receive("identify") {
        dump(self.seqno);
    }
}


contract TodoParent with Deployable {

    numChildren: Int as uint64;
 
    init() {
        self.numChildren = 0;
    }

    receive("deploy another") {
        self.numChildren = self.numChildren + 1;
        let init: StateInit = initOf TodoChild(self.numChildren);
        send(SendParameters{
            to: contractAddress(init),
            value: ton("0.1"),
            mode: SendIgnoreErrors,
            code: init.code,
            data: init.data,
            body: "identify".asComment()
        });
    }

    get fun numChildren(): Int {
        return self.numChildren;
    }
}

The build can pass, but only the first contract is recognized and the second contract is not recognized, and the Deployable modifier is not judged.
The deployment also only recognized the input parameters of the first contract.
image

Imports don't work correctly

Imports does not working correctly. I'm importing file from separate folder. When i'm trying to deploy a contract - it fails during compilation with error saying that the compiler did not found a symbol defined in imported file.

My project file structure:
Снимок экрана 2023-06-17 в 00 11 12

Imports:
Снимок экрана 2023-06-17 в 00 11 51

Symbols defined in imported file ( grade-status.fc ):
Снимок экрана 2023-06-17 в 00 12 16

Error:

Func compilation error: ( function `grade::status::removed` undefined ) cannot generate code for function 
`grade::status::removed`: main.fc:65:9: error: grade::status::removed grade::status::removed(),

Display current column

Some error messages are harder to understand because UI lacks the current column information.

New function: Import on-chain contracts

When you have the source code of a certain contract address, can you render the on-chain contract into the IDE and directly interact with the on-chain contract from the IDE?

image

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.