Skip to content

Commit

Permalink
Merge pull request #85 from jajaperson/master
Browse files Browse the repository at this point in the history
Rename version to VERSION
  • Loading branch information
ije authored Jan 13, 2021
2 parents f2c8cd9 + 94d2fbe commit 0456c9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import log from './log.ts'
import { getContentType } from './mime.ts'
import { listenAndServe, path, ServerRequest, walk } from './std.ts'
import util from './util.ts'
import { version } from './version.ts'
import { VERSION } from './version.ts'

const commands = {
'init': 'Create a new application',
Expand All @@ -15,7 +15,7 @@ const commands = {
'upgrade': 'Upgrade Aleph.js command'
}

const helpMessage = `Aleph.js v${version}
const helpMessage = `Aleph.js v${VERSION}
The React Framework in deno.
Docs: https://alephjs.org/docs
Expand Down Expand Up @@ -63,14 +63,14 @@ async function main() {

// prints aleph.js version
if (argOptions.v && command != 'upgrade') {
console.log(`aleph.js v${version}`)
console.log(`aleph.js v${VERSION}`)
Deno.exit(0)
}

// prints aleph.js and deno version
if (argOptions.version && command != 'upgrade') {
const { deno, v8, typescript } = Deno.version
console.log(`aleph.js ${version}`)
console.log(`aleph.js ${VERSION}`)
console.log(`deno ${deno}`)
console.log(`v8 ${v8}`)
console.log(`typescript ${typescript}`)
Expand Down
12 changes: 6 additions & 6 deletions project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { APIHandler, Config, RouterURL } from './types.ts'
import util, { hashShort, MB, reHashJs, reHttp, reLocaleID, reMDExt, reModuleExt, reStyleModuleExt } from './util.ts'
import { createHTMLDocument } from './vendor/deno-dom/document.ts'
import less from './vendor/less/less.js'
import { version } from './version.ts'
import { VERSION } from './version.ts'

interface Module {
id: string
Expand Down Expand Up @@ -641,7 +641,7 @@ export class Project {
// inject env variables
Object.entries({
...this.config.env,
__version: version,
__version: VERSION,
__buildMode: this.mode,
__buildTarget: this.config.buildTarget,
}).forEach(([key, value]) => Deno.env.set(key, value))
Expand Down Expand Up @@ -690,7 +690,7 @@ export class Project {
const { renderPage } = await import('file://' + this.#modules.get('//deno.land/x/aleph/renderer.js')!.jsFile)
this.#renderer = { renderPage }

log.info(colors.bold(`Aleph.js v${version}`))
log.info(colors.bold(`Aleph.js v${VERSION}`))
if (this.config.__file) {
log.info(colors.bold('- Config'))
log.info(' ▲', this.config.__file)
Expand Down Expand Up @@ -986,7 +986,7 @@ export class Project {
}
dlUrl = u.toString().replace(/=(&|$)/, '$1')
} else if (dlUrl.startsWith('https://deno.land/x/aleph/')) {
dlUrl = `https://deno.land/x/aleph@v${version}/` + util.trimPrefix(dlUrl, 'https://deno.land/x/aleph/')
dlUrl = `https://deno.land/x/aleph@v${VERSION}/` + util.trimPrefix(dlUrl, 'https://deno.land/x/aleph/')
}
if (mod.sourceHash === '') {
log.info('Download', url, dlUrl != url ? colors.dim(`• ${dlUrl}`) : '')
Expand Down Expand Up @@ -1117,7 +1117,7 @@ export class Project {
reactRefresh: this.isDev && !mod.isRemote,
rewriteImportPath: (path: string) => this._resolveImportURL(mod, path),
signUseDeno: (id: string) => {
const sig = 'useDeno.' + (new Sha1()).update(id).update(version).update(Date.now().toString()).hex().slice(0, hashShort)
const sig = 'useDeno.' + (new Sha1()).update(id).update(VERSION).update(Date.now().toString()).hex().slice(0, hashShort)
useDenos.push(sig)
return sig
}
Expand Down Expand Up @@ -1567,7 +1567,7 @@ function getHash(content: string | Uint8Array, checkVersion = false) {
const sha1 = new Sha1()
sha1.update(content)
if (checkVersion) {
sha1.update(version)
sha1.update(VERSION)
}
return sha1.hex()
}
Expand Down
2 changes: 1 addition & 1 deletion version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '0.2.28'
export const VERSION = '0.2.28'

0 comments on commit 0456c9d

Please sign in to comment.