@design-edito/cli 0.0.57

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 (28) hide show
  1. package/cli/assets/list.txt +2 -0
  2. package/cli/assets/version.txt +1 -0
  3. package/cli/index.js +4 -0
  4. package/make-template/assets/html/icons/about.txt +6 -0
  5. package/make-template/assets/html/icons/android-chrome-192x192.png +0 -0
  6. package/make-template/assets/html/icons/android-chrome-512x512.png +0 -0
  7. package/make-template/assets/html/icons/apple-touch-icon.png +0 -0
  8. package/make-template/assets/html/icons/favicon-16x16.png +0 -0
  9. package/make-template/assets/html/icons/favicon-32x32.png +0 -0
  10. package/make-template/assets/html/icons/favicon.ico +0 -0
  11. package/make-template/assets/html/icons/site.webmanifest +1 -0
  12. package/make-template/assets/html/index.html +20 -0
  13. package/make-template/assets/react/gitignore +259 -0
  14. package/make-template/assets/react/package.json +30 -0
  15. package/make-template/assets/react/pages/icons/about.txt +6 -0
  16. package/make-template/assets/react/pages/icons/android-chrome-192x192.png +0 -0
  17. package/make-template/assets/react/pages/icons/android-chrome-512x512.png +0 -0
  18. package/make-template/assets/react/pages/icons/apple-touch-icon.png +0 -0
  19. package/make-template/assets/react/pages/icons/favicon-16x16.png +0 -0
  20. package/make-template/assets/react/pages/icons/favicon-32x32.png +0 -0
  21. package/make-template/assets/react/pages/icons/favicon.ico +0 -0
  22. package/make-template/assets/react/pages/icons/site.webmanifest +1 -0
  23. package/make-template/assets/react/pages/index.html +18 -0
  24. package/make-template/assets/react/src/components/App/index.tsx +3 -0
  25. package/make-template/assets/react/src/index.tsx +5 -0
  26. package/make-template/assets/react/src/tsconfig.json +19 -0
  27. package/make-template/index.js +3 -0
  28. package/package.json +33 -0
@@ -0,0 +1,2 @@
1
+ cli
2
+ make-template
@@ -0,0 +1 @@
1
+ 0.0.57
package/cli/index.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import m from"node:process";import{promises as l}from"node:fs";import f from"node:url";import r from"node:path";import{spawn as g}from"node:child_process";import{program as t}from"commander";var h=f.fileURLToPath(import.meta.url),a=r.dirname(h);t.name("@design-edito/cli").description("The home of @design-edito/cli's project");t.command("list").description("list all the available commands").action(j);t.command("version").description("print current version of the package").action(v);var w=await c();w.forEach(n=>{t.command(n,{hidden:!0}).allowUnknownOption(!0).action(async(...i)=>{let[o,e,s,...d]=m.argv;if(s===void 0)return t.help();if(!(await c()).includes(s))return t.help();let p=r.join(a,"../",s,"index.js");g(p,d,{stdio:"inherit"}).on("error",u=>console.error(`Failed to start subprogram '${s}':`,u))})});t.parse(m.argv);async function c(){let n=r.join(a,"assets/list.txt");return(await l.readFile(n,{encoding:"utf-8"})).split(`
3
+ `).map(o=>o.trim())}async function j(){let i=(await c()).map(o=>{let e=Object.assign(new Array(24).fill(" "),o.split("")).join("");return o==="cli"?`${e} # npx @design-edito/cli help`:`${e} # npx @design-edito/cli ${o} help`}).join(`
4
+ `);console.log(i)}async function v(){let n=r.join(a,"assets/version.txt"),i=await l.readFile(n,{encoding:"utf-8"});console.log(i)}
@@ -0,0 +1,6 @@
1
+ This favicon was generated using the following font:
2
+
3
+ - Font Title: Reddit Mono
4
+ - Font Author: Copyright (c) 2020-2023, Reddit, Inc. (https://github.com/reddit/redditsans)
5
+ - Font Source: https://fonts.gstatic.com/s/redditmono/v1/oPWc_kRmmu4oQ88oo13o48DHbsqn28eR20vUwCYacnnYz7yQYA.ttf
6
+ - Font License: SIL Open Font License, 1.1 (http://scripts.sil.org/OFL))
@@ -0,0 +1 @@
1
+ {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self';">
7
+ <meta name="author" content="[AUTHOR]">
8
+ <meta name="description" content="[DESCRIPTION]">
9
+ <meta name="keywords" content="[KEYWORDS]">
10
+ <title>[TITLE]</title>
11
+ <link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png">
12
+ <link rel="icon" type="image/png" sizes="32x32" href="./icons/favicon-32x32.png">
13
+ <link rel="icon" type="image/png" sizes="16x16" href="./icons/favicon-16x16.png">
14
+ <link rel="manifest" href="./icons/site.webmanifest">
15
+ <link rel="stylesheet" href="./styles/index.css">
16
+ <script type="module" src="./scripts/index.js"></script>
17
+ </head>
18
+ <body>
19
+ </body>
20
+ </html>
@@ -0,0 +1,259 @@
1
+ dist
2
+
3
+ # Created by https://www.toptal.com/developers/gitignore/api/react,nextjs,node,windows,osx,linux
4
+ # Edit at https://www.toptal.com/developers/gitignore?templates=react,nextjs,node,windows,osx,linux
5
+
6
+ ### Linux ###
7
+ *~
8
+
9
+ # temporary files which can be created if a process still has a handle open of a deleted file
10
+ .fuse_hidden*
11
+
12
+ # KDE directory preferences
13
+ .directory
14
+
15
+ # Linux trash folder which might appear on any partition or disk
16
+ .Trash-*
17
+
18
+ # .nfs files are created when an open file is removed but is still being accessed
19
+ .nfs*
20
+
21
+ ### NextJS ###
22
+ # dependencies
23
+ /node_modules
24
+ /.pnp
25
+ .pnp.js
26
+
27
+ # testing
28
+ /coverage
29
+
30
+ # next.js
31
+ /.next/
32
+ /out/
33
+
34
+ # production
35
+ /build
36
+
37
+ # misc
38
+ .DS_Store
39
+ *.pem
40
+
41
+ # debug
42
+ npm-debug.log*
43
+ yarn-debug.log*
44
+ yarn-error.log*
45
+ .pnpm-debug.log*
46
+
47
+ # local env files
48
+ .env*.local
49
+
50
+ # vercel
51
+ .vercel
52
+
53
+ # typescript
54
+ *.tsbuildinfo
55
+ next-env.d.ts
56
+
57
+ ### Node ###
58
+ # Logs
59
+ logs
60
+ *.log
61
+ lerna-debug.log*
62
+
63
+ # Diagnostic reports (https://nodejs.org/api/report.html)
64
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
65
+
66
+ # Runtime data
67
+ pids
68
+ *.pid
69
+ *.seed
70
+ *.pid.lock
71
+
72
+ # Directory for instrumented libs generated by jscoverage/JSCover
73
+ lib-cov
74
+
75
+ # Coverage directory used by tools like istanbul
76
+ coverage
77
+ *.lcov
78
+
79
+ # nyc test coverage
80
+ .nyc_output
81
+
82
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
83
+ .grunt
84
+
85
+ # Bower dependency directory (https://bower.io/)
86
+ bower_components
87
+
88
+ # node-waf configuration
89
+ .lock-wscript
90
+
91
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
92
+ build/Release
93
+
94
+ # Dependency directories
95
+ node_modules/
96
+ jspm_packages/
97
+
98
+ # Snowpack dependency directory (https://snowpack.dev/)
99
+ web_modules/
100
+
101
+ # TypeScript cache
102
+
103
+ # Optional npm cache directory
104
+ .npm
105
+
106
+ # Optional eslint cache
107
+ .eslintcache
108
+
109
+ # Optional stylelint cache
110
+ .stylelintcache
111
+
112
+ # Microbundle cache
113
+ .rpt2_cache/
114
+ .rts2_cache_cjs/
115
+ .rts2_cache_es/
116
+ .rts2_cache_umd/
117
+
118
+ # Optional REPL history
119
+ .node_repl_history
120
+
121
+ # Output of 'npm pack'
122
+ *.tgz
123
+
124
+ # Yarn Integrity file
125
+ .yarn-integrity
126
+
127
+ # dotenv environment variable files
128
+ .env
129
+ .env.development.local
130
+ .env.test.local
131
+ .env.production.local
132
+ .env.local
133
+
134
+ # parcel-bundler cache (https://parceljs.org/)
135
+ .cache
136
+ .parcel-cache
137
+
138
+ # Next.js build output
139
+ .next
140
+ out
141
+
142
+ # Nuxt.js build / generate output
143
+ .nuxt
144
+ dist
145
+
146
+ # Gatsby files
147
+ .cache/
148
+ # Comment in the public line in if your project uses Gatsby and not Next.js
149
+ # https://nextjs.org/blog/next-9-1#public-directory-support
150
+ # public
151
+
152
+ # vuepress build output
153
+ .vuepress/dist
154
+
155
+ # vuepress v2.x temp and cache directory
156
+ .temp
157
+
158
+ # Docusaurus cache and generated files
159
+ .docusaurus
160
+
161
+ # Serverless directories
162
+ .serverless/
163
+
164
+ # FuseBox cache
165
+ .fusebox/
166
+
167
+ # DynamoDB Local files
168
+ .dynamodb/
169
+
170
+ # TernJS port file
171
+ .tern-port
172
+
173
+ # Stores VSCode versions used for testing VSCode extensions
174
+ .vscode-test
175
+
176
+ # yarn v2
177
+ .yarn/cache
178
+ .yarn/unplugged
179
+ .yarn/build-state.yml
180
+ .yarn/install-state.gz
181
+ .pnp.*
182
+
183
+ ### Node Patch ###
184
+ # Serverless Webpack directories
185
+ .webpack/
186
+
187
+ # Optional stylelint cache
188
+
189
+ # SvelteKit build / generate output
190
+ .svelte-kit
191
+
192
+ ### OSX ###
193
+ # General
194
+ .AppleDouble
195
+ .LSOverride
196
+
197
+ # Icon must end with two \r
198
+ Icon
199
+
200
+
201
+ # Thumbnails
202
+ ._*
203
+
204
+ # Files that might appear in the root of a volume
205
+ .DocumentRevisions-V100
206
+ .fseventsd
207
+ .Spotlight-V100
208
+ .TemporaryItems
209
+ .Trashes
210
+ .VolumeIcon.icns
211
+ .com.apple.timemachine.donotpresent
212
+
213
+ # Directories potentially created on remote AFP share
214
+ .AppleDB
215
+ .AppleDesktop
216
+ Network Trash Folder
217
+ Temporary Items
218
+ .apdisk
219
+
220
+ ### react ###
221
+ .DS_*
222
+ **/*.backup.*
223
+ **/*.back.*
224
+
225
+ node_modules
226
+
227
+ *.sublime*
228
+
229
+ psd
230
+ thumb
231
+ sketch
232
+
233
+ ### Windows ###
234
+ # Windows thumbnail cache files
235
+ Thumbs.db
236
+ Thumbs.db:encryptable
237
+ ehthumbs.db
238
+ ehthumbs_vista.db
239
+
240
+ # Dump file
241
+ *.stackdump
242
+
243
+ # Folder config file
244
+ [Dd]esktop.ini
245
+
246
+ # Recycle Bin used on file shares
247
+ $RECYCLE.BIN/
248
+
249
+ # Windows Installer files
250
+ *.cab
251
+ *.msi
252
+ *.msix
253
+ *.msm
254
+ *.msp
255
+
256
+ # Windows shortcuts
257
+ *.lnk
258
+
259
+ # End of https://www.toptal.com/developers/gitignore/api/react,nextjs,node,windows,osx,linux
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "-",
3
+ "version": "0.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "build:src": "npx esbuild src/index.tsx --bundle --minify --outfile=dist/index.js --platform=browser --target=esnext --jsx-factory=React.createElement --jsx-fragment=React.Fragment",
8
+ "watch:src": "npm run build:src -- --watch",
9
+ "make:dist": "mkdir -p dist",
10
+ "make:pages": "mkdir -p pages",
11
+ "serve:dist": "npm run make:dist && npx http-server dist --port ${PORT} --cors -c-1",
12
+ "serve:pages": "npm run make:pages && npx http-server pages --port ${PORT} --cors -c-1",
13
+ "start": "npx concurrently -n 'watch:src ,serve:dist ,serve:pages' 'npm run watch:src' 'PORT=${PORT_DIST:-3001} npm run serve:dist' 'PORT=${PORT_DIST:-3000} npm run serve:pages'"
14
+ },
15
+ "author": "",
16
+ "license": "ISC",
17
+ "devDependencies": {
18
+ "@types/node": "^20.11.30",
19
+ "@types/react": "^18.2.72",
20
+ "concurrently": "^8.2.2",
21
+ "esbuild": "^0.20.2",
22
+ "http-server": "^14.1.1",
23
+ "typescript": "^5.4.3"
24
+ },
25
+ "dependencies": {
26
+ "@types/react-dom": "^18.2.22",
27
+ "react": "^18.2.0",
28
+ "react-dom": "^18.2.0"
29
+ }
30
+ }
@@ -0,0 +1,6 @@
1
+ This favicon was generated using the following font:
2
+
3
+ - Font Title: Reddit Mono
4
+ - Font Author: Copyright (c) 2020-2023, Reddit, Inc. (https://github.com/reddit/redditsans)
5
+ - Font Source: https://fonts.gstatic.com/s/redditmono/v1/oPWc_kRmmu4oQ88oo13o48DHbsqn28eR20vUwCYacnnYz7yQYA.ttf
6
+ - Font License: SIL Open Font License, 1.1 (http://scripts.sil.org/OFL))
@@ -0,0 +1 @@
1
+ {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="description" content="PAGE DESCRIPTION">
7
+ <meta author="AUTHOR">
8
+ <title>TITLE</title>
9
+ <link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png">
10
+ <link rel="icon" type="image/png" sizes="32x32" href="./icons/favicon-32x32.png">
11
+ <link rel="icon" type="image/png" sizes="16x16" href="./icons/favicon-16x16.png">
12
+ <link rel="manifest" href="./icons/site.webmanifest">
13
+ <script type="module" src="http://localhost:3001/index.js"></script>
14
+ </head>
15
+ <body>
16
+ <div class="root"></div>
17
+ </body>
18
+ </html>
@@ -0,0 +1,3 @@
1
+ export default function App () {
2
+ return <div>App.</div>
3
+ }
@@ -0,0 +1,5 @@
1
+ import { render } from 'react-dom'
2
+ import App from './components/App'
3
+
4
+ const target = document.querySelector('.root')
5
+ if (target !== null) render(<App />, target)
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
5
+ "skipLibCheck": true,
6
+ "esModuleInterop": true,
7
+ "allowSyntheticDefaultImports": true,
8
+ "noUncheckedIndexedAccess": true,
9
+ "strict": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "module": "esnext",
12
+ "moduleResolution": "node",
13
+ "resolveJsonModule": true,
14
+ "isolatedModules": true,
15
+ "noEmit": true,
16
+ "jsx": "react-jsx"
17
+ },
18
+ "include": ["./"]
19
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import p from"node:process";import{promises as c,existsSync as h}from"node:fs";import y from"node:url";import e from"node:path";import{spawn as P}from"node:child_process";import{program as l}from"commander";import k from"prompts";import{promises as u}from"node:fs";async function g(t,o,...a){let[s,m]=a,n=await u.readFile(t,s),r=o(n),i=a.length===2?m:s;return await u.writeFile(t,r,i),r}var x=y.fileURLToPath(import.meta.url),j=e.dirname(x),f=p.cwd();l.name("@design-edito/make-template").description("Generate in cwd a project template");l.command("html").description("make simple html project structure").action(S);l.command("react").description("make react + typescript project structure").action(N);l.parse(p.argv);async function S(){let t=e.join(j,"assets/html");if(!h(t))return console.error(`Could not find the template to copy at ${t}`),p.exit(1);let o=e.join(f,"html-template");await c.cp(t,o,{recursive:!0})}async function N(){let t=e.join(j,"assets/react");if(!h(t))return console.error(`Could not find the template to copy at ${t}`),p.exit(1);let o=e.join(f,"react-template");await c.cp(t,o,{recursive:!0});let{projectName:a}=await k({name:"projectName",message:"Project name ? (for package.json name field)",type:"text"}),s=e.join(o,"package.json");await g(s,r=>{let i=typeof r=="string"?r:r.toString(),d=JSON.parse(i);delete d.name;let w={name:a,...d};return`${JSON.stringify(w,null,2)}
3
+ `},{encoding:"utf-8"});let m=P(`cd ${o} && npm i`,{stdio:"inherit",shell:!0});await new Promise((r,i)=>{m.on("exit",()=>r(!0)),m.on("error",()=>i(!1))});let n=e.join(f,a);await c.rename(o,n),await c.rename(e.join(n,"gitignore"),e.join(n,".gitignore"))}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@design-edito/cli",
3
+ "version": "0.0.57",
4
+ "description": "",
5
+ "author": "Maxime Fabas",
6
+ "license": "ISC",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/lm-design-edito/lm-cli"
10
+ },
11
+ "type": "module",
12
+ "main": "index.js",
13
+ "module": "index.js",
14
+ "bin": {
15
+ "cli": "./cli/index.js",
16
+ "make-template": "./make-template/index.js"
17
+ },
18
+ "dependencies": {
19
+ "commander": "^12.0.0",
20
+ "prompts": "^2.4.2"
21
+ },
22
+ "devDependencies": {
23
+ "@commander-js/extra-typings": "^12.0.1",
24
+ "@design-edito/tools": "^0.0.19",
25
+ "@types/node": "^20.11.30",
26
+ "@types/prompts": "^2.4.9",
27
+ "@types/semver": "^7.5.8",
28
+ "esbuild": "^0.20.2",
29
+ "semver": "^7.6.0",
30
+ "simple-git": "^3.23.0",
31
+ "typescript": "^5.4.3"
32
+ }
33
+ }