{"id":15494109,"url":"https://github.com/line-o/gulp-exist-example","last_synced_at":"2025-04-22T20:22:54.392Z","repository":{"id":46483797,"uuid":"308718789","full_name":"line-o/gulp-exist-example","owner":"line-o","description":"What can you achieve with gulp-exist? Have a try and find out.","archived":false,"fork":false,"pushed_at":"2021-10-08T13:16:34.000Z","size":506,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-19T11:31:08.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/line-o.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-30T18:56:19.000Z","updated_at":"2022-03-24T09:53:41.000Z","dependencies_parsed_at":"2022-09-22T12:50:58.548Z","dependency_job_id":null,"html_url":"https://github.com/line-o/gulp-exist-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line-o%2Fgulp-exist-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line-o%2Fgulp-exist-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line-o%2Fgulp-exist-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line-o%2Fgulp-exist-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/line-o","download_url":"https://codeload.github.com/line-o/gulp-exist-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250316446,"owners_count":21410543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:11:25.349Z","updated_at":"2025-04-22T20:22:54.370Z","avatar_url":"https://github.com/line-o.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-exist-example\n\nWhat can you achieve with gulp-exist? Have a try and find out.\n\nA completely ant-less build of a existdb application.\n\n## Prerequisites\n\n- NodeJS\n- an existdb (preferrably 5.0.0 or later) instance running\n\n## Installation\n\n1. Create a project-folder `my-new-app` with this example in it:\n    ```bash\n    npx degit line-o/gulp-exist-example#main my-new-app\n    ```\n\n2. Switch to that project-folder and install the dependencies:\n    ```bash\n    cd my-new-app\n    npm i\n    ```\n\n3. (optional) Copy the example env file \n    `cp .env.example .env`\n4. (optional) Modify the variables to match your setup\n\n## Things you can do\n\nFor convenience this example defines three npm-scripts. This way there is no need to install any package globally (namely `gulp`).\n\n- `npm start` : create XAR package and deploy it immediately to an existdb instance\n- `npm run build`: create XAR package (in the dist-folder of your project)\n- `npm run watch`: start a watcher, builds and deploys changed files to existdb\n\nThe scripts above will first call [dotenv](https://www.npmjs.com/package/dotenv) before calling the gulp task itself. This will read the connection options from `.env` and set them as variables in ENV. \n\n### Testing it for the first time\n\n- run `gulp install`\n- have a look at the packagemanager of your existdb instance\n- increase the version in package.json\n- then run `gulp install` again\n\n### Further down the rabbit hole\n\n- run `gulp watch` and change anything in the src folder\n- observe how SCSS is compiled, JavaScript minified and static files copied\n- after that it will immediately be synced to your database, too\n\n## What else?\n\n`gulp --tasks` will give you an idea of gulp tasks you can try.\n\n```sh\n├── clean\n├── templates\n├── watch:tmpl\n├── styles\n├── watch:styles\n├── minify\n├── watch:es\n├── copy\n├── watch:static\n├── build\n├── watch\n├── deploy\n├── xar\n├── install\n└── default\n```\n\n## How does it work?\n\nThe `gulpfile.js` gathers metadata from package.json to populate the package descriptor dynamically. Additional \nAlso the server connection is read from environment variables. \n\n| variable      | default value          | description\n| ----          | ----                   | ----\n|`EXIST_SERVER` | https://localhost:8443 | the URL to connect to the existdb server\n|`EXIST_USER`   | admin                  | the user to connect to the existdb server\n|`EXIST_PASS`   | _empty_                | the password for the user (must be set in order for EXIST_USER to take effect)\n\nYou can also look at [dotenv-cli](https://www.npmjs.com/package/dotenv-cli) documentation for more options.\n\nThe resulting XAR can now also be installed directly from gulp (actually directly using one of the latest features in [node-exist](https://github.com/eXist-db/node-exist)).\n\n## What's next?\n\n- SCSS is kind of dated, a postCSS example might be more interesting\n- [x] refactor the template replacement into either gulp-exist or even an npm package of its own\n- [ ] investigate npm initializers (think create-react-app)\n- If you have an idea what would be useful -\u003e open an issue :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline-o%2Fgulp-exist-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fline-o%2Fgulp-exist-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline-o%2Fgulp-exist-example/lists"}