@dword-design/base 9.0.5 → 9.0.7

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.
@@ -24,7 +24,7 @@ export default async function (options) {
24
24
  const userInfo = os.userInfo();
25
25
  try {
26
26
  var _ref4, _envVariableNames, _ref5;
27
- return await execa('docker', ['run', '--rm', '--tty', ...(_ref4 = (_envVariableNames = envVariableNames, filter(name => process.env[name] !== undefined)(_envVariableNames)), flatMap(name => ['--env', `${name}=${process.env[name]}`])(_ref4)), '-v', `${process.cwd()}:/app`, '-v', `${volumeName}:/app/node_modules`, 'dworddesign/testing:latest', 'bash', '-c', (_ref5 = ['yarn --frozen-lockfile', '&&', 'NODE_OPTIONS=--openssl-legacy-provider yarn test:raw', ...(options.updateSnapshots ? [' --update-snapshots'] : []), ...(options.pattern ? [`"${options.pattern}"`] : []), ...(options.grep ? [`-g "${options.grep}"`] : [])], join(' ')(_ref5))], options.log ? {
27
+ return await execa('docker', ['run', '--rm', '--tty', ...(_ref4 = (_envVariableNames = envVariableNames, filter(name => process.env[name] !== undefined)(_envVariableNames)), flatMap(name => ['--env', `${name}=${process.env[name]}`])(_ref4)), '-v', `${process.cwd()}:/app`, '-v', `${volumeName}:/app/node_modules`, 'dworddesign/testing:latest', 'bash', '-c', (_ref5 = ['yarn --frozen-lockfile', '&&', 'yarn test:raw', ...(options.updateSnapshots ? [' --update-snapshots'] : []), ...(options.pattern ? [`"${options.pattern}"`] : []), ...(options.grep ? [`-g "${options.grep}"`] : [])], join(' ')(_ref5))], options.log ? {
28
28
  stdio: 'inherit'
29
29
  } : {
30
30
  all: true
@@ -3,16 +3,12 @@
3
3
  exports[`index coverage file extension 1`] = `
4
4
  "
5
5
 
6
- index
7
- ✓ works
8
-
9
-
10
- 1 passing
6
+ 0 passing
11
7
 
12
8
  -----------|---------|----------|---------|---------|-------------------
13
9
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
14
10
  -----------|---------|----------|---------|---------|-------------------
15
- All files | 0 | 0 | 0 | 0 |
16
- index.foo | 0 | 0 | 0 | 0 |
11
+ All files | 100 | 100 | 100 | 100 |
12
+ index.foo | 100 | 100 | 100 | 100 |
17
13
  -----------|---------|----------|---------|---------|-------------------"
18
14
  `;
@@ -19,7 +19,6 @@ Array [
19
19
  "CHANGELOG.md",
20
20
  "LICENSE.md",
21
21
  "coverage",
22
- "dist",
23
22
  "foo",
24
23
  "node_modules",
25
24
  "yarn.lock",
@@ -29,7 +29,7 @@ Object {
29
29
  Object {
30
30
  "uses": "actions/setup-node@v3",
31
31
  "with": Object {
32
- "node-version": 14,
32
+ "node-version": 16,
33
33
  },
34
34
  },
35
35
  Object {
@@ -58,7 +58,6 @@ Object {
58
58
  Object {
59
59
  "env": Object {
60
60
  "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
61
- "NPM_TOKEN": "\${{ secrets.NPM_TOKEN }}",
62
61
  },
63
62
  "if": "github.ref == 'refs/heads/master'",
64
63
  "name": "Release",
@@ -101,7 +100,7 @@ Object {
101
100
  },
102
101
  },
103
102
  Object {
104
- "if": "matrix.os == 'ubuntu-latest' && matrix.node == 14",
103
+ "if": "matrix.os == 'ubuntu-latest' && matrix.node == 16",
105
104
  "uses": "codecov/codecov-action@v3",
106
105
  "with": Object {
107
106
  "token": "\${{ secrets.CODECOV_TOKEN }}",
@@ -120,11 +119,15 @@ Object {
120
119
  "os": "ubuntu-latest",
121
120
  },
122
121
  Object {
123
- "node": 14,
122
+ "node": 18,
123
+ "os": "ubuntu-latest",
124
+ },
125
+ Object {
126
+ "node": 16,
124
127
  "os": "macos-latest",
125
128
  },
126
129
  Object {
127
- "node": 14,
130
+ "node": 16,
128
131
  "os": "windows-latest",
129
132
  },
130
133
  ],
@@ -168,7 +171,7 @@ Object {
168
171
  Object {
169
172
  "uses": "actions/setup-node@v3",
170
173
  "with": Object {
171
- "node-version": 14,
174
+ "node-version": 16,
172
175
  },
173
176
  },
174
177
  Object {
@@ -214,7 +217,6 @@ Object {
214
217
  Object {
215
218
  "env": Object {
216
219
  "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
217
- "NPM_TOKEN": "\${{ secrets.NPM_TOKEN }}",
218
220
  },
219
221
  "if": "github.ref == 'refs/heads/master'",
220
222
  "name": "Release",
@@ -745,7 +747,6 @@ Object {
745
747
  Object {
746
748
  "env": Object {
747
749
  "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
748
- "NPM_TOKEN": "\${{ secrets.NPM_TOKEN }}",
749
750
  },
750
751
  "if": "github.ref == 'refs/heads/master'",
751
752
  "name": "Release",
@@ -836,7 +837,6 @@ Object {
836
837
  Object {
837
838
  "env": Object {
838
839
  "GITHUB_TOKEN": "\${{ secrets.GITHUB_TOKEN }}",
839
- "NPM_TOKEN": "\${{ secrets.NPM_TOKEN }}",
840
840
  },
841
841
  "if": "github.ref == 'refs/heads/master'",
842
842
  "name": "Release",
@@ -7,7 +7,6 @@ Array [
7
7
  "/.nyc_output",
8
8
  "/.test.env.json",
9
9
  "/coverage",
10
- "/dist",
11
10
  "/node_modules",
12
11
  "foo",
13
12
  ]
@@ -23,7 +23,6 @@ Object {
23
23
  "LICENSE.md": true,
24
24
  "bar": true,
25
25
  "coverage": true,
26
- "dist": true,
27
26
  "foo": true,
28
27
  "node_modules": true,
29
28
  "yarn.lock": true,
package/dist/index.js CHANGED
@@ -34,8 +34,19 @@ import getVscodeConfig from "./get-generated-files/get-vscode/index.js";
34
34
  import getGeneratedFiles from "./get-generated-files/index.js";
35
35
  import getGitInfo from "./get-git-info/index.js";
36
36
  class Base {
37
- constructor(config = {}) {
38
- config.name = config.name ? pluginNameToPackageName(config.name, 'base-config') : packageName`@dword-design/base-config-node`;
37
+ constructor(config) {
38
+ const jitiInstance = jiti(process.cwd());
39
+ if (config === undefined) {
40
+ config = {
41
+ name: packageName`@dword-design/base-config-node`
42
+ };
43
+ }
44
+ if (typeof config === 'function') {
45
+ config = config();
46
+ }
47
+ if (config.name) {
48
+ config.name = pluginNameToPackageName(config.name, 'base-config');
49
+ }
39
50
  this.packageConfig = loadPkg.sync() || {};
40
51
  const defaultConfig = {
41
52
  allowedMatches: [],
@@ -74,14 +85,14 @@ class Base {
74
85
  supportedNodeVersions: [14, 16, 18],
75
86
  syncKeywords: true
76
87
  };
77
- let inheritedConfig = importCwd.silent(config.name) || jiti(config.name);
88
+ let inheritedConfig = config.name ? importCwd.silent(config.name) || jitiInstance(config.name) : undefined;
78
89
  const mergeOptions = {
79
90
  customMerge: key => key === 'supportedNodeVersions' ? (a, b) => b : undefined
80
91
  };
81
92
  if (typeof inheritedConfig === 'function') {
82
93
  inheritedConfig = inheritedConfig(deepmerge(defaultConfig, config, mergeOptions));
83
94
  }
84
- this.config = deepmerge.all([defaultConfig, inheritedConfig, config], mergeOptions);
95
+ this.config = deepmerge.all([defaultConfig, ...(inheritedConfig ? [inheritedConfig] : []), config], mergeOptions);
85
96
  this.packageConfig = this.getPackageConfig();
86
97
  this.generatedFiles = this.getGeneratedFiles();
87
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "9.0.5",
3
+ "version": "9.0.7",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",
@@ -100,6 +100,7 @@
100
100
  "access": "public"
101
101
  },
102
102
  "baseConfig": {
103
+ "name": "@dword-design/node",
103
104
  "depcheckConfig": {
104
105
  "ignoreMatches": [
105
106
  "husky"