Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
feat: update for 4.25
Browse files Browse the repository at this point in the history
remove webpack template, update vite template
  • Loading branch information
odoe committed Nov 10, 2022
1 parent 3a2c6a3 commit 0a69104
Show file tree
Hide file tree
Showing 64 changed files with 188 additions and 998 deletions.
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/child_process.js":"1","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/cross-spawn-promise.js":"2","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/del.js":"3","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/fs-extra.js":"4","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/fs.js":"5","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/fs.promised.js":"6","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/inquirer.js":"7","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/live-server.js":"8","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/ora.js":"9","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/path.js":"10","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/pkg-dir.js":"11","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/recursive-copy.js":"12","/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/request-promise-native.js":"13","/Users/rene8209/Documents/dev/github/arcgis-js-cli/src/lib/__mocks__/downloadAsync.js":"14","/Users/rene8209/Documents/dev/github/arcgis-js-cli/src/lib/__mocks__/installer.js":"15","/Users/rene8209/Documents/dev/github/arcgis-js-cli/src/lib/__mocks__/readDirR.js":"16"},{"size":778,"mtime":1668099711362,"results":"17","hashOfConfig":"18"},{"size":731,"mtime":1668099711363,"results":"19","hashOfConfig":"18"},{"size":660,"mtime":1668099711364,"results":"20","hashOfConfig":"18"},{"size":1071,"mtime":1668099711364,"results":"21","hashOfConfig":"18"},{"size":1174,"mtime":1668099711365,"results":"22","hashOfConfig":"18"},{"size":1085,"mtime":1668099711365,"results":"23","hashOfConfig":"18"},{"size":813,"mtime":1668099711366,"results":"24","hashOfConfig":"18"},{"size":709,"mtime":1668099711367,"results":"25","hashOfConfig":"18"},{"size":1142,"mtime":1668099711368,"results":"26","hashOfConfig":"18"},{"size":672,"mtime":1668099711368,"results":"27","hashOfConfig":"18"},{"size":766,"mtime":1668099711369,"results":"28","hashOfConfig":"18"},{"size":763,"mtime":1668099711371,"results":"29","hashOfConfig":"18"},{"size":1112,"mtime":1668099711372,"results":"30","hashOfConfig":"18"},{"size":840,"mtime":1668099711380,"results":"31","hashOfConfig":"18"},{"size":766,"mtime":1668099711381,"results":"32","hashOfConfig":"18"},{"size":725,"mtime":1668099711382,"results":"33","hashOfConfig":"18"},{"filePath":"34","messages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"1s9n2sm",{"filePath":"36","messages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"38","messages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"42","messages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"44","messages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"46","messages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"48","messages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"52","messages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"54","messages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"56","messages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"58","messages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"60","messages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"64","messages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/child_process.js",["66"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/cross-spawn-promise.js",["67"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/del.js",[],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/fs-extra.js",["68","69","70","71"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/fs.js",["72","73","74","75","76","77"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/fs.promised.js",["78","79","80","81"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/inquirer.js",["82","83"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/live-server.js",[],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/ora.js",["84","85"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/path.js",["86"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/pkg-dir.js",["87","88"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/recursive-copy.js",["89","90"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/__mocks__/request-promise-native.js",["91","92","93"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/src/lib/__mocks__/downloadAsync.js",[],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/src/lib/__mocks__/installer.js",["94"],"/Users/rene8209/Documents/dev/github/arcgis-js-cli/src/lib/__mocks__/readDirR.js",[],{"ruleId":"95","severity":1,"message":"96","line":18,"column":34,"nodeType":"97","messageId":"98","endLine":18,"endColumn":38},{"ruleId":"95","severity":1,"message":"96","line":17,"column":34,"nodeType":"97","messageId":"98","endLine":17,"endColumn":38},{"ruleId":"95","severity":1,"message":"96","line":21,"column":26,"nodeType":"97","messageId":"98","endLine":21,"endColumn":30},{"ruleId":"95","severity":1,"message":"99","line":22,"column":31,"nodeType":"97","messageId":"98","endLine":22,"endColumn":37},{"ruleId":"95","severity":1,"message":"96","line":27,"column":30,"nodeType":"97","messageId":"98","endLine":27,"endColumn":34},{"ruleId":"95","severity":1,"message":"99","line":32,"column":31,"nodeType":"97","messageId":"98","endLine":32,"endColumn":37},{"ruleId":"95","severity":1,"message":"96","line":18,"column":32,"nodeType":"97","messageId":"98","endLine":18,"endColumn":36},{"ruleId":"95","severity":1,"message":"96","line":19,"column":31,"nodeType":"97","messageId":"98","endLine":19,"endColumn":35},{"ruleId":"95","severity":1,"message":"96","line":21,"column":30,"nodeType":"97","messageId":"98","endLine":21,"endColumn":34},{"ruleId":"95","severity":1,"message":"96","line":29,"column":27,"nodeType":"97","messageId":"98","endLine":29,"endColumn":31},{"ruleId":"95","severity":1,"message":"96","line":32,"column":25,"nodeType":"97","messageId":"98","endLine":32,"endColumn":29},{"ruleId":"95","severity":1,"message":"96","line":33,"column":24,"nodeType":"97","messageId":"98","endLine":33,"endColumn":28},{"ruleId":"95","severity":1,"message":"96","line":20,"column":30,"nodeType":"97","messageId":"98","endLine":20,"endColumn":34},{"ruleId":"95","severity":1,"message":"99","line":25,"column":31,"nodeType":"97","messageId":"98","endLine":25,"endColumn":37},{"ruleId":"95","severity":1,"message":"96","line":30,"column":31,"nodeType":"97","messageId":"98","endLine":30,"endColumn":35},{"ruleId":"95","severity":1,"message":"99","line":31,"column":31,"nodeType":"97","messageId":"98","endLine":31,"endColumn":37},{"ruleId":"95","severity":1,"message":"96","line":16,"column":20,"nodeType":"97","messageId":"98","endLine":16,"endColumn":24},{"ruleId":"95","severity":1,"message":"99","line":20,"column":31,"nodeType":"97","messageId":"98","endLine":20,"endColumn":37},{"ruleId":"95","severity":1,"message":"96","line":17,"column":29,"nodeType":"97","messageId":"98","endLine":17,"endColumn":33},{"ruleId":"95","severity":1,"message":"99","line":18,"column":31,"nodeType":"97","messageId":"98","endLine":18,"endColumn":37},{"ruleId":"95","severity":1,"message":"96","line":16,"column":21,"nodeType":"97","messageId":"98","endLine":16,"endColumn":25},{"ruleId":"95","severity":1,"message":"96","line":16,"column":28,"nodeType":"97","messageId":"98","endLine":16,"endColumn":32},{"ruleId":"95","severity":1,"message":"99","line":17,"column":31,"nodeType":"97","messageId":"98","endLine":17,"endColumn":37},{"ruleId":"95","severity":1,"message":"96","line":17,"column":26,"nodeType":"97","messageId":"98","endLine":17,"endColumn":30},{"ruleId":"95","severity":1,"message":"99","line":18,"column":31,"nodeType":"97","messageId":"98","endLine":18,"endColumn":37},{"ruleId":"100","severity":1,"message":"101","line":36,"column":16,"nodeType":"102","messageId":"103","endLine":36,"endColumn":41},{"ruleId":"100","severity":1,"message":"104","line":36,"column":33,"nodeType":"97","messageId":"105","endLine":36,"endColumn":40},{"ruleId":"95","severity":1,"message":"99","line":43,"column":31,"nodeType":"97","messageId":"98","endLine":43,"endColumn":37},{"ruleId":"95","severity":1,"message":"99","line":18,"column":31,"nodeType":"97","messageId":"98","endLine":18,"endColumn":37},"@typescript-eslint/no-unused-vars","'args' is defined but never used.","Identifier","unusedVar","'reject' is defined but never used.","@typescript-eslint/explicit-module-boundary-types","Missing return type on function.","FunctionDeclaration","missingReturnType","Argument 'options' should be typed.","missingArgType"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020 Esri
Copyright 2022 Esri

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

This CLI will allow you to quickly scaffold various applications for the [ArcGIS API for JavaScript](https://developers.arcgis.com/javascript/).

> NOTE: It is highly recommended that you use [Vite](https://vitejs.dev/) directly to build your apps. We also provide a number of [application samples](https://github.com/Esri/jsapi-resources/tree/master/esm-samples) that you can use. The 4.25 release of this CLI will most likely be the last release. There are other tools already suited for using existing repositories for applications, such as [degit](https://github.com/Rich-Harris/degit).
## 4.25 Breaking Changes

There is no longer a webpack template provided for this CLI. The only application template uses [Vite](https://vitejs.dev/). You can find webpack application sample [here](https://github.com/Esri/jsapi-resources/tree/master/esm-samples/webpack).

## Usage

### Prerequisites
Expand Down Expand Up @@ -44,16 +50,11 @@ Commands:

## Quick Start

> default template webpack application
> template application
```sh
arcgis create jsapi-app
```

> vite template application
```sh
arcgis create jsapi-vite-app -t vite
```

## Sample Apps

* [ArcGIS Basic App](https://jsapi-basic-416.surge.sh/)
Expand All @@ -73,7 +74,7 @@ Options:
--version Show version number [boolean]
--name, -n directory and package name for the new app
--dest Directory to create the application in [default: <name>]
--type, -t A project template [choices: "jsapi". "vite"] [default: "jsapi"]
--type, -t A project template [choices: "jsapi"] [default: "jsapi"]
-h, --help Show help [boolean]

```
Expand All @@ -87,7 +88,7 @@ Initialize a new application in current directory

Options:
--version Show version number [boolean]
--type, -t A project template [choices: "jsapi". "vite"] [default: "jsapi"]
--type, -t A project template [choices: "jsapi"] [default: "jsapi"]
-h, --help Show help [boolean]
```

Expand Down Expand Up @@ -251,7 +252,7 @@ Anyone and everyone is welcome to [contribute](CONTRIBUTING.md). We do accept pu
4. Improve documentation
## Licensing
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Expand Down
8 changes: 4 additions & 4 deletions __mocks__/child_process.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -16,9 +16,9 @@
const child_process = {};

export const spawn = jest.fn((...args) => {
return {
kill () {}
};
return {
kill() {},
};
});

child_process.spawn = spawn;
Expand Down
8 changes: 4 additions & 4 deletions __mocks__/cross-spawn-promise.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -15,9 +15,9 @@
/* global jest */

export const spawn = jest.fn((...args) => {
return Promise.resolve({
kill() {}
});
return Promise.resolve({
kill() {},
});
});

export default spawn;
2 changes: 1 addition & 1 deletion __mocks__/del.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand Down
20 changes: 9 additions & 11 deletions __mocks__/fs-extra.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -19,21 +19,19 @@ const fse = {};
fse.__RETURN = null;

const copy = jest.fn((...args) => {
return new Promise((resolve, reject) => {
process.nextTick(
() => resolve()
);
});
return new Promise((resolve, reject) => {
process.nextTick(() => resolve());
});
});

const readFile = jest.fn((...args) => {
const file = `{
const file = `{
"name": "Sam"
}`;
let result = fse.__RETURN ? fse.__RETURN : file;
return new Promise((resolve, reject) => {
process.nextTick(() => resolve(result));
});
let result = fse.__RETURN ? fse.__RETURN : file;
return new Promise((resolve, reject) => {
process.nextTick(() => resolve(result));
});
});

fse.copy = copy;
Expand Down
12 changes: 6 additions & 6 deletions __mocks__/fs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint spaced-comment:0 */
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -19,18 +19,18 @@ const existsSync = jest.fn((...args) => true);
const mkdirSync = jest.fn((...args) => {});

const statSync = jest.fn((...args) => {
return {
isDirectory: jest.fn(() => true)
};
return {
isDirectory: jest.fn(() => true),
};
});

const readdirSync = jest.fn(() => []);

const rmdir = jest.fn((...args) => []);

export const promises = {
writeFile: jest.fn((...args) => []),
readFile: jest.fn((...args) => {})
writeFile: jest.fn((...args) => []),
readFile: jest.fn((...args) => {}),
};

fs.statSync = statSync;
Expand Down
18 changes: 9 additions & 9 deletions __mocks__/fs.promised.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint spaced-comment:0 */
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -18,19 +18,19 @@ const fsp = {};
fsp.__RETURN = null;

const readFile = jest.fn((...args) => {
const file = `{
const file = `{
"name": "Sam"
}`;
let result = fsp.__RETURN ? fsp.__RETURN : file;
return new Promise((resolve, reject) => {
process.nextTick(() => resolve(result));
});
let result = fsp.__RETURN ? fsp.__RETURN : file;
return new Promise((resolve, reject) => {
process.nextTick(() => resolve(result));
});
});

const writeFile = jest.fn((...args) => {
return new Promise((resolve, reject) => {
process.nextTick(() => resolve());
});
return new Promise((resolve, reject) => {
process.nextTick(() => resolve());
});
});

fsp.readFile = readFile;
Expand Down
16 changes: 7 additions & 9 deletions __mocks__/inquirer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -14,14 +14,12 @@
const inquirer = {};

const prompt = (...args) => {
const answers = {
tpltype: "storymap"
};
return new Promise((resolve, reject) => {
process.nextTick(
() => resolve(answers)
);
});
const answers = {
tpltype: 'storymap',
};
return new Promise((resolve, reject) => {
process.nextTick(() => resolve(answers));
});
};

inquirer.prompt = prompt;
Expand Down
8 changes: 4 additions & 4 deletions __mocks__/live-server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -14,9 +14,9 @@
/* eslint spaced-comment:0 */
/* global jest */
const liveServer = () => {
return {
start: jest.fn()
};
return {
start: jest.fn(),
};
};

export default liveServer();
52 changes: 26 additions & 26 deletions __mocks__/ora.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -15,33 +15,33 @@
/* global jest */

const succeed = jest.fn((...args) => {
return new Promise((resolve, reject) => {
process.nextTick(() => resolve());
});
return new Promise((resolve, reject) => {
process.nextTick(() => resolve());
});
});

const ora = jest.fn().mockImplementation(args => {
ora.__text = args.text;
return {
start: jest.fn(() => {
return {
info() {},
start() {},
stop() {},
fail() {},
get text() {
return ora.__text;
},
set text(v) {
ora.__text = v;
},
succeed
};
}),
stop() {},
succeed,
fail() {}
};
const ora = jest.fn().mockImplementation((args) => {
ora.__text = args.text;
return {
start: jest.fn(() => {
return {
info() {},
start() {},
stop() {},
fail() {},
get text() {
return ora.__text;
},
set text(v) {
ora.__text = v;
},
succeed,
};
}),
stop() {},
succeed,
fail() {},
};
});

ora.__succeed = succeed;
Expand Down
4 changes: 2 additions & 2 deletions __mocks__/path.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2020 Esri
Copyright 2022 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -13,7 +13,7 @@

const path = {};

const resolve = (...args) => "~redcup";
const resolve = (...args) => '~redcup';

path.resolve = resolve;

Expand Down
Loading

0 comments on commit 0a69104

Please sign in to comment.