Giter VIP home page Giter VIP logo

prpl's Introduction

This project is no longer actively maintained.

PRPL

PRPL is a lightweight library for building fast static sites. It does two things:

  • Interpolate your content into HTML files
  • Maximize your site's runtime speed with the PRPL pattern

Features

  • Tiny HTML-based API
  • Zero configuration
  • Zero or near-zero module dependencies
  • CLI, CJS and ESM module interfaces
  • Define your own template syntax
  • Ship no client JavaScript
  • Works on Linux, MacOS and Windows

Why?

All the static site generators I have tried have one or more of these problems:

  • Built on an underlying framework like React, Vue, etc.
  • Relies on complex build tools like Webpack, Babel, etc.
  • Depends on a massive tree of modules that force constant maintenance
  • Has interfaces, source code and documentation that cannot be understood in one sitting
  • Requires that your site source be organized in a way that looks nothing like your output
  • Forces a huge leap from hello world to a real world implementation

PRPL is my answer to these gripes.

Usage

PRPL requires Node LTS or greater.

To clone the minimal starter and run it locally, run:

npx -y create-prpl@latest

Visit docs for full documentation, guides and design decisions.

prpl's People

Contributors

tyhopp 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

Watchers

 avatar  avatar  avatar  avatar  avatar

prpl's Issues

BUG: Failed to copy 'prefetch.js' to dist. Error: ENOENT: no such file or directory

I tried running npm run dev on a fresh template generated by create-prpl@latest, but it bugged out, is this related to marked? I tried using an older version 0.3.5 but same issue persists.

~
  node -v
v16.17.1
  cd code
~\Code
  npx -y create-prpl@latest

added 40 packages, and audited 41 packages in 4s

4 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> [email protected] dev
> rm -rf dist && prpl && prpl-server

 [PRPL] Failed to copy 'prefetch.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\prefetch.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\prefetch.js'
 [PRPL] Failed to copy 'prefetch-worker.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\prefetch-worker.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\prefetch-worker.js'
 [PRPL] Failed to copy 'router.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\router.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\router.js'
file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/marked/lib/marked.esm.js:2380
    throw new Error('marked(): input parameter is undefined or null');
          ^

Error: marked(): input parameter is undefined or null
    at marked (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/marked/lib/marked.esm.js:2380:11)
    at transformMarkdown (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:355:12)
    at interpolatePage (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:402:39)
    at async interpolateHTML (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:456:5)
    at async walkSourceTree (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:488:25)
    at async walkSourceTree (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:499:21)
    at async interpolate (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:511:5)
node:child_process:915
    throw err;
    ^

Error: Command failed: npm run dev
    at checkExecSyncError (node:child_process:841:11)
    at Object.execSync (node:child_process:912:15)
    at sh (C:\Users\Kaleidosium\AppData\Local\npm-cache\_npx\aa2ca10baf14b8f3\node_modules\create-prpl\dist\index.cjs:16:19)
    at Object.<anonymous> (C:\Users\Kaleidosium\AppData\Local\npm-cache\_npx\aa2ca10baf14b8f3\node_modules\create-prpl\dist\index.cjs:30:1)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 8904,
  stdout: null,
  stderr: null
}
~\Code xERROR
  cd .\prpl-example-basic\
~\Code\prpl-example-basic
  npm run dev

> [email protected] dev
> rm -rf dist && prpl && prpl-server

 [PRPL] Failed to copy 'prefetch.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\prefetch.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\prefetch.js'
 [PRPL] Failed to copy 'prefetch-worker.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\prefetch-worker.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\prefetch-worker.js'
 [PRPL] Failed to copy 'router.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\router.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\router.js'
file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/marked/lib/marked.esm.js:2380
    throw new Error('marked(): input parameter is undefined or null');
          ^

Error: marked(): input parameter is undefined or null
    at marked (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/marked/lib/marked.esm.js:2380:11)
    at transformMarkdown (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:355:12)
    at interpolatePage (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:402:39)
    at async interpolateHTML (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:456:5)
    at async walkSourceTree (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:488:25)
    at async walkSourceTree (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:499:21)
    at async interpolate (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:511:5)
~\Code\prpl-example-basic xERROR
  npm run build

> [email protected] build
> rm -rf dist && prpl

 [PRPL] Failed to copy 'prefetch.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\prefetch.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\prefetch.js'
 [PRPL] Failed to copy 'prefetch-worker.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\prefetch-worker.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\prefetch-worker.js'
 [PRPL] Failed to copy 'router.js' to dist. Error: ENOENT: no such file or directory, copyfile 'C:\C:\Users\Kaleidosium\Code\prpl-example-basic\node_modules\@prpl\core\dist\client\router.js' -> 'C:\Users\Kaleidosium\Code\prpl-example-basic\dist\router.js'
file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/marked/lib/marked.esm.js:2380
    throw new Error('marked(): input parameter is undefined or null');
          ^

Error: marked(): input parameter is undefined or null
    at marked (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/marked/lib/marked.esm.js:2380:11)
    at transformMarkdown (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:355:12)
    at interpolatePage (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:402:39)
    at async interpolateHTML (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:456:5)
    at async walkSourceTree (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:488:25)
    at async walkSourceTree (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:499:21)
    at async interpolate (file:///C:/Users/Kaleidosium/Code/prpl-example-basic/node_modules/@prpl/core/dist/index.mjs:511:5)

Reconfigure CI

Reconfigure CI so that the test site uses local packages from the branch.

At the moment the test site points to the latest published packages, which is very misleading when the tests run in your PR because you expect the CI to test your changes.

RSS plugin output not sorted by date

Describe the bug
Items in output of RSS plugin are sorted by name in file system rather than by date.

To Reproduce
Steps to reproduce the behavior:

  1. Build a PRPL project with more than one content item where the more recent date item has a name earlier in the alphabet.
  2. See items in output RSS file are not sorted by date.

Expected behavior
RSS items are listed in descending order by date.

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.