create-harper 0.0.2 → 0.0.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 (71) hide show
  1. package/README.md +5 -0
  2. package/index.js +37 -214
  3. package/lib/constants/renameFiles.js +1 -0
  4. package/lib/fs/applyAndWriteTemplateFile.js +5 -5
  5. package/lib/fs/crawlTemplateDir.js +3 -3
  6. package/lib/pkg/toValidPackageName.js +2 -1
  7. package/lib/steps/getEnvVars.js +79 -0
  8. package/lib/steps/getImmediate.js +29 -0
  9. package/lib/steps/getPackageName.js +38 -0
  10. package/lib/steps/getProjectName.js +40 -0
  11. package/lib/steps/getTemplate.js +65 -0
  12. package/lib/steps/handleExistingDir.js +61 -0
  13. package/lib/steps/scaffoldProject.js +40 -0
  14. package/lib/steps/showOutro.js +30 -0
  15. package/package.json +12 -8
  16. package/template-barebones/README.md +1 -1
  17. package/template-barebones/_env +3 -0
  18. package/template-barebones/_env.example +3 -0
  19. package/template-barebones/package.json +1 -1
  20. package/template-react/README.md +1 -1
  21. package/template-react/_aiignore +1 -0
  22. package/template-react/_env +3 -0
  23. package/template-react/_env.example +3 -0
  24. package/template-react/_github/workflow/deploy.yaml +1 -1
  25. package/template-react/_gitignore +147 -0
  26. package/template-react/graphql.config.yml +3 -0
  27. package/template-react/index.html +1 -1
  28. package/template-react/package.json +5 -4
  29. package/template-react-ts/README.md +1 -1
  30. package/template-react-ts/_aiignore +1 -0
  31. package/template-react-ts/_env +3 -0
  32. package/template-react-ts/_env.example +3 -0
  33. package/template-react-ts/_github/workflow/deploy.yaml +1 -1
  34. package/template-react-ts/_gitignore +147 -0
  35. package/template-react-ts/graphql.config.yml +3 -0
  36. package/template-react-ts/index.html +1 -1
  37. package/template-react-ts/package.json +5 -4
  38. package/template-studio/README.md +1 -1
  39. package/template-studio/_aiignore +1 -0
  40. package/template-studio/_gitignore +147 -0
  41. package/template-studio/graphql.config.yml +3 -0
  42. package/template-studio/package.json +1 -1
  43. package/template-studio/web/index.html +2 -2
  44. package/template-studio-ts/README.md +1 -1
  45. package/template-studio-ts/_aiignore +1 -0
  46. package/template-studio-ts/_gitignore +147 -0
  47. package/template-studio-ts/graphql.config.yml +3 -0
  48. package/template-studio-ts/package.json +1 -1
  49. package/template-studio-ts/web/index.html +2 -2
  50. package/template-vanilla/README.md +1 -1
  51. package/template-vanilla/_aiignore +1 -0
  52. package/template-vanilla/_env +3 -0
  53. package/template-vanilla/_env.example +3 -0
  54. package/template-vanilla/_gitignore +147 -0
  55. package/template-vanilla/graphql.config.yml +3 -0
  56. package/template-vanilla/package.json +1 -1
  57. package/template-vanilla/web/index.html +2 -2
  58. package/template-vanilla-ts/README.md +1 -1
  59. package/template-vanilla-ts/_aiignore +1 -0
  60. package/template-vanilla-ts/_env +3 -0
  61. package/template-vanilla-ts/_env.example +3 -0
  62. package/template-vanilla-ts/_gitignore +147 -0
  63. package/template-vanilla-ts/graphql.config.yml +3 -0
  64. package/template-vanilla-ts/package.json +1 -1
  65. package/template-vanilla-ts/web/index.html +2 -2
  66. package/lib/fs/editFile.js +0 -6
  67. package/lib/pkg/getFullCustomCommand.js +0 -47
  68. package/template-shared/_env.example +0 -3
  69. /package/{template-shared → template-barebones}/_aiignore +0 -0
  70. /package/{template-shared → template-barebones}/_gitignore +0 -0
  71. /package/{template-shared → template-barebones}/graphql.config.yml +0 -0
@@ -0,0 +1,147 @@
1
+ .DS_Store
2
+
3
+ #
4
+ # https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Node.gitignore
5
+ #
6
+
7
+ # Logs
8
+ logs
9
+ *.log
10
+ npm-debug.log*
11
+ yarn-debug.log*
12
+ yarn-error.log*
13
+ lerna-debug.log*
14
+
15
+ # Diagnostic reports (https://nodejs.org/api/report.html)
16
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
17
+
18
+ # Runtime data
19
+ pids
20
+ *.pid
21
+ *.seed
22
+ *.pid.lock
23
+
24
+ # Directory for instrumented libs generated by jscoverage/JSCover
25
+ lib-cov
26
+
27
+ # Coverage directory used by tools like istanbul
28
+ coverage
29
+ *.lcov
30
+
31
+ # nyc test coverage
32
+ .nyc_output
33
+
34
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
35
+ .grunt
36
+
37
+ # Bower dependency directory (https://bower.io/)
38
+ bower_components
39
+
40
+ # node-waf configuration
41
+ .lock-wscript
42
+
43
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
44
+ build/Release
45
+
46
+ # Dependency directories
47
+ node_modules/
48
+ jspm_packages/
49
+
50
+ # Snowpack dependency directory (https://snowpack.dev/)
51
+ web_modules/
52
+
53
+ # TypeScript cache
54
+ *.tsbuildinfo
55
+
56
+ # Optional npm cache directory
57
+ .npm
58
+
59
+ # Optional eslint cache
60
+ .eslintcache
61
+
62
+ # Optional stylelint cache
63
+ .stylelintcache
64
+
65
+ # Optional REPL history
66
+ .node_repl_history
67
+
68
+ # Output of 'npm pack'
69
+ *.tgz
70
+
71
+ # Yarn Integrity file
72
+ .yarn-integrity
73
+
74
+ # dotenv environment variable files
75
+ .env
76
+ .env.*
77
+ !.env.example
78
+
79
+ # parcel-bundler cache (https://parceljs.org/)
80
+ .cache
81
+ .parcel-cache
82
+
83
+ # Next.js build output
84
+ .next
85
+ out
86
+
87
+ # Nuxt.js build / generate output
88
+ .nuxt
89
+ dist
90
+ .output
91
+
92
+ # Gatsby files
93
+ .cache/
94
+ # Comment in the public line in if your project uses Gatsby and not Next.js
95
+ # https://nextjs.org/blog/next-9-1#public-directory-support
96
+ # public
97
+
98
+ # vuepress build output
99
+ .vuepress/dist
100
+
101
+ # vuepress v2.x temp and cache directory
102
+ .temp
103
+ .cache
104
+
105
+ # Sveltekit cache directory
106
+ .svelte-kit/
107
+
108
+ # vitepress build output
109
+ **/.vitepress/dist
110
+
111
+ # vitepress cache directory
112
+ **/.vitepress/cache
113
+
114
+ # Docusaurus cache and generated files
115
+ .docusaurus
116
+
117
+ # Serverless directories
118
+ .serverless/
119
+
120
+ # FuseBox cache
121
+ .fusebox/
122
+
123
+ # DynamoDB Local files
124
+ .dynamodb/
125
+
126
+ # Firebase cache directory
127
+ .firebase/
128
+
129
+ # TernJS port file
130
+ .tern-port
131
+
132
+ # Stores VSCode versions used for testing VSCode extensions
133
+ .vscode-test
134
+
135
+ # yarn v3
136
+ .pnp.*
137
+ .yarn/*
138
+ !.yarn/patches
139
+ !.yarn/plugins
140
+ !.yarn/releases
141
+ !.yarn/sdks
142
+ !.yarn/versions
143
+
144
+ # Vite files
145
+ vite.config.js.timestamp-*
146
+ vite.config.ts.timestamp-*
147
+ .vite/
@@ -0,0 +1,3 @@
1
+ schema: schema.graphql
2
+ include: node_modules/harperdb/schema.graphql
3
+ documents: '**/*.graphql'
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "<<packageName>>",
2
+ "name": "your-package-name-here",
3
3
  "version": "1.0.0",
4
4
  "description": "Your new Harper app",
5
5
  "type": "module",
@@ -3,12 +3,12 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Harper Application Template</title>
6
+ <title>your-project-name-here</title>
7
7
  <link rel="stylesheet" href="styles.css" />
8
8
  </head>
9
9
  <body>
10
10
  <main>
11
- <h1>Harper Application Template</h1>
11
+ <h1>your-project-name-here</h1>
12
12
  <p>
13
13
  This is an example of serving static assets using the built-in
14
14
  <a
@@ -1,6 +0,0 @@
1
- import fs from 'node:fs';
2
-
3
- export function editFile(file, callback) {
4
- const content = fs.readFileSync(file, 'utf-8');
5
- fs.writeFileSync(file, callback(content), 'utf-8');
6
- }
@@ -1,47 +0,0 @@
1
- export function getFullCustomCommand(customCommand, pkgInfo) {
2
- const pkgManager = pkgInfo ? pkgInfo.name : 'npm';
3
- const isYarn1 = pkgManager === 'yarn' && pkgInfo?.version.startsWith('1.');
4
-
5
- return (
6
- customCommand
7
- .replace(/^npm create (?:-- )?/, () => {
8
- // `bun create` uses it's own set of templates,
9
- // the closest alternative is using `bun x` directly on the package
10
- if (pkgManager === 'bun') {
11
- return 'bun x create-';
12
- }
13
- // Deno uses `run -A npm:create-` instead of `create` or `init` to also provide needed perms
14
- if (pkgManager === 'deno') {
15
- return 'deno run -A npm:create-';
16
- }
17
- // pnpm doesn't support the -- syntax
18
- if (pkgManager === 'pnpm') {
19
- return 'pnpm create ';
20
- }
21
- // For other package managers, preserve the original format
22
- return customCommand.startsWith('npm create -- ')
23
- ? `${pkgManager} create -- `
24
- : `${pkgManager} create `;
25
- })
26
- // Only Yarn 1.x doesn't support `@version` in the `create` command
27
- .replace('@latest', () => (isYarn1 ? '' : '@latest'))
28
- .replace(/^npm exec /, () => {
29
- // Prefer `pnpm dlx`, `yarn dlx`, or `bun x`
30
- if (pkgManager === 'pnpm') {
31
- return 'pnpm dlx ';
32
- }
33
- if (pkgManager === 'yarn' && !isYarn1) {
34
- return 'yarn dlx ';
35
- }
36
- if (pkgManager === 'bun') {
37
- return 'bun x ';
38
- }
39
- if (pkgManager === 'deno') {
40
- return 'deno run -A npm:';
41
- }
42
- // Use `npm exec` in all other cases,
43
- // including Yarn 1.x and other custom npm clients.
44
- return 'npm exec ';
45
- })
46
- );
47
- }
@@ -1,3 +0,0 @@
1
- CLI_TARGET_USERNAME='YOUR_CLUSTER_USERNAME'
2
- CLI_TARGET_PASSWORD='YOUR_CLUSER_PASSWORD'
3
- CLI_TARGET='YOUR_FABRIC.HARPER.FAST_CLUSER_URL_HERE'