npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@soltivo/create-theme

v1.0.6

Published

Create soltivo themes CLI

Downloads

188

Readme

CREATE-SOLTIVO-THEME

create-soltivo-theme is an CLI which allows you to setup, manager, develop your soltivo themes.

How to use it.

Once installed you will be able to run, create-soltivo-theme under any directory, after that you will be prompted with a few questions.

  • choose your project name. required,string.
  • choose the template.
    • you will be able to select from a list only the available templates.
  • init or not the git init in the project repository.

After you went through the questions the cli will create a new folder where the cli is running with your project name and install all dependencies of packages.

You can test your project inside the folder by running yarn start or npm run start, to start the development server, after a few seconds you should see a browser window open with your template.

Scripts

by default all templates will come with a few scripts inside package.json.

  • start
    • it should start the server in http://localhost:${process.env.PORT}
  • data
    • it should start watching for data changes.
  • build
    • it should build your theme for productions creating two folders under dist, dist/browser and dist/server.

Project structure

After running the cli for create a project you will get a structure for your theme, but it is important to know you cannot move the following folders and its files inside.

src/data

This folder contains the entry point of data containing two files:

  • global.data.ts: this contains the global data of your website like, general, nav, footer, colors, font of your theme, it also contains validation for and configuration for the theme.
  • website.context.ts: this is a normal react context, it contains the WebsiteData of your project.

IMPORTANT: you cannot rename/remove global.data.ts.

src/pages

For better structure of the theme and understanding of it, we insert all pages at the top level of the src folder, this makes it easier to manager your pages through the app.

Also all pages folders have the following files:

  • ${pageName}.tsx: this is just a normal react component, normally it has some configuration inside too.
  • ${pageName}.data.ts: this is the data of this specific page.

NOTE: you can also add other files for styles or helpers if you want inside this folder.

IMPORTANT: you cannot rename/remove .data. from ${pageName}.data.ts.

src/sections

Same as pages you have sections folder at the top level of src folder contaning a very similar structure to pages.

Also all sections folders have the following files:

  • ${sectionName}.tsx: this is just a normal react component.
  • ${sectionName}.data.ts: this is the data of this specific section.

NOTE: you can also add other files for styles or helpers if you want inside this folder.

IMPORTANT: you cannot rename/remove .data. from ${sectionName}.data.ts.

src/routes

This is where we recommend you to setup you react routes, we are using react-router-dom, this folder contains normally only one file named routes.tsx containing all the routes for the application.

src/components

We also recommend you to create your components at the top level of src folder instead of creating inside pages and sections folders.

src/assets

You can use this folder for assets like, styles, images, icons, json etc, it is also recommend to use this folder at the top level of src folder.

.env file

This is a required file because we have some important data for building the theme inside of it, you can also define custom process.env variables like so:

  • THEME_MY_VARIABLE
  • MY_VARIABLE

Required enviroment variables:

  • THEME_ID: theme id using uuiv4.
  • THEME_NAME: name of your project and it is equal to package.json name attribute.
  • THEME_GOOGLE_API_KEY: Provided by soltivo a public key for google apis.
  • THEME_BOOKING_APP_URL: Url for soltivo booking application.

A few last notes

  • The files src/app.tsx and src/server.tsx are both entry points for server and browser build, we do not recommend you to change these files unless you know what you are doing, but the main reason for this warning is because the server may not like your changes, and for production we all themes are SSR and not CSR.

  • If you want to change the src/index.tsx you should keep in mind the @soltivo/theme-library open function is already taking care of the base setup for the react rendering methods for hidrate(production) and render(development).