generator-reshow 0.17.36 → 0.17.37

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.
@@ -20,7 +20,7 @@ do_build() {
20
20
  DEST_FOLDER=${DIR}/${FOLDER_PREFIX}${BUILD_VERSION}
21
21
  mkdir -p ${DEST_FOLDER}
22
22
 
23
- for file in $COPY_FILES; do [ -e "$file" ] && cp $file ${DEST_FOLDER}; done
23
+ for file in $COPY_FILES; do [ -e "$file" ] && cp -a $file ${DEST_FOLDER}; done
24
24
  for file in $DOCKER_FILES; do
25
25
  if [ -e "$file" ]; then
26
26
  cp $file ${DEST_FOLDER}
@@ -74,6 +74,8 @@ module.exports = class extends YoGenerator {
74
74
  data.devDependencies["react"] = "^18.x";
75
75
  data.devDependencies["react-dom"] = "^18.x";
76
76
  data.devDependencies["reshow-unit"] = "*";
77
+ data.scripts["build:type"] =
78
+ "npx -p typescript tsc src/index.js src/**/*.js src/ui/**/*.jsx --jsx react-jsx --declaration --allowJs --emitDeclarationOnly --skipLibCheck --declarationDir types";
77
79
  delete data.devDependencies["reshow-unit-dom"];
78
80
  }
79
81
  if (!isUseWebpack) {
@@ -29,16 +29,18 @@
29
29
  "update-compile-sh": "yo reshow:compile-sh",
30
30
  "webpack": "webpack",
31
31
  "start": "ws",
32
- "format": "prettier-eslint --write 'src/**/*.js' 'ui/**/*.js*'",
32
+ "format": "prettier-eslint --write 'src/**/*.js'",
33
33
  "clean:webpack": "find ./assets -name '*.*' | xargs rm -rf && rm -rf workbox-*.js",
34
- "clean": "find ./build -name '*.*' | xargs rm -rf",
34
+ "clean": "find ./build ./types -name '*.*' | xargs rm -rf",
35
35
  "build:cjs": "BABEL_ENV=cjs babel src -d build/cjs/src --ignore /**/__tests__<%= babelRootMode %>",
36
36
  "build:es": "BABEL_ENV=es babel src -d build/es/src --out-file-extension .mjs<%= babelRootMode %>",
37
- "build": "npm run clean && npm run build:cjs && npm run build:es",
37
+ "build:type": "npx -p typescript tsc src/index.js src/**/*.js --declaration --allowJs --emitDeclarationOnly --skipLibCheck --declarationDir types",
38
+ "build": "npm run clean && npm run build:cjs && npm run build:es && npm run build:type",
38
39
  "mochaFor": "mocha -r global-jsdom/register",
39
40
  "mocha": "npm run mochaFor -- 'build/{cjs,es}/**/__tests__/*.{js,mjs}'",
40
41
  "test": "npm run build && npm run mocha",
41
42
  "prepublishOnly": "npm run test"
42
43
  },
43
- "files": ["build", "package.json", "README.md"]
44
+ "types": "./types/index.d.ts",
45
+ "files": ["types", "build", "package.json", "README.md"]
44
46
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.17.36",
2
+ "version": "0.17.37",
3
3
  "name": "generator-reshow",
4
4
  "repository": {
5
5
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  "yo-unit": "*"
21
21
  },
22
22
  "scripts": {
23
- "mochaFor": "mocha --timeout 2500",
23
+ "mochaFor": "mocha --timeout 3000",
24
24
  "mocha": "npm run mochaFor -- 'generators/**/__tests__/*.js'",
25
25
  "test": "npm run mocha",
26
26
  "prepublishOnly": "npm run test"