Creating the Sealious playground template (npm init)

Hello everyone!
I was giving a try at the task of creating and linking the npm package to the Sealious playground template. (Task details)
I have found a solution that works for me, but I would like to hear your opinion, especially regarding its performance on Linux systems.

The following command should clone the template and install its dependencies:

npm init sealious-app

And if you’re interested about the code, here I will place a link to the github project. Takes you to the file I added: Link to github proyect

I am open to any comment or correction, probably there are ways of making it more efficient :wink:

1 Like

Well, I noticed that I was uploading more files than needed, so I removed all but the executable “bin” one.
It clones perfectly the app, but it cannot open the folder because recieves its name as “undefined”:

I wonder why could it be as I have it textually specified on the line 15 as:

const repoName = "sealious-app";

Maybe I can avoid using this secondary function, but if it is helpful, I can’t see the mistake that produces it.

The file in question

I very much am! :smiley:

First of all, the repository is hosted on GitHub - we host all Sealcode code on Sealhub. I’ve created a small repository using Module Starter · module-starter

For ease of code review, please move the functionality that you’ve coded there into the new repository, commit the changes, and don’t push those - submit them for review following the Coding and review workflow.

The code uses typescript you need to run npm run build every time you make changes to TS code, or you can run npm run build -- --watch in a separate terminal to automatically build every time you make changes.

You can test your code without publishing it to npm, just by running the main executable with the node command.

cd /tmp
node /path/to/your/repo/lib/index.js

The repo that I’ve created for you contains the minimal amount of boilerplate, thanks to that it should be close to being as performant as possible :wink:

Finally here it is!:

I have added a file named “cli.js” that is meant to do the job. Also I included a line on the package.json that would execute it when using the npm function. Yet to upload to npm!

1 Like

Nice! One thing before I move on with code review - this npm init thing should live in a clone of module-starter, not in module-starter itself. Please move your changes to a clone, so it can have its own independent identity. For your convenience, I’ve forked module starter. To move your changes to that fork, please follow these steps:

cd ~
git clone ssh://

Then, copy the changed files to ~/create-sealious-app, and run arc diff according to the regular workflow :+1:

Here it is the new version on the create-sealious-app repository:

If there any kind of mistake in content or form let me know!

Nice job! I’ve sent some comments at D1398 :slight_smile:

Hello! I have fixed the minor issues, and also created a function that allows the user to name the new repository directory. My question is:

  • If I have used the prompt npm package for it, users running “npm init” will access this functionallity? Or I have to get it available first?

It will be installed automatically :+1:

Great! Then here it is the corrected version addressing the previous issues: Revision Link

The user should be able to write the name of the repository directory before the installation. The file that has to be executed is the same (cli.js).

Regards prettier, I applied its formatting to all the files included in the .prettierrc file. If it wasn’t intended to be like this, let me know

One last change in D1398 and we can land :muscle:

Now it should work :smiley: , it is allowed the input of spaced directory names