-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prepare rename to algoliasearch-netlify (#19)
- Loading branch information
Showing
15 changed files
with
129 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
dist/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
12.16.2 | ||
14.11.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,20 @@ | ||
> ⚠️ **This project is an alpha, not usable without dedicated access.** | ||
# crawler-netlify-plugin | ||
# Algolia's Netlify integration | ||
|
||
This plugin links your Netlify site with Algolia's Crawler. | ||
It will trigger a crawl on each successful build. | ||
This integration links your Netlify site with Algolia. | ||
|
||
## Architecture | ||
|
||
- [`src/`](./src/): plugin sources | ||
- [`public/`](./public/): test website | ||
- [`app/`](./app/): Front-end library | ||
- [`plugin/`](./plugin/): Netlify plugin sources | ||
- [`public/`](./public/): Test website | ||
|
||
## Environment variables | ||
The plugin links your Netlify site to Algolia's Crawler. | ||
It triggers a crawl on each successful build. | ||
|
||
- `ALGOLIA_API_KEY` [Optional in dev] API Key to authenticate the call to the crawler. | ||
- `ALGOLIA_BASE_URL` [Optional] Defaults to `https://crawler.algolia.com/`. | ||
|
||
For a local run, those need to be set in `.env` using `cp .env.example .env` and modifying the values to fit your needs. | ||
|
||
## Scripts | ||
|
||
- `yarn dev`: run dev environment | ||
- `yarn release`: build & publish the library | ||
This repository is itself a netlify site, which allows us to test the whole setup. | ||
|
||
## Development | ||
|
||
### Pre-requisites | ||
|
||
**Only accessible to Algolia employees.** | ||
|
||
1. Access to the Algolia team on Netlify (only granted to Algolia employees). | ||
2. Access to the test website in this org: https://app.netlify.com/sites/crawler-netlify-plugin/ | ||
3. Clone the repo and link it to the test website on Netlify: | ||
```sh | ||
git clone [email protected]:algolia/crawler-netlify-plugin.git | ||
cd crawler-netlify-plugin | ||
yarn | ||
yarn netlify link | ||
# Accept linking it with the current git remote, it'll detect the correct site automatically | ||
``` | ||
4. Setup `.env` by copying the example file: | ||
```sh | ||
cp .env.example .env | ||
``` | ||
Make sure the values in this file are good. | ||
|
||
### Running the dev env | ||
|
||
```sh | ||
yarn dev | ||
``` | ||
|
||
This script creates a temporary `netlify.toml` which references a plugin located at `dist/index.js`. | ||
It then builds the site locally, running the local version of the plugin. | ||
|
||
To change the crawler target from the prod one to a locally running on, simply change in your `.env` `ALGOLIA_BASE_URL` to target your local instance. | ||
See each project's respective README. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
|
||
# This file is generated by scripts/generate_netlify_toml.sh | ||
# DO NOT MODIFY, MODIFY THE GENERATING SCRIPT | ||
|
||
|
||
[[plugins]] | ||
package = "@algolia/crawler-netlify-plugin" | ||
|
||
package = "./plugin/dist/index.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
{ | ||
"name": "@algolia/crawler-netlify-plugin", | ||
"version": "0.0.3", | ||
"main": "dist/index.js", | ||
"repository": "https://github.com/algolia/crawler-netlify-plugin.git", | ||
"name": "@algolia/netlify", | ||
"version": "0.0.4", | ||
"private": true, | ||
"author": "Algolia Team <[email protected]>", | ||
"license": "MIT", | ||
"private": false, | ||
"repository": "https://github.com/algolia/algoliasearch-netlify.git", | ||
"workspaces": [ | ||
"plugin" | ||
], | ||
"scripts": { | ||
"build": "tsc -b", | ||
"dev": "NODE_ENV=development ./scripts/dev.sh", | ||
"build": "echo 'Website already built in public'", | ||
"build:plugin": "cd plugin && yarn build", | ||
"dev:plugin": "cd plugin && yarn dev", | ||
"lint": "eslint --ext=jsx,ts,tsx,js .", | ||
"release": "yarn build && yarn publish" | ||
"release:plugin": "cd plugin && yarn release" | ||
}, | ||
"dependencies": { | ||
"node-fetch": "2.6.0" | ||
"@algolia/crawler-netlify-plugin": "*" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "14.0.27", | ||
|
@@ -35,9 +38,8 @@ | |
"prettier": "2.1.1", | ||
"typescript": "4.0.2" | ||
}, | ||
"files": [ | ||
"README.md", | ||
"manifest.yml", | ||
"dist/" | ||
] | ||
"engines": { | ||
"yarn": "1.*", | ||
"node": "14.*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# crawler-netlify-plugin | ||
|
||
This plugin links your Netlify site with Algolia's Crawler. | ||
It will trigger a crawl on each successful build. | ||
|
||
## Environment variables | ||
|
||
- `ALGOLIA_API_KEY` [Optional in dev] API Key to authenticate the call to the crawler. | ||
- `ALGOLIA_BASE_URL` [Optional] Defaults to `https://crawler.algolia.com/`. | ||
|
||
For a local run, those need to be set in `.env` using `cp .env.example .env` and modifying the values to fit your needs. | ||
|
||
## Scripts | ||
|
||
- `yarn dev`: run dev environment | ||
- `yarn release`: build & publish the library | ||
|
||
## Development | ||
|
||
### Pre-requisites | ||
|
||
**Only accessible to Algolia employees.** | ||
|
||
1. Access to the Algolia team on Netlify (only granted to Algolia employees). | ||
2. Access to the test website in this org: https://app.netlify.com/sites/crawler-netlify-plugin/ | ||
3. Clone the repo and link it to the test website on Netlify: | ||
```sh | ||
git clone [email protected]:algolia/algoliasearch-netlify.git | ||
cd algoliasearch-netlify | ||
yarn | ||
yarn netlify link | ||
# Accept linking it with the current git remote, it'll detect the correct site automatically | ||
``` | ||
4. Setup `.env` by copying the example file: | ||
```sh | ||
cp .env.example .env | ||
``` | ||
Make sure the values in this file are good. | ||
|
||
### Running the dev env | ||
|
||
```sh | ||
yarn dev | ||
``` | ||
|
||
This script creates a temporary `netlify.toml` which references a plugin located at `dist/index.js`. | ||
It then builds the site locally, running the local version of the plugin. | ||
|
||
To change the crawler target from the prod one to a locally running on, simply change in your `.env` `ALGOLIA_BASE_URL` to target your local instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name: crawler-netlify-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "@algolia/crawler-netlify-plugin", | ||
"version": "0.0.4", | ||
"private": false, | ||
"author": "Algolia Team <[email protected]>", | ||
"license": "MIT", | ||
"repository": "https://github.com/algolia/algoliasearch-netlify.git", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"README.md", | ||
"manifest.yml", | ||
"dist/" | ||
], | ||
"scripts": { | ||
"build": "tsc -b", | ||
"dev": "NODE_ENV=development ../scripts/dev_plugin.sh", | ||
"postinstall": "npm run build", | ||
"release": "yarn build && yarn publish" | ||
}, | ||
"dependencies": { | ||
"node-fetch": "2.6.0" | ||
}, | ||
"devDependencies": {} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"baseUrl": ".", | ||
"outDir": "./dist", /* Redirect output structure to the directory. */ | ||
}, | ||
"include": [ | ||
"src" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
cd .. | ||
|
||
[ -f .env ] || ( echo 'Missing .env' && exit 1 ) | ||
set -a | ||
source .env | ||
set +a | ||
|
||
yarn build:plugin | ||
yarn netlify build |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters