apprun 3.28.8 → 3.28.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"vdom-lit-html.js","sourceRoot":"","sources":["../src/vdom-lit-html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAW,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAkB,QAAQ,EAAa,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,SAAS,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAO;IACrC,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,CAAC,IAAI,CAAA,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;KAC5C;SAAM,IAAI,YAAY,IAAI,IAAI,EAAE;QAC/B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;YAAE,OAAO,CAAC,eAAe,EAAE,CAAC;QACtD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACvB;SAAM;QACL,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACrC,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;KACnC;AACH,CAAC;AAED,MAAM,OAAO,YAAa,SAAQ,SAAS;IAGzC,YAAY,QAAkB;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,iEAAiE;QACjE,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,KAAK,EAAE;YACpC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC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,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,IAAI,MAAM,EAAE,GAAG,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apprun",
3
- "version": "3.28.8",
3
+ "version": "3.28.9",
4
4
  "description": "JavaScript library that has Elm inspired architecture, event pub-sub and components",
5
5
  "main": "dist/apprun.js",
6
6
  "module": "dist/apprun.esm.js",
@@ -37,18 +37,15 @@
37
37
  "url": "https://github.com/yysun/apprun/issues"
38
38
  },
39
39
  "homepage": "https://github.com/yysun/apprun#readme",
40
- "dependencies": {
41
- "commander": "^7.2.0"
42
- },
43
40
  "devDependencies": {
44
- "@rollup/plugin-commonjs": "^21.0.1",
41
+ "@rollup/plugin-commonjs": "^21.0.2",
45
42
  "@rollup/plugin-node-resolve": "^13.1.3",
46
- "@types/jest": "^27.4.0",
43
+ "@types/jest": "^27.4.1",
47
44
  "jest": "^27.5.1",
48
45
  "json-loader": "^0.5.7",
49
- "lit-html": "^2.1.3",
46
+ "lit-html": "^2.2.0",
50
47
  "marked": "^4.0.12",
51
- "rollup": "^2.67.2",
48
+ "rollup": "^2.68.0",
52
49
  "rollup-plugin-filesize": "^9.1.2",
53
50
  "rollup-plugin-node-resolve": "^5.2.0",
54
51
  "rollup-plugin-sourcemaps": "^0.6.3",
@@ -56,7 +53,7 @@
56
53
  "ts-jest": "^27.1.3",
57
54
  "ts-loader": "^9.2.6",
58
55
  "typescript": "^4.5.5",
59
- "webpack": "^5.68.0",
56
+ "webpack": "^5.69.1",
60
57
  "webpack-cli": "^4.9.2",
61
58
  "webpack-dev-server": "^4.7.4"
62
59
  },
@@ -8,6 +8,7 @@ import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
8
8
  function _render(element, vdom, parent?) {
9
9
  if (!vdom) return;
10
10
  if (typeof vdom === 'string') {
11
+ if (!element['_$litPart$']) element.replaceChildren();
11
12
  render(html`${unsafeHTML(vdom)}`, element);
12
13
  } else if ('_$litType$' in vdom) {
13
14
  if (!element['_$litPart$']) element.replaceChildren();
@@ -1,35 +0,0 @@
1
-
2
- import app from 'apprun';
3
-
4
- app.on('//', (route) => {
5
- const menus = document.querySelectorAll('.navbar-nav li');
6
- for (let i = 0; i < menus.length; ++i) {menus[i].classList.remove('active');}
7
- const item = document.querySelector(`[href='${route}']`);
8
- item && item.parentElement.classList.add('active');
9
- });
10
-
11
- export default () => <div class="container">
12
- <nav class="navbar navbar-expand-lg navbar-light bg-light">
13
- <a class="navbar-brand" href="#">Project Name</a>
14
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
15
- aria-expanded="false" aria-label="Toggle navigation">
16
- <span class="navbar-toggler-icon"></span>
17
- </button>
18
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
19
- <ul class="navbar-nav mr-auto">
20
- <li class="nav-item active">
21
- <a class="nav-link" href="#Home">Home
22
- <span class="sr-only">(current)</span>
23
- </a>
24
- </li>
25
- <li class="nav-item">
26
- <a class="nav-link" href="#About">About</a>
27
- </li>
28
- <li class="nav-item">
29
- <a class="nav-link" href="#Contact">Contact</a>
30
- </li>
31
- </ul>
32
- </div>
33
- </nav>
34
- <div class="container" id="my-app"></div>
35
- </div>;
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env node
2
- const builder = require('esbuild');
3
- const server = require('apprun-dev-server');
4
-
5
- const build = (watch = false) => builder.build({
6
- entryPoints: ['src/main.tsx'],
7
- outfile: 'dist/main.js',
8
- bundle: true,
9
- minify: true,
10
- sourcemap: true,
11
- watch
12
- });
13
-
14
- const start = () => {
15
- server.start({
16
- host: 'localhost',
17
- port: process.env.PORT || 8080,
18
- watch: 'src'
19
- });
20
- }
21
-
22
- if (!process.argv[2]) {
23
- build();
24
- } else {
25
- build(true);
26
- start();
27
- }
@@ -1,40 +0,0 @@
1
- /* eslint-disable no-undef */
2
- module.exports = {
3
- env: {
4
- browser: true,
5
- es2021: true,
6
- },
7
- extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8
- parser: '@typescript-eslint/parser',
9
- parserOptions: {
10
- ecmaVersion: 12,
11
- sourceType: 'module',
12
- },
13
-
14
- plugins: ['@typescript-eslint'],
15
-
16
- /// https://devstephen.medium.com/style-guides-for-linting-ecmascript-2015-eslint-common-google-airbnb-6c25fd3dff0
17
- rules: {
18
- indent: ['error', 2],
19
- quotes: ['error', 'single'],
20
- semi: ['error', 'always'],
21
- 'no-trailing-spaces': 'error',
22
- 'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 0 }],
23
- '@typescript-eslint/explicit-module-boundary-types': 'off',
24
- 'no-case-declarations': 'off',
25
- 'eqeqeq': 'error',
26
- 'curly': ['error', 'all'],
27
- 'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
28
- 'no-extra-parens': ['error', 'functions'],
29
- 'no-useless-catch': 'error',
30
- 'no-console': 'error',
31
- 'space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always' }],
32
- 'object-curly-spacing': ['error', 'always'],
33
- 'array-bracket-spacing': ['error', 'never'],
34
- 'no-unused-expressions': ['error', { allowShortCircuit: true }],
35
- 'arrow-parens': ['error', 'as-needed', { 'requireForBlockBody': true }],
36
- '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: 'app' }],
37
- 'no-invalid-this': 'off',
38
- '@typescript-eslint/no-invalid-this': ['error']
39
- },
40
- };
@@ -1,6 +0,0 @@
1
- .DS_Store
2
- Thumbs.db
3
- *.log
4
- node_modules
5
- coverage
6
- .cache
@@ -1,14 +0,0 @@
1
- import { app, Component } from 'apprun';
2
-
3
- export default class #nameComponent extends Component {
4
- state = '#name';
5
-
6
- view = state => <div>
7
- <h1>{state}</h1>
8
- </div>;
9
-
10
- update = {
11
- '##name': state => state,
12
- };
13
- }
14
-
@@ -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,24 +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
- static: path.join(__dirname),
22
- },
23
- devtool: 'source-map'
24
- }
@@ -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>