@jahia/vite-plugin 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- package/package.json +4 -1
- package/node/node +0 -0
- package/node/yarn/dist/LICENSE +0 -26
- package/node/yarn/dist/README.md +0 -60
- package/node/yarn/dist/bin/yarn +0 -35
- package/node/yarn/dist/bin/yarn.cmd +0 -2
- package/node/yarn/dist/bin/yarn.js +0 -31
- package/node/yarn/dist/bin/yarnpkg +0 -2
- package/node/yarn/dist/bin/yarnpkg.cmd +0 -2
- package/node/yarn/dist/lib/cli.js +0 -154071
- package/node/yarn/dist/lib/v8-compile-cache.js +0 -351
- package/node/yarn/dist/package.json +0 -28
- package/node/yarn/dist/preinstall.js +0 -60
- package/pom.xml +0 -111
- package/src/index.ts +0 -230
- package/src/insert-filename.ts +0 -105
package/README.md
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
A Vite plugin to develop JavaScript Modules for the Jahia platform.
|
|
4
4
|
|
|
5
|
-
This README will be updated soon.
|
|
6
|
-
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
|
-
Using our project creation CLI should set you up correctly. It will ship with good defaults to get you started, but your workflow might need more advanced settings. For that, the `jahia` Vite plugin can take an object of options:
|
|
7
|
+
Using our [project creation CLI (@jahia/create-module)](https://www.npmjs.com/package/@jahia/create-module) should set you up correctly. It will ship with good defaults to get you started, but your workflow might need more advanced settings. For that, the `jahia` Vite plugin can take an object of options:
|
|
10
8
|
|
|
11
9
|
```js
|
|
12
10
|
import { defineConfig } from "vite";
|
|
@@ -18,10 +16,14 @@ export default defineConfig({
|
|
|
18
16
|
jahia({
|
|
19
17
|
// Client options
|
|
20
18
|
client: {
|
|
21
|
-
input:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
input: {
|
|
20
|
+
// Parent directory of client-side code
|
|
21
|
+
dir: "./src/client",
|
|
22
|
+
// Glob pattern to match all client-side code in dir
|
|
23
|
+
glob: "**/*.jsx",
|
|
24
|
+
}
|
|
25
|
+
// Output directory for client-side code
|
|
26
|
+
output: "./javascript/client/",
|
|
25
27
|
},
|
|
26
28
|
|
|
27
29
|
// Server options
|
|
@@ -31,6 +33,7 @@ export default defineConfig({
|
|
|
31
33
|
output: {
|
|
32
34
|
dir: "./javascript/server",
|
|
33
35
|
fileName: "index", // Will produce index.js and index.css
|
|
36
|
+
// A known bug causes the css file to be named style.css regardless of this setting
|
|
34
37
|
},
|
|
35
38
|
},
|
|
36
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jahia/vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com:Jahia/javascript-modules.git",
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"import": "./dist/index.js"
|
|
14
14
|
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
15
18
|
"scripts": {
|
|
16
19
|
"build": "pkgroll && publint"
|
|
17
20
|
},
|
package/node/node
DELETED
|
Binary file
|
package/node/yarn/dist/LICENSE
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
BSD 2-Clause License
|
|
2
|
-
|
|
3
|
-
For Yarn software
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2016-present, Yarn Contributors. All rights reserved.
|
|
6
|
-
|
|
7
|
-
Redistribution and use in source and binary forms, with or without modification,
|
|
8
|
-
are permitted provided that the following conditions are met:
|
|
9
|
-
|
|
10
|
-
* Redistributions of source code must retain the above copyright notice, this
|
|
11
|
-
list of conditions and the following disclaimer.
|
|
12
|
-
|
|
13
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
|
14
|
-
this list of conditions and the following disclaimer in the documentation
|
|
15
|
-
and/or other materials provided with the distribution.
|
|
16
|
-
|
|
17
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
21
|
-
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
22
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
23
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
24
|
-
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
25
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
26
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/node/yarn/dist/README.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://yarnpkg.com/">
|
|
3
|
-
<img alt="Yarn" src="https://github.com/yarnpkg/assets/blob/master/yarn-kitten-full.png?raw=true" width="546">
|
|
4
|
-
</a>
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
Fast, reliable, and secure dependency management.
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://circleci.com/gh/yarnpkg/yarn"><img alt="Circle Status" src="https://circleci.com/gh/yarnpkg/yarn.svg?style=shield&circle-token=5f0a78473b0f440afb218bf2b82323cc6b3cb43f"></a>
|
|
13
|
-
<a href="https://ci.appveyor.com/project/kittens/yarn/branch/master"><img alt="Appveyor Status" src="https://ci.appveyor.com/api/projects/status/0xdv8chwe2kmk463?svg=true"></a>
|
|
14
|
-
<a href="https://dev.azure.com/yarnpkg/yarn/_build"><img alt="Azure Pipelines status" src="https://dev.azure.com/yarnpkg/yarn/_apis/build/status/Yarn%20Acceptance%20Tests"></a>
|
|
15
|
-
<a href="https://discord.gg/yarnpkg"><img alt="Discord Chat" src="https://img.shields.io/discord/226791405589233664.svg"></a>
|
|
16
|
-
<a href="http://commitizen.github.io/cz-cli/"><img alt="Commitizen friendly" src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg"></a>
|
|
17
|
-
</p>
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
**Fast:** Yarn caches every package it has downloaded, so it never needs to download the same package again. It also does almost everything concurrently to maximize resource utilization. This means even faster installs.
|
|
22
|
-
|
|
23
|
-
**Reliable:** Using a detailed but concise lockfile format and a deterministic algorithm for install operations, Yarn is able to guarantee that any installation that works on one system will work exactly the same on another system.
|
|
24
|
-
|
|
25
|
-
**Secure:** Yarn uses checksums to verify the integrity of every installed package before its code is executed.
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
* **Offline Mode.** If you've installed a package before, then you can install it again without an internet connection.
|
|
30
|
-
* **Deterministic.** The same dependencies will be installed in the same exact way on any machine, regardless of installation order.
|
|
31
|
-
* **Network Performance.** Yarn efficiently queues requests and avoids request waterfalls in order to maximize network utilization.
|
|
32
|
-
* **Network Resilience.** A single request that fails will not cause the entire installation to fail. Requests are automatically retried upon failure.
|
|
33
|
-
* **Flat Mode.** Yarn resolves mismatched versions of dependencies to a single version to avoid creating duplicates.
|
|
34
|
-
* **More emojis.** 🐈
|
|
35
|
-
|
|
36
|
-
## Installing Yarn
|
|
37
|
-
|
|
38
|
-
Read the [Installation Guide](https://yarnpkg.com/en/docs/install) on our website for detailed instructions on how to install Yarn.
|
|
39
|
-
|
|
40
|
-
## Using Yarn
|
|
41
|
-
|
|
42
|
-
Read the [Usage Guide](https://yarnpkg.com/en/docs/usage) on our website for detailed instructions on how to use Yarn.
|
|
43
|
-
|
|
44
|
-
## Contributing to Yarn
|
|
45
|
-
|
|
46
|
-
Contributions are always welcome, no matter how large or small. Substantial feature requests should be proposed as an [RFC](https://github.com/yarnpkg/rfcs). Before contributing, please read the [code of conduct](CODE_OF_CONDUCT.md).
|
|
47
|
-
|
|
48
|
-
See [Contributing](https://yarnpkg.com/org/contributing/).
|
|
49
|
-
|
|
50
|
-
## Prior art
|
|
51
|
-
|
|
52
|
-
Yarn wouldn't exist if it wasn't for excellent prior art. Yarn has been inspired by the following projects:
|
|
53
|
-
|
|
54
|
-
- [Bundler](https://github.com/bundler/bundler)
|
|
55
|
-
- [Cargo](https://github.com/rust-lang/cargo)
|
|
56
|
-
- [npm](https://github.com/npm/cli)
|
|
57
|
-
|
|
58
|
-
## Credits
|
|
59
|
-
|
|
60
|
-
Thanks to [Sam Holmes](https://github.com/samholmes) for donating the npm package name!
|
package/node/yarn/dist/bin/yarn
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
argv0=$(echo "$0" | sed -e 's,\\,/,g')
|
|
3
|
-
basedir=$(dirname "$(readlink "$0" || echo "$argv0")")
|
|
4
|
-
|
|
5
|
-
case "$(uname -s)" in
|
|
6
|
-
Darwin) basedir="$( cd "$( dirname "$argv0" )" && pwd )";;
|
|
7
|
-
Linux) basedir=$(dirname "$(readlink -f "$0" || echo "$argv0")");;
|
|
8
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
9
|
-
*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
command_exists() {
|
|
13
|
-
command -v "$1" >/dev/null 2>&1;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if command_exists node; then
|
|
17
|
-
if [ "$YARN_FORCE_WINPTY" = 1 ] || command_exists winpty && test -t 1; then
|
|
18
|
-
winpty node "$basedir/yarn.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/yarn.js" "$@"
|
|
21
|
-
fi
|
|
22
|
-
ret=$?
|
|
23
|
-
# Debian and Ubuntu use "nodejs" as the name of the binary, not "node", so we
|
|
24
|
-
# search for that too. See:
|
|
25
|
-
# https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html
|
|
26
|
-
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907
|
|
27
|
-
elif command_exists nodejs; then
|
|
28
|
-
exec nodejs "$basedir/yarn.js" "$@"
|
|
29
|
-
ret=$?
|
|
30
|
-
else
|
|
31
|
-
>&2 echo 'Yarn requires Node.js 4.0 or higher to be installed.'
|
|
32
|
-
ret=1
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
exit $ret
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/* eslint-disable no-var */
|
|
4
|
-
/* eslint-disable flowtype/require-valid-file-annotation */
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
var ver = process.versions.node;
|
|
8
|
-
var majorVer = parseInt(ver.split('.')[0], 10);
|
|
9
|
-
|
|
10
|
-
if (majorVer < 4) {
|
|
11
|
-
console.error('Node version ' + ver + ' is not supported, please use Node.js 4.0 or higher.');
|
|
12
|
-
process.exit(1); // eslint-disable-line no-process-exit
|
|
13
|
-
} else {
|
|
14
|
-
try {
|
|
15
|
-
require(__dirname + '/../lib/v8-compile-cache.js');
|
|
16
|
-
} catch (err) {
|
|
17
|
-
// We don't have/need this on legacy builds and dev builds
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Just requiring this package will trigger a yarn run since the
|
|
21
|
-
// `require.main === module` check inside `cli/index.js` will always
|
|
22
|
-
// be truthy when built with webpack :(
|
|
23
|
-
// `lib/cli` may be `lib/cli/index.js` or `lib/cli.js` depending on the build.
|
|
24
|
-
var cli = require(__dirname + '/../lib/cli');
|
|
25
|
-
if (!cli.autoRun) {
|
|
26
|
-
cli.default().catch(function(error) {
|
|
27
|
-
console.error(error.stack || error.message || error);
|
|
28
|
-
process.exitCode = 1;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|