Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
/arcgis-js-cliPublic archive

CLI to build a template application and widgets using the ArcGIS API for JavaScript

License

NotificationsYou must be signed in to change notification settings

Esri/arcgis-js-cli

Repository files navigation

⚠️ This repository has been archived
This package is no longer supported. Use at your own risk.

This CLI will allow you to quickly scaffold various applications for theArcGIS Maps SDK JavaScript.

NOTE: It is highly recommended that you useVite directly to build your apps. We also provide a number ofapplication 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 asdegit.

4.25 Breaking Changes

There is no longer a webpack template provided for this CLI. The only application template usesVite. You can find webpack application samplehere.

Usage

Prerequisites

You will need node v8+.

  • NOTE FOR WINDOWS USERS - You may need to install theWindows-Build-Tools to compile npm modules for this project.npm install --global --production windows-build-tools

Installation

From NPM

npm install -g @arcgis/cli

In a terminal, run:

arcgis --help

This will output the following:

Usage: arcgis<name> [dest] -t<type>Commands:  arcgis create<name> [dest]  Create a new application.  arcgis init [type]           Initialize a new applicationin current directory  arcgis widget<name> [type]  Create a new Widget.  arcgis styles<subcommand>   Run commands to work with a custom CSS                               theme

Quick Start

template application

arcgis create jsapi-app

Sample Apps

Features

Create a new application

$ arcgis create<name> [dest]Create a new application.Options:  --version   Show version number                                                        [boolean]  --name, -n  directory and package namefor the new app  --dest      Directory to create the applicationin                                     [default:<name>]  --type, -t  A project template           [choices:"jsapi"] [default:"jsapi"]  -h, --help  Showhelp                                                                  [boolean]

Initialize a new application in current directory

$ arcgis init [type]Initialize a new applicationin current directoryOptions:  --version   Show version number                                                        [boolean]  --type, -t  A project template           [choices:"jsapi"]                  [default:"jsapi"]  -h, --help  Showhelp                                                                  [boolean]

Create a new widget

You can scaffold a standalone widget for use in your application. Widgets are saved into atmp folder.

$ arcgis widget<name> [type]Create a new Widget.Options:  --version   Show version number                                      [boolean]  --name, -n  Name of new widget  --type, -t  A widget template            [choices:"jsapi","exb"] [default:"jsapi"]  -h, --help  Showhelp                                                [boolean]

Experience Builder Widgets

The CLI can be used to scaffold custom widgets for theArcGIS Experience Builder Developer Edition.

You will want to run the CLI in the extracted root directory of your Experience Builder installation.

arcgis widget my-widget -t exb

This will install your widget in the Experience Builder folder structure as follows.

<Experience-Builder-Installation>\client\your-extensions\widgets\MyWidget\

Author a custom theme

Create a new CSS theme.

$ arcgis styles<subcommand>Run subcommands to work with a custom CSS themeCommands:  arcgis styles create [theme]   Create a custom theme  arcgis styles preview [theme]  Launch theme-previewtest page  arcgis styles eject [theme]    Eject a built theme readyfor deployment  arcgis styles list             List existing themesin the current project  arcgis styles clean            Removes anylocal scaffolding. This should be                                 used when no more theme authoring is to bedonein the working directory.  arcgis styles scaffold         Sets up project scaffolding. This isdone                                 automatically when creating a themefor the                                 first time.

Create a new theme

$ arcgis styles create [theme]Create a custom themePositionals:  theme  the name of the theme to create   [string] [default:"my-custom-theme"]Options:      --version            Show version number                             [boolean]      -e, --with-examples  when specified, the created theme will include examples                           from the SDK                                    [boolean]      -b, --with-base      when specified, the created theme will include base filesforlocal overrides (advanced)                  [boolean]      -f, --force          overwrites a themeif it already exists         [boolean]      -h, --help           Showhelp                                       [boolean]

Preview a theme

$ arcgis styles preview [theme]Launch theme-previewtest pagePositionals:  theme  the name of the theme to preview (this is only neededif there is more         than one themein the workspace)  [string] [default:"my-custom-theme"]Options:      --version      Show version number                                   [boolean]      -p, --port     port to usefor the preview page                       [number]      -h, --help     Showhelp                                             [boolean]

Eject a theme

$ arcgis styles eject [theme]Eject a built theme readyfor deploymentPositionals:  theme  the name of the theme to eject (this is only neededif there is more         than one themein the workspace)  [string] [default:"my-custom-theme"]Options:      --version      Show version number                                   [boolean]      -h, --help     Showhelp                                             [boolean]

List themes

$ arcgis styles listList existing themesin the current projectOptions:      --version      Show version number                                   [boolean]      -h, --help     Showhelp                                             [boolean]

Clean themes workspace

$ arcgis styles cleanRemoves anylocal scaffolding. This should be used when no more theme authoringis to bedonein the working directory.Options:      --version      Show version number                                   [boolean]      -f, --force    required to clean anylocal scaffolding used by this utility                                                                           [boolean]      -h, --help     Showhelp                                             [boolean]

Scaffold styling workspace

$ arcgis styles scaffoldSets up project scaffolding. This isdone automatically when creating a themefor the first time.Options:      --version      Show version number                                   [boolean]      -f, --force    forces creation of project scaffolding                [boolean]      -h, --help     Showhelp                                             [boolean]

Licensing

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

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository'sLICENSE file


[8]ページ先頭

©2009-2025 Movatter.jp