syumai / dem Goto Github PK
View Code? Open in Web Editor NEWA module version manager for Deno.
License: MIT License
A module version manager for Deno.
License: MIT License
// @deno-types="./vendor/https/deno.land/std/foo/bar.d.ts"
import * as bar from "./bar.js";
.js
/// <reference types="./vendor/https/deno.land/std/foo/bar.d.ts" />
export const bar = "bar";
Not sure if something like this is already supported:
{
"modules": [
{
"protocol": "https",
"path": "deno.land/std",
"version": "v0.51.0",
"files": [
"/http/server.ts"
],
"alias": "server.ts"
}
]
}
import { serve } from './vendor/server.ts"
deno fmt
default.Perhaps I am misunderstanding dem, but it seems dem add
should be files in vendor? But I am not seeing this happening. Thus far, only dem alias
does anything to vendor/ .
Using dem 0.9.9:
dem init
jq . dem.json
{
"modules": [],
"aliases": {}
}
dem add https://deno.land/x/[email protected]
jq .modules dem.json
[
{
"protocol": "https",
"path": "deno.land/x/dejs",
"version": "0.9.3",
"files": []
}
]
But, there is no vendor directory (if I create vendor/ beforehand, nothing is placed inside of it).
try non- esm.sh
typescript module
import
section
dem ensure / dem prune
Add document to describe how to release new version of dem.
export { default } from xxx
PS C:> deno --version
deno 1.16.3 (release, x86_64-pc-windows-msvc)
v8 9.7.106.5
typescript 4.4.2
PS C:> dem version
dem: 0.9.9
PS C:> dem update
error: Uncaught (in promise) TypeError: Invalid URL
const u = new URL(name);
^
at Object.opSync (deno:core/01_core.js:142:12)
at opUrlParse (deno:ext/url/00_url.js:47:27)
at new URL (deno:ext/url/00_url.js:320:20)
at Function.parse (https://deno.land/x/[email protected]/module.ts:20:15)
at App.updateModule (https://deno.land/x/[email protected]/mod.ts:159:31)
at main (https://deno.land/x/[email protected]/cmd.ts:74:11)
PS C:>
When i use dem ensure for this project and I started the code. I got Uncaught SyntaxError: The requested module './vendor/https/jspm.dev/typescript/lib/typescript.js' does not provide an export named 'default'
So I looked the code and the hasDefaultExport function return false even if a module a export default. I rewrite the code to get working but that's my first step with typescript and I think my code could be better.
Here is the full function
export function hasDefaultExport(body: string): boolean {
const sourceFile = ts.createSourceFile("", body, ts.ScriptTarget.ES2020);
let hasDefault = false;
sourceFile.forEachChild((node: ts.Node) => {
if(ts.isExportDeclaration(node)){
const exportClause: ts.NamedExports = node.exportClause as ts.NamedExports;
if(exportClause !== undefined){
hasDefault = hasDefault || (exportClause.elements[0].name.escapedText as string === 'default');
}
}
});
return hasDefault;
}
Hello, thank you for the module!
I run into a problem when run dem
on deno v0.29.0 like this:
$ dem update https://deno.land/[email protected]
sub command https://deno.land/[email protected] does not exist.
I think this is because Deno.args
now does not include script name. (denoland/deno#3628)
Would you have a plan to support deno v0.29.0 or above?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.