Code Monkey home page Code Monkey logo

app-template-rescript-react's Introduction

New Project

✨ Bootstrapped with Create Snowpack App (CSA).

Using npm

npx create-snowpack-app new-dir --template app-template-reason-react

Using yarn

npx create-snowpack-app new-dir --template app-template-reason-react --use-yarn

Available Scripts

npm start

Runs the app in the development mode. Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

npm run build

Builds a static copy of your site to the build/ folder. Your app is ready to be deployed!

For the best production performance: Add a build bundler plugin like "@snowpack/plugin-webpack" to your snowpack.config.js config file.

npm test

Launches the application test runner. Run with the --watch flag (npm test -- --watch) to run in interactive watch mode.

app-template-rescript-react's People

Contributors

dependabot[bot] avatar idkjs avatar jihchi avatar r17x 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

Watchers

 avatar  avatar  avatar

Forkers

idkjs gensjaak

app-template-rescript-react's Issues

fail to start new project

Hello @jihchi , I have been try to use this template.

This is the following what I'm doing (following on readme)

❯ npx create-snowpack-app new-dir --template app-template-reason-react --use-yarn
Need to install the following packages:
  create-snowpack-app
Ok to proceed? (y) y

  - Using template app-template-reason-react
  - Creating a new project in /Users/r17/evl/new-dir
  - Installing package dependencies. This might take a couple of minutes.

warning package.json: No license field
warning No license field
warning snowpack > rollup > [email protected]: "Please update to latest v2.3 or v2.2"
warning snowpack > pacote > @npmcli/run-script > node-gyp > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning snowpack > pacote > @npmcli/run-script > node-gyp > request > [email protected]: this library is no longer supported
warning " > @rescript/[email protected]" has unmet peer dependency "bs-platform@>=8.3.0".

  - Initializing git repo.

  - Success!

Quickstart:

  cd new-dir
  yarn start

All Commands:

  yarn install     Install your dependencies. (We already ran this one for you!)
  yarn start       Start your development server.
  yarn run build   Build your website for production.
  yarn test        Run your tests.

❯ cd new-dir
❯ yarn run start
yarn run v1.22.5
warning package.json: No license field
$ snowpack dev
[24:60:40] [snowpack] Welcome to Snowpack! Because this is your first time running
this project, Snowpack needs to prepare your dependencies. This is a one-time step
and the results will be cached for the lifetime of your project. Please wait...
[24:60:40] [snowpack] Ready!
[24:60:40] [snowpack] Server started in 12ms.
[24:60:40] [snowpack] Local: http://localhost:8080
[24:60:40] [snowpack] Network: http://192.168.0.11:8080
[24:60:40] [npm] npm
[24:60:40] [npm] ERR! No workspaces found:
[24:60:40] [npm] npm ERR!   --workspace=true
[24:60:40] [npm] npm ERR! A complete log of this run can be found in:
[24:60:40] [npm] npm ERR!     $HOME/.npm/_logs/2021-04-17T16_59_40_507Z-debug.log
[24:60:40] [npm] Command exited with error code: Error: Command failed with exit code 1: npm run build:res -w
npm ERR! No workspaces found:
npm ERR!   --workspace=true

npm ERR! A complete log of this run can be found in:
npm ERR!     $HOME/.npm/_logs/2021-04-17T16_59_40_507Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

So, I'm check debug.log

0 verbose cli [
0 verbose cli   '/opt/homebrew/Cellar/node/15.14.0/bin/node',
0 verbose cli   '/opt/homebrew/bin/npm',
0 verbose cli   'run',
0 verbose cli   'build:res',
0 verbose cli   '-w'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/opt/homebrew/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:$HOME/evl/new-dir/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:$HOME/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setEnvs Completed in 0ms
17 timing config:load Completed in 6ms
18 timing npm:load:configload Completed in 6ms
19 timing npm:load:setTitle Completed in 2ms
20 timing npm:load:setupLog Completed in 1ms
21 timing npm:load:cleanupLog Completed in 1ms
22 timing npm:load:configScope Completed in 0ms
23 timing npm:load:projectScope Completed in 0ms
24 timing npm:load Completed in 10ms
25 timing config:load:flatten Completed in 1ms
26 timing command:run-script Completed in 1ms
27 verbose stack Error: No workspaces found:
27 verbose stack   --workspace=true
27 verbose stack     at getWorkspaces (/opt/homebrew/lib/node_modules/npm/lib/workspaces/get-workspaces.js:27:11)
27 verbose stack     at async RunScript.runWorkspaces (/opt/homebrew/lib/node_modules/npm/lib/run-script.js:191:24)
28 verbose cwd $HOME/evl/new-dir
29 verbose Darwin 20.3.0
30 verbose argv "/opt/homebrew/Cellar/node/15.14.0/bin/node" "/opt/homebrew/bin/npm" "run" "build:res" "-w"
31 verbose node v15.14.0
32 verbose npm  v7.7.6
33 error No workspaces found:
33 error   --workspace=true
34 verbose exit 1

I don't know why shown --workspace=true, but I assume this is about command args -w.

thank you

Is Babel necessary?

Thanks for providing a perfectly working playground to learn Rescript with React!

As far as I can see, Rescript and Snowpack do not need babel to work. I removed the babel.config.json and the app works fine. Am I missing something?

Specify in-source: false?

in-source: false allows Rescript files to be built to an external directory, instead of the build artefacts existing next to the source files.

Is this possible? I tried to specify it and tweak the mount options but I couldn't get it to work.

/** @type {import("snowpack").SnowpackUserConfig } */
module.exports = {
  mount: {
    public: { url: '/', static: true },
    'lib/es6/src': { url: '/dist' },
    src: { url: '/dist' },
  },
  plugins: [
    '@snowpack/plugin-react-refresh',
    '@snowpack/plugin-dotenv',
    [
      '@snowpack/plugin-run-script',
      {
        cmd: 'bsb -make-world',
        watch: '$1 -w',
      },
    ],
  ],
  packageOptions: {
    /* ... */
  },
  devOptions: {
    /* ... */
  },
  buildOptions: {
    /* ... */
  },
  alias: {
    /* ... */
  },
};

Usage?

Does this work with create-snowpack-app? Or do we just clone this?

If cloning maybe put a template tag on it?

Doesn't seem to work unless you take out clean-world from snowpack.config.js or change the order to clean-world first:

  "scripts": {
    "run:re,rei": "bsb -clean-world && bsb -make-world",
    "run:re,rei::watch": "$1 -w"
  },

Thanks for doing this!

Uncaught TypeError: Failed to resolve module specifier

Just cloned the repo and ran the start script with yarn and got the following console error:
Uncaught TypeError: Failed to resolve module specifier "react". Relative references must start with either "/", "./", or "../".

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.