angular-grab-monorepo 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.
Files changed (99) hide show
  1. package/.claude/settings.local.json +10 -0
  2. package/.playwright-mcp/console-2026-03-07T02-49-38-061Z.log +37 -0
  3. package/.playwright-mcp/console-2026-03-07T02-51-03-493Z.log +26 -0
  4. package/.playwright-mcp/console-2026-03-07T02-51-25-431Z.log +15 -0
  5. package/.playwright-mcp/console-2026-03-07T02-52-02-980Z.log +91 -0
  6. package/.playwright-mcp/page-2026-03-07T02-52-09-791Z.png +0 -0
  7. package/LICENSE +21 -0
  8. package/README.md +215 -0
  9. package/examples/angular-19-app/.editorconfig +17 -0
  10. package/examples/angular-19-app/.vscode/extensions.json +4 -0
  11. package/examples/angular-19-app/.vscode/launch.json +20 -0
  12. package/examples/angular-19-app/.vscode/mcp.json +9 -0
  13. package/examples/angular-19-app/.vscode/tasks.json +42 -0
  14. package/examples/angular-19-app/README.md +59 -0
  15. package/examples/angular-19-app/angular.json +79 -0
  16. package/examples/angular-19-app/package.json +42 -0
  17. package/examples/angular-19-app/public/favicon.ico +0 -0
  18. package/examples/angular-19-app/src/app/app.config.ts +13 -0
  19. package/examples/angular-19-app/src/app/app.css +37 -0
  20. package/examples/angular-19-app/src/app/app.html +25 -0
  21. package/examples/angular-19-app/src/app/app.routes.ts +3 -0
  22. package/examples/angular-19-app/src/app/app.spec.ts +23 -0
  23. package/examples/angular-19-app/src/app/app.ts +12 -0
  24. package/examples/angular-19-app/src/app/button/button.component.ts +25 -0
  25. package/examples/angular-19-app/src/app/card/card.component.ts +33 -0
  26. package/examples/angular-19-app/src/app/header/header.component.ts +31 -0
  27. package/examples/angular-19-app/src/app/popover/popover.component.ts +133 -0
  28. package/examples/angular-19-app/src/index.html +13 -0
  29. package/examples/angular-19-app/src/main.ts +6 -0
  30. package/examples/angular-19-app/src/styles.css +1 -0
  31. package/examples/angular-19-app/tsconfig.app.json +15 -0
  32. package/examples/angular-19-app/tsconfig.json +33 -0
  33. package/examples/angular-19-app/tsconfig.spec.json +15 -0
  34. package/package.json +22 -0
  35. package/packages/angular-grab/builders.json +14 -0
  36. package/packages/angular-grab/package.json +96 -0
  37. package/packages/angular-grab/src/angular/__tests__/context-builder.test.ts +216 -0
  38. package/packages/angular-grab/src/angular/angular-grab.service.ts +62 -0
  39. package/packages/angular-grab/src/angular/index.ts +13 -0
  40. package/packages/angular-grab/src/angular/provide-angular-grab.ts +22 -0
  41. package/packages/angular-grab/src/angular/resolvers/component-resolver.ts +71 -0
  42. package/packages/angular-grab/src/angular/resolvers/context-builder.ts +86 -0
  43. package/packages/angular-grab/src/angular/resolvers/ng-utils.ts +14 -0
  44. package/packages/angular-grab/src/angular/resolvers/source-resolver.ts +61 -0
  45. package/packages/angular-grab/src/builder/__tests__/builder.test.ts +72 -0
  46. package/packages/angular-grab/src/builder/builders/application/index.ts +13 -0
  47. package/packages/angular-grab/src/builder/builders/application/schema.json +7 -0
  48. package/packages/angular-grab/src/builder/builders/dev-server/index.ts +9 -0
  49. package/packages/angular-grab/src/builder/builders/dev-server/schema.json +7 -0
  50. package/packages/angular-grab/src/builder/index.ts +3 -0
  51. package/packages/angular-grab/src/cli/__tests__/cli.test.ts +239 -0
  52. package/packages/angular-grab/src/cli/commands/init.ts +106 -0
  53. package/packages/angular-grab/src/cli/index.ts +15 -0
  54. package/packages/angular-grab/src/cli/utils/detect-project.ts +78 -0
  55. package/packages/angular-grab/src/cli/utils/modify-angular-json.ts +42 -0
  56. package/packages/angular-grab/src/cli/utils/modify-app-config.ts +42 -0
  57. package/packages/angular-grab/src/core/__tests__/generate-snippet.test.ts +149 -0
  58. package/packages/angular-grab/src/core/__tests__/plugin-registry.test.ts +286 -0
  59. package/packages/angular-grab/src/core/__tests__/store.test.ts +118 -0
  60. package/packages/angular-grab/src/core/__tests__/utils.test.ts +85 -0
  61. package/packages/angular-grab/src/core/clipboard/copy.ts +104 -0
  62. package/packages/angular-grab/src/core/clipboard/generate-snippet.ts +38 -0
  63. package/packages/angular-grab/src/core/constants.ts +10 -0
  64. package/packages/angular-grab/src/core/grab.ts +596 -0
  65. package/packages/angular-grab/src/core/index.global.ts +13 -0
  66. package/packages/angular-grab/src/core/index.ts +19 -0
  67. package/packages/angular-grab/src/core/keyboard/keyboard-handler.ts +163 -0
  68. package/packages/angular-grab/src/core/overlay/crosshair.ts +107 -0
  69. package/packages/angular-grab/src/core/overlay/freeze-overlay.ts +239 -0
  70. package/packages/angular-grab/src/core/overlay/overlay-renderer.ts +180 -0
  71. package/packages/angular-grab/src/core/overlay/select-feedback.ts +108 -0
  72. package/packages/angular-grab/src/core/overlay/toast.ts +175 -0
  73. package/packages/angular-grab/src/core/picker/element-picker.ts +114 -0
  74. package/packages/angular-grab/src/core/plugins/plugin-registry.ts +83 -0
  75. package/packages/angular-grab/src/core/store.ts +52 -0
  76. package/packages/angular-grab/src/core/toolbar/actions-menu.ts +178 -0
  77. package/packages/angular-grab/src/core/toolbar/comment-popover.ts +235 -0
  78. package/packages/angular-grab/src/core/toolbar/copy-actions.ts +98 -0
  79. package/packages/angular-grab/src/core/toolbar/history-popover.ts +245 -0
  80. package/packages/angular-grab/src/core/toolbar/theme-manager.ts +188 -0
  81. package/packages/angular-grab/src/core/toolbar/toolbar-icons.ts +29 -0
  82. package/packages/angular-grab/src/core/toolbar/toolbar-renderer.ts +239 -0
  83. package/packages/angular-grab/src/core/types.ts +139 -0
  84. package/packages/angular-grab/src/core/utils.ts +16 -0
  85. package/packages/angular-grab/src/esbuild-plugin/__tests__/transform.test.ts +174 -0
  86. package/packages/angular-grab/src/esbuild-plugin/index.ts +3 -0
  87. package/packages/angular-grab/src/esbuild-plugin/plugin.ts +29 -0
  88. package/packages/angular-grab/src/esbuild-plugin/scan.ts +105 -0
  89. package/packages/angular-grab/src/esbuild-plugin/transform.ts +152 -0
  90. package/packages/angular-grab/src/vite-plugin/__tests__/plugin.test.ts +84 -0
  91. package/packages/angular-grab/src/vite-plugin/index.ts +19 -0
  92. package/packages/angular-grab/src/webpack-plugin/__tests__/plugin.test.ts +72 -0
  93. package/packages/angular-grab/src/webpack-plugin/index.ts +2 -0
  94. package/packages/angular-grab/src/webpack-plugin/loader.ts +15 -0
  95. package/packages/angular-grab/src/webpack-plugin/plugin.ts +20 -0
  96. package/packages/angular-grab/tsconfig.json +15 -0
  97. package/packages/angular-grab/tsup.config.ts +119 -0
  98. package/pnpm-workspace.yaml +3 -0
  99. package/turbo.json +21 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "declaration": true,
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "outDir": "dist",
11
+ "rootDir": "src",
12
+ "lib": ["ES2022", "DOM", "DOM.Iterable"]
13
+ },
14
+ "include": ["src"]
15
+ }
@@ -0,0 +1,119 @@
1
+ import { defineConfig } from 'tsup';
2
+ import { copyFileSync, mkdirSync, writeFileSync } from 'fs';
3
+ import { resolve } from 'path';
4
+
5
+ export default defineConfig([
6
+ // 1. Core: ESM + CJS + types
7
+ {
8
+ entry: { 'core/index': 'src/core/index.ts' },
9
+ format: ['esm', 'cjs'],
10
+ dts: true,
11
+ clean: true,
12
+ sourcemap: true,
13
+ outDir: 'dist',
14
+ },
15
+ // 2. Core IIFE: browser global
16
+ {
17
+ entry: { 'core/index': 'src/core/index.global.ts' },
18
+ format: ['iife'],
19
+ globalName: 'AngularGrab',
20
+ outDir: 'dist',
21
+ clean: false,
22
+ minify: true,
23
+ },
24
+ // 3. Angular: ESM + types
25
+ {
26
+ entry: { 'angular/index': 'src/angular/index.ts' },
27
+ format: ['esm'],
28
+ dts: true,
29
+ clean: false,
30
+ sourcemap: true,
31
+ outDir: 'dist',
32
+ external: ['@angular/core'],
33
+ },
34
+ // 4. Esbuild plugin: ESM + CJS + types
35
+ {
36
+ entry: { 'esbuild-plugin/index': 'src/esbuild-plugin/index.ts' },
37
+ format: ['esm', 'cjs'],
38
+ dts: true,
39
+ clean: false,
40
+ sourcemap: true,
41
+ outDir: 'dist',
42
+ external: ['esbuild', 'typescript'],
43
+ },
44
+ // 5. Vite plugin: ESM + types
45
+ {
46
+ entry: { 'vite-plugin/index': 'src/vite-plugin/index.ts' },
47
+ format: ['esm'],
48
+ dts: true,
49
+ clean: false,
50
+ sourcemap: true,
51
+ outDir: 'dist',
52
+ external: ['vite'],
53
+ },
54
+ // 6. Webpack plugin + loader: ESM + CJS + types
55
+ {
56
+ entry: {
57
+ 'webpack-plugin/index': 'src/webpack-plugin/index.ts',
58
+ 'webpack-plugin/loader': 'src/webpack-plugin/loader.ts',
59
+ },
60
+ format: ['esm', 'cjs'],
61
+ dts: true,
62
+ clean: false,
63
+ sourcemap: true,
64
+ outDir: 'dist',
65
+ shims: true,
66
+ external: ['webpack'],
67
+ },
68
+ // 7. Builder: CJS only (Angular CLI requirement)
69
+ // Angular CLI uses require() to load builders. Since the root package is
70
+ // "type": "module", we force .js output and write a nested package.json
71
+ // with "type": "commonjs" so Node treats these .js files as CJS.
72
+ {
73
+ entry: {
74
+ 'builder/index': 'src/builder/index.ts',
75
+ 'builder/builders/application/index': 'src/builder/builders/application/index.ts',
76
+ 'builder/builders/dev-server/index': 'src/builder/builders/dev-server/index.ts',
77
+ },
78
+ format: ['cjs'],
79
+ dts: false,
80
+ clean: false,
81
+ sourcemap: true,
82
+ outDir: 'dist',
83
+ outExtension: () => ({ js: '.js' }),
84
+ external: ['@angular/build', '@angular-devkit/architect'],
85
+ onSuccess: async () => {
86
+ const distBuilder = resolve('dist', 'builder');
87
+ mkdirSync(distBuilder, { recursive: true });
88
+
89
+ // Mark dist/builder/ as CommonJS so .js files are loaded via require()
90
+ writeFileSync(
91
+ resolve(distBuilder, 'package.json'),
92
+ JSON.stringify({ type: 'commonjs' }) + '\n',
93
+ );
94
+
95
+ // Copy schema.json files to dist
96
+ const distApp = resolve(distBuilder, 'builders', 'application');
97
+ const distDev = resolve(distBuilder, 'builders', 'dev-server');
98
+ mkdirSync(distApp, { recursive: true });
99
+ mkdirSync(distDev, { recursive: true });
100
+ copyFileSync(
101
+ resolve('src', 'builder', 'builders', 'application', 'schema.json'),
102
+ resolve(distApp, 'schema.json'),
103
+ );
104
+ copyFileSync(
105
+ resolve('src', 'builder', 'builders', 'dev-server', 'schema.json'),
106
+ resolve(distDev, 'schema.json'),
107
+ );
108
+ },
109
+ },
110
+ // 8. CLI: ESM with shebang
111
+ {
112
+ entry: { 'cli/index': 'src/cli/index.ts' },
113
+ format: ['esm'],
114
+ clean: false,
115
+ sourcemap: true,
116
+ outDir: 'dist',
117
+ banner: { js: '#!/usr/bin/env node' },
118
+ },
119
+ ]);
@@ -0,0 +1,3 @@
1
+ packages:
2
+ - "packages/*"
3
+ - "examples/*"
package/turbo.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://turbo.build/schema.json",
3
+ "tasks": {
4
+ "build": {
5
+ "dependsOn": ["^build"],
6
+ "outputs": ["dist/**"]
7
+ },
8
+ "dev": {
9
+ "dependsOn": ["^build"],
10
+ "cache": false,
11
+ "persistent": true
12
+ },
13
+ "test": {
14
+ "dependsOn": ["build"]
15
+ },
16
+ "lint": {},
17
+ "clean": {
18
+ "cache": false
19
+ }
20
+ }
21
+ }