@ttoss/config 1.29.3 → 1.29.4

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
@@ -5,7 +5,7 @@
5
5
  ## Install
6
6
 
7
7
  ```shell
8
- yarn add -DW @ttoss/config
8
+ pnpm add -Dw @ttoss/config
9
9
  ```
10
10
 
11
11
  ## Monorepo
@@ -17,7 +17,7 @@ Use the configs of this section on the root of your monorepo.
17
17
  Install the following packages:
18
18
 
19
19
  ```shell
20
- yarn add -DW eslint prettier @ttoss/eslint-config
20
+ pnpm add -Dw eslint prettier @ttoss/eslint-config
21
21
 
22
22
  ```
23
23
 
@@ -44,7 +44,7 @@ This group of packages will only work if you have already installed [ESLint and
44
44
  Install the following packages on the root of your monorepo:
45
45
 
46
46
  ```shell
47
- yarn add -DW husky @commitlint/cli lint-staged
47
+ pnpm add -Dw husky @commitlint/cli lint-staged
48
48
  ```
49
49
 
50
50
  Create the `.commitlintrc.js` file and add the following configuration:
@@ -67,9 +67,9 @@ Finally, configure Husky:
67
67
 
68
68
  ```shell
69
69
  npm set-script prepare "husky install"
70
- yarn run prepare
71
- yarn husky add .husky/commit-msg "yarn commitlint --edit"
72
- yarn husky add .husky/pre-commit "yarn lint-staged"
70
+ pnpm run prepare
71
+ pnpm husky add .husky/commit-msg "pnpm commitlint --edit"
72
+ pnpm husky add .husky/pre-commit "pnpm lint-staged"
73
73
  ```
74
74
 
75
75
  ## Packages
@@ -91,7 +91,7 @@ module.exports = babelConfig();
91
91
  Install [Jest](https://jestjs.io/) and its types on your package:
92
92
 
93
93
  ```shell
94
- yarn add -D jest @types/jest
94
+ pnpm add -D jest @types/jest
95
95
  ```
96
96
 
97
97
  Create the `jest.config.ts` file on the package folder:
@@ -119,7 +119,7 @@ Use [tsup](https://tsup.egoist.sh/) to bundle your TypeScript packages.
119
119
  Install [tsup](https://tsup.egoist.sh/) on your package.
120
120
 
121
121
  ```shell
122
- yarn add -D tsup
122
+ pnpm add -D tsup
123
123
  ```
124
124
 
125
125
  Create the `tsup.config.ts` file on the package folder:
@@ -143,7 +143,7 @@ Configure the `build` script on `package.json`:
143
143
  Install [TypeScript](https://www.npmjs.com/package/typescript) on your package:
144
144
 
145
145
  ```shell
146
- yarn add -D typescript
146
+ pnpm add -D typescript
147
147
  ```
148
148
 
149
149
  Extend default configuration for each `tsconfig.json` (`touch tsconfig.json`) on the package folder:
package/dist/esm/index.js CHANGED
@@ -5,9 +5,9 @@ import deepmerge from "deepmerge";
5
5
  var overwriteMerge = (_, sourceArray) => {
6
6
  return sourceArray;
7
7
  };
8
- var configCreator = (defaultConfig7 = {}) => {
8
+ var configCreator = (defaultConfig8 = {}) => {
9
9
  return (config = {}, deepmergeConfig) => {
10
- return deepmerge(defaultConfig7, config, {
10
+ return deepmerge(defaultConfig8, config, {
11
11
  arrayMerge: deepmergeConfig?.arrayMerge === "overwrite" ? overwriteMerge : void 0
12
12
  });
13
13
  };
@@ -85,6 +85,26 @@ var defaultConfig5 = {
85
85
  };
86
86
  var prettierConfig = configCreator(defaultConfig5);
87
87
 
88
+ // src/syncpack.ts
89
+ var defaultConfig6 = {
90
+ dependencyTypes: ["dev", "overrides",
91
+ /**
92
+ * Exclude peer dependencies from the list of dependencies to check
93
+ * to avoid updating peer dependencies to the latest version, as updating
94
+ * React to the latest version instead >=16.8.0.
95
+ */
96
+ // 'peer',
97
+ "pnpmOverrides", "prod", "resolutions"],
98
+ filter: ".",
99
+ indent: " ",
100
+ semverGroups: [],
101
+ semverRange: "",
102
+ sortAz: ["contributors", "dependencies", "devDependencies", "keywords", "peerDependencies", "resolutions", "scripts"],
103
+ sortFirst: ["name", "version", "description", "author"],
104
+ versionGroups: []
105
+ };
106
+ var syncpackConfig = configCreator(defaultConfig6);
107
+
88
108
  // src/tsup.ts
89
109
  import { transformAsync } from "@babel/core";
90
110
  var formatjsPlugin = {
@@ -113,7 +133,7 @@ var formatjsPlugin = {
113
133
  });
114
134
  }
115
135
  };
116
- var defaultConfig6 = {
136
+ var defaultConfig7 = {
117
137
  clean: true,
118
138
  dts: true,
119
139
  entryPoints: ["src/index.ts"],
@@ -131,5 +151,5 @@ var defaultConfig6 = {
131
151
  },
132
152
  esbuildPlugins: [formatjsPlugin]
133
153
  };
134
- var tsupConfig = configCreator(defaultConfig6);
135
- export { babelConfig, commitlintConfig, jestConfig, lintstagedConfig, prettierConfig, tsupConfig };
154
+ var tsupConfig = configCreator(defaultConfig7);
155
+ export { babelConfig, commitlintConfig, jestConfig, lintstagedConfig, prettierConfig, syncpackConfig, tsupConfig };
package/dist/index.d.ts CHANGED
@@ -20,8 +20,12 @@ declare const prettierConfig: (config?: any, deepmergeConfig?: {
20
20
  arrayMerge: "append" | "overwrite";
21
21
  } | undefined) => any;
22
22
 
23
+ declare const syncpackConfig: (config?: any, deepmergeConfig?: {
24
+ arrayMerge: "append" | "overwrite";
25
+ } | undefined) => any;
26
+
23
27
  declare const tsupConfig: (config?: Options, deepmergeConfig?: {
24
28
  arrayMerge: "append" | "overwrite";
25
29
  } | undefined) => Options;
26
30
 
27
- export { babelConfig, commitlintConfig, jestConfig, lintstagedConfig, prettierConfig, tsupConfig };
31
+ export { babelConfig, commitlintConfig, jestConfig, lintstagedConfig, prettierConfig, syncpackConfig, tsupConfig };
package/dist/index.js CHANGED
@@ -43,6 +43,7 @@ __export(src_exports, {
43
43
  jestConfig: () => jestConfig,
44
44
  lintstagedConfig: () => lintstagedConfig,
45
45
  prettierConfig: () => prettierConfig,
46
+ syncpackConfig: () => syncpackConfig,
46
47
  tsupConfig: () => tsupConfig
47
48
  });
48
49
  module.exports = __toCommonJS(src_exports);
@@ -52,9 +53,9 @@ var import_deepmerge = __toESM(require("deepmerge"));
52
53
  var overwriteMerge = (_, sourceArray) => {
53
54
  return sourceArray;
54
55
  };
55
- var configCreator = (defaultConfig7 = {}) => {
56
+ var configCreator = (defaultConfig8 = {}) => {
56
57
  return (config = {}, deepmergeConfig) => {
57
- return (0, import_deepmerge.default)(defaultConfig7, config, {
58
+ return (0, import_deepmerge.default)(defaultConfig8, config, {
58
59
  arrayMerge: deepmergeConfig?.arrayMerge === "overwrite" ? overwriteMerge : void 0
59
60
  });
60
61
  };
@@ -132,6 +133,26 @@ var defaultConfig5 = {
132
133
  };
133
134
  var prettierConfig = configCreator(defaultConfig5);
134
135
 
136
+ // src/syncpack.ts
137
+ var defaultConfig6 = {
138
+ dependencyTypes: ["dev", "overrides",
139
+ /**
140
+ * Exclude peer dependencies from the list of dependencies to check
141
+ * to avoid updating peer dependencies to the latest version, as updating
142
+ * React to the latest version instead >=16.8.0.
143
+ */
144
+ // 'peer',
145
+ "pnpmOverrides", "prod", "resolutions"],
146
+ filter: ".",
147
+ indent: " ",
148
+ semverGroups: [],
149
+ semverRange: "",
150
+ sortAz: ["contributors", "dependencies", "devDependencies", "keywords", "peerDependencies", "resolutions", "scripts"],
151
+ sortFirst: ["name", "version", "description", "author"],
152
+ versionGroups: []
153
+ };
154
+ var syncpackConfig = configCreator(defaultConfig6);
155
+
135
156
  // src/tsup.ts
136
157
  var import_core = require("@babel/core");
137
158
  var formatjsPlugin = {
@@ -160,7 +181,7 @@ var formatjsPlugin = {
160
181
  });
161
182
  }
162
183
  };
163
- var defaultConfig6 = {
184
+ var defaultConfig7 = {
164
185
  clean: true,
165
186
  dts: true,
166
187
  entryPoints: ["src/index.ts"],
@@ -178,7 +199,7 @@ var defaultConfig6 = {
178
199
  },
179
200
  esbuildPlugins: [formatjsPlugin]
180
201
  };
181
- var tsupConfig = configCreator(defaultConfig6);
202
+ var tsupConfig = configCreator(defaultConfig7);
182
203
  // Annotate the CommonJS export names for ESM import in node:
183
204
  0 && (module.exports = {
184
205
  babelConfig,
@@ -186,5 +207,6 @@ var tsupConfig = configCreator(defaultConfig6);
186
207
  jestConfig,
187
208
  lintstagedConfig,
188
209
  prettierConfig,
210
+ syncpackConfig,
189
211
  tsupConfig
190
212
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/config",
3
- "version": "1.29.3",
3
+ "version": "1.29.4",
4
4
  "description": "Default configuration for packages.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ttoss",
@@ -34,11 +34,14 @@
34
34
  "devDependencies": {
35
35
  "@jest/types": "^29.3.1",
36
36
  "@types/jest": "^29.5.0",
37
- "jest": "^29.5.0"
37
+ "@types/node": "^18.15.11",
38
+ "esbuild": "^0.17.16",
39
+ "jest": "^29.5.0",
40
+ "tsup": "^6.7.0"
38
41
  },
39
42
  "keywords": [],
40
43
  "publishConfig": {
41
44
  "access": "public"
42
45
  },
43
- "gitHead": "39abc27c77c2587edc8d877ccb121783611791a4"
46
+ "gitHead": "81c9da91988b338a6449d84b4dfc183ccf9ed941"
44
47
  }
package/src/index.ts CHANGED
@@ -3,4 +3,5 @@ export { commitlintConfig } from './commitlint';
3
3
  export { jestConfig } from './jest';
4
4
  export { lintstagedConfig } from './lintstaged';
5
5
  export { prettierConfig } from './prettier';
6
+ export { syncpackConfig } from './syncpack';
6
7
  export { tsupConfig } from './tsup';
@@ -0,0 +1,37 @@
1
+ import { configCreator } from './configCreator';
2
+
3
+ /**
4
+ * https://jamiemason.github.io/syncpack/config-file
5
+ */
6
+ export const defaultConfig: any = {
7
+ dependencyTypes: [
8
+ 'dev',
9
+ 'overrides',
10
+ /**
11
+ * Exclude peer dependencies from the list of dependencies to check
12
+ * to avoid updating peer dependencies to the latest version, as updating
13
+ * React to the latest version instead >=16.8.0.
14
+ */
15
+ // 'peer',
16
+ 'pnpmOverrides',
17
+ 'prod',
18
+ 'resolutions',
19
+ ],
20
+ filter: '.',
21
+ indent: ' ',
22
+ semverGroups: [],
23
+ semverRange: '',
24
+ sortAz: [
25
+ 'contributors',
26
+ 'dependencies',
27
+ 'devDependencies',
28
+ 'keywords',
29
+ 'peerDependencies',
30
+ 'resolutions',
31
+ 'scripts',
32
+ ],
33
+ sortFirst: ['name', 'version', 'description', 'author'],
34
+ versionGroups: [],
35
+ };
36
+
37
+ export const syncpackConfig = configCreator(defaultConfig);
@@ -0,0 +1 @@
1
+ declare module '@babel/core';
package/tsconfig.json CHANGED
@@ -12,7 +12,6 @@
12
12
  "lib": ["dom", "ES2021"],
13
13
  "module": "commonjs",
14
14
  "target": "ES2021",
15
- "importHelpers": true,
16
15
  "declaration": true,
17
16
  "sourceMap": true,
18
17
  "strict": true,
@@ -24,6 +23,11 @@
24
23
  "skipLibCheck": true,
25
24
  "forceConsistentCasingInFileNames": true,
26
25
  "noEmit": true,
27
- "resolveJsonModule": true
26
+ "resolveJsonModule": true,
27
+ /**
28
+ * Set `preserveSymlinks` to `false` else change-case package and @aws-sdk/*
29
+ * packages will not be able to resolve their dependencies.
30
+ */
31
+ "preserveSymlinks": false
28
32
  }
29
33
  }