newspack-scripts 3.1.0-alpha.2 → 3.1.0

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/README.md CHANGED
@@ -33,6 +33,20 @@ Lints to commit message, to be used in a git `commit-msg` hook.
33
33
 
34
34
  Will run [`semantic-release`](semantic-release.gitbook.io/) based on a very opinionated configuration.
35
35
 
36
+ ### typescript-check
37
+
38
+ Will validate TypeScript code in the project. This requires a `tsconfig.json` file to be placed in the project root. Example:
39
+
40
+ ```json
41
+ {
42
+ "extends": "newspack-scripts/config/tsconfig.json",
43
+ "compilerOptions": {
44
+ "rootDir": "src"
45
+ },
46
+ "include": ["src"]
47
+ }
48
+ ```
49
+
36
50
  ---
37
51
 
38
52
  ## Semantic Release
@@ -2,7 +2,6 @@
2
2
  "$schema": "https://json.schemastore.org/tsconfig",
3
3
  "compilerOptions": {
4
4
  "noEmit":true,
5
- "rootDir": "src",
6
5
  "composite": true,
7
6
  "noEmitHelpers": true,
8
7
  "skipLibCheck": true,
@@ -21,9 +20,5 @@
21
20
  "forceConsistentCasingInFileNames": true,
22
21
  "allowJs": true,
23
22
  "checkJs": false
24
- },
25
- "include": [
26
- "src",
27
- "src/**/*.json"
28
- ]
23
+ }
29
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newspack-scripts",
3
- "version": "3.1.0-alpha.2",
3
+ "version": "3.1.0",
4
4
  "description": "",
5
5
  "bin": {
6
6
  "newspack-scripts": "./bin/newspack-scripts.js"
@@ -17,6 +17,7 @@
17
17
  "@semantic-release/git": "^10.0.1",
18
18
  "@testing-library/jest-dom": "^5.15.1",
19
19
  "@testing-library/react": "^12.1.2",
20
+ "@types/wordpress__data": "^4.6.10",
20
21
  "@wordpress/a11y": "^3.2.4",
21
22
  "@wordpress/api-fetch": "^5.2.6",
22
23
  "@wordpress/base-styles": "^4.0.4",
@@ -2,17 +2,14 @@
2
2
 
3
3
  const spawn = require("cross-spawn");
4
4
  const path = require("path");
5
+ const modules = require("./utils/modules");
5
6
 
6
- console.log(path.resolve(__dirname, "../config/tsconfig.json"));
7
+ const result = spawn.sync(`${process.cwd()}/node_modules/.bin/tsc`, [], {
8
+ stdio: "inherit",
9
+ });
7
10
 
8
- const result = spawn.sync(
9
- `${process.cwd()}/node_modules/.bin/tsc`,
10
- ["--project", path.resolve(__dirname, "../config/tsconfig.json")],
11
- {
12
- stdio: "inherit",
13
- }
14
- );
15
-
16
- console.log(result);
11
+ if (result.status === 0) {
12
+ console.log("All good!");
13
+ }
17
14
 
18
15
  process.exit(result.status);