@dword-design/base 9.3.1 → 9.4.1

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.
@@ -4,7 +4,6 @@ exports[`index empty parent 1`] = `
4
4
  Object {
5
5
  "allowedMatches": Array [],
6
6
  "commands": Object {},
7
- "coverageFileExtensions": Array [],
8
7
  "deployAssets": Array [],
9
8
  "deployEnv": Object {},
10
9
  "deployPlugins": Array [],
@@ -37,7 +36,6 @@ $ yarn add foo
37
36
  exports[`index inherited 1`] = `
38
37
  Object {
39
38
  "allowedMatches": Array [],
40
- "coverageFileExtensions": Array [],
41
39
  "deployAssets": Array [
42
40
  Object {
43
41
  "label": "Foo",
@@ -5,6 +5,7 @@ Object {
5
5
  ".babelrc.json": true,
6
6
  ".commitlintrc.json": true,
7
7
  ".cz.json": true,
8
+ ".devcontainer": true,
8
9
  ".editorconfig": true,
9
10
  ".env.json": true,
10
11
  ".env.schema.json": true,
@@ -1,5 +1,4 @@
1
1
  import endent from "@dword-design/functions/dist/endent.js";
2
- import flatMap from "@dword-design/functions/dist/flat-map.js";
3
2
  import includes from "@dword-design/functions/dist/includes.js";
4
3
  import packageJsonSchema from '@dword-design/package-json-schema';
5
4
  import Ajv from 'ajv';
@@ -13,7 +12,7 @@ const ajv = new Ajv({
13
12
  });
14
13
  const validatePackageJson = ajv.compile(packageJsonSchema);
15
14
  export default async function (options) {
16
- var _ref, _this$config$coverage;
15
+ var _ref;
17
16
  options = {
18
17
  log: process.env.NODE_ENV !== 'test',
19
18
  patterns: [],
@@ -30,7 +29,7 @@ export default async function (options) {
30
29
  await this.depcheck();
31
30
  }
32
31
  const runDockerTests = !isCI() || !(_ref = ['win32', 'darwin'], includes(process.platform)(_ref));
33
- return execa(this.packageConfig.type === 'module' ? packageName`c8` : packageName`nyc`, ['--reporter', 'lcov', '--reporter', 'text', '--cwd', process.cwd(), '--all', ...(_this$config$coverage = this.config.coverageFileExtensions, flatMap(extension => ['--extension', extension])(_this$config$coverage)), '--exclude', '**/*.spec.js', '--exclude', 'coverage', '--exclude', 'tmp-*', '--exclude', 'dist', 'mocha', '--reporter', _require.resolve(packageName`mocha-spec-reporter-with-file-names`), '--ui', packageName`mocha-ui-exports-auto-describe`, '--require', packageName`@dword-design/babel-register`, '--require', packageName`@dword-design/pretest`, '--file', _require.resolve(packageName`@dword-design/setup-test`), ...(runDockerTests ? [] : ['--ignore', '**/*.usesdocker.spec.js']), '--timeout', 130000, ...(options.patterns.length > 0 ? options.patterns : ['{,!(node_modules)/**/}*.spec.js']), ...(options.grep ? ['--grep', options.grep] : []), ...(process.platform === 'win32' ? ['--exit'] : [])], {
32
+ return execa(this.packageConfig.type === 'module' ? packageName`c8` : packageName`nyc`, ['--reporter', 'lcov', '--reporter', 'text', '--cwd', process.cwd(), '--all', '--exclude', '**/*.spec.js', '--exclude', 'coverage', '--exclude', 'tmp-*', '--exclude', 'dist', 'mocha', '--reporter', _require.resolve(packageName`mocha-spec-reporter-with-file-names`), '--ui', packageName`mocha-ui-exports-auto-describe`, '--require', packageName`@dword-design/pretest`, '--file', _require.resolve(packageName`@dword-design/setup-test`), ...(runDockerTests ? [] : ['--ignore', '**/*.usesdocker.spec.js']), '--timeout', 130000, ...(options.patterns.length > 0 ? options.patterns : ['{,!(node_modules)/**/}*.spec.js']), ...(options.grep ? ['--grep', options.grep] : []), ...(process.platform === 'win32' ? ['--exit'] : [])], {
34
33
  env: {
35
34
  NODE_ENV: 'test',
36
35
  ...(this.packageConfig.type === 'module' && {
@@ -31,6 +31,7 @@ Array [
31
31
  ".babelrc.json",
32
32
  ".commitlintrc.json",
33
33
  ".cz.json",
34
+ ".devcontainer/devcontainer.json",
34
35
  ".editorconfig",
35
36
  ".eslintrc.json",
36
37
  ".gitattributes",
@@ -1 +1 @@
1
- export default ['.babelrc.json', '.commitlintrc.json', '.cz.json', '.editorconfig', '.eslintrc.json', '.gitattributes', '.github', '.gitignore', '.gitpod.Dockerfile', '.gitpod.yml', '.husky', '.nyc_output', '.releaserc.json', '.renovaterc.json', 'CHANGELOG.md', 'coverage', 'LICENSE.md', 'node_modules', 'yarn.lock'];
1
+ export default ['.babelrc.json', '.commitlintrc.json', '.cz.json', '.devcontainer', '.editorconfig', '.eslintrc.json', '.gitattributes', '.github', '.gitignore', '.gitpod.Dockerfile', '.gitpod.yml', '.husky', '.nyc_output', '.releaserc.json', '.renovaterc.json', '.vscode', 'CHANGELOG.md', 'coverage', 'LICENSE.md', 'node_modules', 'yarn.lock'];
@@ -5,6 +5,7 @@ Array [
5
5
  ".babelrc.json",
6
6
  ".commitlintrc.json",
7
7
  ".cz.json",
8
+ ".devcontainer",
8
9
  ".editorconfig",
9
10
  ".eslintrc.json",
10
11
  ".gitattributes",
@@ -16,6 +17,7 @@ Array [
16
17
  ".nyc_output",
17
18
  ".releaserc.json",
18
19
  ".renovaterc.json",
20
+ ".vscode",
19
21
  "CHANGELOG.md",
20
22
  "LICENSE.md",
21
23
  "coverage",
@@ -0,0 +1,11 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`index works 1`] = `
4
+ Object {
5
+ "features": Object {
6
+ "ghcr.io/devcontainers/features/docker-in-docker:2": Object {},
7
+ },
8
+ "image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
9
+ "updateContentCommand": "yarn --frozen-lockfile",
10
+ }
11
+ `;
@@ -0,0 +1,9 @@
1
+ export default function () {
2
+ return {
3
+ features: {
4
+ 'ghcr.io/devcontainers/features/docker-in-docker:2': {}
5
+ },
6
+ image: `mcr.microsoft.com/devcontainers/javascript-node:0-${this.config.nodeVersion}`,
7
+ updateContentCommand: 'yarn --frozen-lockfile'
8
+ };
9
+ }
@@ -12,7 +12,6 @@ export default function () {
12
12
  RUN bash -c 'VERSION="${this.config.nodeVersion}" \
13
13
  && source $HOME/.nvm/nvm.sh && nvm install $VERSION \
14
14
  && nvm use $VERSION && nvm alias default $VERSION'
15
- RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
16
15
 
17
16
  RUN echo "\\nexport PATH=$(yarn global bin):\\$PATH" >> /home/gitpod/.bashrc
18
17
 
@@ -6,6 +6,7 @@ Object {
6
6
  "engines": Object {
7
7
  "node": ">=14",
8
8
  },
9
+ "exports": "./dist/index.js",
9
10
  "files": Array [
10
11
  "dist",
11
12
  ],
@@ -45,6 +46,7 @@ Object {
45
46
  "engines": Object {
46
47
  "node": ">=14",
47
48
  },
49
+ "exports": "./dist/index.js",
48
50
  "files": Array [
49
51
  "dist",
50
52
  ],
@@ -72,6 +74,7 @@ Object {
72
74
  "prepublishOnly": "base prepublishOnly",
73
75
  "test": "base test",
74
76
  },
77
+ "type": "module",
75
78
  "types": "types.d.ts",
76
79
  "version": "1.1.0",
77
80
  }
@@ -83,6 +86,7 @@ Object {
83
86
  "engines": Object {
84
87
  "node": ">=14",
85
88
  },
89
+ "exports": "./dist/index.js",
86
90
  "files": Array [
87
91
  "dist",
88
92
  ],
@@ -103,6 +107,7 @@ Object {
103
107
  "prepublishOnly": "base prepublishOnly",
104
108
  "test": "base test",
105
109
  },
110
+ "type": "module",
106
111
  "version": "1.0.0",
107
112
  }
108
113
  `;
@@ -113,6 +118,7 @@ Object {
113
118
  "engines": Object {
114
119
  "node": ">=14",
115
120
  },
121
+ "exports": "./dist/index.js",
116
122
  "files": Array [
117
123
  "dist",
118
124
  ],
@@ -132,6 +138,7 @@ Object {
132
138
  "prepublishOnly": "base prepublishOnly",
133
139
  "test": "base test",
134
140
  },
141
+ "type": "module",
135
142
  "version": "1.0.0",
136
143
  }
137
144
  `;
@@ -8,6 +8,7 @@ Object {
8
8
  ".babelrc.json": true,
9
9
  ".commitlintrc.json": true,
10
10
  ".cz.json": true,
11
+ ".devcontainer": true,
11
12
  ".editorconfig": true,
12
13
  ".eslintrc.json": true,
13
14
  ".gitattributes": true,
@@ -19,6 +20,7 @@ Object {
19
20
  ".nyc_output": true,
20
21
  ".releaserc.json": true,
21
22
  ".renovaterc.json": true,
23
+ ".vscode": true,
22
24
  "CHANGELOG.md": true,
23
25
  "LICENSE.md": true,
24
26
  "bar": true,
@@ -16,7 +16,7 @@ import githubLabelsConfig from "./github-labels.js";
16
16
  import githubSyncLabelsConfig from "./github-sync-labels.js";
17
17
  import gitpodConfig from "./gitpod.js";
18
18
  export default function () {
19
- var _babelConfig, _commitlintConfig, _commitizenConfig, _this$getEslintConfig, _githubFunding, _sortKeys, _sortKeys2, _sortKeys3, _sortKeys4, _sortKeys5, _ref, _this$getGitignoreCon, _gitpodConfig, _this$getReleaseConfi, _sortKeys6, _this$getVscodeConfig, _ref2, _packageConfig;
19
+ var _babelConfig, _commitlintConfig, _commitizenConfig, _this$getGithubCodesp, _this$getEslintConfig, _githubFunding, _sortKeys, _sortKeys2, _sortKeys3, _sortKeys4, _sortKeys5, _ref, _this$getGitignoreCon, _gitpodConfig, _this$getReleaseConfi, _sortKeys6, _this$getVscodeConfig, _ref2, _packageConfig;
20
20
  const packageConfig = this.getPackageConfig();
21
21
  return {
22
22
  '.babelrc.json': `${(_babelConfig = babelConfig, jsonToString({
@@ -28,6 +28,9 @@ export default function () {
28
28
  '.cz.json': `${(_commitizenConfig = commitizenConfig, jsonToString({
29
29
  indent: 2
30
30
  })(_commitizenConfig))}\n`,
31
+ '.devcontainer/devcontainer.json': `${(_this$getGithubCodesp = this.getGithubCodespacesConfig(), jsonToString({
32
+ indent: 2
33
+ })(_this$getGithubCodesp))}\n`,
31
34
  '.editorconfig': editorconfigConfig,
32
35
  '.eslintrc.json': `${(_this$getEslintConfig = this.getEslintConfig(), jsonToString({
33
36
  indent: 2
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ import testRaw from "./commands/test-raw/index.js";
22
22
  import getDepcheckSpecialBase from "./get-depcheck-special-base/index.js";
23
23
  import getEditorIgnoreConfig from "./get-generated-files/get-editor-ignore/index.js";
24
24
  import getEslintConfig from "./get-generated-files/get-eslint/index.js";
25
+ import getGithubCodespacesConfig from "./get-generated-files/get-github-codespaces/index.js";
25
26
  import getGithubSyncMetadataConfig from "./get-generated-files/get-github-sync-metadata/index.js";
26
27
  import getGithubWorkflowConfig from "./get-generated-files/get-github-workflow/index.js";
27
28
  import getGitignoreConfig from "./get-generated-files/get-gitignore/index.js";
@@ -58,7 +59,6 @@ class Base {
58
59
  const defaultConfig = {
59
60
  allowedMatches: [],
60
61
  commands: {},
61
- coverageFileExtensions: [],
62
62
  depcheckConfig: {
63
63
  detectors: [depcheck.detector.importDeclaration, depcheck.detector.requireCallExpression, depcheck.detector.requireResolveCallExpression, depcheckDetectorExeca, depcheckDetectorPackageName],
64
64
  ignorePath: '.gitignore',
@@ -118,6 +118,7 @@ Object.assign(Base.prototype, {
118
118
  getEditorIgnoreConfig,
119
119
  getEslintConfig,
120
120
  getGeneratedFiles,
121
+ getGithubCodespacesConfig,
121
122
  getGithubSyncMetadataConfig,
122
123
  getGithubWorkflowConfig,
123
124
  getGitignoreConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "9.3.1",
3
+ "version": "9.4.1",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",
@@ -29,7 +29,6 @@
29
29
  "@commitlint/cli": "^17.4.0",
30
30
  "@commitlint/config-conventional": "^17.4.0",
31
31
  "@dword-design/babel-config": "^2.0.0",
32
- "@dword-design/babel-register": "^1.0.0",
33
32
  "@dword-design/base-config-node": "^1.6.0",
34
33
  "@dword-design/ci": "^3.0.0",
35
34
  "@dword-design/eslint-config": "^3.0.6",