@quilted/create 0.1.19 → 0.1.22
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/CHANGELOG.md +18 -0
- package/build/cjs/app.cjs +21 -13
- package/build/cjs/index.cjs +85 -39
- package/build/cjs/package-manager.cjs +15 -5
- package/build/cjs/package.cjs +28 -21
- package/build/cjs/parser-babel.cjs +3 -3
- package/build/cjs/parser-yaml.cjs +2 -2
- package/build/cjs/standalone.cjs +3 -3
- package/build/esm/app.mjs +21 -13
- package/build/esm/index.mjs +84 -40
- package/build/esm/package-manager.mjs +15 -5
- package/build/esm/package.mjs +28 -21
- package/build/esm/parser-babel.mjs +1 -1
- package/build/esm/parser-yaml.mjs +1 -1
- package/build/esm/standalone.mjs +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/package.d.ts +1 -1
- package/package.json +5 -3
- package/quilt.project.ts +19 -5
- package/source/create.ts +2 -2
- package/source/package.ts +1 -1
- package/templates/app-basic/quilt.project.ts +5 -5
- package/templates/app-basic/tsconfig.json +1 -1
- package/templates/app-single-file/quilt.project.ts +3 -4
- package/templates/app-single-file/tsconfig.json +1 -1
- package/templates/package/package.json +2 -2
- package/templates/package/quilt.project.ts +3 -4
- package/templates/package/tsconfig.json +1 -1
- package/tsconfig.json +1 -1
- package/build/cjs/_commonjsHelpers.cjs +0 -10
- package/build/esm/_commonjsHelpers.mjs +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @quilted/create
|
|
2
2
|
|
|
3
|
+
## 0.1.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a12c3576`](https://github.com/lemonmade/quilt/commit/a12c357693b173461f51a35fb7efdd0a9267e471) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix more build issues
|
|
8
|
+
|
|
9
|
+
## 0.1.21
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`0629288e`](https://github.com/lemonmade/quilt/commit/0629288ee4ba2e2ccfd73fbb216c3559e1a5c77e) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix missing package builds
|
|
14
|
+
|
|
15
|
+
## 0.1.20
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#364](https://github.com/lemonmade/quilt/pull/364) [`4dc1808a`](https://github.com/lemonmade/quilt/commit/4dc1808a86d15e821b218b528617430cbd8b5b48) Thanks [@lemonmade](https://github.com/lemonmade)! - Update to simplified Quilt config
|
|
20
|
+
|
|
3
21
|
## 0.1.19
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/build/cjs/app.cjs
CHANGED
|
@@ -31,22 +31,28 @@ function _interopNamespace(e) {
|
|
|
31
31
|
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
32
32
|
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
33
33
|
|
|
34
|
+
let _ = t => t,
|
|
35
|
+
_t,
|
|
36
|
+
_t2,
|
|
37
|
+
_t3;
|
|
34
38
|
async function createApp() {
|
|
35
39
|
const argv = getArgv();
|
|
36
40
|
|
|
37
41
|
if (argv['--help']) {
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
var _argv$PackageManag;
|
|
43
|
+
|
|
44
|
+
const additionalOptions = index.stripIndent(_t || (_t = _`
|
|
45
|
+
${0}
|
|
40
46
|
The template to use for your new application. If you don’t specify a template,
|
|
41
47
|
this command will ask you for one instead. Must be one of the following:
|
|
42
48
|
|
|
43
|
-
- ${
|
|
44
|
-
- ${
|
|
45
|
-
|
|
49
|
+
- ${0}, a web app with a minimal file structure
|
|
50
|
+
- ${0}, an entire web app in a single file
|
|
51
|
+
`), index.cyan_1(`--template`), index.bold_1('basic'), index.bold_1('single-file'));
|
|
46
52
|
index.printHelp({
|
|
47
53
|
kind: 'app',
|
|
48
54
|
options: additionalOptions,
|
|
49
|
-
packageManager: argv['--package-manager']
|
|
55
|
+
packageManager: (_argv$PackageManag = argv['--package-manager']) === null || _argv$PackageManag === void 0 ? void 0 : _argv$PackageManag.toLowerCase()
|
|
50
56
|
});
|
|
51
57
|
return;
|
|
52
58
|
}
|
|
@@ -189,21 +195,21 @@ async function createApp() {
|
|
|
189
195
|
}
|
|
190
196
|
|
|
191
197
|
commands.push(`pnpm develop ${index.dim_1('# Start the development server')}`);
|
|
192
|
-
const whatsNext = index.stripIndent`
|
|
193
|
-
Your new app is ready to go! There’s just ${
|
|
198
|
+
const whatsNext = index.stripIndent(_t2 || (_t2 = _`
|
|
199
|
+
Your new app is ready to go! There’s just ${0} you’ll need to take
|
|
194
200
|
in order to start developing:
|
|
195
|
-
|
|
201
|
+
`), commands.length > 1 ? 'a few more steps' : 'one more step');
|
|
196
202
|
console.log();
|
|
197
203
|
console.log(whatsNext);
|
|
198
204
|
console.log();
|
|
199
205
|
console.log(commands.map(command => ` ${command}`).join('\n'));
|
|
200
|
-
const followUp = index.stripIndent`
|
|
206
|
+
const followUp = index.stripIndent(_t3 || (_t3 = _`
|
|
201
207
|
Quilt can also help you build, test, lint, and type-check your new application.
|
|
202
208
|
You can learn more about building apps with Quilt by reading the documentation:
|
|
203
|
-
${
|
|
209
|
+
${0}
|
|
204
210
|
|
|
205
211
|
Have fun! 🎉
|
|
206
|
-
|
|
212
|
+
`), index.underline_1(index.magenta_1('https://github.com/lemonmade/quilt/tree/main/documentation')));
|
|
207
213
|
console.log();
|
|
208
214
|
console.log(followUp);
|
|
209
215
|
} // Argument handling
|
|
@@ -251,7 +257,9 @@ async function getName(argv, {
|
|
|
251
257
|
async function getDirectory(argv, {
|
|
252
258
|
name
|
|
253
259
|
}) {
|
|
254
|
-
|
|
260
|
+
var _argv$Directory;
|
|
261
|
+
|
|
262
|
+
let directory = path__namespace.resolve((_argv$Directory = argv['--directory']) !== null && _argv$Directory !== void 0 ? _argv$Directory : packageManager.toValidPackageName(name));
|
|
255
263
|
|
|
256
264
|
while (!argv['--yes']) {
|
|
257
265
|
if (fs__namespace.existsSync(directory) && !(await packageManager.isEmpty(directory))) {
|
package/build/cjs/index.cjs
CHANGED
|
@@ -34,6 +34,12 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
|
34
34
|
var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
|
35
35
|
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
36
36
|
|
|
37
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
38
|
+
|
|
39
|
+
function getDefaultExportFromCjs (x) {
|
|
40
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
const flagSymbol = Symbol('arg flag');
|
|
38
44
|
|
|
39
45
|
class ArgError extends Error {
|
|
@@ -807,88 +813,117 @@ var stripIndent = new TemplateTag(stripIndentTransformer, trimResultTransformer)
|
|
|
807
813
|
|
|
808
814
|
new TemplateTag(stripIndentTransformer('all'), trimResultTransformer);
|
|
809
815
|
|
|
816
|
+
var defineProperty = {exports: {}};
|
|
817
|
+
|
|
818
|
+
(function (module) {
|
|
819
|
+
function _defineProperty(obj, key, value) {
|
|
820
|
+
if (key in obj) {
|
|
821
|
+
Object.defineProperty(obj, key, {
|
|
822
|
+
value: value,
|
|
823
|
+
enumerable: true,
|
|
824
|
+
configurable: true,
|
|
825
|
+
writable: true
|
|
826
|
+
});
|
|
827
|
+
} else {
|
|
828
|
+
obj[key] = value;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
return obj;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
835
|
+
}(defineProperty));
|
|
836
|
+
|
|
837
|
+
var _defineProperty$1 = /*@__PURE__*/getDefaultExportFromCjs(defineProperty.exports);
|
|
838
|
+
|
|
810
839
|
class AbortError extends Error {
|
|
811
840
|
static test(error) {
|
|
812
841
|
return error != null && error.code === 'ABORT_ERR';
|
|
813
842
|
}
|
|
814
843
|
|
|
815
|
-
code = 'ABORT_ERR';
|
|
816
|
-
name = 'AbortError';
|
|
817
|
-
|
|
818
844
|
constructor(message = 'The operation was aborted') {
|
|
819
845
|
super(message);
|
|
846
|
+
|
|
847
|
+
_defineProperty$1(this, "code", 'ABORT_ERR');
|
|
848
|
+
|
|
849
|
+
_defineProperty$1(this, "name", 'AbortError');
|
|
820
850
|
}
|
|
821
851
|
|
|
822
852
|
}
|
|
823
853
|
|
|
854
|
+
let _$1 = t => t,
|
|
855
|
+
_t$1,
|
|
856
|
+
_t2,
|
|
857
|
+
_t3,
|
|
858
|
+
_t4;
|
|
824
859
|
function printHelp({
|
|
825
860
|
kind,
|
|
826
861
|
options: customOptions,
|
|
827
862
|
packageManager
|
|
828
863
|
}) {
|
|
829
864
|
const command = createCommand(packageManager);
|
|
830
|
-
const usage = stripIndent`
|
|
831
|
-
${
|
|
832
|
-
|
|
865
|
+
const usage = stripIndent(_t$1 || (_t$1 = _$1`
|
|
866
|
+
${0} ${0} ${0} ${0} ${0}
|
|
867
|
+
`), bold_1('Usage:'), command, kind ? magenta_1(kind) : magenta_1('[kind]'), green_1('[name]'), cyan_1('[options]'));
|
|
833
868
|
console.log(usage);
|
|
834
|
-
const example = stripIndent`
|
|
835
|
-
${
|
|
836
|
-
|
|
869
|
+
const example = stripIndent(_t2 || (_t2 = _$1`
|
|
870
|
+
${0} ${0} ${0} ${0} ${0}
|
|
871
|
+
`), bold_1('Example:'), command, magenta_1(kind !== null && kind !== void 0 ? kind : 'app'), green_1(`my-${kind !== null && kind !== void 0 ? kind : 'app'}`), cyan_1('--install'));
|
|
837
872
|
console.log(dim_1(example));
|
|
838
873
|
|
|
839
874
|
if (!kind) {
|
|
840
|
-
const kindSection = stripIndent`
|
|
841
|
-
${
|
|
875
|
+
const kindSection = stripIndent(_t3 || (_t3 = _$1`
|
|
876
|
+
${0} can be one of the following project types:
|
|
842
877
|
|
|
843
|
-
- ${
|
|
844
|
-
- ${
|
|
878
|
+
- ${0}, a web application
|
|
879
|
+
- ${0}, a shared library of code
|
|
845
880
|
|
|
846
881
|
You’ll be asked a few additional questions based on the kind you choose.
|
|
847
|
-
|
|
882
|
+
`), bold_1(magenta_1('kind')), magenta_1('app'), magenta_1('package'));
|
|
848
883
|
console.log();
|
|
849
884
|
console.log(kindSection);
|
|
850
885
|
}
|
|
851
886
|
|
|
852
|
-
const optionsSection = stripIndent`
|
|
853
|
-
${
|
|
887
|
+
const optionsSection = stripIndent(_t4 || (_t4 = _$1`
|
|
888
|
+
${0}
|
|
854
889
|
The name of the project. When creating a package, you should use the public name you
|
|
855
|
-
want for the package, including any scope you want to use (example: ${
|
|
890
|
+
want for the package, including any scope you want to use (example: ${0}).
|
|
856
891
|
If you don’t provide a name with this flag, this command will ask you for one later.
|
|
857
892
|
|
|
858
|
-
${
|
|
893
|
+
${0}
|
|
859
894
|
The directory to create the project in. If you don’t provide this flag, Quilt will pick
|
|
860
895
|
a default directory based on the kind of the project and the name you provided.
|
|
861
896
|
|
|
862
|
-
${
|
|
897
|
+
${0}, ${0}
|
|
863
898
|
If you aren’t already in a monorepo, this flag will create your new project with some
|
|
864
899
|
additional structure that allows it to be a monorepo — that is, you will be able to add
|
|
865
900
|
multiple projects to a single repository.
|
|
866
901
|
|
|
867
|
-
${
|
|
902
|
+
${0}, ${0}
|
|
868
903
|
Whether to install dependencies in the newly created project. If you do not provide this
|
|
869
904
|
flag, Quilt will ask you about it later.
|
|
870
905
|
|
|
871
|
-
${
|
|
906
|
+
${0}
|
|
872
907
|
The package manager to use for your new project. This choice will be used to populate
|
|
873
|
-
some commands, and will be used to install dependencies if the ${
|
|
908
|
+
some commands, and will be used to install dependencies if the ${0} flag is set.
|
|
874
909
|
|
|
875
|
-
Must be one of the following: ${
|
|
910
|
+
Must be one of the following: ${0}, ${0}, or ${0}.
|
|
876
911
|
|
|
877
|
-
${
|
|
912
|
+
${0}, ${0}
|
|
878
913
|
Extra developer tools to configure when creating your new project. This option only
|
|
879
914
|
applies when creating a brand new project, not when adding a project to an existing
|
|
880
915
|
workspace. You can include this flag multiple times to add multiple tools. You can
|
|
881
916
|
enable any of the following tools:
|
|
882
917
|
|
|
883
|
-
- ${
|
|
884
|
-
- ${
|
|
918
|
+
- ${0}, which adds a continuous integration (CI) GitHub Action to your project.
|
|
919
|
+
- ${0}, which adds some basic VSCode settings to your project.
|
|
885
920
|
|
|
886
|
-
${
|
|
921
|
+
${0}, ${0}
|
|
887
922
|
Answers “yes” to any question this command would have asked.
|
|
888
923
|
|
|
889
|
-
${
|
|
924
|
+
${0}, ${0}
|
|
890
925
|
Prints this help documentation.
|
|
891
|
-
|
|
926
|
+
`), cyan_1('--name'), bold_1('@my-org/my-package'), cyan_1('--directory'), cyan_1(`--monorepo`), cyan_1(`--no-monorepo`), cyan_1(`--install`), cyan_1(`--no-install`), cyan_1('--package-manager'), cyan_1('--install'), bold_1('pnpm'), bold_1('npm'), bold_1('yarn'), cyan_1(`--extras`), cyan_1(`--no-extras`), bold_1('github'), bold_1('vscode'), cyan_1('--yes'), cyan_1('-y'), cyan_1('--help'), cyan_1('-h'));
|
|
892
927
|
console.log();
|
|
893
928
|
console.log(`${bold_1(cyan_1('options'))} can include any of these flags:`);
|
|
894
929
|
|
|
@@ -906,8 +941,10 @@ function printOptionsSection(section) {
|
|
|
906
941
|
}
|
|
907
942
|
|
|
908
943
|
function createCommand(explicitPackageManager) {
|
|
944
|
+
var _process$env$npm_conf;
|
|
945
|
+
|
|
909
946
|
let packageManager;
|
|
910
|
-
const npmUserAgent = process.env['npm_config_user_agent']
|
|
947
|
+
const npmUserAgent = (_process$env$npm_conf = process.env['npm_config_user_agent']) !== null && _process$env$npm_conf !== void 0 ? _process$env$npm_conf : 'npm';
|
|
911
948
|
|
|
912
949
|
if (npmUserAgent.includes('pnpm') || explicitPackageManager === 'pnpm') {
|
|
913
950
|
packageManager = 'pnpm';
|
|
@@ -6657,7 +6694,9 @@ async function getPackageManager(argv) {
|
|
|
6657
6694
|
const explicitPackageManager = argv['--package-manager'].toLocaleLowerCase();
|
|
6658
6695
|
packageManager = VALID_PACKAGE_MANAGERS.has(explicitPackageManager) ? explicitPackageManager : 'npm';
|
|
6659
6696
|
} else {
|
|
6660
|
-
|
|
6697
|
+
var _process$env$npm_conf;
|
|
6698
|
+
|
|
6699
|
+
const npmUserAgent = (_process$env$npm_conf = process.env['npm_config_user_agent']) !== null && _process$env$npm_conf !== void 0 ? _process$env$npm_conf : 'npm';
|
|
6661
6700
|
|
|
6662
6701
|
if (npmUserAgent.includes('pnpm') || fs__namespace.existsSync('pnpm-lock.yaml')) {
|
|
6663
6702
|
packageManager = 'pnpm';
|
|
@@ -6696,7 +6735,8 @@ async function getExtrasToSetup(argv, {
|
|
|
6696
6735
|
return extrasToSetup;
|
|
6697
6736
|
}
|
|
6698
6737
|
|
|
6699
|
-
|
|
6738
|
+
let _ = t => t,
|
|
6739
|
+
_t;
|
|
6700
6740
|
const VALID_PROJECT_KINDS = new Set(['app', 'package']);
|
|
6701
6741
|
run().catch(error => {
|
|
6702
6742
|
if (AbortError.test(error)) return;
|
|
@@ -6705,6 +6745,8 @@ run().catch(error => {
|
|
|
6705
6745
|
});
|
|
6706
6746
|
|
|
6707
6747
|
async function run() {
|
|
6748
|
+
var _permissiveArgs$_$;
|
|
6749
|
+
|
|
6708
6750
|
const permissiveArgs = arg_1({
|
|
6709
6751
|
'--help': Boolean,
|
|
6710
6752
|
'-h': '--help',
|
|
@@ -6712,7 +6754,7 @@ async function run() {
|
|
|
6712
6754
|
}, {
|
|
6713
6755
|
permissive: true
|
|
6714
6756
|
});
|
|
6715
|
-
const firstArgument = permissiveArgs._[0]
|
|
6757
|
+
const firstArgument = (_permissiveArgs$_$ = permissiveArgs._[0]) === null || _permissiveArgs$_$ === void 0 ? void 0 : _permissiveArgs$_$.toLowerCase();
|
|
6716
6758
|
|
|
6717
6759
|
if (firstArgument != null && !firstArgument.startsWith('-') && !VALID_PROJECT_KINDS.has(firstArgument)) {
|
|
6718
6760
|
// TODO: show help with error message
|
|
@@ -6721,15 +6763,17 @@ async function run() {
|
|
|
6721
6763
|
}
|
|
6722
6764
|
|
|
6723
6765
|
let kind = firstArgument == null || !VALID_PROJECT_KINDS.has(firstArgument) ? undefined : firstArgument;
|
|
6724
|
-
const header = stripIndent`
|
|
6725
|
-
🧵 ${
|
|
6726
|
-
|
|
6766
|
+
const header = stripIndent(_t || (_t = _`
|
|
6767
|
+
🧵 ${0}
|
|
6768
|
+
`), bold_1('quilt create'));
|
|
6727
6769
|
console.log(header);
|
|
6728
6770
|
console.log();
|
|
6729
6771
|
|
|
6730
6772
|
if (permissiveArgs['--help'] && !kind) {
|
|
6773
|
+
var _permissiveArgs$Pac;
|
|
6774
|
+
|
|
6731
6775
|
printHelp({
|
|
6732
|
-
packageManager: permissiveArgs['--package-manager']
|
|
6776
|
+
packageManager: (_permissiveArgs$Pac = permissiveArgs['--package-manager']) === null || _permissiveArgs$Pac === void 0 ? void 0 : _permissiveArgs$Pac.toLowerCase()
|
|
6733
6777
|
});
|
|
6734
6778
|
return;
|
|
6735
6779
|
}
|
|
@@ -6761,9 +6805,9 @@ async function run() {
|
|
|
6761
6805
|
case 'package':
|
|
6762
6806
|
{
|
|
6763
6807
|
const {
|
|
6764
|
-
|
|
6808
|
+
createProject
|
|
6765
6809
|
} = await Promise.resolve().then(function () { return require('./package.cjs'); });
|
|
6766
|
-
await
|
|
6810
|
+
await createProject();
|
|
6767
6811
|
break;
|
|
6768
6812
|
}
|
|
6769
6813
|
}
|
|
@@ -6771,9 +6815,11 @@ async function run() {
|
|
|
6771
6815
|
|
|
6772
6816
|
exports.arg_1 = arg_1;
|
|
6773
6817
|
exports.bold_1 = bold_1;
|
|
6818
|
+
exports.commonjsGlobal = commonjsGlobal;
|
|
6774
6819
|
exports.cyan_1 = cyan_1;
|
|
6775
6820
|
exports.dim_1 = dim_1;
|
|
6776
6821
|
exports.getCreateAsMonorepo = getCreateAsMonorepo;
|
|
6822
|
+
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
6777
6823
|
exports.getExtrasToSetup = getExtrasToSetup;
|
|
6778
6824
|
exports.getPackageManager = getPackageManager;
|
|
6779
6825
|
exports.getShouldInstall = getShouldInstall;
|
|
@@ -30,7 +30,9 @@ function loadTemplate(name) {
|
|
|
30
30
|
let templateRootPromise;
|
|
31
31
|
return {
|
|
32
32
|
async copy(to, handleFile) {
|
|
33
|
-
|
|
33
|
+
var _templateRootPromise;
|
|
34
|
+
|
|
35
|
+
(_templateRootPromise = templateRootPromise) !== null && _templateRootPromise !== void 0 ? _templateRootPromise : templateRootPromise = templateDirectory(name);
|
|
34
36
|
const templateRoot = await templateRootPromise;
|
|
35
37
|
const targetRoot = path__namespace.resolve(to);
|
|
36
38
|
const files = fs__namespace.readdirSync(templateRoot).filter(file => !path__namespace.basename(file).startsWith('.'));
|
|
@@ -48,7 +50,9 @@ function loadTemplate(name) {
|
|
|
48
50
|
},
|
|
49
51
|
|
|
50
52
|
async read(file) {
|
|
51
|
-
|
|
53
|
+
var _templateRootPromise2;
|
|
54
|
+
|
|
55
|
+
(_templateRootPromise2 = templateRootPromise) !== null && _templateRootPromise2 !== void 0 ? _templateRootPromise2 : templateRootPromise = templateDirectory(name);
|
|
52
56
|
const templateRoot = await templateRootPromise;
|
|
53
57
|
return fs__namespace.readFileSync(path__namespace.join(templateRoot, file), {
|
|
54
58
|
encoding: 'utf8'
|
|
@@ -163,8 +167,10 @@ async function format(content, {
|
|
|
163
167
|
|
|
164
168
|
const ENDS_WITH_TSCONFIG = /[/]?tsconfig[.a-z0-9]*[.]json/i;
|
|
165
169
|
async function addToTsConfig(directory, output) {
|
|
170
|
+
var _tsconfig$references;
|
|
171
|
+
|
|
166
172
|
const tsconfig = JSON.parse(await output.read('tsconfig.json'));
|
|
167
|
-
tsconfig.references
|
|
173
|
+
(_tsconfig$references = tsconfig.references) !== null && _tsconfig$references !== void 0 ? _tsconfig$references : tsconfig.references = [];
|
|
168
174
|
const relativePath = path.relative(output.root, directory);
|
|
169
175
|
const relativeForDisplay = relativeDirectoryForDisplay(relativePath);
|
|
170
176
|
|
|
@@ -243,18 +249,22 @@ async function addToTsConfig(directory, output) {
|
|
|
243
249
|
|
|
244
250
|
async function addToPackageManagerWorkspaces(directory, output, packageManager) {
|
|
245
251
|
if (packageManager === 'pnpm') {
|
|
252
|
+
var _workspaceYaml$packag;
|
|
253
|
+
|
|
246
254
|
const {
|
|
247
255
|
parse,
|
|
248
256
|
stringify
|
|
249
257
|
} = await Promise.resolve().then(function () { return require('./index3.cjs'); }).then(function (n) { return n.index; });
|
|
250
258
|
const workspaceYaml = parse(await output.read('pnpm-workspace.yaml'));
|
|
251
|
-
workspaceYaml.packages = await addToWorkspaces(path.relative(output.root, directory), workspaceYaml.packages
|
|
259
|
+
workspaceYaml.packages = await addToWorkspaces(path.relative(output.root, directory), (_workspaceYaml$packag = workspaceYaml.packages) !== null && _workspaceYaml$packag !== void 0 ? _workspaceYaml$packag : []);
|
|
252
260
|
await output.write('pnpm-workspace.yaml', await format(stringify(workspaceYaml), {
|
|
253
261
|
as: 'yaml'
|
|
254
262
|
}));
|
|
255
263
|
} else {
|
|
264
|
+
var _packageJson$workspac;
|
|
265
|
+
|
|
256
266
|
const packageJson = JSON.parse(await output.read('package.json'));
|
|
257
|
-
packageJson.workspaces = await addToWorkspaces(path.relative(output.root, directory), packageJson.workspaces
|
|
267
|
+
packageJson.workspaces = await addToWorkspaces(path.relative(output.root, directory), (_packageJson$workspac = packageJson.workspaces) !== null && _packageJson$workspac !== void 0 ? _packageJson$workspac : []);
|
|
258
268
|
await output.write('package.json', await format(JSON.stringify(packageJson), {
|
|
259
269
|
as: 'json-stringify'
|
|
260
270
|
}));
|
package/build/cjs/package.cjs
CHANGED
|
@@ -31,27 +31,34 @@ function _interopNamespace(e) {
|
|
|
31
31
|
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
32
32
|
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
let _ = t => t,
|
|
35
|
+
_t,
|
|
36
|
+
_t2,
|
|
37
|
+
_t3,
|
|
38
|
+
_t4;
|
|
39
|
+
async function createProject() {
|
|
35
40
|
const argv = getArgv();
|
|
36
41
|
|
|
37
42
|
if (argv['--help']) {
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
var _argv$PackageManag;
|
|
44
|
+
|
|
45
|
+
const additionalOptions = index.stripIndent(_t || (_t = _`
|
|
46
|
+
${0}, ${0}
|
|
40
47
|
Whether this package will use React. If you don’t provide this option, the command
|
|
41
48
|
will ask you about it later.
|
|
42
49
|
|
|
43
|
-
${
|
|
50
|
+
${0}, ${0}
|
|
44
51
|
Whether this package will be published for other projects to install. If you do not
|
|
45
52
|
provide this option, the command will ask you about it later.
|
|
46
53
|
|
|
47
|
-
${
|
|
54
|
+
${0}
|
|
48
55
|
The package registry to publish this package to. This option only applies if you create
|
|
49
56
|
a public package. If you do not provide this option, it will use the default NPM registry.
|
|
50
|
-
|
|
57
|
+
`), index.cyan_1(`--react`), index.cyan_1(`--no-react`), index.cyan_1(`--public`), index.cyan_1(`--private`), index.cyan_1(`--registry`));
|
|
51
58
|
index.printHelp({
|
|
52
59
|
kind: 'package',
|
|
53
60
|
options: additionalOptions,
|
|
54
|
-
packageManager: argv['--package-manager']
|
|
61
|
+
packageManager: (_argv$PackageManag = argv['--package-manager']) === null || _argv$PackageManag === void 0 ? void 0 : _argv$PackageManag.toLowerCase()
|
|
55
62
|
});
|
|
56
63
|
return;
|
|
57
64
|
}
|
|
@@ -212,16 +219,16 @@ async function createPackage() {
|
|
|
212
219
|
console.log('Installed dependencies.');
|
|
213
220
|
}
|
|
214
221
|
|
|
215
|
-
const packageJsonInstructions = index.stripIndent`
|
|
222
|
+
const packageJsonInstructions = index.stripIndent(_t2 || (_t2 = _`
|
|
216
223
|
Your new package is ready to go! However, before you go too much further,
|
|
217
|
-
you should update the following fields in ${
|
|
224
|
+
you should update the following fields in ${0}:
|
|
218
225
|
|
|
219
|
-
- ${
|
|
220
|
-
- ${
|
|
226
|
+
- ${0}, where you provide a description of what your package does
|
|
227
|
+
- ${0}, where you should include the ${0} of your project’s repo
|
|
221
228
|
|
|
222
|
-
Before you publish your package, you will also want to update the ${
|
|
229
|
+
Before you publish your package, you will also want to update the ${0}
|
|
223
230
|
field in the package.json file.
|
|
224
|
-
|
|
231
|
+
`), index.cyan_1(packageManager.relativeDirectoryForDisplay(path__namespace.relative(process.cwd(), path__namespace.join(packageDirectory, 'package.json')))), index.bold_1(`"description"`), index.bold_1(`"repository"`), index.bold_1(`"url"`), index.bold_1(`"version"`));
|
|
225
232
|
console.log();
|
|
226
233
|
console.log(packageJsonInstructions);
|
|
227
234
|
const commands = [];
|
|
@@ -240,23 +247,23 @@ async function createPackage() {
|
|
|
240
247
|
}
|
|
241
248
|
|
|
242
249
|
if (commands.length > 0) {
|
|
243
|
-
const whatsNext = index.stripIndent`
|
|
244
|
-
After you update your package.json, there’s ${
|
|
250
|
+
const whatsNext = index.stripIndent(_t3 || (_t3 = _`
|
|
251
|
+
After you update your package.json, there’s ${0} you’ll need to take
|
|
245
252
|
in order to start building:
|
|
246
|
-
|
|
253
|
+
`), commands.length > 1 ? 'a few more steps' : 'one more step');
|
|
247
254
|
console.log();
|
|
248
255
|
console.log(whatsNext);
|
|
249
256
|
console.log();
|
|
250
257
|
console.log(commands.map(command => ` ${command}`).join('\n'));
|
|
251
258
|
}
|
|
252
259
|
|
|
253
|
-
const followUp = index.stripIndent`
|
|
260
|
+
const followUp = index.stripIndent(_t4 || (_t4 = _`
|
|
254
261
|
Quilt can help you build, test, lint, and type-check your new package. You
|
|
255
262
|
can learn more about building packages with Quilt by reading the documentation:
|
|
256
|
-
${
|
|
263
|
+
${0}
|
|
257
264
|
|
|
258
265
|
Have fun! 🎉
|
|
259
|
-
|
|
266
|
+
`), index.underline_1(index.magenta_1('https://github.com/lemonmade/quilt/tree/main/documentation')));
|
|
260
267
|
console.log();
|
|
261
268
|
console.log(followUp);
|
|
262
269
|
} // Argument handling
|
|
@@ -386,7 +393,7 @@ function adjustPackageJson(packageJson, {
|
|
|
386
393
|
packageJson.name = name;
|
|
387
394
|
const packageParts = name.split('/');
|
|
388
395
|
const scope = packageParts[0].startsWith('@') ? packageParts[0] : undefined;
|
|
389
|
-
const finalRegistry = registry
|
|
396
|
+
const finalRegistry = registry !== null && registry !== void 0 ? registry : 'https://registry.npmjs.org';
|
|
390
397
|
|
|
391
398
|
if (scope) {
|
|
392
399
|
packageJson.publishConfig[`${scope}/registry`] = finalRegistry;
|
|
@@ -422,4 +429,4 @@ function sortKeys(object) {
|
|
|
422
429
|
return newObject;
|
|
423
430
|
}
|
|
424
431
|
|
|
425
|
-
exports.
|
|
432
|
+
exports.createProject = createProject;
|