dartvel_dev 0.2.1
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/LICENSE +110 -0
- package/README.md +42 -0
- package/bin/dartvel.js +12 -0
- package/index.js +101 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Daniel Effiong
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the MIT license that is effective on the second anniversary of the date we make
|
|
91
|
+
the Software available. On or after that date, you may use the Software under
|
|
92
|
+
the MIT license, in which case the following will apply:
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
95
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
96
|
+
the Software without restriction, including without limitation the rights to
|
|
97
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
98
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
99
|
+
so, subject to the following conditions:
|
|
100
|
+
|
|
101
|
+
The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
copies or substantial portions of the Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# dartvel_dev
|
|
2
|
+
|
|
3
|
+
A batteries-included, AI-native full-stack application platform built around
|
|
4
|
+
Flutter.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npx dartvel_dev --help
|
|
8
|
+
# or
|
|
9
|
+
npm install -g dartvel_dev
|
|
10
|
+
dartvel --help
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Why the package is `dartvel_dev` and the command is `dartvel`
|
|
14
|
+
|
|
15
|
+
`dartvel` on pub.dev was taken on 2026-08-06 by an unrelated package, so the
|
|
16
|
+
published identifier carries a suffix. The command you type does not, and
|
|
17
|
+
neither does anything else you interact with.
|
|
18
|
+
|
|
19
|
+
The same name is used on [pub.dev](https://pub.dev/packages/dartvel_dev) and in
|
|
20
|
+
the [Homebrew tap](https://github.com/Danroyal001/homebrew-dartvel_dev), so
|
|
21
|
+
whichever way you install it, it is called the same thing.
|
|
22
|
+
|
|
23
|
+
## What this package does
|
|
24
|
+
|
|
25
|
+
It launches the real CLI rather than containing a copy of it.
|
|
26
|
+
|
|
27
|
+
Dartvel is a Dart toolchain: `dartvel` is a Dart executable published on
|
|
28
|
+
pub.dev. Vendoring a compiled build into an npm package would ship a second
|
|
29
|
+
copy that drifts from the one `dart pub global activate` installs, and would
|
|
30
|
+
need a release per platform before this package could exist at all.
|
|
31
|
+
|
|
32
|
+
So on first run this finds `dartvel` on your PATH, and if it is not there,
|
|
33
|
+
installs it with `dart pub global activate dartvel_dev` and runs it through
|
|
34
|
+
`dart pub global run` — which works whether or not `~/.pub-cache/bin` is on
|
|
35
|
+
your PATH.
|
|
36
|
+
|
|
37
|
+
If there is no Dart SDK at all, it says so and points at the Flutter installer,
|
|
38
|
+
rather than failing with a command-not-found from somewhere three layers down.
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
The Dart SDK, which the Flutter SDK includes. Node 18 or newer.
|
package/bin/dartvel.js
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// A launcher, not a copy of the framework.
|
|
2
|
+
//
|
|
3
|
+
// Dartvel is a Dart toolchain: the `dartvel` command is a Dart executable
|
|
4
|
+
// published on pub.dev as `dartvel_dev`. Vendoring a compiled build of it into
|
|
5
|
+
// an npm package would ship a second copy that drifts from the one
|
|
6
|
+
// `dart pub global activate` installs, so this finds the real one, installs it
|
|
7
|
+
// on first use, and gets out of the way.
|
|
8
|
+
//
|
|
9
|
+
// The npm package exists because many people reach for `npx` before anything
|
|
10
|
+
// else, and because the name should belong to the project.
|
|
11
|
+
//
|
|
12
|
+
// The package is `dartvel_dev` and the command is `dartvel`. Those differ on
|
|
13
|
+
// purpose: `dartvel` was taken on pub.dev on 2026-08-06 by an unrelated
|
|
14
|
+
// package, so the published name carries the suffix while the thing you type
|
|
15
|
+
// does not.
|
|
16
|
+
|
|
17
|
+
'use strict';
|
|
18
|
+
|
|
19
|
+
const { spawn, spawnSync } = require('child_process');
|
|
20
|
+
|
|
21
|
+
/** The pub.dev package that carries the CLI. */
|
|
22
|
+
const PUB_PACKAGE = 'dartvel_dev';
|
|
23
|
+
|
|
24
|
+
/** The command that package installs. */
|
|
25
|
+
const COMMAND = 'dartvel';
|
|
26
|
+
|
|
27
|
+
/** Where to send someone who has no Dart at all. */
|
|
28
|
+
const INSTALL_DART = 'https://docs.flutter.dev/get-started/install';
|
|
29
|
+
|
|
30
|
+
function which(command) {
|
|
31
|
+
const probe = spawnSync(
|
|
32
|
+
process.platform === 'win32' ? 'where' : 'which',
|
|
33
|
+
[command],
|
|
34
|
+
{ encoding: 'utf8' }
|
|
35
|
+
);
|
|
36
|
+
return probe.status === 0 && String(probe.stdout).trim().length > 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Whether the Dartvel CLI is already on the PATH. */
|
|
40
|
+
function hasDartvel() {
|
|
41
|
+
return which(COMMAND);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Whether a Dart SDK is available to install it with. */
|
|
45
|
+
function hasDart() {
|
|
46
|
+
return which('dart') || which('flutter');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function activate() {
|
|
50
|
+
// Not silent: this downloads and compiles, and a launcher that appears to
|
|
51
|
+
// hang is worse than one that says what it is doing.
|
|
52
|
+
process.stderr.write(
|
|
53
|
+
`${COMMAND} is not installed yet — running: ` +
|
|
54
|
+
`dart pub global activate ${PUB_PACKAGE}\n`
|
|
55
|
+
);
|
|
56
|
+
const result = spawnSync('dart', ['pub', 'global', 'activate', PUB_PACKAGE], {
|
|
57
|
+
stdio: 'inherit',
|
|
58
|
+
});
|
|
59
|
+
return result.status === 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Run the Dartvel CLI with `args`, resolving to its exit code. */
|
|
63
|
+
function run(args) {
|
|
64
|
+
if (hasDartvel()) {
|
|
65
|
+
return spawnThrough(COMMAND, args);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!hasDart()) {
|
|
69
|
+
process.stderr.write(
|
|
70
|
+
'Dartvel needs the Dart SDK, and there is no `dart` on your PATH.\n' +
|
|
71
|
+
`Install Flutter, which includes Dart: ${INSTALL_DART}\n`
|
|
72
|
+
);
|
|
73
|
+
return Promise.resolve(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!activate()) {
|
|
77
|
+
process.stderr.write(
|
|
78
|
+
`Could not install ${PUB_PACKAGE} from pub.dev.\n` +
|
|
79
|
+
`Try it directly: dart pub global activate ${PUB_PACKAGE}\n`
|
|
80
|
+
);
|
|
81
|
+
return Promise.resolve(1);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// `pub global activate` installs into ~/.pub-cache/bin, which is on the PATH
|
|
85
|
+
// only if the user has put it there. Going through `dart pub global run`
|
|
86
|
+
// works either way.
|
|
87
|
+
return spawnThrough('dart', ['pub', 'global', 'run', PUB_PACKAGE, ...args]);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function spawnThrough(command, args) {
|
|
91
|
+
return new Promise((resolve) => {
|
|
92
|
+
const child = spawn(command, args, { stdio: 'inherit' });
|
|
93
|
+
child.on('error', (error) => {
|
|
94
|
+
process.stderr.write(`Could not run ${command}: ${error.message}\n`);
|
|
95
|
+
resolve(1);
|
|
96
|
+
});
|
|
97
|
+
child.on('close', (code) => resolve(code === null ? 1 : code));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
module.exports = { run, hasDartvel, hasDart, PUB_PACKAGE, COMMAND };
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dartvel_dev",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Dartvel — a batteries-included, AI-native full-stack application platform built around Flutter. This is the npm launcher for the CLI published on pub.dev as dartvel_dev.",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"dartvel": "./bin/dartvel.js",
|
|
8
|
+
"dartvel_dev": "./bin/dartvel.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"index.js",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./index.js"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "node --check index.js && node --check bin/dartvel.js && node test.js"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"dartvel",
|
|
24
|
+
"flutter",
|
|
25
|
+
"dart",
|
|
26
|
+
"full-stack",
|
|
27
|
+
"framework",
|
|
28
|
+
"cli"
|
|
29
|
+
],
|
|
30
|
+
"author": "SigmaDev",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/Danroyal001/dartvel_dev.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://dartvel.dev",
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {}
|
|
41
|
+
}
|