@dword-design/base 9.6.3 → 9.6.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.
@@ -6,13 +6,11 @@ Object {
6
6
  "engines": Object {
7
7
  "node": ">=14",
8
8
  },
9
- "exports": "./dist/index.js",
10
9
  "files": Array [
11
10
  "dist",
12
11
  ],
13
12
  "funding": "https://github.com/sponsors/dword-design",
14
13
  "license": "MIT",
15
- "main": "dist/index.js",
16
14
  "publishConfig": Object {
17
15
  "access": "public",
18
16
  },
@@ -26,6 +24,7 @@ Object {
26
24
  "prepublishOnly": "base prepublishOnly",
27
25
  "test": "base test",
28
26
  },
27
+ "type": "module",
29
28
  "version": "1.0.0",
30
29
  }
31
30
  `;
@@ -46,7 +45,6 @@ Object {
46
45
  "engines": Object {
47
46
  "node": ">=14",
48
47
  },
49
- "exports": "./dist/index.js",
50
48
  "files": Array [
51
49
  "dist",
52
50
  ],
@@ -56,7 +54,6 @@ Object {
56
54
  "bar",
57
55
  ],
58
56
  "license": "MIT",
59
- "main": "dist/index.js",
60
57
  "name": "foo",
61
58
  "peerDependencies": Object {
62
59
  "nuxt": "^1.0.0",
@@ -86,13 +83,11 @@ Object {
86
83
  "engines": Object {
87
84
  "node": ">=14",
88
85
  },
89
- "exports": "./dist/index.js",
90
86
  "files": Array [
91
87
  "dist",
92
88
  ],
93
89
  "funding": "https://github.com/sponsors/dword-design",
94
90
  "license": "MIT",
95
- "main": "dist/index.js",
96
91
  "publishConfig": Object {
97
92
  "access": "public",
98
93
  },
@@ -111,34 +106,3 @@ Object {
111
106
  "version": "1.0.0",
112
107
  }
113
108
  `;
114
-
115
- exports[`index sub-folder 1`] = `
116
- Object {
117
- "author": "Sebastian Landwehr <info@sebastianlandwehr.com>",
118
- "engines": Object {
119
- "node": ">=14",
120
- },
121
- "exports": "./dist/index.js",
122
- "files": Array [
123
- "dist",
124
- ],
125
- "funding": "https://github.com/sponsors/dword-design",
126
- "license": "MIT",
127
- "main": "dist/index.js",
128
- "publishConfig": Object {
129
- "access": "public",
130
- },
131
- "scripts": Object {
132
- "checkUnknownFiles": "base checkUnknownFiles",
133
- "commit": "base commit",
134
- "depcheck": "base depcheck",
135
- "dev": "base dev",
136
- "lint": "base lint",
137
- "prepare": "base prepare",
138
- "prepublishOnly": "base prepublishOnly",
139
- "test": "base test",
140
- },
141
- "type": "module",
142
- "version": "1.0.0",
143
- }
144
- `;
@@ -19,6 +19,7 @@ export default function () {
19
19
  ...(_this$config$commands = this.config.commands, mapValues(stubTrue)(_this$config$commands))
20
20
  };
21
21
  return {
22
+ type: 'module',
22
23
  ...(_this$packageConfig = this.packageConfig, pick(['name', 'private', 'deploy', 'description', 'baseConfig', 'bin', 'keywords', 'dependencies', 'devDependencies', 'peerDependencies', 'publishConfig', 'type', 'types'])(_this$packageConfig)),
23
24
  funding: 'https://github.com/sponsors/dword-design',
24
25
  publishConfig: {
@@ -35,6 +36,6 @@ export default function () {
35
36
  files: ['dist', ...(fs.existsSync('types.d.ts') ? ['types.d.ts'] : [])],
36
37
  license: 'MIT',
37
38
  ...this.config.packageConfig,
38
- scripts: (_ref = (_commandNames = commandNames, mapValues((nothing, name) => this.packageConfig.name === '@dword-design/base' ? `rimraf dist && babel --config-file ${packageName`@dword-design/babel-config`} --copy-files --no-copy-ignored --out-dir dist --ignore "**/*.spec.js" src && node dist/cli.js ${name}` : `base ${name}`)(_commandNames)), sortKeys(_ref))
39
+ scripts: (_ref = (_commandNames = commandNames, mapValues((handler, name) => this.packageConfig.name === '@dword-design/base' ? `rimraf dist && babel --config-file ${packageName`@dword-design/babel-config`} --copy-files --no-copy-ignored --out-dir dist --ignore "**/*.spec.js" src && node dist/cli.js ${name}` : `base ${name}`)(_commandNames)), sortKeys(_ref))
39
40
  };
40
41
  }
package/dist/index.js CHANGED
@@ -8,8 +8,8 @@ import depcheckDetectorExeca from 'depcheck-detector-execa';
8
8
  import depcheckDetectorPackageName from 'depcheck-detector-package-name';
9
9
  import packageName from 'depcheck-package-name';
10
10
  import depcheckParserBabel from 'depcheck-parser-babel';
11
+ import fs from 'fs-extra';
11
12
  import jiti from 'jiti';
12
- import loadPkg from 'load-pkg';
13
13
  import { createRequire } from 'module';
14
14
  import P from 'path';
15
15
  import { transform as pluginNameToPackageName } from 'plugin-name-to-package-name';
@@ -62,7 +62,7 @@ class Base {
62
62
  if (config.name) {
63
63
  config.name = pluginNameToPackageName(config.name, 'base-config');
64
64
  }
65
- this.packageConfig = loadPkg.sync() || {};
65
+ this.packageConfig = fs.existsSync('package.json') ? fs.readJsonSync('package.json') : {};
66
66
  const defaultConfig = {
67
67
  allowedMatches: [],
68
68
  commands: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/base",
3
- "version": "9.6.3",
3
+ "version": "9.6.4",
4
4
  "description": "Base package for projects.",
5
5
  "repository": "dword-design/base",
6
6
  "funding": "https://github.com/sponsors/dword-design",
@@ -64,7 +64,6 @@
64
64
  "ignore": "^5.1.4",
65
65
  "is-ci": "^3.0.0",
66
66
  "jiti": "^1.16.0",
67
- "load-pkg": "^4.0.0",
68
67
  "make-cli": "^3.0.0",
69
68
  "mocha": "^10.2.0",
70
69
  "mocha-spec-reporter-with-file-names": "npm:@dword-design/mocha-spec-reporter-with-file-names",