proscenium 0.1.1-x86_64-linux → 0.1.2-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/esbuild +0 -0
- data/lib/proscenium/compilers/esbuild/argument_error.js +2 -0
- data/lib/proscenium/compilers/esbuild/css_plugin.js +3 -7
- data/lib/proscenium/compilers/esbuild.js +11 -3
- data/lib/proscenium/middleware/esbuild.rb +11 -1
- data/lib/proscenium/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 446ad2f069aa35ab275b66632c447318d4f6b58306e4de6f6812b1b4cd3292b3
|
4
|
+
data.tar.gz: 9e620e076b80ae0bc7613b09743b19eceec98a2e16818d19177e01e77394efe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c933cfec773e60aea31f7262bf16dc22471a6dcbb7ede70d9631ba97652f3723c8c2761872ea5276e99cdfab19481e084a6818857580b85cd905260c6d14e8f4
|
7
|
+
data.tar.gz: 82116ba5093880d9a81080fc90b5611271033c595ea3799b04bb99fc8bf2790d40b517c94b5b8999745b9f93487fb85ed2ac8ea4cbc7f5e7479c800bb2bba051
|
data/bin/esbuild
CHANGED
Binary file
|
@@ -1,6 +1,8 @@
|
|
1
1
|
export default class ArgumentError extends Error {
|
2
2
|
static MESSAGES = {
|
3
3
|
rootRequired: 'Current working directory is required as --root.',
|
4
|
+
lightningcssBinRequired:
|
5
|
+
'Path to the lightningcss CLI binary is required as --lightningcss-bin.',
|
4
6
|
pathsRequired: 'One or more file paths or globs are required.',
|
5
7
|
|
6
8
|
rootUnknown: ({ root }) => `A valid working directory is required - received ${root}`
|
@@ -1,16 +1,12 @@
|
|
1
1
|
import { crypto } from 'std/crypto/mod.ts'
|
2
|
-
import { join,
|
2
|
+
import { join, dirname, basename } from 'std/path/mod.ts'
|
3
3
|
|
4
4
|
import { fileExists } from '../../utils.js'
|
5
5
|
import postcss from './css/postcss.js'
|
6
6
|
import setup from './setup_plugin.js'
|
7
7
|
|
8
|
-
export default setup('css', async build => {
|
8
|
+
export default setup('css', async (build, options) => {
|
9
9
|
const cwd = build.initialOptions.absWorkingDir
|
10
|
-
const lightningcssBin = resolve(
|
11
|
-
dirname(fromFileUrl(import.meta.url)),
|
12
|
-
'../../../../bin/lightningcss'
|
13
|
-
)
|
14
10
|
|
15
11
|
let customMedia
|
16
12
|
try {
|
@@ -40,7 +36,7 @@ export default setup('css', async build => {
|
|
40
36
|
}
|
41
37
|
|
42
38
|
let cmd = [
|
43
|
-
lightningcssBin,
|
39
|
+
options.lightningcssBin,
|
44
40
|
'--nesting',
|
45
41
|
'--error-recovery',
|
46
42
|
args.pluginData?.importedFromJs && '--minify',
|
@@ -31,6 +31,8 @@ import throwCompileError from './esbuild/compile_error.js'
|
|
31
31
|
* take place.
|
32
32
|
* --import-map
|
33
33
|
* Path to an import map, relative to the <root>.
|
34
|
+
* --lightningcss-bin
|
35
|
+
* Path to the lightningcss CLI binary.
|
34
36
|
* --write
|
35
37
|
* Write output to the filesystem according to esbuild logic.
|
36
38
|
* --debug
|
@@ -40,10 +42,11 @@ if (import.meta.main) {
|
|
40
42
|
!Deno.env.get('RAILS_ENV') && Deno.env.set('RAILS_ENV', 'development')
|
41
43
|
|
42
44
|
const { _: paths, ...options } = parseArgs(Deno.args, {
|
43
|
-
string: ['root', 'import-map'],
|
45
|
+
string: ['root', 'import-map', 'lightningcss-bin'],
|
44
46
|
boolean: ['write', 'debug'],
|
45
47
|
alias: {
|
46
|
-
'import-map': 'importMap'
|
48
|
+
'import-map': 'importMap',
|
49
|
+
'lightningcss-bin': 'lightningcssBin'
|
47
50
|
}
|
48
51
|
})
|
49
52
|
|
@@ -62,6 +65,7 @@ async function main(paths = [], options = {}) {
|
|
62
65
|
|
63
66
|
if (!Array.isArray(paths) || paths.length < 1) throw new ArgumentError('pathsRequired')
|
64
67
|
if (!options.root) throw new ArgumentError('rootRequired')
|
68
|
+
if (!options.lightningcssBin) throw new ArgumentError('lightningcssBinRequired')
|
65
69
|
|
66
70
|
const root = resolve(options.root)
|
67
71
|
|
@@ -117,7 +121,11 @@ async function main(paths = [], options = {}) {
|
|
117
121
|
jsxDev: !isTest && !isProd,
|
118
122
|
minify: isProd,
|
119
123
|
bundle: true,
|
120
|
-
plugins: [
|
124
|
+
plugins: [
|
125
|
+
envPlugin(),
|
126
|
+
resolvePlugin({ runtimeDir, importMap, debug }),
|
127
|
+
cssPlugin({ lightningcssBin: options.lightningcssBin, debug })
|
128
|
+
],
|
121
129
|
metafile: write,
|
122
130
|
write
|
123
131
|
}
|
@@ -15,7 +15,9 @@ module Proscenium
|
|
15
15
|
|
16
16
|
def attempt
|
17
17
|
benchmark :esbuild do
|
18
|
-
render_response build(
|
18
|
+
render_response build(
|
19
|
+
"#{cli} --root #{root} --lightningcss-bin #{lightningcss_cli} #{path}"
|
20
|
+
)
|
19
21
|
end
|
20
22
|
rescue CompileError => e
|
21
23
|
render_response "export default #{e.detail.to_json}" do |response|
|
@@ -38,6 +40,14 @@ module Proscenium
|
|
38
40
|
Gem.bin_path 'proscenium', 'esbuild'
|
39
41
|
end
|
40
42
|
end
|
43
|
+
|
44
|
+
def lightningcss_cli
|
45
|
+
if ENV['PROSCENIUM_TEST']
|
46
|
+
'bin/lightningcss'
|
47
|
+
else
|
48
|
+
Gem.bin_path 'proscenium', 'lightningcss'
|
49
|
+
end
|
50
|
+
end
|
41
51
|
end
|
42
52
|
end
|
43
53
|
end
|
data/lib/proscenium/version.rb
CHANGED