denofn / denopack Goto Github PK
View Code? Open in Web Editor NEWThe bundling and minification toolset, made for Deno
Home Page: https://denopack.mod.land
License: MIT License
The bundling and minification toolset, made for Deno
Home Page: https://denopack.mod.land
License: MIT License
A config that emits a HTML file like so:
html({
template: createHtmlTemplate,
title: "React App",
meta: [
{ charset: "utf-8" },
{
name: "viewport",
content: "width=device-width, initial-scale=1",
},
{
name: "description",
content: "Web site created using create-react-app",
},
],
fileName: "x/test.html",
}),
leads to three issues:
<script src="mod.js" type="module"></script>
should look like <script src="../mod.js" type="module"></script>
<link href="mod.css" rel="stylesheet">
should look like <link href="../mod.css" rel="stylesheet">
mkdir -r dist/x
has to be run before denopack, because denopack does not create the directory itself.Meta
> denopack --version
denopack/0.8.0 linux-x86_64 deno-1.3.3
error: Uncaught Error: DENO_DIR is not set
if (!deno_dir) throw new Error(DENO_DIR is not set
);
^
at mod.ts:2:22
as far as I know, DENO_DIR env is not exist
Describe the bug
If the output filename includes a directory - subdir/output.js
- it is ignored, and the file written to the current directory
To Reproduce
Enter subdir/output.js
in output file config.
Expected behavior
FIle and sourcemap should be put in subdir
.
Desktop (please complete the following information):
Additional context
emitFiles.ts
seems to be confusing the dir
and file
options. dir
is for code splitting chunks, and isn't used for single build file. This bit of code needs rewriting.
Describe the bug
When Rollup encounters a runtime error, it leaves you with very little to go on -- aside from a stack trace, containing mangled function names and hard-to-reach line numbers.
This doesn't really help:
[resynth@synthcave synth-di]$ time deno run --unstable --allow-read --allow-write --allow-env --allow-net https://deno.land/x/[email protected]/cli.ts --config ./build/base.config.ts
error: Uncaught (in promise) TypeError: Cannot read property 'split' of undefined
at Ve (https://unpkg.com/[email protected]/dist/es/rollup.browser.js:11:31514)
at Ra (https://unpkg.com/[email protected]/dist/es/rollup.browser.js:11:318386)
at async Ua.loadEntryModule (https://unpkg.com/[email protected]/dist/es/rollup.browser.js:11:327081)
at async Promise.all (index 0)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
You get an un-minifed error.
The Rollup module you're importing does not come with a source map, btw.
Describe the bug
The installation fails
To Reproduce
Execute the command on the readme (deno run --allow-run --allow-read https://deno.land/x/[email protected]/install.ts
)
Expected behavior
I expect the installation to success
Desktop (please complete the following information):
Additional context
โฏ deno run --allow-run --allow-read https://deno.land/x/[email protected]/install.ts
error: error sending request for url (https://cdn.dreg.dev/package/@rollup/[email protected]): error trying to connect: dns error: No such host is known. (os error 11001)
at https://deno.land/x/[email protected]/plugin/deps.ts:8:8
error: Uncaught (in promise) AssertionError: Failed to install plugin dependencies.
throw new AssertionError(msg);
^
at assert (https://deno.land/[email protected]/testing/asserts.ts:156:11)
at https://deno.land/x/[email protected]/install.ts:63:1
at eventLoopTick (ext:core/01_core.js:166:11)
Checklist
Since jspm support for Deno is way in the future for now, this will probably have to be done manually or through the Dreg project (denofn/dreg).
Ultimately this would allow denopack's CLI to become more of a wrapper for functionality proposed in #8 rather than a Denoified version of the Rollup CLI.
Since the future of dreg is still undecided, I'm opening an issue here as well.
Multiple decorators are not getting called.
Reproduce the behavior with test.ts:
function A() {
console.log("@A evaluated");
return function (
target: any,
propertyKey: string,
descriptor: PropertyDescriptor,
) {
console.log("@A called");
const fn = descriptor.value;
descriptor.value = function() {
console.log("fn() called from @A");
fn();
};
};
}
function B() {
console.log("@B evaluated");
return function (
target: any,
propertyKey: string,
descriptor: PropertyDescriptor,
) {
console.log("@B called");
const fn = descriptor.value;
descriptor.value = function() {
console.log("fn() called from @B");
fn();
};
};
}
class C {
@A()
@B()
static test() {
console.log("C.test() called");
}
}
C.test();
denopack -i test.ts
denopack completed in 405ms
deno run bundle.js
@A evaluated
@B evaluated
@B called
@B called
fn() called from @B
fn() called from @B
C.test() called
Expected behavior
@A evaluated
@B evaluated
@B called
@A called
fn() called from @A
fn() called from @B
C.test() called
Describe the bug
Css plugin paths are not being resolved correctly
To Reproduce
Specify any route in the css configuration output
option that isn't located in the root of the output folder.
Expected behavior
Should create the folder and emit the file
Similar solution to #16
Describe the bug
I'm getting a 500 Internal Server Error
when running:
deno run --allow-run --allow-read https://x.nest.land/[email protected]/install.ts
Screenshots
Download https://cdn.dreg.dev/polyfill/node/path.ts
Download https://cdn.dreg.dev/package/@types/[email protected]
error: Import 'https://cdn.dreg.dev/package/[email protected]' failed: 500 Internal Server Error
at https://cdn.dreg.dev/package/@rollup/[email protected]/dist/es/index.js:2:0
error: Uncaught (in promise) AssertionError: Failed to install plugin dependencies.
throw new AssertionError(msg);
^
at assert (asserts.ts:156:11)
at install.ts:63:1
Desktop (please complete the following information):
Additional context
The issue appears to be at the CDN level given that this is not reachable: https://cdn.dreg.dev/package/[email protected]. Not sure if I should have opened this issue on the Dreg repo instead.
Checklist
Describe the bug
Deno 1.7.0 removes Deno.compile()
and Deno.transpileOnly()
, so denopack fails on load.
Additional context
https://deno.land/[email protected]/typescript/runtime describes the replacement.
On the positive side, it may be possible to replace some of the existing code with Deno.emit()
.
Describe the bug
When using the CLI, I have encountered the following runtime error.
deno run --unstable --allow-read --allow-write --allow-env --allow-net https://deno.land/x/[email protected]/cli.ts --config ./bundle.config.ts
error: Uncaught (in promise) TypeError: Cannot destructure property 'output' of 'opts' as it is undefined.
const { output: _outputOpts, ...rollupOpts } = opts;
^
at mergeOptions (options.ts:64:19)
at runBundler (runBundler.ts:30:53)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected it to work. ๐
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
deno 1.5.4 (bc79d55, release, x86_64-unknown-linux-gnu)
v8 8.8.278.2
typescript 4.0.5
Checklist
Is your feature request related to a problem? Please describe.
handy for contributors
Describe the solution you'd like
see title
Describe alternatives you've considered
manual... lol
Describe the bug
When trying to install latest denopack v0.10.0 in Deno 1.5.0 and 1.5.2, the installation failed with error CertNotValidForName
Screenshots
$ deno --version
deno 1.5.2 (71d7482, release, x86_64-apple-darwin)
v8 8.7.220.3
typescript 4.0.5
$ deno run --allow-run --allow-read https://x.nest.land/[email protected]/install.ts
Check https://x.nest.land/[email protected]/install.ts
Download https://lr4vbhbl66orzg7pmpep4hflo5kmcvpd4jgwsz6uch5hvv4xproa.arweave.net/XHlQnCv3nRyb72PI_hyrd1TBVePiTWln1BH6eteXfFw/deps.ts
Download https://unpkg.com/[email protected]/dist/es/rollup.browser.js
Download https://unpkg.com/[email protected]/dist/rollup.d.ts
...
Download https://lr4vbhbl66orzg7pmpep4hflo5kmcvpd4jgwsz6uch5hvv4xproa.arweave.net/XHlQnCv3nRyb72PI_hyrd1TBVePiTWln1BH6eteXfFw/plugin/deps.ts
Download https://cdn.dreg.dev/package/@rollup/[email protected]
Sending fatal alert BadCertificate
error: error sending request for url (https://cdn.dreg.dev/package/@rollup/[email protected]): error trying to connect: invalid certificate: CertNotValidForName
at https://lr4vbhbl66orzg7pmpep4hflo5kmcvpd4jgwsz6uch5hvv4xproa.arweave.net/XHlQnCv3nRyb72PI_hyrd1TBVePiTWln1BH6eteXfFw/plugin/deps.ts:1:0
error: Uncaught (in promise) AssertionError: Failed to install plugin dependencies.
throw new AssertionError(msg);
^
at assert (asserts.ts:156:11)
at install.ts:63:1
However, when browsing to the URL: https://cdn.dreg.dev/package/@rollup/[email protected], the browser shows certificate as valid.
Desktop (please complete the following information):
Checklist
After denopack 0.5.0, focus will shift a bit to frontend related plugins
Hi,
I might found a security issue in this project. As a matter of community responsibility, please create a security advisory and invite me to disclose the vulnerability further.
Thanks,
AH
Hey, thanks for this project, it looks like a great way to bring nice Deno code to the browser!
Is your feature request related to a problem? Please describe.
I'd like to use denopack to bundle any deno std
library not using the Deno
APIs.
I tried bundling a project but it fails with Uncaught Error: Terser is not supposed to return nothing!
.
I narrowed down the problem to having export { createHash } from 'https://deno.land/[email protected]/hash/mod.ts'
in my deps.ts
file and my assumption, comparing with other imports from std
that can get compiled correctly, is that it's because the std/hash
module uses WASM imports.
Describe the solution you'd like
Rollup has a WASM plugin that would be great to support in denopack, either as a plugin or in core.
Alternatively, if there is an easy way to convert/wrap existing Rollup plugins to denopack ones it could be a good option.
Describe alternatives you've considered
Using deno bundle
+ minifier
Thanks!
I was actually thinking of building a bundler for Deno because its internal bundler isn't great for client-side output...
On that note I tried to install this package globally while also trying to just run the CLI via velociraptor. But I get this error:
error: TS1031 at https://unpkg.com/[email protected]/dist/es/rollup.browser.js:11:39947,Unexpected token Some(LParen) at https://unpkg.com/[email protected]/dist/es/rollup.browser.js:11:39954
Are you aware of this?
Remote debugging in VS Code and Google Chrome not working properly after denopack bundling.
Operating system: MacOS Catalina 10.15.6
Deno version: 1.3.3
VS Code version: 1.49.0
Steps to reproduce the issue:
Open react-template in VS Code.
Create "dist" folder in the root directory.
Run denopack -c denopack.config.ts
to bundle the project and serve files from the dist directory on port 3000.
Open Google Chrome with remote debugging enabled with this command:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug
Open http://localhost:9222/json to verify if Chrome is running with remote debugging enabled on port 9222.
Add this configuration to launch.json file in .vscode folder:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "pwa-chrome",
"webRoot": "${workspaceFolder}"
},
]
}
Result: All breakpoints are unbounded and inaccessible from the debugger.
Can you please, give me some guidance, how to setup and use remote debugging with VSCode, Chrome, and Denopack?
The same configuration is working fine with the create-react-app typescript template.
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.