leanweb 2.0.2 → 2.0.5

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.
package/commands/serve.js CHANGED
@@ -1,8 +1,3 @@
1
- import { createRequire } from "module";
2
- const require = createRequire(import.meta.url);
3
-
4
- import fs from 'fs';
5
- import fse from 'fs-extra';
6
1
  import * as utils from './utils.js';
7
2
  import watch from 'node-watch';
8
3
  import liveServer from 'live-server';
@@ -20,8 +15,6 @@ const noopen = process.env.noopen || false;
20
15
 
21
16
  (async () => {
22
17
 
23
- const project = require(`${process.cwd()}/${utils.dirs.src}/leanweb.json`);
24
-
25
18
  const build = async (eventType, filename) => {
26
19
  // console.log(eventType + ': ', filename);
27
20
  await utils.exec(`npx leanweb build ${env}`);
package/commands/utils.js CHANGED
@@ -8,7 +8,6 @@ import fse from 'fs-extra';
8
8
  export const dirs = {
9
9
  src: 'src',
10
10
  build: 'build',
11
- serve: 'serve',
12
11
  dist: 'dist',
13
12
  };
14
13
 
@@ -34,7 +33,7 @@ export const writeIfChanged = (file, string) => {
34
33
  }
35
34
  }
36
35
  fs.writeFileSync(file, string);
37
- }
36
+ };
38
37
 
39
38
  export const exec = command => execSync(command, { encoding: 'utf8', stdio: 'inherit' });
40
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "2.0.2",
3
+ "version": "2.0.5",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -20,17 +20,17 @@
20
20
  "author": "Qian Chen",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@babel/parser": "^7.20.5",
24
- "clean-css": "^5.3.1",
25
- "esbuild": "^0.15.16",
23
+ "@babel/parser": "^7.21.1",
24
+ "clean-css": "^5.3.2",
25
+ "esbuild": "^0.17.10",
26
26
  "fs-extra": "^11.1.0",
27
- "globby": "^13.1.2",
27
+ "globby": "^13.1.3",
28
28
  "html-minifier": "^4.0.0",
29
29
  "isomorphic-git": "^1.21.0",
30
30
  "live-server": "^1.2.2",
31
31
  "node-watch": "^0.7.3",
32
32
  "parse5": "^7.1.2",
33
- "sass": "^1.56.1",
33
+ "sass": "^1.58.3",
34
34
  "semver": "^7.3.8"
35
35
  }
36
36
  }
@@ -30,7 +30,7 @@ class APIClient {
30
30
  if (this.sendToken) {
31
31
  const token = localStorage.getItem('access_token');
32
32
  if (token) {
33
- headers['access_token'] = token;
33
+ headers['authorization'] = token;
34
34
  } else {
35
35
  return null;
36
36
  }
@@ -271,18 +271,15 @@ export default class LWElement extends HTMLElement {
271
271
  let object;
272
272
  let propertyExpr;
273
273
  if (astModel.type === 'MemberExpression') {
274
- propertyExpr = astModel.property.name;
275
- if (astModel.computed) {
276
- // . false and [] true
277
- propertyExpr = parser.evaluate([astModel.property], context, interpolation.loc)[0];
278
- }
274
+ // . false and [] true
275
+ propertyExpr = astModel.computed ? parser.evaluate([astModel.property], context, interpolation.loc)[0] : astModel.property.name;
279
276
  object = parser.evaluate([astModel.object], context, interpolation.loc)[0];
280
277
  } else if (astModel.type === 'Identifier') {
281
278
  object = this;
282
279
  propertyExpr = astModel.name;
283
280
  }
284
281
 
285
- if (modelNode.type === 'number') {
282
+ if (modelNode.type === 'number' || modelNode.type === 'range') {
286
283
  // set do_not_update mark for cases when user inputs 0.01, 0.0 will not be evaluated prematurely
287
284
  modelNode.do_not_update = true;
288
285
  object[propertyExpr] = modelNode.value * 1;