Skip to content

Commit

Permalink
se corrigio pequeños errores y la configuracion de webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
fernik committed Nov 20, 2020
1 parent a98d49c commit 4126aab
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 27 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2018, Nike
Copyright (c) 2018, Nike Madrid
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
54 changes: 50 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
# PatronJs
# PatronJs [![npm version](https://badge.fury.io/js/jspatron.svg)](https://badge.fury.io/js/jspatron)

[![npm version](https://badge.fury.io/js/jspatron.svg)](https://badge.fury.io/js/jspatron)
PatronJs is a framework based on the model view controller architecture, using ES5 async / await to render views and compile data, ideal for single page applications.
It is extensible where you can integrate libraries or create functionalities available throughout your application.

PatronJs es framework basado el la arquitectura modelo vista controlador, utilizando ES5 async/await para renderisar vistas y compilar datos.ideal para aplicaciones de una sola pagina.
Es extensible donde pueden integrar librerias o crear funcionalidades disponible en toda tu aplicacion.

## Directories

- **directory - app /**
all controllers for the view are added.

- **directory - bootstrap /**
where the application is initialized and adds the accessible routes.

- **directory - config /**
add all project and framework configurations.

- **directory - public /**
public access to content.

- **directory - views /**
where the view is prepared and added to the main document.

## routes file - bootstrap / route.js


```typescript
route.has (url: string, option_controller: object | Function, method_execute: string)
```

**example**
```javascript
class IndexController extends MainController {
constructor () {super ()}
home() {
return 'home'
}
}

route.has ('/', IndexController, 'home')
```
or
```javascript
route.has ('/', {
controller: IndexController,
// load assets css or js
load: {
js: ['index'],
css: []
}
}, 'home')
```
2 changes: 1 addition & 1 deletion bootstrap/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Patron from "jspatron/patron";
import {App as Patron} from "jspatron/app";
import * as config from "../config/app.js";

let app = new Patron(config);
Expand Down
10 changes: 4 additions & 6 deletions bootstrap/initialize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* import URLStateCapture from "jspatron/url-state";
import {URLStateCapture} from "jspatron/app"
import app from "./routes.js";

try {
Expand All @@ -8,10 +7,9 @@ try {
/**
* hash change
*/
/* evt.state(app.run(evt))
evt.state(app.run(evt))
} catch (e) {
app.handlerError(e);
} */
import Route from "jspatron/route";
}

console.log(Route);
console.log();
1 change: 0 additions & 1 deletion dist/patron.bundle.js

This file was deleted.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"license": "BSD-2-Clause",
"homepage": "https://github.com/everskyblue/patronjs#readme",
"scripts": {
"start": "webpack --mode development"
"start": "webpack --mode production",
"build-dev": "webpack --mode none"
},
"keywords": [
"framework",
Expand All @@ -25,10 +26,10 @@
"jspatron": "^0.9.0"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-transform-async-to-generator": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"babel-loader": "^8.1.0"
"@babel/core": "7.12.3",
"@babel/plugin-transform-async-to-generator": "7.12.1",
"@babel/plugin-transform-runtime": "7.12.1",
"@babel/preset-env": "7.12.1",
"babel-loader": "8.1.0"
}
}
17 changes: 9 additions & 8 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ const path = require('path')
module.exports = {
entry: {
'app.bundle': path.resolve(__dirname, 'bootstrap/initialize.js')
/**
* bundle framework
*/
//'patron.bundle': path.resolve(__dirname, 'node_modules/jspatron/globals.js')
},
output: {
// options related to how webpack emits results
path: path.resolve(__dirname, "dist"),
filename: "[name].js",
libraryTarget: "umd"
Expand All @@ -18,13 +13,19 @@ module.exports = {
rules: [
{
test: /\.js$/,
exclude: /node_module/,
use: ['babel-loader']
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: ["@babel/plugin-transform-async-to-generator", "@babel/plugin-transform-runtime"]
}
}
}
]
},
resolve: {
modules: ["node_modules", path.resolve(__dirname, "node_modules")]
modules: [path.resolve(__dirname, "node_modules")]
},
externals: {
jspatron: 'jspatron'
Expand Down

0 comments on commit 4126aab

Please sign in to comment.