@jahia/create-module 0.5.3 → 0.5.4
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/index.js +88 -150
- package/package.json +11 -19
- package/template/README.md +1 -1
- package/template/{dotenv → dot/env} +1 -1
- package/template/dot/github/workflows/build.yml +18 -0
- package/template/dot/node-version +1 -0
- package/template/dot/vscode/extensions.json +3 -0
- package/template/dot/vscode/settings.json +8 -0
- package/template/dot/yarnrc.yml +1 -0
- package/template/package.json +20 -20
- package/template/prettier.config.js +0 -1
- package/template/settings/content-types-icons/$MODULE_HelloCard.png +0 -0
- package/template/settings/content-types-icons/$MODULE_HelloWorld.png +0 -0
- package/template/settings/content-types-icons/$MODULE_LanguageSwitcher.png +0 -0
- package/template/settings/content-types-icons/$MODULE_component.png +0 -0
- package/template/settings/definitions.cnd +2 -7
- package/template/settings/import.xml +103 -11
- package/template/settings/locales/en.json +10 -3
- package/template/settings/locales/fr.json +10 -3
- package/template/settings/resources/$MODULE.properties +15 -0
- package/template/settings/resources/$MODULE_fr.properties +15 -0
- package/template/src/components/HelloCard/component.module.css +14 -0
- package/template/src/components/HelloCard/default.server.tsx +18 -0
- package/template/src/components/HelloCard/definition.cnd +3 -0
- package/template/src/components/HelloWorld/Celebrate.client.tsx +30 -0
- package/template/src/components/HelloWorld/component.module.css +105 -0
- package/template/src/components/HelloWorld/default.server.tsx +85 -0
- package/template/src/components/HelloWorld/definition.cnd +3 -0
- package/template/src/components/LanguageSwitcher/component.module.css +5 -0
- package/template/src/components/LanguageSwitcher/default.server.tsx +45 -0
- package/template/src/components/LanguageSwitcher/definition.cnd +1 -0
- package/template/src/pages/Layout.tsx +24 -0
- package/template/src/pages/basic.server.tsx +16 -0
- package/template/src/pages/global.css +11 -0
- package/template/src/types.d.ts +1 -0
- package/template/static/arrows/bottom.svg +1 -0
- package/template/static/arrows/left.svg +1 -0
- package/template/static/illustrations/code.svg +1 -0
- package/template/static/illustrations/coffee.svg +1 -0
- package/template/static/illustrations/interface.svg +1 -0
- package/template/static/illustrations/read.svg +1 -0
- package/template/static/illustrations/write.svg +1 -0
- package/template/tsconfig.json +11 -19
- package/template/vite.config.mjs +6 -10
- package/babel.config.cjs +0 -3
- package/node/node +0 -0
- package/node/npm +0 -65
- package/node/npm.cmd +0 -20
- package/node/npx +0 -65
- package/node/npx.cmd +0 -20
- 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 -134
- package/sync-version.js +0 -16
- package/template/dotgithub/workflows/build.yml +0 -21
- package/template/dotidea/jsLinters/eslint.xml +0 -6
- package/template/dotvscode/settings.json +0 -11
- package/template/dotyarnrc.yml +0 -1
- package/template/settings/content-types-icons/MODULE_NAMESPACE_simpleContent.png +0 -0
- package/template/settings/locales/de.json +0 -5
- package/template/settings/resources/MODULE_NAME.properties +0 -3
- package/template/settings/resources/MODULE_NAME_fr.properties +0 -3
- package/template/src/client/index.jsx +0 -1
- package/template/src/server/templates/page/PageHome.tsx +0 -43
- package/template/src/server/views/simpleContent/SimpleContentDefault.tsx +0 -16
- package/template/static/css/styles.css +0 -8
- package/tests/create-templatesSet-project.test.js +0 -136
- /package/template/{dotgitignore → dot/gitignore} +0 -0
- /package/template/{dotidea → dot/idea}/prettier.xml +0 -0
- /package/template/{dotprettierignore → dot/prettierignore} +0 -0
package/template/vite.config.mjs
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import { defineConfig } from "vite";
|
|
2
2
|
import jahia from "@jahia/vite-plugin";
|
|
3
|
-
import path from "node:path";
|
|
4
3
|
import { spawnSync } from "node:child_process";
|
|
5
4
|
|
|
6
5
|
export default defineConfig({
|
|
7
|
-
resolve: {
|
|
8
|
-
alias: { $client: path.resolve("./src/client") },
|
|
9
|
-
},
|
|
10
6
|
plugins: [
|
|
11
7
|
jahia({
|
|
12
8
|
client: {
|
|
13
9
|
input: {
|
|
14
|
-
dir: "./src/
|
|
15
|
-
glob: "**/*.{jsx,tsx}",
|
|
10
|
+
dir: "./src/",
|
|
11
|
+
glob: "**/*.client.{jsx,tsx}",
|
|
16
12
|
},
|
|
17
|
-
output: "./dist/
|
|
13
|
+
output: "./dist/",
|
|
18
14
|
},
|
|
19
15
|
server: {
|
|
20
16
|
// You can use a glob pattern to match multiple files
|
|
21
|
-
input: "./src
|
|
17
|
+
input: "./src/**/*.server.{jsx,tsx}",
|
|
22
18
|
output: {
|
|
23
|
-
dir: "./dist/server",
|
|
24
|
-
fileName: "index", // Will produce index.js and
|
|
19
|
+
dir: "./dist/server/",
|
|
20
|
+
fileName: "index", // Will produce index.js and style.css (because of a bug)
|
|
25
21
|
},
|
|
26
22
|
},
|
|
27
23
|
// This function is called every time a build succeeds in watch mode
|
package/babel.config.cjs
DELETED
package/node/node
DELETED
|
Binary file
|
package/node/npm
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# This is used by the Node.js installer, which expects the cygwin/mingw
|
|
4
|
-
# shell script to already be present in the npm dependency folder.
|
|
5
|
-
|
|
6
|
-
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
|
|
7
|
-
|
|
8
|
-
basedir=`dirname "$0"`
|
|
9
|
-
|
|
10
|
-
case `uname` in
|
|
11
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
12
|
-
esac
|
|
13
|
-
|
|
14
|
-
if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then
|
|
15
|
-
IS_WSL="true"
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
function no_node_dir {
|
|
19
|
-
# if this didn't work, then everything else below will fail
|
|
20
|
-
echo "Could not determine Node.js install directory" >&2
|
|
21
|
-
exit 1
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
NODE_EXE="$basedir/node.exe"
|
|
25
|
-
if ! [ -x "$NODE_EXE" ]; then
|
|
26
|
-
NODE_EXE="$basedir/node"
|
|
27
|
-
fi
|
|
28
|
-
if ! [ -x "$NODE_EXE" ]; then
|
|
29
|
-
NODE_EXE=node
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
# this path is passed to node.exe, so it needs to match whatever
|
|
33
|
-
# kind of paths Node.js thinks it's using, typically win32 paths.
|
|
34
|
-
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)' 2> /dev/null)"
|
|
35
|
-
if [ $? -ne 0 ]; then
|
|
36
|
-
# this fails under WSL 1 so add an additional message. we also suppress stderr above
|
|
37
|
-
# because the actual error raised is not helpful. in WSL 1 node.exe cannot handle
|
|
38
|
-
# output redirection properly. See https://github.com/microsoft/WSL/issues/2370
|
|
39
|
-
if [ "$IS_WSL" == "true" ]; then
|
|
40
|
-
echo "WSL 1 is not supported. Please upgrade to WSL 2 or above." >&2
|
|
41
|
-
fi
|
|
42
|
-
no_node_dir
|
|
43
|
-
fi
|
|
44
|
-
NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js"
|
|
45
|
-
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
|
|
46
|
-
NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"`
|
|
47
|
-
if [ $? -ne 0 ]; then
|
|
48
|
-
no_node_dir
|
|
49
|
-
fi
|
|
50
|
-
NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js"
|
|
51
|
-
|
|
52
|
-
# a path that will fail -f test on any posix bash
|
|
53
|
-
NPM_WSL_PATH="/.."
|
|
54
|
-
|
|
55
|
-
# WSL can run Windows binaries, so we have to give it the win32 path
|
|
56
|
-
# however, WSL bash tests against posix paths, so we need to construct that
|
|
57
|
-
# to know if npm is installed globally.
|
|
58
|
-
if [ "$IS_WSL" == "true" ]; then
|
|
59
|
-
NPM_WSL_PATH=`wslpath "$NPM_PREFIX_NPM_CLI_JS"`
|
|
60
|
-
fi
|
|
61
|
-
if [ -f "$NPM_PREFIX_NPM_CLI_JS" ] || [ -f "$NPM_WSL_PATH" ]; then
|
|
62
|
-
NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
"$NODE_EXE" "$NPM_CLI_JS" "$@"
|
package/node/npm.cmd
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
:: Created by npm, please don't edit manually.
|
|
2
|
-
@ECHO OFF
|
|
3
|
-
|
|
4
|
-
SETLOCAL
|
|
5
|
-
|
|
6
|
-
SET "NODE_EXE=%~dp0\node.exe"
|
|
7
|
-
IF NOT EXIST "%NODE_EXE%" (
|
|
8
|
-
SET "NODE_EXE=node"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js"
|
|
12
|
-
SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js"
|
|
13
|
-
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO (
|
|
14
|
-
SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js"
|
|
15
|
-
)
|
|
16
|
-
IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" (
|
|
17
|
-
SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%"
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
"%NODE_EXE%" "%NPM_CLI_JS%" %*
|
package/node/npx
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# This is used by the Node.js installer, which expects the cygwin/mingw
|
|
4
|
-
# shell script to already be present in the npm dependency folder.
|
|
5
|
-
|
|
6
|
-
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
|
|
7
|
-
|
|
8
|
-
basedir=`dirname "$0"`
|
|
9
|
-
|
|
10
|
-
case `uname` in
|
|
11
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
12
|
-
esac
|
|
13
|
-
|
|
14
|
-
if [ `uname` = 'Linux' ] && type wslpath &>/dev/null ; then
|
|
15
|
-
IS_WSL="true"
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
function no_node_dir {
|
|
19
|
-
# if this didn't work, then everything else below will fail
|
|
20
|
-
echo "Could not determine Node.js install directory" >&2
|
|
21
|
-
exit 1
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
NODE_EXE="$basedir/node.exe"
|
|
25
|
-
if ! [ -x "$NODE_EXE" ]; then
|
|
26
|
-
NODE_EXE="$basedir/node"
|
|
27
|
-
fi
|
|
28
|
-
if ! [ -x "$NODE_EXE" ]; then
|
|
29
|
-
NODE_EXE=node
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
# this path is passed to node.exe, so it needs to match whatever
|
|
33
|
-
# kind of paths Node.js thinks it's using, typically win32 paths.
|
|
34
|
-
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)' 2> /dev/null)"
|
|
35
|
-
if [ $? -ne 0 ]; then
|
|
36
|
-
# this fails under WSL 1 so add an additional message. we also suppress stderr above
|
|
37
|
-
# because the actual error raised is not helpful. in WSL 1 node.exe cannot handle
|
|
38
|
-
# output redirection properly. See https://github.com/microsoft/WSL/issues/2370
|
|
39
|
-
if [ "$IS_WSL" == "true" ]; then
|
|
40
|
-
echo "WSL 1 is not supported. Please upgrade to WSL 2 or above." >&2
|
|
41
|
-
fi
|
|
42
|
-
no_node_dir
|
|
43
|
-
fi
|
|
44
|
-
NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js"
|
|
45
|
-
NPX_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npx-cli.js"
|
|
46
|
-
NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"`
|
|
47
|
-
if [ $? -ne 0 ]; then
|
|
48
|
-
no_node_dir
|
|
49
|
-
fi
|
|
50
|
-
NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js"
|
|
51
|
-
|
|
52
|
-
# a path that will fail -f test on any posix bash
|
|
53
|
-
NPX_WSL_PATH="/.."
|
|
54
|
-
|
|
55
|
-
# WSL can run Windows binaries, so we have to give it the win32 path
|
|
56
|
-
# however, WSL bash tests against posix paths, so we need to construct that
|
|
57
|
-
# to know if npm is installed globally.
|
|
58
|
-
if [ "$IS_WSL" == "true" ]; then
|
|
59
|
-
NPX_WSL_PATH=`wslpath "$NPM_PREFIX_NPX_CLI_JS"`
|
|
60
|
-
fi
|
|
61
|
-
if [ -f "$NPM_PREFIX_NPX_CLI_JS" ] || [ -f "$NPX_WSL_PATH" ]; then
|
|
62
|
-
NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS"
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
"$NODE_EXE" "$NPX_CLI_JS" "$@"
|
package/node/npx.cmd
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
:: Created by npm, please don't edit manually.
|
|
2
|
-
@ECHO OFF
|
|
3
|
-
|
|
4
|
-
SETLOCAL
|
|
5
|
-
|
|
6
|
-
SET "NODE_EXE=%~dp0\node.exe"
|
|
7
|
-
IF NOT EXIST "%NODE_EXE%" (
|
|
8
|
-
SET "NODE_EXE=node"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js"
|
|
12
|
-
SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js"
|
|
13
|
-
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO (
|
|
14
|
-
SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js"
|
|
15
|
-
)
|
|
16
|
-
IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" (
|
|
17
|
-
SET "NPX_CLI_JS=%NPM_PREFIX_NPX_CLI_JS%"
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
"%NODE_EXE%" "%NPX_CLI_JS%" %*
|
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
|
-
}
|