coralite-scripts 0.28.6 → 0.29.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/bin/index.js CHANGED
@@ -82,43 +82,21 @@ if (mode === 'dev') {
82
82
 
83
83
  // compile website
84
84
  await coralite.build(async (result) => {
85
- if (result.type === 'component') {
86
- const relativeDir = relative(config.components, result.path.dirname)
87
- let outDir
88
- if (config.standaloneOutput) {
89
- outDir = join(config.output, config.standaloneOutput, relativeDir)
90
- } else {
91
- outDir = join(config.output, 'components', relativeDir)
92
- }
93
- const outFile = join(outDir, result.path.filename)
94
-
95
- await mkdir(outDir, { recursive: true })
96
- await writeFile(outFile, result.content)
85
+ const relativeDir = relative(config.pages, result.path.dirname)
86
+ const outDir = join(config.output, relativeDir)
87
+ const outFile = join(outDir, result.path.filename)
97
88
 
98
- if (options.verbose) {
99
- process.stdout.write(toTime() + colours.bgCyan(' Compiled Component ') + dash + toMS(result.duration) + dash + result.path.pathname + '\n')
100
- } else {
101
- componentCount++
102
- }
89
+ await mkdir(outDir, { recursive: true })
90
+ await writeFile(outFile, result.content)
103
91
 
104
- return outFile
92
+ if (options.verbose) {
93
+ process.stdout.write(toTime() + toMS(result.duration) + dash + result.path.pathname + '\n')
105
94
  } else {
106
- const relativeDir = relative(config.pages, result.path.dirname)
107
- const outDir = join(config.output, relativeDir)
108
- const outFile = join(outDir, result.path.filename)
109
-
110
- await mkdir(outDir, { recursive: true })
111
- await writeFile(outFile, result.content)
112
-
113
- if (options.verbose) {
114
- process.stdout.write(toTime() + toMS(result.duration) + dash + result.path.pathname + '\n')
115
- } else {
116
- pageCount++
117
- spinner.text = `Building pages... (${pageCount} completed)`
118
- }
119
-
120
- return outFile
95
+ pageCount++
96
+ spinner.text = `Building pages... (${pageCount} completed)`
121
97
  }
98
+
99
+ return outFile
122
100
  })
123
101
 
124
102
  if (!options.verbose) {
@@ -1,28 +1,10 @@
1
1
  declare const _default: {};
2
2
  export default _default;
3
- export type CoraliteStaticAsset = {
4
- /**
5
- * - The package name to copy assets from.
6
- */
7
- pkg: string;
8
- /**
9
- * - The path to the asset within the package.
10
- */
11
- path: string;
12
- /**
13
- * - The destination path for the asset in the output directory.
14
- */
15
- dest: string;
16
- };
17
3
  export type CoraliteScriptBaseConfig = {
18
4
  /**
19
5
  * - The path to the directory containing static assets.
20
6
  */
21
7
  public: string;
22
- /**
23
- * - Static assets to copy during build.
24
- */
25
- assets?: CoraliteStaticAsset[];
26
8
  /**
27
9
  * - Server configuration options.
28
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.js"],"names":[],"mappings":";;;;;;SAOc,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;;;YAKN,MAAM;;;;aACN,mBAAmB,EAAE;;;;aAEhC;QAA0B,IAAI,EAAnB,MAAM;KACjB;aACA;QAA2C,IAAI,EAApC,KAAK,GAAG,MAAM,GAAG,MAAM;QACR,KAAK,EAApB,MAAM;KACjB;;;;kBAAW,QAAQ,OAAO,CAAC;;;;iBAChB,OAAO,SAAS,EAAE,cAAc,EAAE;;;;WAClC,YAAY,GAAG,aAAa;;mCAI7B,wBAAwB,GAAG,cAAc;;;;;UAKxC,OAAO;;;;YACP,OAAO;;;;cACP,OAAO;;6BAhCK,MAAM;oCADC,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.js"],"names":[],"mappings":";;;;;;YAOc,MAAM;;;;aAEjB;QAA0B,IAAI,EAAnB,MAAM;KACjB;aACA;QAA2C,IAAI,EAApC,KAAK,GAAG,MAAM,GAAG,MAAM;QACR,KAAK,EAApB,MAAM;KACjB;;;;kBAAW,QAAQ,OAAO,CAAC;;;;iBAChB,OAAO,SAAS,EAAE,cAAc,EAAE;;;;WAClC,YAAY,GAAG,aAAa;;mCAI7B,wBAAwB,GAAG,cAAc;;;;;UAKxC,OAAO;;;;YACP,OAAO;;;;cACP,OAAO;;6BAxBK,MAAM;oCADC,gBAAgB"}
package/libs/server.js CHANGED
@@ -271,25 +271,6 @@ async function server (config, options) {
271
271
  await coralite.pages.setItem(pathname)
272
272
  // build the HTML for this page using the built-in compiler.
273
273
  const documents = await coralite.build(pathname, async (result) => {
274
- if (result.type === 'component') {
275
- const relativeDir = relative(config.components, result.path.dirname)
276
- let outDir
277
- if (config.standaloneOutput) {
278
- outDir = join(config.output, config.standaloneOutput, relativeDir)
279
- } else {
280
- outDir = join(config.output, 'components', relativeDir)
281
- }
282
- const outFile = join(outDir, result.path.filename)
283
-
284
- await mkdir(outDir, { recursive: true })
285
- await writeFile(outFile, result.content)
286
-
287
- if (options.verbose) {
288
- process.stdout.write(toTime() + colours.bgCyan(' Compiled Component ') + colours.gray(' ─ ') + toMS(result.duration) + colours.gray(' ─ ') + result.path.pathname + '\n')
289
- }
290
- return null
291
- }
292
-
293
274
  // inject a script to enable live reload via Server-Sent Events
294
275
  const injectedHtml = result.content.replace(/<\/body>/i, rebuildScript)
295
276
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coralite-scripts",
3
- "version": "0.28.6",
3
+ "version": "0.29.0",
4
4
  "description": "Configuration and scripts for Create Coralite.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,7 +58,7 @@
58
58
  "portfinder": "^1.0.38",
59
59
  "postcss": "^8.5.6",
60
60
  "sass": "^1.91.0",
61
- "coralite": "0.28.4"
61
+ "coralite": "0.29.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "premove dist && pnpm build-types",
package/types/index.js CHANGED
@@ -3,17 +3,9 @@
3
3
  * @import {Options} from 'sass'
4
4
  */
5
5
 
6
- /**
7
- * @typedef {Object} CoraliteStaticAsset
8
- * @property {string} pkg - The package name to copy assets from.
9
- * @property {string} path - The path to the asset within the package.
10
- * @property {string} dest - The destination path for the asset in the output directory.
11
- */
12
-
13
6
  /**
14
7
  * @typedef {Object} CoraliteScriptBaseConfig
15
8
  * @property {string} public - The path to the directory containing static assets.
16
- * @property {CoraliteStaticAsset[]} [assets] - Static assets to copy during build.
17
9
  * @property {Object} [server] - Server configuration options.
18
10
  * @property {number} server.port - The port number on which the development server will run.
19
11
  * @property {Object} [styles]