create-coralite 1.0.0-rc.8 → 1.0.0

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 CHANGED
@@ -39,12 +39,16 @@ pnpm create coralite
39
39
 
40
40
  ### `-t, --template <name>`
41
41
 
42
- - **Purpose**: Select styling template for the scaffolded project.
43
- - **Choices**: `css`, `scss`
42
+ - **Purpose**: Select template for the scaffolded project.
43
+ - **Choices**: `css`, `scss`, `plugin`
44
44
  - **Default**: Empty string → user selection required
45
- - **Usage Example**:
45
+ - **Usage Examples**:
46
46
  ```bash
47
+ # Scaffold a SCSS application
47
48
  npm create coralite -t scss
49
+
50
+ # Scaffold a Coralite plugin package
51
+ npm create coralite -t plugin
48
52
  ```
49
53
 
50
54
  ---
@@ -60,8 +64,8 @@ pnpm create coralite
60
64
  ## Repository & Documentation
61
65
 
62
66
  ### Source Code
63
- - Hosted on [Codeberg](https://codeberg.org), a decentralized Git hosting service.
64
- - Path: [packages/create-coralite](https://codeberg.org/tjdavid/coralite/src/branch/main/packages/create-coralite) within the larger Coralite repository.
67
+ - Hosted on [GitHub](https://github.com/tjdav/coralite).
68
+ - Path: [packages/create-coralite](https://github.com/tjdav/coralite/tree/main/packages/create-coralite) within the larger Coralite repository.
65
69
 
66
70
  ### Official Documentation
67
71
  - Accessible at: [https://coralite.dev/docs/create-coralite](https://coralite.dev/docs/create-coralite)
package/bin/index.js CHANGED
@@ -41,7 +41,8 @@ program
41
41
  .addOption(
42
42
  new Option('-t, --template <name>', 'use a specific template').choices([
43
43
  'css',
44
- 'scss'
44
+ 'scss',
45
+ 'plugin'
45
46
  ]).default('')
46
47
  )
47
48
 
@@ -87,7 +88,7 @@ if (program.args.length > 1) {
87
88
  const positionalTarget = program.args[0] || ''
88
89
  const options = program.opts()
89
90
  const cwd = process.cwd()
90
- const { magenta, cyan } = colours
91
+ const { magenta, cyan, yellow } = colours
91
92
  const TEMPLATES = [
92
93
  {
93
94
  value: 'css',
@@ -98,6 +99,11 @@ const TEMPLATES = [
98
99
  value: 'scss',
99
100
  name: 'SCSS',
100
101
  colour: magenta
102
+ },
103
+ {
104
+ value: 'plugin',
105
+ name: 'Plugin',
106
+ colour: yellow
101
107
  }
102
108
  ]
103
109
  const defaultTarget = 'coralite-project'
@@ -277,7 +283,13 @@ async function createProject () {
277
283
  const files = fs.readdirSync(templateDir)
278
284
 
279
285
  for (const file of files.filter((f) => f !== 'package.json')) {
280
- if (file === 'AGENTS.md' && options.agent === false) {
286
+ if (file === 'AGENTS.md') {
287
+ if (options.agent === false) {
288
+ continue
289
+ }
290
+ const agentsTemplate = fs.readFileSync(path.join(templateDir, 'AGENTS.md'), 'utf-8')
291
+ const agentsContent = agentsTemplate.replace(/\{\{\s*version\s*\}\}/g, pkg.version)
292
+ write('AGENTS.md', agentsContent)
281
293
  continue
282
294
  }
283
295
  if (file === 'README.md') {
@@ -326,7 +338,15 @@ async function createProject () {
326
338
  }`
327
339
  }
328
340
 
329
- if (pkgManager === 'yarn') {
341
+ if (template === 'plugin') {
342
+ if (pkgManager === 'yarn') {
343
+ doneMessage += '\n yarn'
344
+ doneMessage += '\n yarn test'
345
+ } else {
346
+ doneMessage += `\n ${pkgManager} install`
347
+ doneMessage += `\n ${pkgManager} test`
348
+ }
349
+ } else if (pkgManager === 'yarn') {
330
350
  doneMessage += '\n yarn'
331
351
  doneMessage += '\n yarn dev'
332
352
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-coralite",
3
- "version": "1.0.0-rc.8",
3
+ "version": "1.0.0",
4
4
  "description": "Coralite scaffolding script",
5
5
  "bin": {
6
6
  "create-coralite": "bin/index.js",
@@ -24,7 +24,7 @@
24
24
  "type": "module",
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "https://codeberg.org/tjdavid/coralite.git",
27
+ "url": "https://github.com/tjdav/coralite.git",
28
28
  "directory": "packages/create-coralite"
29
29
  },
30
30
  "homepage": "https://coralite.dev/docs/create-coralite",