@baseplate-dev/tools 0.1.1 → 0.1.3

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 ADDED
@@ -0,0 +1,24 @@
1
+ # @baseplate-dev/tools
2
+
3
+ This package contains common development tools and configurations used throughout the Baseplate monorepo.
4
+
5
+ ## Purpose
6
+
7
+ The tools package provides:
8
+
9
+ - Shared ESLint configurations for Node.js and React projects
10
+ - Prettier configurations for consistent code formatting
11
+ - TypeScript configurations for various project types
12
+ - Vitest configurations for testing
13
+ - Common development tool settings
14
+
15
+ ## Configurations Included
16
+
17
+ - **ESLint**: Base, Node.js, React, and Storybook configurations
18
+ - **Prettier**: Node.js and React specific formatting rules
19
+ - **TypeScript**: Base configs for CLI, library, and Vite projects
20
+ - **Vitest**: Test runner configurations for Node.js and React
21
+
22
+ ## Part of Baseplate Monorepo
23
+
24
+ This package is part of the Baseplate monorepo and provides standardized development configurations to ensure consistency across all packages.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@baseplate-dev/tools",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Shared dev configurations for linting, formatting, and testing Baseplate projects",
5
- "homepage": "https://www.halfdomelabs.com/",
5
+ "homepage": "https://www.baseplate.dev",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/halfdomelabs/baseplate",
9
9
  "directory": "packages/tools"
10
10
  },
11
- "license": "SEE LICENSE IN LICENSE",
11
+ "license": "MPL-2.0",
12
12
  "author": "Half Dome Labs LLC",
13
13
  "sideEffects": false,
14
14
  "type": "module",
@@ -28,38 +28,41 @@ export function srcSubpathImportPlugin(dirname) {
28
28
 
29
29
  return {
30
30
  name: 'custom-src-resolve',
31
- resolveId(id, importer) {
32
- // Only handle #src imports
33
- if (!id.startsWith('#src')) {
34
- return null;
35
- }
31
+ resolveId: {
32
+ order: 'pre',
33
+ handler(id, importer) {
34
+ // Only handle #src imports
35
+ if (!id.startsWith('#src')) {
36
+ return null;
37
+ }
36
38
 
37
- // Skip if no importer (entry point) or importer is in node_modules
38
- if (!importer || importer.includes('node_modules')) {
39
- return null;
40
- }
39
+ // Skip if no importer (entry point) or importer is in node_modules
40
+ if (!importer || importer.includes('node_modules')) {
41
+ return null;
42
+ }
41
43
 
42
- // Check if importer is within the project directory
43
- const resolvedImporter = path.resolve(importer);
44
- const projectRoot = path.resolve(dirname);
44
+ // Check if importer is within the project directory
45
+ const resolvedImporter = path.resolve(importer);
46
+ const projectRoot = path.resolve(dirname);
45
47
 
46
- if (!resolvedImporter.startsWith(projectRoot)) {
47
- return null;
48
- }
48
+ if (!resolvedImporter.startsWith(projectRoot)) {
49
+ return null;
50
+ }
49
51
 
50
- // Replace #src with the actual src path
51
- const basePath = id.replace(/^#src/, srcPath).replace(/\.js$/, '');
52
+ // Replace #src with the actual src path
53
+ const basePath = id.replace(/^#src/, srcPath).replace(/\.js$/, '');
52
54
 
53
- // Try each extension
54
- for (const ext of EXTENSIONS) {
55
- const resolvedPath = basePath + ext;
56
- if (fs.existsSync(resolvedPath)) {
57
- return resolvedPath;
55
+ // Try each extension
56
+ for (const ext of EXTENSIONS) {
57
+ const resolvedPath = basePath + ext;
58
+ if (fs.existsSync(resolvedPath)) {
59
+ return resolvedPath;
60
+ }
58
61
  }
59
- }
60
62
 
61
- // If no extension matches, return the base path
62
- return basePath;
63
+ // If no extension matches, return the base path
64
+ return basePath;
65
+ },
63
66
  },
64
67
  };
65
68
  }