create-harper 0.0.4 → 0.0.5

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 (58) hide show
  1. package/index.js +21 -20
  2. package/lib/constants/defaultEnv.js +3 -0
  3. package/lib/constants/exampleFiles.js +22 -0
  4. package/lib/constants/frameworks.js +1 -13
  5. package/lib/constants/templates.js +2 -2
  6. package/lib/fs/crawlTemplateDir.js +9 -3
  7. package/lib/steps/getEnvVars.js +57 -6
  8. package/lib/steps/getExamples.js +48 -0
  9. package/lib/steps/getTemplate.js +4 -4
  10. package/lib/steps/helpAgents.js +15 -0
  11. package/lib/steps/scaffoldProject.js +3 -2
  12. package/package.json +1 -2
  13. package/template-react/config.yaml +2 -2
  14. package/template-react/resources/exampleSocket.js +34 -0
  15. package/template-react/resources/exampleTable.js +14 -0
  16. package/template-react/resources/greeting.js +10 -0
  17. package/{template-studio/schema.graphql → template-react/schemas/exampleTable.graphql} +1 -1
  18. package/template-react-ts/config.yaml +2 -2
  19. package/template-react-ts/resources/exampleSocket.ts +41 -0
  20. package/template-react-ts/resources/exampleTable.ts +20 -0
  21. package/template-react-ts/{resources.ts → resources/greeting.ts} +0 -23
  22. package/{template-vanilla/schema.graphql → template-react-ts/schemas/exampleTable.graphql} +1 -1
  23. package/template-studio/config.yaml +2 -2
  24. package/template-studio/resources/exampleSocket.js +34 -0
  25. package/template-studio/resources/exampleTable.js +14 -0
  26. package/template-studio/resources/greeting.js +10 -0
  27. package/{template-vanilla-ts/schema.graphql → template-studio/schemas/exampleTable.graphql} +1 -1
  28. package/template-studio-ts/config.yaml +2 -2
  29. package/template-studio-ts/resources/exampleSocket.ts +41 -0
  30. package/template-studio-ts/resources/exampleTable.ts +20 -0
  31. package/{template-vanilla-ts/resources.ts → template-studio-ts/resources/greeting.ts} +0 -23
  32. package/template-studio-ts/{schema.graphql → schemas/exampleTable.graphql} +1 -1
  33. package/template-vanilla/README.md +1 -1
  34. package/template-vanilla/config.yaml +2 -2
  35. package/template-vanilla/resources/exampleSocket.js +34 -0
  36. package/template-vanilla/resources/exampleTable.js +14 -0
  37. package/template-vanilla/resources/greeting.js +10 -0
  38. package/template-vanilla/schemas/exampleTable.graphql +7 -0
  39. package/template-vanilla-ts/README.md +2 -2
  40. package/template-vanilla-ts/config.yaml +2 -2
  41. package/template-vanilla-ts/resources/exampleSocket.ts +41 -0
  42. package/template-vanilla-ts/resources/exampleTable.ts +20 -0
  43. package/{template-studio-ts/resources.ts → template-vanilla-ts/resources/greeting.ts} +0 -23
  44. package/template-vanilla-ts/schemas/exampleTable.graphql +7 -0
  45. package/template-barebones/README.md +0 -7
  46. package/template-barebones/_aiignore +0 -1
  47. package/template-barebones/_env +0 -3
  48. package/template-barebones/_env.example +0 -3
  49. package/template-barebones/_gitignore +0 -147
  50. package/template-barebones/config.yaml +0 -7
  51. package/template-barebones/graphql.config.yml +0 -3
  52. package/template-barebones/package.json +0 -14
  53. package/template-barebones/schema.graphql +0 -1
  54. package/template-react/resources.js +0 -27
  55. package/template-react/schema.graphql +0 -5
  56. package/template-react-ts/schema.graphql +0 -5
  57. package/template-studio/resources.js +0 -27
  58. package/template-vanilla/resources.js +0 -27
@@ -1,27 +0,0 @@
1
- import { Resource } from 'harperdb';
2
-
3
- /** Here we can define any JavaScript-based resources and extensions to tables
4
- import {tables} from 'harperdb';
5
-
6
- export class MyCustomResource extends tables.TableName {
7
- // we can define our own custom POST handler
8
- post(content) {
9
- // do something with the incoming content;
10
- return super.post(content);
11
- }
12
- // or custom GET handler
13
- get() {
14
- // we can modify this resource before returning
15
- return super.get();
16
- }
17
- }
18
- */
19
- // we can also define a custom resource without a specific table
20
- export class Greeting extends Resource {
21
- // a "Hello, world!" handler
22
- static loadAsInstance = false; // use the updated/newer Resource API
23
-
24
- get() {
25
- return { greeting: 'Hello, world!' };
26
- }
27
- }