leanweb 1.1.4 → 1.1.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/build.js CHANGED
@@ -121,18 +121,18 @@ const require = createRequire(import.meta.url);
121
121
  const buildHTML = () => {
122
122
  project.components.forEach(cmp => {
123
123
  const cmpName = utils.getComponentName(cmp);
124
- const htmlFilename = `${projectPath}/${buildDir}/components/${cmp}/${cmpName}.html`;
124
+ const htmlFilename = `${buildDir}/components/${cmp}/${cmpName}.html`;
125
125
  const htmlFileExists = fs.existsSync(htmlFilename);
126
126
  if (htmlFileExists) {
127
127
 
128
- const scssFilename = `${projectPath}/${buildDir}/components/${cmp}/${cmpName}.scss`;
128
+ const scssFilename = `${buildDir}/components/${cmp}/${cmpName}.scss`;
129
129
  const scssFileExists = fs.existsSync(scssFilename);
130
130
  let cssString = '';
131
131
  if (scssFileExists) {
132
132
  let scssString = `@use "global-styles.scss";\n`;
133
133
  scssString += fs.readFileSync(scssFilename, 'utf8');
134
134
  scssString += '\n[lw-false],[lw-for]{display:none !important;}\n';
135
- cssString = utils.buildCSS(scssString, `${projectPath}/${buildDir}/components/${cmp}`);
135
+ cssString = utils.buildCSS(scssString, `${buildDir}/components/${cmp}`);
136
136
  }
137
137
  const styleString = cssString || '';
138
138
  const htmlString = fs.readFileSync(htmlFilename, 'utf8');
@@ -144,16 +144,16 @@ const require = createRequire(import.meta.url);
144
144
  fs.writeFileSync(`${buildDir}/components/${cmp}/ast.js`, `export default ${JSON.stringify(ast, null, 0)};`);
145
145
  }
146
146
  });
147
- const htmlString = fs.readFileSync(`${projectPath}/${buildDir}/index.html`, 'utf8');
147
+ const htmlString = fs.readFileSync(`${buildDir}/index.html`, 'utf8');
148
148
  fs.writeFileSync(`${buildDir}/index.html`, htmlString);
149
149
  };
150
150
 
151
151
  const buildSCSS = () => {
152
- const projectScssFilename = `${projectPath}/src/${project.name}.scss`;
152
+ const projectScssFilename = `${projectPath}/${utils.dirs.src}/${project.name}.scss`;
153
153
  let projectCssString = '';
154
154
  if (fs.existsSync(projectScssFilename)) {
155
155
  const projectScssString = fs.readFileSync(projectScssFilename, 'utf8');
156
- projectCssString += utils.buildCSS(projectScssString, `${projectPath}/${buildDir}`);
156
+ projectCssString += utils.buildCSS(projectScssString, buildDir);
157
157
  }
158
158
  fs.writeFileSync(`${buildDir}/${project.name}.css`, projectCssString);
159
159
  };
package/commands/init.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import fs from 'fs';
2
2
  import fse from 'fs-extra';
3
3
  import git from 'isomorphic-git';
4
- import globby from 'globby';
4
+ import { globby } from 'globby';
5
5
  import * as utils from './utils.js';
6
6
 
7
7
  import path from 'path';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leanweb",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Builds framework agnostic web components.",
5
5
  "bin": {
6
6
  "leanweb": "leanweb.js",
@@ -20,25 +20,25 @@
20
20
  "author": "Qian Chen",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@babel/core": "^7.16.12",
24
- "@babel/parser": "^7.16.12",
25
- "@babel/plugin-transform-runtime": "^7.16.10",
23
+ "@babel/core": "^7.17.0",
24
+ "@babel/parser": "^7.17.0",
25
+ "@babel/plugin-transform-runtime": "^7.17.0",
26
26
  "@babel/preset-env": "^7.16.11",
27
27
  "babel-loader": "^8.2.3",
28
28
  "clean-css": "^5.2.4",
29
- "css-loader": "^6.5.1",
29
+ "css-loader": "^6.6.0",
30
30
  "fs-extra": "^10.0.0",
31
- "globby": "^13.1.0",
31
+ "globby": "^13.1.1",
32
32
  "html-minifier": "^4.0.0",
33
- "isomorphic-git": "^1.11.1",
33
+ "isomorphic-git": "^1.11.2",
34
34
  "json5-loader": "^4.0.1",
35
35
  "node-watch": "^0.7.3",
36
36
  "parse5": "^6.0.1",
37
37
  "raw-loader": "^4.0.2",
38
- "sass": "^1.49.0",
38
+ "sass": "^1.49.7",
39
39
  "sass-loader": "^12.4.0",
40
40
  "semver": "^7.3.5",
41
- "webpack": "^5.67.0",
42
- "webpack-dev-server": "^4.7.3"
41
+ "webpack": "^5.68.0",
42
+ "webpack-dev-server": "^4.7.4"
43
43
  }
44
44
  }