Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename version to VERSION #85

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'