Code Monkey home page Code Monkey logo

framework's Introduction

Formidablejs Core

About Formidablejs

Note: This repository contains the core code of the Formidable framework. If you want to build an application using Formidable, visit the main Formidablejs repository.

Core E2E Package Manager npm PRs Welcome GitHub Contributor Covenant

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

framework's People

Contributors

donaldp avatar illogikal 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

Watchers

 avatar  avatar  avatar

framework's Issues

Caching... failed after creating application

Description

Running npm start throws a Caching... failed error.

Version

@formidablejs/[email protected]

Output

Error:

Caching... failed
 > app/Mail/VerifyEmail.imba:7:21: error: Could not resolve "@formidablejs/helpers" (mark it as external to exclude it from the bundle)
    7 │ import {config} from '@formidablejs/helpers'/*$path$*/;~~~~~~~~~~~~~~~~~~~~~~~


 > app/Mail/ResetPassword.imba:7:21: error: Could not resolve "@formidablejs/helpers" (mark it as external to exclude it from the bundle)
    7 │ import {config} from '@formidablejs/helpers'/*$path$*/;~~~~~~~~~~~~~~~~~~~~~~~


× failed with 2 errors [
  {
    detail: undefined,
    location: {
      column: 21,
      file: 'app/Mail/ResetPassword.imba',
      length: 23,
      line: 7,
      lineText: "import {config} from '@formidablejs/helpers'/*$path$*/;",
      namespace: ''
    },
    notes: [],
    text: 'Could not resolve "@formidablejs/helpers" (mark it as external to exclude it from the bundle)'
  },
  {
    detail: undefined,
    location: {
      column: 21,
      file: 'app/Mail/VerifyEmail.imba',
      length: 23,
      line: 7,
      lineText: "import {config} from '@formidablejs/helpers'/*$path$*/;",
      namespace: ''
    },
    notes: [],
    text: 'Could not resolve "@formidablejs/helpers" (mark it as external to exclude it from the bundle)'
  }
]

Possible fix

Update imports

ForbiddenException: Action not allowed error

Issue/Error

ForbiddenException gets thrown when the previously logged in user is removed from the database.

This is because the personal_access_token and session are still active.

Possible fix

  • Always check if the personal_access_token and user are still in the database in the Authenticate middleware and ErrorIfAuthenticated middleware

sqlite does not support inserting default values

formidablejs/framework version: 0.7.0

Details

knex throws a warning when using sqlite3 as the default database driver.

Expected Behavior

Warning shouldn't be thrown.

Actual Behavior

knex throws a warning when using sqlite3 as the default database driver.

Possible Fix

Add a knex config options in the database config so we can easily add the knex option to get rid of the warning when using sqlite.

Additional Info

Your Environment

  • Linux 5.11.0-40-generic
  • elementary OS 6 Odin (Ubuntu 20.04.3 LTS)
  • Node 14.18.1

Steps to Reproduce

  1. Open the .env file
  2. Set DB_CONNECTION to sqlite
  3. Create a sqlite file: touch database/db.sqlite
  4. Set DATABASE_URL to database/db.sqlite
  5. Cache the config: craftsman cache
  6. Run the application: npm run start:dev

Stack Trace

sqlite does not support inserting default values. Set the `useNullAsDefault` flag to hide this warning. (see docs http://knexjs.org/#Builder-insert).

Web Application is un-testable

formidablejs/framework version: 0.6.1

Details

supertest request throws error 500 when the application uses Imba views.

Expected Behavior

Default test should always return a status code of 200.

Actual Behavior

Test throws error 500.

Possible Fix

Additional Info

Your Environment

  • Node.js 14.18.1:
  • Linux 5.3.0-62-generic:
  • Useful link to screenshot or any other information:

Steps to Reproduce

  1. create new formidable application using craftsman new <name> --web
  2. change environment to testing in the .env
  3. run craftsman build
  4. run npm run test

Stack Trace

TypeError: Cannot read property 'inputs' of undefined
    at $r.inputs [as get] (/home/donald/code/myapp/.formidable/server.app.js:2:9929)
    at at.input (/home/donald/code/myapp/.formidable/server.app.js:2:10278)
    at at.asset (/home/donald/code/myapp/.formidable/server.app.js:2:10352)
    at at.String [as get] (/home/donald/code/myapp/.formidable/server.app.js:2:10479)
    at String (<anonymous>)
    at ys.outerHTML (/home/donald/code/myapp/.formidable/server.app.js:5:915)
    at r.innerHTML (/home/donald/code/myapp/.formidable/server.app.js:2:29957)
    at r.outerHTML (/home/donald/code/myapp/.formidable/server.app.js:2:30401)
    at cs.innerHTML (/home/donald/code/myapp/.formidable/server.app.js:2:29957)
    at cs.outerHTML (/home/donald/code/myapp/.formidable/server.app.js:2:30401)
    at cs.outerHTML (/home/donald/code/myapp/.formidable/server.app.js:2:32119)
    at cs.toString (/home/donald/code/myapp/.formidable/server.app.js:2:26360)
    at String (<anonymous>)
    at er.make (/home/donald/code/myapp/node_modules/@formidablejs/framework/lib/Http/View/View.js:101:10)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at ViewResponse.toView (/home/donald/code/myapp/node_modules/@formidablejs/framework/lib/Http/Response/ViewResponse.js:47:18)


remove unused dependencies

There are a number of dependencies that are required by the package but aren't actually used.
We need to remove them

Error shown in the console

I see these errors in the console on a fresh install. I don't even have any sessions nor custom code

ℹ listening on http://::1:3000/
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open 'storage/sessions/0mI12SRd0Uu5UM1fji599zWTtLFjQGn5.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open 'storage/sessions/0mI12SRd0Uu5UM1fji599zWTtLFjQGn5.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open 'storage/sessions/0mI12SRd0Uu5UM1fji599zWTtLFjQGn5.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open 'storage/sessions/0mI12SRd0Uu5UM1fji599zWTtLFjQGn5.json'
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open 'storage/sessions/0mI12SRd0Uu5UM1fji599zWTtLFjQGn5.json'

Is it linked to this [session-file-store] Deleting expired sessions?

How to reproduce:

  • Create a new project and keep it running for a day. (many [session-file-store] Deleting expired sessions in the logs)
  • restart and you will see these errors

TypeScript support for DB migrations

Description

Allow migrations to be written in TypeScript.

Why

The default Formidable template uses TypeScript, it would make sense to have some consistency.

Possible Implementation & Open Questions

Not sure yet

Is this something you're interested in working on?

Yes

Switch to plugin based application boot sequence

Description

Convert Application Boot Sequence to plugins.

Why

Switching to a plugin based application boot sequence will allow some services to be completely turned off during the application's initial boot.

This will make it easy to completely remove services like Sessions and Cookies, etc.

Possible Implementation & Open Questions

Just create new Service Resolvers that re-uses the startup kernel code.

See

hasStaticContent(router)

Is this something you're interested in working on?

Yes

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.