create-digigov-app 0.3.23 → 0.5.0

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.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "create-digigov-app",
3
3
  "entries": [
4
+ {
5
+ "version": "0.5.0",
6
+ "tag": "create-digigov-app_v0.5.0",
7
+ "date": "Thu, 30 Dec 2021 12:54:03 GMT",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "comment": "Update scaffolder's templates including @digigov/css configuration"
12
+ }
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ "version": "0.4.1",
18
+ "tag": "create-digigov-app_v0.4.1",
19
+ "date": "Tue, 02 Nov 2021 13:03:39 GMT",
20
+ "comments": {
21
+ "dependency": [
22
+ {
23
+ "comment": "Updating dependency \"@digigov/cli\" from `0.5.24` to `0.5.25`"
24
+ }
25
+ ]
26
+ }
27
+ },
28
+ {
29
+ "version": "0.4.0",
30
+ "tag": "create-digigov-app_v0.4.0",
31
+ "date": "Wed, 22 Sep 2021 10:15:42 GMT",
32
+ "comments": {
33
+ "minor": [
34
+ {
35
+ "comment": "create common layout component"
36
+ },
37
+ {
38
+ "comment": "Create a default `src/pages/404.js|ts` page when a new Digigov app codebase is generated from scratch"
39
+ }
40
+ ],
41
+ "patch": [
42
+ {
43
+ "comment": "Add README to the tool codebase"
44
+ }
45
+ ],
46
+ "dependency": [
47
+ {
48
+ "comment": "Updating dependency \"@digigov/cli-lint\" from `0.5.24` to `0.5.25`"
49
+ }
50
+ ]
51
+ }
52
+ },
53
+ {
54
+ "version": "0.3.24",
55
+ "tag": "create-digigov-app_v0.3.24",
56
+ "date": "Tue, 24 Aug 2021 13:55:40 GMT",
57
+ "comments": {
58
+ "patch": [
59
+ {
60
+ "comment": "Add digigovrc.js path to gitignore when a new Digigov Application is generated"
61
+ }
62
+ ]
63
+ }
64
+ },
4
65
  {
5
66
  "version": "0.3.23",
6
67
  "tag": "create-digigov-app_v0.3.23",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,37 @@
1
1
  # Change Log - create-digigov-app
2
2
 
3
- This log was last generated on Thu, 12 Aug 2021 08:56:35 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 30 Dec 2021 12:54:03 GMT and should not be manually modified.
4
+
5
+ ## 0.5.0
6
+ Thu, 30 Dec 2021 12:54:03 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Update scaffolder's templates including @digigov/css configuration
11
+
12
+ ## 0.4.1
13
+ Tue, 02 Nov 2021 13:03:39 GMT
14
+
15
+ _Version update only_
16
+
17
+ ## 0.4.0
18
+ Wed, 22 Sep 2021 10:15:42 GMT
19
+
20
+ ### Minor changes
21
+
22
+ - create common layout component
23
+ - Create a default `src/pages/404.js|ts` page when a new Digigov app codebase is generated from scratch
24
+
25
+ ### Patches
26
+
27
+ - Add README to the tool codebase
28
+
29
+ ## 0.3.24
30
+ Tue, 24 Aug 2021 13:55:40 GMT
31
+
32
+ ### Patches
33
+
34
+ - Add digigovrc.js path to gitignore when a new Digigov Application is generated
4
35
 
5
36
  ## 0.3.23
6
37
  Thu, 12 Aug 2021 08:56:35 GMT
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # create-digigov-app
2
+
3
+ > `create-digigov-app` tool is a scaffolder CLI tool that helps devs to quickly
4
+ > create new empty codebases without writing any code
5
+
6
+ ## How to run the scaffolder
7
+
8
+ Create a new service app in a folder called `my-digigov-service`. The tool
9
+ will ask you for a few options to customize the newly created codebase.
10
+
11
+ ```
12
+ yarn create digigov-app my-digigov-service
13
+ ```
14
+
15
+ or if you prefer to use `npx`
16
+
17
+ ```
18
+ npx create-digigov-app my-digigov-service
19
+ ```
20
+
21
+ ## Test the scaffolder locally
22
+
23
+ If you done some changes in the tool and you need to test that it works as
24
+ expected, you can run the `cli.js` in your terminal as a node script and
25
+ instruct the tool to create the new folder to the `/tmp` directory thus keeping
26
+ the `digigov-sdk` repository clean.
27
+
28
+ ```
29
+ node cli.js /tmp/test-service
30
+ ```
31
+
32
+ After the script ends successfully, you can visit the `/tmp/test-service` and
33
+ make sure that the files were generated as expected and run scripts like `yarn
34
+ dev` and `yarn build` as in any other application.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-digigov-app",
3
- "version": "0.3.23",
3
+ "version": "0.5.0",
4
4
  "description": "Create a DigiGOV App with ease",
5
5
  "bin": "cli.js",
6
6
  "files": [
@@ -25,8 +25,8 @@
25
25
  "validate-npm-package-name": "3.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@digigov/cli": "0.5.24",
29
- "@digigov/cli-lint": "0.5.24",
28
+ "@digigov/cli": "0.5.25",
29
+ "@digigov/cli-lint": "0.5.25",
30
30
  "@digigov/cli-test": "0.5.24",
31
31
  "typescript": "4.2.3"
32
32
  },
package/saofile.js CHANGED
@@ -2,17 +2,20 @@ const { relative } = require('path');
2
2
  const validate = require('validate-npm-package-name');
3
3
 
4
4
  const digigovDepsDev = [
5
- "@digigov/cli",
6
- "@digigov/cli-lint",
7
- "@digigov/cli-app",
8
- "@digigov/cli-build",
9
- "@digigov/cli-test"
10
- ]
5
+ '@digigov/cli',
6
+ '@digigov/cli-lint',
7
+ '@digigov/cli-app',
8
+ '@digigov/cli-build',
9
+ '@digigov/cli-test',
10
+ ];
11
11
 
12
12
  const digigovDeps = [
13
- "@digigov/ui",
14
- "@digigov/nextjs"
15
- ]
13
+ '@digigov/ui',
14
+ '@digigov/nextjs',
15
+ '@digigov/react-core',
16
+ '@digigov/css',
17
+ 'tailwindcss',
18
+ ];
16
19
 
17
20
  module.exports = {
18
21
  prompts: require('./prompts'),
@@ -58,8 +61,10 @@ module.exports = {
58
61
  '_package.json': 'package.json',
59
62
  '_.prettierrc.js': '.prettierrc.js',
60
63
  '_.eslintrc.js': '.eslintrc.js',
64
+ '_postcss.config.js': 'postcss.config.js',
65
+ '_tailwind.config.js': 'tailwind.config.js',
61
66
  '_tsconfig.json': 'tsconfig.json',
62
- '_Dockerfile': 'Dockerfile',
67
+ _Dockerfile: 'Dockerfile',
63
68
  },
64
69
  });
65
70
 
@@ -74,13 +79,13 @@ module.exports = {
74
79
  await this.npmInstall({ npmClient: this.answers.pm });
75
80
  await this.npmInstall({
76
81
  npmClient: this.answers.pm,
77
- packages: digigovDeps
78
- })
82
+ packages: digigovDeps,
83
+ });
79
84
  await this.npmInstall({
80
85
  npmClient: this.answers.pm,
81
86
  packages: digigovDepsDev,
82
- saveDev: true
83
- })
87
+ saveDev: true,
88
+ });
84
89
  }
85
90
 
86
91
  const chalk = this.chalk;
@@ -0,0 +1,3 @@
1
+ // If you want to use other PostCSS plugins, see the following:
2
+ // https://tailwindcss.com/docs/using-with-preprocessors
3
+ module.exports = require('@digigov/cli-app/postcssrc')();
@@ -0,0 +1 @@
1
+ module.exports = require('@digigov/cli-app/tailwindrc')();
@@ -1,4 +1,5 @@
1
- # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring
2
+ files.
2
3
 
3
4
  # dependencies
4
5
  /node_modules
@@ -23,3 +24,6 @@
23
24
  npm-debug.log*
24
25
  yarn-debug.log*
25
26
  yarn-error.log*
27
+
28
+ # ignore development specific digigov files
29
+ digigovrc.js
@@ -0,0 +1,4 @@
1
+ @tailwind base;
2
+ @layer base {
3
+ @import "@digigov/css/src/base/base.css";
4
+ };
@@ -0,0 +1,15 @@
1
+ @tailwind components;
2
+ @layer components {
3
+ @import "@digigov/css/src/components/accordion.css";
4
+ @import "@digigov/css/src/components/button.css";
5
+ @import "@digigov/css/src/components/components.css";
6
+ @import "@digigov/css/src/components/form.css";
7
+ @import "@digigov/css/src/components/checkboxes.css";
8
+ @import "@digigov/css/src/components/radios.css";
9
+ @import "@digigov/css/src/components/general.css";
10
+ @import "@digigov/css/src/components/header.css";
11
+ @import "@digigov/css/src/components/footer.css";
12
+ @import "@digigov/css/src/components/layout.css";
13
+ @import "@digigov/css/src/components/nav.css";
14
+ @import "@digigov/css/src/components/typography.css";
15
+ };
@@ -0,0 +1,4 @@
1
+
2
+ @import "./base.css";
3
+ @import "./components.css";
4
+ @import './utilities.css';
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import Head from 'next/head';
3
+ import { useTranslation } from '@digigov/ui/app/i18n';
4
+
5
+ import BasicLayout, {
6
+ Top,
7
+ Content,
8
+ Bottom,
9
+ } from '@digigov/ui/layouts/Basic';
10
+ import Header /* , { HeaderTitle } */ from '@digigov/ui/app/Header';
11
+ /* import ServiceBadge from '@digigov/ui/core/ServiceBadge'; */
12
+ import GovGRLogo from '@digigov/ui/govgr/Logo';
13
+ import GovGRFooter from '@digigov/ui/govgr/Footer';
14
+
15
+ const Layout = ({ children }) => {
16
+ const { t } = useTranslation();
17
+ return (
18
+ <BasicLayout>
19
+ <Head>
20
+ <title>{t('app.name')}</title>
21
+ </Head>
22
+ <Top>
23
+ <Header>
24
+ <GovGRLogo />
25
+ {/* Use the HeaderTitle with a service name if your service is more than 5 pages long - this can help users understand which service they are using. */}
26
+ {/* <HeaderTitle>
27
+ {t('app.name')}
28
+ <ServiceBadge label="ALPHA" />
29
+ </HeaderTitle> */}
30
+ </Header>
31
+ </Top>
32
+ <Content>
33
+ {children}
34
+ </Content>
35
+ <Bottom>
36
+ <GovGRFooter />
37
+ </Bottom>
38
+ </BasicLayout>
39
+ );
40
+ };
41
+
42
+ export default Layout;
@@ -5,4 +5,4 @@ export default {
5
5
  intro_text: 'Welcome to My Service',
6
6
  },
7
7
  ...defaultEn,
8
- };
8
+ };
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import NotFound from '@digigov/ui/app/NotFound';
3
+ import { Main, Side } from '@digigov/ui/layouts/Basic';
4
+ import Layout from '<%= name %>/components/Layout';
5
+
6
+ const NotFoundPage = () => {
7
+ return (
8
+ <Layout>
9
+ <Main>
10
+ <NotFound />
11
+ </Main>
12
+ <Side></Side>
13
+ </Layout>
14
+ );
15
+ };
16
+
17
+ export default NotFoundPage;
@@ -1,7 +1,9 @@
1
1
  import App from '@digigov/nextjs/App';
2
2
  import initI18n from '@digigov/nextjs/i18n';
3
- import el from '../locales/el';
4
- import en from '../locales/en';
3
+ import el from '<%= name %>/locales/el';
4
+ import en from '<%= name %>/locales/en';
5
+ import 'tailwindcss/tailwind.css';
6
+ import '../../index.css';
5
7
 
6
8
  initI18n({
7
9
  el: {
@@ -1,49 +1,24 @@
1
1
  import React from 'react';
2
- import Head from 'next/head';
3
2
  import { useTranslation } from '@digigov/ui/app/i18n';
4
-
5
- import BasicLayout, {
6
- Top,
7
- Content,
8
- Main,
9
- Side,
10
- Bottom,
11
- } from '@digigov/ui/layouts/Basic';
12
- import Header, { HeaderTitle } from '@digigov/ui/app/Header';
13
- import ServiceBadge from '@digigov/ui/core/ServiceBadge';
14
- import GovGRLogo from '@digigov/ui/govgr/Logo';
15
- import GovGRFooter from '@digigov/ui/govgr/Footer';
3
+ import { Main, Side } from '@digigov/ui/layouts/Basic';
16
4
  import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
5
+ import CallToAction from '@digigov/ui/core/Button/CallToAction';
6
+ import Paragraph from '@digigov/ui/typography/Paragraph';
7
+ import Layout from '<%= name %>/components/Layout';
17
8
 
18
9
  const Home = () => {
19
10
  const { t } = useTranslation();
20
11
  return (
21
- <BasicLayout>
22
- <Head>
23
- <title>{t('app.name')}</title>
24
- </Head>
25
- <Top>
26
- <Header>
27
- <GovGRLogo />
28
- <HeaderTitle>
29
- {t('app.name')}
30
- <ServiceBadge label="ALPHA" />
31
- </HeaderTitle>
32
- </Header>
33
- </Top>
34
- <Content>
35
- <Main>
36
- <PageTitle>
37
- <PageTitleHeading>{t('app.name')}</PageTitleHeading>
38
- </PageTitle>
39
- <div>{t('app.intro_text')}</div>
40
- </Main>
41
- <Side></Side>
42
- </Content>
43
- <Bottom>
44
- <GovGRFooter />
45
- </Bottom>
46
- </BasicLayout>
12
+ <Layout>
13
+ <Main>
14
+ <PageTitle>
15
+ <PageTitleHeading>{t('app.name')}</PageTitleHeading>
16
+ </PageTitle>
17
+ <Paragraph>{t('app.intro_text')}</Paragraph>
18
+ <CallToAction href="/login">{t('button.start')}</CallToAction>
19
+ </Main>
20
+ <Side></Side>
21
+ </Layout>
47
22
  );
48
23
  };
49
24
 
@@ -0,0 +1,4 @@
1
+ @tailwind utilities;
2
+ @layer utilities {
3
+ @import "@digigov/css/src/utilities/utilities.css";
4
+ };
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import Head from 'next/head';
3
+ import { useTranslation } from '@digigov/ui/app/i18n';
4
+
5
+ import BasicLayout, {
6
+ Top,
7
+ Content,
8
+ Bottom,
9
+ } from '@digigov/ui/layouts/Basic';
10
+ import Header /* , { HeaderTitle } */ from '@digigov/ui/app/Header';
11
+ /* import ServiceBadge from '@digigov/ui/core/ServiceBadge'; */
12
+ import GovGRLogo from '@digigov/ui/govgr/Logo';
13
+ import GovGRFooter from '@digigov/ui/govgr/Footer';
14
+
15
+ const Layout: React.FC = ({ children }) => {
16
+ const { t } = useTranslation();
17
+ return (
18
+ <BasicLayout>
19
+ <Head>
20
+ <title>{t('app.name')}</title>
21
+ </Head>
22
+ <Top>
23
+ <Header>
24
+ <GovGRLogo />
25
+ {/* Use the HeaderTitle with a service name if your service is more than 5 pages long - this can help users understand which service they are using. */}
26
+ {/* <HeaderTitle>
27
+ {t('app.name')}
28
+ <ServiceBadge label="ALPHA" />
29
+ </HeaderTitle> */}
30
+ </Header>
31
+ </Top>
32
+ <Content>
33
+ {children}
34
+ </Content>
35
+ <Bottom>
36
+ <GovGRFooter />
37
+ </Bottom>
38
+ </BasicLayout>
39
+ );
40
+ };
41
+
42
+ export default Layout;
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import NotFound from '@digigov/ui/app/NotFound';
3
+ import { Main, Side } from '@digigov/ui/layouts/Basic';
4
+ import Layout from '<%= name %>/components/Layout';
5
+
6
+ const NotFoundPage: React.FC = () => {
7
+ return (
8
+ <Layout>
9
+ <Main>
10
+ <NotFound />
11
+ </Main>
12
+ <Side></Side>
13
+ </Layout>
14
+ );
15
+ };
16
+
17
+ export default NotFoundPage;
18
+
@@ -1,7 +1,9 @@
1
1
  import App from '@digigov/nextjs/App';
2
2
  import initI18n from '@digigov/nextjs/i18n';
3
- import el from '../locales/el';
4
- import en from '../locales/en';
3
+ import el from '<%= name %>/locales/el';
4
+ import en from '<%= name %>/locales/en';
5
+ import 'tailwindcss/tailwind.css';
6
+ import '../../index.css';
5
7
 
6
8
  initI18n({
7
9
  el: {
@@ -1,49 +1,24 @@
1
1
  import React from 'react';
2
- import Head from 'next/head';
3
2
  import { useTranslation } from '@digigov/ui/app/i18n';
4
-
5
- import BasicLayout, {
6
- Top,
7
- Content,
8
- Main,
9
- Side,
10
- Bottom,
11
- } from '@digigov/ui/layouts/Basic';
12
- import Header, { HeaderTitle } from '@digigov/ui/app/Header';
13
- import ServiceBadge from '@digigov/ui/core/ServiceBadge';
14
- import GovGRLogo from '@digigov/ui/govgr/Logo';
15
- import GovGRFooter from '@digigov/ui/govgr/Footer';
3
+ import { Main, Side } from '@digigov/ui/layouts/Basic';
16
4
  import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
5
+ import CallToAction from '@digigov/ui/core/Button/CallToAction';
6
+ import Paragraph from '@digigov/ui/typography/Paragraph';
7
+ import Layout from '<%= name %>/components/Layout';
17
8
 
18
9
  const Home: React.FC = () => {
19
10
  const { t } = useTranslation();
20
11
  return (
21
- <BasicLayout>
22
- <Head>
23
- <title>{t('app.name')}</title>
24
- </Head>
25
- <Top>
26
- <Header>
27
- <GovGRLogo />
28
- <HeaderTitle>
29
- {t('app.name')}
30
- <ServiceBadge label="ALPHA" />
31
- </HeaderTitle>
32
- </Header>
33
- </Top>
34
- <Content>
35
- <Main>
36
- <PageTitle>
37
- <PageTitleHeading>{t('app.name')}</PageTitleHeading>
38
- </PageTitle>
39
- <div>{t('app.intro_text')}</div>
40
- </Main>
41
- <Side></Side>
42
- </Content>
43
- <Bottom>
44
- <GovGRFooter />
45
- </Bottom>
46
- </BasicLayout>
12
+ <Layout>
13
+ <Main>
14
+ <PageTitle>
15
+ <PageTitleHeading>{t('app.name')}</PageTitleHeading>
16
+ </PageTitle>
17
+ <Paragraph>{t('app.intro_text')}</Paragraph>
18
+ <CallToAction href="/login">{t('button.start')}</CallToAction>
19
+ </Main>
20
+ <Side></Side>
21
+ </Layout>
47
22
  );
48
23
  };
49
24