apprun 3.28.7 → 3.28.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +4 -2
  2. package/README.md +8 -40
  3. package/WHATSNEW.md +6 -6
  4. package/apprun-cli.js +3 -221
  5. package/dist/apprun-dev-tools.js +1 -2
  6. package/dist/apprun-dev-tools.js.map +1 -1
  7. package/dist/apprun-html.esm.js +10 -112
  8. package/dist/apprun-html.esm.js.map +1 -1
  9. package/dist/apprun-html.js +1 -1
  10. package/dist/apprun-html.js.LICENSE.txt +2 -24
  11. package/dist/apprun-html.js.map +1 -1
  12. package/dist/apprun-play.js +1 -1
  13. package/dist/apprun-play.js.map +1 -1
  14. package/dist/apprun.esm.js +1 -1
  15. package/dist/apprun.esm.js.map +1 -1
  16. package/dist/apprun.js +1 -1
  17. package/dist/apprun.js.map +1 -1
  18. package/esm/apprun-dev-tools.js +2 -1
  19. package/esm/apprun-dev-tools.js.map +1 -1
  20. package/esm/apprun.js +1 -1
  21. package/esm/apprun.js.map +1 -1
  22. package/esm/component.js +3 -2
  23. package/esm/component.js.map +1 -1
  24. package/esm/directive.js +3 -3
  25. package/esm/directive.js.map +1 -1
  26. package/esm/vdom-lit-html.js +46 -21
  27. package/esm/vdom-lit-html.js.map +1 -1
  28. package/esm/vdom-my.js +9 -3
  29. package/esm/vdom-my.js.map +1 -1
  30. package/esm/vdom-to-html.js +1 -2
  31. package/esm/vdom-to-html.js.map +1 -1
  32. package/esm/vdom.js +1 -4
  33. package/esm/vdom.js.map +1 -1
  34. package/esm/web-component.js +18 -16
  35. package/esm/web-component.js.map +1 -1
  36. package/package.json +18 -19
  37. package/src/apprun.ts +1 -1
  38. package/src/component.ts +2 -2
  39. package/src/directive.ts +3 -3
  40. package/src/vdom-lit-html.ts +47 -20
  41. package/src/vdom-my.ts +8 -3
  42. package/src/vdom-to-html.tsx +2 -2
  43. package/src/vdom.ts +1 -4
  44. package/src/web-component.ts +16 -14
  45. package/webpack.config.js +2 -1
  46. package/cli-templates/Layout.ts_ +0 -35
  47. package/cli-templates/_build.js +0 -27
  48. package/cli-templates/_eslintrc.js +0 -40
  49. package/cli-templates/_gitignore +0 -6
  50. package/cli-templates/component.ts_ +0 -14
  51. package/cli-templates/index.html +0 -10
  52. package/cli-templates/jest.config.js +0 -19
  53. package/cli-templates/karma.conf.js +0 -24
  54. package/cli-templates/main.ts_ +0 -13
  55. package/cli-templates/readme.md +0 -7
  56. package/cli-templates/spa_index.html +0 -14
  57. package/cli-templates/spa_main.ts_ +0 -12
  58. package/cli-templates/spec.ts_ +0 -12
  59. package/cli-templates/stories.js_ +0 -47
  60. package/cli-templates/tsconfig.es5.json +0 -15
  61. package/cli-templates/tsconfig.es6.json +0 -15
  62. package/cli-templates/webpack.config.js +0 -23
  63. package/index-apprun-play.html +0 -46
@@ -1,10 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>AppRun App</title>
6
- </head>
7
- <body>
8
- <script type="module" src="./dist/main.js"></script>
9
- </body>
10
- </html>
@@ -1,19 +0,0 @@
1
- module.exports = {
2
- "transform": {
3
- "^.+\\.tsx?$": "ts-jest"
4
- },
5
- "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
6
- "moduleFileExtensions": [
7
- "ts",
8
- "tsx",
9
- "js",
10
- "jsx",
11
- "json",
12
- "node"
13
- ],
14
- "globals": {
15
- "ts-jest": {
16
- "diagnostics": true
17
- }
18
- },
19
- }
@@ -1,24 +0,0 @@
1
- var webpackConfig = require('./webpack.config');
2
- module.exports = function (config) {
3
- config.set({
4
- basePath: '',
5
- frameworks: ["jasmine"],
6
- files: [
7
- { pattern: "tests/*.spec.*" }
8
- ],
9
- exclude: [
10
- ],
11
- preprocessors: {
12
- 'tests/*.spec.*': ['webpack'],
13
- },
14
- webpack: webpackConfig,
15
- reporters: ["progress"],
16
- colors: true,
17
- // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
18
- logLevel: config.LOG_INFO,
19
- browsers: ['Chrome'],
20
- mime: {
21
- 'text/x-typescript': ['ts', 'tsx']
22
- }
23
- })
24
- }
@@ -1,13 +0,0 @@
1
- import app from 'apprun';
2
-
3
- const state = 'Hello world - AppRun !';
4
-
5
- const view = (state) => <div>
6
- <h1>{state}</h1>
7
- </div>;
8
-
9
- const update = {
10
-
11
- };
12
-
13
- app.start(document.body, state, view, update);
@@ -1,7 +0,0 @@
1
- ##
2
-
3
- * Use _npm start_ to start the dev server
4
- * Use _npm test_ to run unit tests
5
- * Use _npm run build_ to build for production
6
-
7
- This is an application built with [AppRun](https://github.com/yysun/apprun).
@@ -1,14 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
- <title>AppRun SPA</title>
7
- <link rel="stylesheet" href="https://unpkg.com/bootstrap@4.4.1/dist/css/bootstrap.min.css">
8
- <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.slim.min.js"></script>
9
- <script src="https://unpkg.com/popper.js@1.16.1/dist/umd/popper.min.js"></script>
10
- <script src="https://unpkg.com/bootstrap@4.4.1/dist/js/bootstrap.min.js"></script>
11
- <body>
12
- <script type="module" src="./dist/main.js"></script>
13
- </body>
14
- </html>
@@ -1,12 +0,0 @@
1
- import app from 'apprun';
2
- import Home from './Home';
3
- import About from './About';
4
- import Contact from './Contact';
5
- import Layout from './Layout';
6
-
7
- app.render(document.body, <Layout />);
8
-
9
- const element = 'my-app';
10
- new Home().start(element);
11
- new About().mount(element);
12
- new Contact().mount(element);
@@ -1,12 +0,0 @@
1
- import app from 'apprun';
2
- import #name from '../src/#name';
3
-
4
- describe('component', () => {
5
- it('should render state upon route event', () => {
6
- const element = document.createElement('div');
7
- const component = new #name().mount(element);
8
- app.run('##name');
9
- expect(element.textContent).toBe('#name');
10
- expect(component.state).toBe('#name');
11
- });
12
- });
@@ -1,47 +0,0 @@
1
- import #name from '../#name';
2
-
3
- export default {
4
- title: '#name',
5
- argTypes: {
6
- event: {
7
- name: 'event',
8
- type: { name: 'string', required: false },
9
- description: 'event',
10
- control: {
11
- type: 'text'
12
- }
13
- },
14
-
15
- route: {
16
- name: 'route',
17
- type: { name: 'string', required: false },
18
- description: 'route',
19
- control: {
20
- type: 'text'
21
- }
22
- }
23
- },
24
- };
25
-
26
- export const #name_Event = ({ event }) => {
27
- const div = document.createElement('div');
28
- const component = new #name().mount(div);
29
- const e = JSON.parse(event);
30
- const [name, ...params] = e;
31
- component.run(name, ...params);
32
- return div;
33
- };
34
- #name_Event.args = {
35
- event: '["."]',
36
- };
37
-
38
- export const #name_Route = ({ route }) => {
39
- const div = document.createElement('div');
40
- new #name().mount(div);
41
- app.route(route);
42
- return div;
43
- };
44
-
45
- #name_Route.args = {
46
- route: '##name',
47
- };
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "module": "es2015",
5
- "moduleResolution": "node",
6
- "jsx": "react",
7
- "jsxFactory": "app.h",
8
- "jsxFragmentFactory": "app.Fragment",
9
- "lib": ["dom", "es2015", "es5"],
10
- "experimentalDecorators": true,
11
- "sourceMap": true,
12
- "esModuleInterop": true,
13
- "outDir": "dist"
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2015",
4
- "module": "es2015",
5
- "moduleResolution": "node",
6
- "jsx": "react",
7
- "jsxFactory": "app.h",
8
- "jsxFragmentFactory": "app.Fragment",
9
- "lib": ["dom", "es2015", "es5"],
10
- "experimentalDecorators": true,
11
- "sourceMap": true,
12
- "esModuleInterop": true,
13
- "outDir": "dist"
14
- }
15
- }
@@ -1,23 +0,0 @@
1
- const path = require('path');
2
- module.exports = {
3
- entry: {
4
- 'dist/main': './src/main.tsx',
5
- },
6
- output: {
7
- filename: '[name].js',
8
- path: path.resolve(__dirname)
9
- },
10
- resolve: {
11
- extensions: ['.ts', '.tsx', '.js']
12
- },
13
- module: {
14
- rules: [
15
- { test: /\.tsx?$/, loader: 'ts-loader' },
16
- { test: /\.js$/, use: ["source-map-loader"], enforce: "pre" }
17
- ]
18
- },
19
- devServer: {
20
- open: true
21
- },
22
- devtool: 'source-map'
23
- }
@@ -1,46 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <title>AppRun Play</title>
6
- <link rel="stylesheet" href="demo/lib/codemirror.css">
7
- <script src="demo/lib/codemirror.js"></script>
8
- <script src="demo/mode/javascript/javascript.js"></script>
9
- <script src="demo/mode/xml/xml.js"></script>
10
- <script src="demo/mode/jsx/jsx.js"></script>
11
- <script src="dist/apprun-play.js"></script>
12
- </head>
13
- <body>
14
- <textarea style="width:100%; height:300px">
15
- const state = 0;
16
- const view = state => {
17
- return `<div>
18
- <h1>${state}</h1>
19
- <button onclick='app.run("-1")'>-1</button>
20
- <button onclick='app.run("+1")'>+1</button>
21
- </div>`;
22
- };
23
- const update = {
24
- '+1': state => state + 1,
25
- '-1': state => state - 1
26
- };
27
- app.start(document.body, state, view, update);
28
- </textarea>
29
- <apprun-play></apprun-play>
30
-
31
- <textarea>
32
- <html>
33
- <body>
34
- <script src="https://unpkg.com/apprun/dist/apprun-html.js"></script>
35
- <script>
36
- const view = state => `<div>${state}</div>`;
37
- app.start(document.body, 'hello world', view);
38
- </script>
39
- </body>
40
- </html>
41
- </textarea>
42
- <p>
43
- <apprun-play></apprun-play>
44
- </p>
45
- </body>
46
- </html>